remove_cv.qbk 897 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_cv remove_cv]
  8. template <class T>
  9. struct remove_cv
  10. {
  11. typedef __below type;
  12. };
  13. template <class T> using remove_cv_t = typename remove_cv<T>::type; // C++11 and above
  14. __type The same type as `T`, but with any /top level/ cv-qualifiers removed.
  15. __std_ref 3.9.3.
  16. [all_compilers]
  17. __header ` #include <boost/type_traits/remove_cv.hpp>` or ` #include <boost/type_traits.hpp>`
  18. [table Examples
  19. [ [Expression] [Result Type]]
  20. [[`remove_cv<int>::type`][`int`]]
  21. [[`remove_cv<int const>::type`] [`int`]]
  22. [[`remove_cv<int const volatile>::type`] [`int`]]
  23. [[`remove_cv<int const&>::type`] [`int const&`]]
  24. [[`remove_cv<int const*>::type`] [`int const*`]]
  25. ]
  26. [endsect]