[class.inhctor.init] (original) (raw)

:

struct B1 { B1(int, ...) { } };

struct B2 { B2(double) { } };

int get();

struct D1 : B1 { using B1::B1;
int x; int y = get(); };

void test() { D1 d(2, 3, 4);

D1 e;
}

struct D2 : B2 { using B2::B2; B1 b; };

D2 f(1.0);

struct W { W(int); }; struct X : virtual W { using W::W; X() = delete; }; struct Y : X { using X::X; }; struct Z : Y, virtual W { using Y::Y; }; Z z(0);

template struct Log : T { using T::T;
~Log() { std::clog << "Destroying wrapper" << std::endl; } };

Class template Log wraps any class and forwards all of its constructors, while writing a message to the standard log whenever an object of class Log is destroyed.

end example