Chapter 11. Type Traits

I am the voice of today, the herald of tomorrow…. I am the leaden army that conquers the world—I am type.

The Type SpeaksFREDERIC WILLIAM GOUDY

The TR1 library has more than 50 class templates that provide compile-time constants based on various properties of their type arguments or new types that are like their type argument with some of its properties changed. They are basic building blocks. You can use them directly in your code, but more often, you’ll use them to construct other templates that do something you need in a more narrowly focused library or in your current application.

As an example, the C++ language allows you to overload functions based on their argument types.[1] In some cases, though, you need a more ...

Get The C++ Standard Library Extensions A Tutorial and Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.