Chapter 13. Copy Control
CONTENTS
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
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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.