Skip to Content
Navigating C++ and Object-Oriented Design
book

Navigating C++ and Object-Oriented Design

by Paul Anderson, Gail Anderson
October 1997
Intermediate to advanced
800 pages
20h 48m
English
Pearson
Content preview from Navigating C++ and Object-Oriented Design

6.3. Overloading Resolution

When users call overloaded functions with arguments, it's not always possible to call them with data types that exactly match one of the overloaded signatures. To avoid compilation errors and ambiguities, you need to know how the compiler promotes data types, performs conversions (trivial, standard, or user-defined), and determines which “best-fit” function to call. This section investigates how the compiler resolves overloaded signatures for single and multiple arguments. We'll start with single argument matching and then generalize the rules for multiple arguments.

Single Argument Matching

The compiler uses the following steps (in order) to match single argument signatures with single argument function calls.

  1. Exact ...

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

Exploring C++20: The Programmer's Introduction to C++

Exploring C++20: The Programmer's Introduction to C++

Ray Lischner

Publisher Resources

ISBN: 0135327482Purchase book