]>
Commit | Line | Data |
---|---|---|
92f5a8d4 TL |
1 | /* |
2 | Copyright 2019 Glen Joseph Fernandes | |
3 | (glenjofe@gmail.com) | |
4 | ||
5 | Distributed under the Boost Software License, | |
6 | Version 1.0. (See accompanying file LICENSE_1_0.txt | |
7 | or copy at http://www.boost.org/LICENSE_1_0.txt) | |
8 | */ | |
9 | ||
10 | #ifdef TEST_STD | |
11 | #include <type_traits> | |
12 | #else | |
13 | #include <boost/type_traits/copy_cv_ref.hpp> | |
14 | #endif | |
15 | #include "test.hpp" | |
16 | #include "check_type.hpp" | |
17 | ||
18 | TT_TEST_BEGIN(copy_cv_ref) | |
19 | ||
20 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, char>::type, int); | |
21 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, const char>::type, const int); | |
22 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, volatile char>::type, volatile int); | |
23 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, const volatile char>::type, const volatile int); | |
24 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, char&>::type, int&); | |
25 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, const char&>::type, const int&); | |
26 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, volatile char&>::type, volatile int&); | |
27 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, const volatile char&>::type, const volatile int&); | |
28 | ||
29 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, char>::type, const int); | |
30 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, const char>::type, const int); | |
31 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, volatile char>::type, const volatile int); | |
32 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, const volatile char>::type, const volatile int); | |
33 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, char&>::type, const int&); | |
34 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, const char&>::type, const int&); | |
35 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, volatile char&>::type, const volatile int&); | |
36 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, const volatile char&>::type, const volatile int&); | |
37 | ||
38 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, char>::type, volatile int); | |
39 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, const char>::type, const volatile int); | |
40 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, volatile char>::type, volatile int); | |
41 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, const volatile char>::type, const volatile int); | |
42 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, char&>::type, volatile int&); | |
43 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, const char&>::type, const volatile int&); | |
44 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, volatile char&>::type, volatile int&); | |
45 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, const volatile char&>::type, const volatile int&); | |
46 | ||
47 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, char>::type, const volatile int); | |
48 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, const char>::type, const volatile int); | |
49 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, volatile char>::type, const volatile int); | |
50 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, const volatile char>::type, const volatile int); | |
51 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, char&>::type, const volatile int&); | |
52 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, const char&>::type, const volatile int&); | |
53 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, volatile char&>::type, const volatile int&); | |
54 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, const volatile char&>::type, const volatile int&); | |
55 | ||
56 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, char>::type, int&); | |
57 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, const char>::type, int&); | |
58 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, volatile char>::type, int&); | |
59 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, const volatile char>::type, int&); | |
60 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, char&>::type, int&); | |
61 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, const char&>::type, int&); | |
62 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, volatile char&>::type, int&); | |
63 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, const volatile char&>::type, int&); | |
64 | ||
65 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, char>::type, const int&); | |
66 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, const char>::type, const int&); | |
67 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, volatile char>::type, const int&); | |
68 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, const volatile char>::type, const int&); | |
69 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, char&>::type, const int&); | |
70 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, const char&>::type, const int&); | |
71 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, volatile char&>::type, const int&); | |
72 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, const volatile char&>::type, const int&); | |
73 | ||
74 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, char>::type, volatile int&); | |
75 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, const char>::type, volatile int&); | |
76 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, volatile char>::type, volatile int&); | |
77 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, const volatile char>::type, volatile int&); | |
78 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, char&>::type, volatile int&); | |
79 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, const char&>::type, volatile int&); | |
80 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, volatile char&>::type, volatile int&); | |
81 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, const volatile char&>::type, volatile int&); | |
82 | ||
83 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, char>::type, const volatile int&); | |
84 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, const char>::type, const volatile int&); | |
85 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, volatile char>::type, const volatile int&); | |
86 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, const volatile char>::type, const volatile int&); | |
87 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, char&>::type, const volatile int&); | |
88 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, const char&>::type, const volatile int&); | |
89 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, volatile char&>::type, const volatile int&); | |
90 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, const volatile char&>::type, const volatile int&); | |
91 | ||
92 | #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) | |
93 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, char&&>::type, int&&); | |
94 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, const char&&>::type, const int&&); | |
95 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, volatile char&&>::type, volatile int&&); | |
96 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, const volatile char&&>::type, const volatile int&&); | |
97 | ||
98 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, char&&>::type, const int&&); | |
99 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, const char&&>::type, const int&&); | |
100 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, volatile char&&>::type, const volatile int&&); | |
101 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, const volatile char&&>::type, const volatile int&&); | |
102 | ||
103 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, char&&>::type, volatile int&&); | |
104 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, const char&&>::type, const volatile int&&); | |
105 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, volatile char&&>::type, volatile int&&); | |
106 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, const volatile char&&>::type, const volatile int&&); | |
107 | ||
108 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, char&&>::type, const volatile int&&); | |
109 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, const char&&>::type, const volatile int&&); | |
110 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, volatile char&&>::type, const volatile int&&); | |
111 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, const volatile char&&>::type, const volatile int&&); | |
112 | ||
113 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, char&&>::type, int&); | |
114 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, const char&&>::type, int&); | |
115 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, volatile char&&>::type, int&); | |
116 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, const volatile char&&>::type, int&); | |
117 | ||
118 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, char&&>::type, const int&); | |
119 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, const char&&>::type, const int&); | |
120 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, volatile char&&>::type, const int&); | |
121 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, const volatile char&&>::type, const int&); | |
122 | ||
123 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, char&&>::type, volatile int&); | |
124 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, const char&&>::type, volatile int&); | |
125 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, volatile char&&>::type, volatile int&); | |
126 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, const volatile char&&>::type, volatile int&); | |
127 | ||
128 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, char&&>::type, const volatile int&); | |
129 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, const char&&>::type, const volatile int&); | |
130 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, volatile char&&>::type, const volatile int&); | |
131 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, const volatile char&&>::type, const volatile int&); | |
132 | ||
133 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, char>::type, int&&); | |
134 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, const char>::type, int&&); | |
135 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, volatile char>::type, int&&); | |
136 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, const volatile char>::type, int&&); | |
137 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, char&>::type, int&); | |
138 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, const char&>::type, int&); | |
139 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, volatile char&>::type, int&); | |
140 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, const volatile char&>::type, int&); | |
141 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, char&&>::type, int&&); | |
142 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, const char&&>::type, int&&); | |
143 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, volatile char&&>::type, int&&); | |
144 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, const volatile char&&>::type, int&&); | |
145 | ||
146 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, char>::type, const int&&); | |
147 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, const char>::type, const int&&); | |
148 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, volatile char>::type, const int&&); | |
149 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, const volatile char>::type, const int&&); | |
150 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, char&>::type, const int&); | |
151 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, const char&>::type, const int&); | |
152 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, volatile char&>::type, const int&); | |
153 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, const volatile char&>::type, const int&); | |
154 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, char&&>::type, const int&&); | |
155 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, const char&&>::type, const int&&); | |
156 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, volatile char&&>::type, const int&&); | |
157 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, const volatile char&&>::type, const int&&); | |
158 | ||
159 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, char>::type, volatile int&&); | |
160 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, const char>::type, volatile int&&); | |
161 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, volatile char>::type, volatile int&&); | |
162 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, const volatile char>::type, volatile int&&); | |
163 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, char&>::type, volatile int&); | |
164 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, const char&>::type, volatile int&); | |
165 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, volatile char&>::type, volatile int&); | |
166 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, const volatile char&>::type, volatile int&); | |
167 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, char&&>::type, volatile int&&); | |
168 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, const char&&>::type, volatile int&&); | |
169 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, volatile char&&>::type, volatile int&&); | |
170 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, const volatile char&&>::type, volatile int&&); | |
171 | ||
172 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, char>::type, const volatile int&&); | |
173 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, const char>::type, const volatile int&&); | |
174 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, volatile char>::type, const volatile int&&); | |
175 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, const volatile char>::type, const volatile int&&); | |
176 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, char&>::type, const volatile int&); | |
177 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, const char&>::type, const volatile int&); | |
178 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, volatile char&>::type, const volatile int&); | |
179 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, const volatile char&>::type, const volatile int&); | |
180 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, char&&>::type, const volatile int&&); | |
181 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, const char&&>::type, const volatile int&&); | |
182 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, volatile char&&>::type, const volatile int&&); | |
183 | BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, const volatile char&&>::type, const volatile int&&); | |
184 | #endif | |
185 | ||
186 | TT_TEST_END |