You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the C.xx sections we can find the term: "default operations" a lot.
I don't think the terms are used correctly in every place.
In the same sections we can find 2 times: "special functions".
I think the ISO standard uses the term: "special member functions".
In my understanding the "default operations" are "special member functions" that the compiler can generate for you by default.
If you define the "special member functions" then the compiler will only generate some of "default operations".
E.g. the section
C.ctor: Constructors, assignments, and destructors
These functions control the lifecycle of objects: creation, copy, move, and destruction.
Define constructors to guarantee and simplify initialization of classes.
These are default operations:
a default constructor: X()
a copy constructor: X(const X&)
a copy assignment: operator=(const X&)
a move constructor: X(X&&)
a move assignment: operator=(X&&)
a destructor: ~X()
By default, the compiler defines each of these operations if it is used, but the default can be suppressed.
should be:
C.ctor: Constructors, assignments, and destructors
These special member functions control the lifecycle of objects: creation, copy, move, and destruction.
Define constructors to guarantee and simplify initialization of classes.
These are special member functions:
a default constructor: X()
a copy constructor: X(const X&)
a copy assignment: operator=(const X&)
a move constructor: X(X&&)
a move assignment: operator=(X&&)
a destructor: ~X()
By default, the compiler defines default operations for each of these functions if it is used, but the default can be suppressed.
The lines following this intro C.20, C.21, ... should be checked, for correctness of usage of "default operations."
e.g. C.20 should be
C.20: If you can avoid defining special member functions, do
as defining "default operations" in contractionary it itself: How can a user define a default ?
The text was updated successfully, but these errors were encountered:
In the C.xx sections we can find the term: "default operations" a lot.
I don't think the terms are used correctly in every place.
In the same sections we can find 2 times: "special functions".
I think the ISO standard uses the term: "special member functions".
In my understanding the "default operations" are "special member functions" that the compiler can generate for you by default.
If you define the "special member functions" then the compiler will only generate some of "default operations".
E.g. the section
should be:
C.ctor: Constructors, assignments, and destructors
These special member functions control the lifecycle of objects: creation, copy, move, and destruction.
Define constructors to guarantee and simplify initialization of classes.
These are special member functions:
a default constructor: X()
a copy constructor: X(const X&)
a copy assignment: operator=(const X&)
a move constructor: X(X&&)
a move assignment: operator=(X&&)
a destructor: ~X()
By default, the compiler defines default operations for each of these functions if it is used, but the default can be suppressed.
The lines following this intro C.20, C.21, ... should be checked, for correctness of usage of "default operations."
e.g. C.20 should be
C.20: If you can avoid defining special member functions, do
as defining "default operations" in contractionary it itself: How can a user define a default ?
The text was updated successfully, but these errors were encountered: