remove_reference.qbk 938 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. [/
  2. Copyright 2007 John Maddock.
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt).
  6. ]
  7. [section:remove_reference remove_reference]
  8. template <class T>
  9. struct remove_reference
  10. {
  11. typedef __below type;
  12. };
  13. template <class T> using remove_reference_t = typename remove_reference<T>::type; // C++11 and above
  14. __type The same type as `T`, but with any reference modifier removed.
  15. __std_ref 8.3.2.
  16. [all_compilers]
  17. __header ` #include <boost/type_traits/remove_reference.hpp>` or ` #include <boost/type_traits.hpp>`
  18. [table Examples
  19. [ [Expression] [Result Type]]
  20. [[`remove_reference<int>::type`][`int`]]
  21. [[`remove_reference<int const&>::type`] [`int const`]]
  22. [[`remove_reference<int&&>::type`] [`int`]]
  23. [[`remove_reference<int*>::type`] [`int*`]]
  24. [[`remove_reference<int*&>::type`] [`int*`]]
  25. ]
  26. [endsect]