Cplus2 Primer Ed5 Reading Notes 2

Personalized notes taken while reading Cplus2 Primer Ed5 (C++11 standard) Part III: Tools for Class Authors.

Chapter 13. Copy Control

  • Unlike the synthesized default constructor, a copy constructor is synthesized even if we define other constructors.

  • When we use direct initialization, we are asking the compiler to use ordinary function matching to select the constructor that best matches the arguments we provide. When we use copy initilization, we are asking the compiler to copy the right-hand operand into the object being created, converting that operand if necessary.

  • Copy initialization happens not only when we define variables using an =, but also when we
    1. Pass an object as an argument to a parameter of nonreference type
    2. Return an object from a function that has a nonreference return type
    3. Brace initialize the elements in an array or the members of an aggregate class

Chapter 14. Overloaded Operations and Conversions

Chapter 15. Object-Oriented Programming

Chapter 16. Templates and Generic Programming