O'Reilly logo

The C++ Programming Language, Fourth Edition by Bjarne Stroustrup

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

23. Templates

Your quote here.

– B. Stroustrup

Introduction and Overview

A Simple String Template

Defining a Template; Template Instantiation

Type Checking

Type Equivalence; Error Detection

Class Template Members

Data Members; Member Functions; Member Type Aliases; static Members; Member Types; Member Templates; Friends

Function Templates

Function Template Arguments; Function Template Argument Deduction; Function Template Overloading

Template Aliases

Source Code Organization

Linkage

Advice

23.1. Introduction and Overview

Templates provide direct support for generic programming (§3.4) in the form of programming using types as parameters. The C++ template mechanism allows a type or a value to be a parameter in the definition of ...

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