O'Reilly logo

C++ Primer, Fourth Edition by Barbara E. Moo, Josée Lajoie, Stanley B. Lippman

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

Chapter 16. Templates and Generic Programming

CONTENTS

Section 16.1 Template Definitions 624

Section 16.2 Instantiation 636

Section 16.3 Template Compilation Models 643

Section 16.4 Class Template Members 647

Section 16.5 A Generic Handle Class 666

Section 16.6 Template Specializations 671

Section 16.7 Overloading and Function Templates 679

Chapter Summary 683

Defined Terms 683

Generic programming involves writing code in a way that is independent of any particular type. When we use a generic program we supply the type(s) or value(s) on which that instance of the program will operate. The library containers, iterators, and algorithms described in Part II are examples of generic programming. There is a single definition of each container, such ...

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