Skip to main content

Class Templates

  • Chapter
  • First Online:
Beginning C++
  • 12k Accesses

Abstract

You learned about templates that the compiler uses to create functions back in Chapter 8; this chapter is about templates the compiler can use to create classes. Class templates are a powerful mechanism for generating new class types automatically. A significant portion of the Standard Library is built entirely on the ability to define templates, particularly the Standard Template Library, which includes many class and function templates.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 44.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Ivor Horton

About this chapter

Cite this chapter

Horton, I. (2014). Class Templates. In: Beginning C++. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0007-0_16

Download citation

Publish with us

Policies and ethics