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

Chapter 10. Template Classes

You have seen the benefits of template functions with algorithms that are type independent. Now let's apply the concept of genericity to classes that manage type-independent data. Rather than manage separate classes bound to specific types, we create one generic class that provides the same set of behaviors for all types. Generic classes eliminate code duplication for different types and make library design easier and more manageable.

The C++ template mechanism supports the implementation of generic classes. This chapter shows you how to recognize genericity and how to design template classes. We look at template class definition and instantiation and how to specialize class definitions for efficiency and extensibility. ...

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