In 8.4.2 Explicitly-defaulted functions [dcl.fct.def.default] standard,
Explicit default functions and implicitly declared functions are collectively referred to as default functions, and the implementation should provide them with implicit definitions (12.1 12.4, 12.8), which may mean their removal. A special member function is a user if it is declared by the user and is not explicitly installed by default or deleted by its first declaration. The function provided by the user is clearly defaulted (i.e., clearly defaulted after the first declaration) defined at the point where it is clearly defaulted; if such a function is implicitly defined as remote, the program is poorly formed. [Note. Declaring a default function after its first declaration can provide efficient execution and a brief definition, allowing a stable binary interface to the evolving code base.-End note]
What does the note at the end mean? From what I see, declaring a default function after its first declaration will make the function user-provided, so make the function non-trivial and thus make the type have a non-trivial default constructor or make the type non-trivial -copyable, and, of course, make the type is non-trivial and non-POD, but still has an implementation to provide the actual definition of a function. But I donβt understand how this leads to " provide efficient execution and concise definition while enabling a stable binary interface to an evolving code base ". Any thoughts are welcome, and real-world examples are much appreciated. Thanks.
An example of this type:
struct A { A(); }; A::A() = default;
c ++ c ++ 11
goodbyeera
source share