Chapter 14. Overloaded Operations and Conversions

CONTENTS

Section 14.1 Defining an Overloaded Operator 506

Section 14.2 Input and Output Operators 513

Section 14.3 Arithmetic and Relational Operators 517

Section 14.4 Assignment Operators 520

Section 14.5 Subscript Operator 522

Section 14.6 Member Access Operators 523

Section 14.7 Increment and Decrement Operators 526

Section 14.8 Call Operator and Function Objects 530

Section 14.9 Conversions and Class Types 535

Chapter Summary 552

Defined Terms 552

In Chapter 5 we saw that C++ defines a large number of operators and automatic conversions among the built-in types. These facilities allow programmers to write a rich set of mixed-type expressions.

C++ lets us redefine the meaning of the operators ...

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.