copy_cv_ref.qbk 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. [/
  2. Copyright 2019 Glen Joseph Fernandes
  3. (glenjofe@gmail.com)
  4. Distributed under the Boost Software License,
  5. Version 1.0. (See accompanying file LICENSE_1_0.txt
  6. or copy at http://www.boost.org/LICENSE_1_0.txt).
  7. ]
  8. [section:copy_cv_ref copy_cv_ref]
  9. template<class T, class U>
  10. struct copy_cv_ref
  11. {
  12. typedef __below type;
  13. };
  14. template<class T, class U>
  15. using copy_cv_ref_t = typename copy_cv_ref<T, U>::type;
  16. __type [^T /cvref/], where /cvref/ are the cvref-qualifiers of `U`.
  17. __header `#include <boost/type_traits/copy_cv_ref.hpp>` or
  18. `#include <boost/type_traits.hpp>>`
  19. [table Examples
  20. [[Expression] [Result Type]]
  21. [[`copy_cv_ref<int, const char>::type`][`const int`]]
  22. [[`copy_cv_ref<int, volatile char>::type`][`volatile int`]]
  23. [[`copy_cv_ref<int, const volatile char>::type`][`const volatile int`]]
  24. [[`copy_cv_ref<int, char&>::type`][`int&`]]
  25. [[`copy_cv_ref<int, const char&>::type`][`const int&`]]
  26. [[`copy_cv_ref<int, volatile char&>::type`][`volatile int&`]]
  27. [[`copy_cv_ref<int, const volatile char&>::type`][`const volatile int&`]]
  28. [[`copy_cv_ref<int, char&&>::type`][`int&&`]]
  29. [[`copy_cv_ref<int, const char&&>::type`][`const int&&`]]
  30. [[`copy_cv_ref<int, volatile char&&>::type`][`volatile int&&`]]
  31. [[`copy_cv_ref<int, const volatile char&&>::type`][`const volatile int&&`]]
  32. [[`copy_cv_ref<int&&, char&>::type`][`int&`]]
  33. [[`copy_cv_ref<int&, const char>::type`][`int&`]]
  34. [[`copy_cv_ref<int&, volatile char&>::type`][`int&`]]
  35. [[`copy_cv_ref<int&, const volatile char&&>::type`][`int&`]]
  36. ]
  37. [all_compilers] The type alias `copy_cv_ref_t` is only available if the compiler
  38. supports template aliases.
  39. [endsect]