Chapter 8. Adventures in Functions

In this chapter you’ll learn about the following:

Inline functions

Reference variables

• How to pass function arguments by reference

Default arguments

Function overloading

Function templates

• Function template specializations

With Chapter 7, “Functions: C++’s Programming Modules,” under your belt, you now know a lot about C++ functions, but there’s much more to come. C++ provides many new function features that separate C++ from its C heritage. The new features include inline functions, by-reference variable passing, default argument values, function overloading (polymorphism), and template functions. This chapter, more than any other you’ve read so far, explores features found in C++ but not ...

Get C++ Primer Plus, Fifth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.