remove_cv_ref.qbk 995 B

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