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

10.2. Template Class Definition

Here's the format for template class definitions.

template <class TYPE1, class TYPE2, Type name1, Type nameN> 
class Class_name { . . . };

A template parameter list appears in front of a class definition and consists of the keyword template followed by a comma-separated list of class-type pairs and/or constant expression parameters enclosed by < and >. The class-type pairs (class TYPE1,class TYPE2) follow the same rules as template functions (page 389), but constant expression parameters (Type name1, Type nameN) have a different syntax. With template parameter lists, you may combine class-type pairs and constant expression parameters in any order (or omit them). For now, let's work with the class-type syntax, ...

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