Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit 01b856e70e.
PrevUpHomeNext

type_identity

template <class T>
struct type_identity
{
   typedef T type;
};

template <class T> using type_identity_t = typename type_identity<T>::type; // C++11 and above

Header: #include <boost/type_traits/type_identity.hpp> or #include <boost/type_traits.hpp>

Table 1.37. Examples

Expression

Result Type

type_identity<int>::type

int

type_identity<int&>::type

int&

type_identity<int* const&>::type

int* const&



PrevUpHomeNext