class A{ public: A() = default; // Inline explicitly defaulted constructor definition A(const A&); ~A() = default; // Inline explicitly defaulted destructor definition }; A::A(const A&) = default; // Out-of-line
Generation of the default constructor is still prevented by declaring the copy constructor, but you can bring it back by explicitly defaulting it. Explicitly defaulted special member functions are still considered trivial, so there's no performance penalty, and noncopyable isn't prevented from being ...
Generation of the default constructor is still prevented by declaring the copy constructor, but you can bring it back by explicitly defaulting it. Explicitly defaulted special member functions are still considered trivial, so there's no performance penalty, andnoncopyableisn't prevented from being a ...
* method.cc (maybe_delete_defaulted_fn): New. (defaulted_late_check): Add a tristate parameter. Call maybe_delete_defaulted_fn instead of giving an error. gcc/ChangeLog: * doc/invoke.texi: Document -Wdefaulted-function-deleted. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/defaulted15.C: Add...
Generation of the default constructor is still prevented by declaring the copy constructor, but you can bring it back by explicitly defaulting it. Explicitly defaulted special member functions are still considered trivial, so there's no performance penalty, andnoncopyableisn't prevented from being a ...
B(int, int) = default; // Error, constructorB(int, int)is not // a special member function. B(int=0) = default; // Error, constructorB(int=0)has a default argument. }; The explicitly defaulted function declarations enable more opportunities in optimization, because the compiler might ...