123456789101112131415161718192021222324252627282930313233 |
- [/
- Copyright 2015 Peter Dimov.
- Distributed under the Boost Software License, Version 1.0.
- (See accompanying file LICENSE_1_0.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt).
- ]
- [section:type_identity 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 Examples
- [ [Expression] [Result Type]]
- [[`type_identity<int>::type`][`int`]]
- [[`type_identity<int&>::type`] [`int&`]]
- [[`type_identity<int* const&>::type`] [`int* const&`]]
- ]
- [endsect]
|