An Introduction to Type Traits and Conditional Compilation

Discover the type traits and conditional techniques that we'll cover in this section.

Type traits are an important metaprogramming technique that enables us to inspect properties of types or to perform transformations of types at compile-time. Type traits are themselves templates, and we can see them as metatypes. Knowing information such as the nature of a type, its supported operations, and its various properties is key for performing conditional compilation of templated code. It’s also very useful when writing a library of templates.

Overview of type traits and conditional compilation

In this section, we’ll learn the following:

Get hands-on with 1200+ tech skills courses.