add_cv.qbk 818 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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:add_cv add_cv]
  8. template <class T>
  9. struct add_cv
  10. {
  11. typedef __below type;
  12. };
  13. template <class T> using add_cv_t = typename add_cv<T>::type; // C++11 and above
  14. __type The same type as `T const volatile` for all `T`.
  15. __std_ref 3.9.3.
  16. __header ` #include <boost/type_traits/add_cv.hpp>` or ` #include <boost/type_traits.hpp>`
  17. [table Examples
  18. [ [Expression] [Result Type]]
  19. [[`add_cv<int>::type`][`int const volatile`]]
  20. [[`add_cv<int&>::type`] [`int&`]]
  21. [[`add_cv<int*>::type`] [`int* const volatile`]]
  22. [[`add_cv<int const>::type`] [`int const volatile`]]
  23. ]
  24. [all_compilers]
  25. [endsect]