Chapter 13. Copy Control


Section 13.1 The Copy Constructor 476

Section 13.2 The Assignment Operator 482

Section 13.3 The Destructor 484

Section 13.4 A Message-Handling Example 486

Section 13.5 Managing Pointer Members 492

Chapter Summary 502

Defined Terms 502

Each type, whether a built-in or class type, defines the meaning of a (possibly empty) set of operations on objects of that type. We can add two int values, run size on a vector, and so on. These operations define what can be done with objects of the given type.

Each type also defines what happens when objects of the type are created. Initialization of objects of class type is defined by constructors. Types also control what happens when objects of the type are copied, assigned, ...

Get C++ Primer, Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.