CD
Size: a a a
CD
DF
DF
OS
#include <memory>
struct Base
{
protected:
Base(int) {}
}
struct Derived: Base
{
using Base::Base;
}
int main()
{
auto ptr = std::make_unique<Derived>(123);
}
v
#include <memory>
struct Base
{
protected:
Base(int) {}
}
struct Derived: Base
{
using Base::Base;
}
int main()
{
auto ptr = std::make_unique<Derived>(123);
}
OS
IA
v
struct Base {
protected:
Base(int) {}
void f(){}
};
struct Derived: public Base {
public:
using Base::Base;
using Base::f;
};
static_assert(std::is_same_v<void
, std::void_t<decltype(std::declval<Derived>().f())>>
);
static_assert(std::is_constructible_v<Derived, int>);
OS
OS
Using-declaratorthat names a constructor does not create a synonym; instead, the additional constructors are accessible if they would be accessible when used to construct an object of the corresponding base class
v
Using-declaratorthat names a constructor does not create a synonym; instead, the additional constructors are accessible if they would be accessible when used to construct an object of the corresponding base class
OS
OS
т
AB
AB
A
AB
IA