-
Book Overview & Buying
-
Table Of Contents
C++ Memory Management
By :
Over the years, C++ programmers have developed various techniques to reason about the properties of their types, mostly at compile time. Inferring such things as “Is the T type const?” or “Is the T type trivially copyable?” can be very useful, particularly in the context of generic code. The constructs resulting from these techniques are called type traits, and many of those that came into common practice over time (as well as some that require compiler support to be implemented) were standardized and can be found in the <type_traits> header.
The ways in which standard type traits are expressed have standardized over time, going from complex beasts such as std::numeric_limits<T>, which provide a lot of different services for type T, to more specific services such as std::is_const<T> (Is the type T actually const?) or std::remove_const<T> (Please give me the type that’s like T but without the const qualification...