copy_cv.qbk 942 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. [/
  2. Copyright 2015 Peter Dimov.
  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:copy_cv copy_cv]
  8. template <class T, class U>
  9. struct copy_cv
  10. {
  11. typedef __below type;
  12. };
  13. template <class T, class U> using copy_cv_t = typename copy_cv<T, U>::type; // C++11 and above
  14. __type [^T /cv/], where /cv/ are the cv-qualifiers of `U`.
  15. __header ` #include <boost/type_traits/copy_cv.hpp>` or ` #include <boost/type_traits.hpp>`
  16. [table Examples
  17. [ [Expression] [Result Type]]
  18. [[`copy_cv<int, void>::type`][`int`]]
  19. [[`copy_cv<int const, void>::type`][`int const`]]
  20. [[`copy_cv<int, void const>::type`][`int const`]]
  21. [[`copy_cv<int volatile, void const>::type`][`int const volatile`]]
  22. [[`copy_cv<int&, void const>::type`] [`int&`]]
  23. [[`copy_cv<int*, void volatile>::type`] [`int* volatile`]]
  24. ]
  25. [endsect]