Simply put:
struct M { M(M const&) =delete; }; struct X { X(X const&) =default; M m; };
Implicitly declared functions are also considered "default" ([dcl.fct.def.default] / 5); a more familiar example of pre-C ++ 11 might be something like:
struct M { protected: M(M const&); }; struct X { M m; };
Please note that if you explicitly set a function after it has been declared, the program will be poorly formed if the function is implicitly deleted ([dcl.fct.def.default] / 5):
struct M { M(M const&) =delete; }; struct X { X(X const&); M m; }; X::X(X const&) =default;
user657267
source share