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 an old version of Boost. Click here to view this page for the latest version.
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.35. Examples

Expression

Result Type

type_identity<int>::type

int

type_identity<int&>::type

int&

type_identity<int* const&>::type

int* const&



PrevUpHomeNext