Skip to Content
C++20 for Programmers: An Objects-Natural Approach, 3rd Edition
book

C++20 for Programmers: An Objects-Natural Approach, 3rd Edition

by Paul Deitel, Harvey Deitel
April 2022
Intermediate to advanced
1012 pages
38h 1m
English
Pearson
Content preview from C++20 for Programmers: An Objects-Natural Approach, 3rd Edition

15. Templates, C++20 Concepts and Metaprogramming

Objectives

In this chapter, you’ll:

  • Appreciate the rising importance of generic programming.

  • Use class templates to create related custom classes.

  • Understand compile-time vs. runtime polymorphism.

  • Distinguish between templates and template instantiations.

  • Use C++20 abbreviated function templates and templated lambdas.

  • Use C++20 concepts to constrain template parameters and overload function templates based on their type requirements.

  • Use type traits and see how they relate to C++20 concepts.

  • Test concepts at compile-time with static_assert.

  • Create a custom concept-constrained algorithm.

  • Rebuild our class MyArray as a custom container class template with custom iterators.

  • Use non-type template ...

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

Designing Data-Intensive Applications, 2nd Edition

Designing Data-Intensive Applications, 2nd Edition

Martin Kleppmann, Chris Riccomini

Publisher Resources

ISBN: 9780136905776