Constructors
Always try to provide a default constructor if possible.
Always try to initialize variables with their declaration.
Delegating constructors is much faster than using assignment.
Always follow the rule of three: if you include one of the following, you have to include all of them.
Constructor
Destructor
Copy constructor
In virtual
classes, always declare the destructor virtual
.
Aggregate initialization for struct
s is great. Use them.
Not required, but declaring your constructor and destructor noexcept
is good practice.
Last updated