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