Self-Review Exercises

  1. 18.1 State which of the following are true and which are false. If false, explain why.

    1. Keywords typename and class as used with a template type parameter specifically mean “any user-defined class type.”

    2. A function template can be overloaded by another function template with the same function name.

    3. Template parameter names among template definitions must be unique.

    4. Each member-function definition outside its corresponding class template definition must begin with template and the same template parameters as its class template.

  2. 18.2 Fill in the blanks in each of the following:

    1. Templates enable us to specify, with a single code segment, an entire range of related functions called          , or an entire range of ...

Get C++ How to Program, 10/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.