Chapter 11. Operator Overloading, Copy/Move Semantics and Smart Pointers

Images

Objectives

In this chapter, you’ll:

Use built-in string class overloaded operators.

Use operator overloading to help you craft valuable classes.

Understand the special member functions and when to implement them for custom types.

Understand when objects should be moved vs. copied.

Use rvalue references and move semantics to eliminate unnecessary copies of temporary objects that are going out of scope, improving program performance.

Understand why you should avoid dynamic memory management with operators new and delete.

Manage dynamic memory automatically with ...

Get C++20 for Programmers, 3rd 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.