Skip to Content
The C++ Programming Language, 4th Edition
book

The C++ Programming Language, 4th Edition

by Bjarne Stroustrup
May 2013
Intermediate to advanced
1376 pages
47h 26m
English
Addison-Wesley Professional
Content preview from The C++ Programming Language, 4th Edition

18. Operator Overloading

When I use a word it means just what I choose it to mean – neither more nor less.

– Humpty Dumpty

Introduction

Operator Functions

Binary and Unary Operators; Predefined Meanings for Operators; Operators and User-Defined Types; Passing Objects; Operators in Namespaces

A Complex Number Type

Member and Nonmember Operators; Mixed-Mode Arithmetic; Conversions; Literals; Accessor Functions; Helper Functions

Type Conversion

Conversion Operators; explicit Conversion Operators; Ambiguities

Advice

18.1. Introduction

Every technical field – and most nontechnical fields – has developed conventional shorthand notation to make convenient the presentation and discussion involving frequently used concepts. For example, because ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming: Principles and Practice Using C++, 3rd Edition

Programming: Principles and Practice Using C++, 3rd Edition

Bjarne Stroustrup

Publisher Resources

ISBN: 9780133522884Purchase Link