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

9.5. Specializing Template Functions

Template functions affect overloading resolution (page 270). The compiler uses the following algorithm to resolve overloaded function calls.

  1. Look at all nontemplate functions first, and determine if there is a function whose signature exactly matches the function call's argument types.

  2. Look for a template function whose signature exactly matches the function call's argument types.

  3. Resolve the function call with nontemplate functions, using conversion rules (trivial conversions, promotions, standard conversions, and user-defined conversions).

Template function signatures must match function call arguments exactly in the second step. The compiler attempts conversions for arguments only in the third step. Compilation ...

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