blob: 3c6622afb58ab98c1cb609e737a9dd08a20b83be [file] [log] [blame]
Brian Silverman4a2409e2018-08-04 23:24:02 -07001[/
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
8[section:add_cv add_cv]
9
10 template <class T>
11 struct add_cv
12 {
13 typedef __below type;
14 };
15
16 template <class T> using add_cv_t = typename add_cv<T>::type; // C++11 and above
17
18__type The same type as `T const volatile` for all `T`.
19
20__std_ref 3.9.3.
21
22__header ` #include <boost/type_traits/add_cv.hpp>` or ` #include <boost/type_traits.hpp>`
23
24[table Examples
25
26[ [Expression] [Result Type]]
27
28[[`add_cv<int>::type`][`int const volatile`]]
29
30[[`add_cv<int&>::type`] [`int&`]]
31
32[[`add_cv<int*>::type`] [`int* const volatile`]]
33
34[[`add_cv<int const>::type`] [`int const volatile`]]
35
36]
37
38[all_compilers]
39
40[endsect]
41