liveBook · Manning

Big three

As explained in 100 C++ Mistakes and How to Avoid Them

The big 3 is the C++ special-member-function set consisting of a copy constructor, copy assignment operator, and destructor.

The big three are a copy constructor, copy assignment operator, and destructor. When a class manages dynamic memory or limited resources such as sockets, files, or database connections, these operations belong to its class invariant. section 7.6

How 100 C++ Mistakes and How to Avoid Them covers it

How deep it goes
Explains copying and destruction through shared-resource failure, deep copying, assignment, and move-enabled modernization.
Examples
Uses Page and TextSection listings to contrast shared pointers, uniqueness-preserving copies, and defaulted move operations.
What you can do after
Apply it by implementing deep-copy construction, copy assignment, and destruction, then modernize ownership with unique_ptr and move operations.
How it connects
Connects resource management with class invariants, dynamic memory, copy semantics, move semantics, and unique_ptr.

Also explained in

Compare how 3 books explain big three →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of 100 C++ Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.