O'Reilly logo

Navigating C++ and Object-Oriented Design by Gail Anderson, Paul Anderson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required