O'Reilly logo

Just Enough C/C++ Programming by Guy W. Lecky-Thompson

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 18. Templates and the STL

This chapter introduces the C++ concept known as templates, which promote the use of reusable code by allowing you to create generic versions of useful functions. Each template can be used with a variety of different data types—both built-in and user-defined—and reused in different situations.

Part of the reason this chapter introduces templates is to also cover and discuss the Standard Template Library (or STL). This library contains some useful generic definitions of classes and functions to manipulate them.

This chapter is divided into two sections:

The first section discusses template functions and template classes, whereas the second looks at specific classes and functions ...

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