| 1 | // (C) Copyright 2009-2011 Frederic Bron. |
| 2 | // |
| 3 | // Use, modification and distribution are subject to the Boost Software License, |
| 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
| 5 | // http://www.boost.org/LICENSE_1_0.txt). |
| 6 | // |
| 7 | // See http://www.boost.org/libs/type_traits for most recent version including documentation. |
| 8 | |
| 9 | #ifndef BOOST_TT_HAS_DEREFERENCE_HPP_INCLUDED |
| 10 | #define BOOST_TT_HAS_DEREFERENCE_HPP_INCLUDED |
| 11 | |
| 12 | #define BOOST_TT_TRAIT_NAME has_dereference |
| 13 | #define BOOST_TT_TRAIT_OP * |
| 14 | #define BOOST_TT_FORBIDDEN_IF\ |
| 15 | /* void* or fundamental */\ |
| 16 | (\ |
| 17 | (\ |
| 18 | ::boost::is_pointer< Rhs_noref >::value && \ |
| 19 | ::boost::is_void< Rhs_noptr >::value\ |
| 20 | ) || \ |
| 21 | ::boost::is_fundamental< Rhs_nocv >::value\ |
| 22 | ) |
| 23 | |
| 24 | |
| 25 | #include <boost/type_traits/detail/has_prefix_operator.hpp> |
| 26 | |
| 27 | #undef BOOST_TT_TRAIT_NAME |
| 28 | #undef BOOST_TT_TRAIT_OP |
| 29 | #undef BOOST_TT_FORBIDDEN_IF |
| 30 | #if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION) |
| 31 | |
| 32 | namespace boost { |
| 33 | |
| 34 | template <class R> |
| 35 | struct has_dereference<void*, R> : public false_type {}; |
| 36 | template <> |
| 37 | struct has_dereference<void*, boost::binary_op_detail::dont_care> : public false_type {}; |
| 38 | template <> |
| 39 | struct has_dereference<void*, void> : public false_type {}; |
| 40 | |
| 41 | template <class R> |
| 42 | struct has_dereference<const void*, R> : public false_type {}; |
| 43 | template <> |
| 44 | struct has_dereference<const void*, boost::binary_op_detail::dont_care> : public false_type {}; |
| 45 | template <> |
| 46 | struct has_dereference<const void*, void> : public false_type {}; |
| 47 | |
| 48 | template <class R> |
| 49 | struct has_dereference<volatile void*, R> : public false_type {}; |
| 50 | template <> |
| 51 | struct has_dereference<volatile void*, boost::binary_op_detail::dont_care> : public false_type {}; |
| 52 | template <> |
| 53 | struct has_dereference<volatile void*, void> : public false_type {}; |
| 54 | |
| 55 | template <class R> |
| 56 | struct has_dereference<const volatile void*, R> : public false_type {}; |
| 57 | template <> |
| 58 | struct has_dereference<const volatile void*, boost::binary_op_detail::dont_care> : public false_type {}; |
| 59 | template <> |
| 60 | struct has_dereference<const volatile void*, void> : public false_type {}; |
| 61 | |
| 62 | template <class R> |
| 63 | struct has_dereference<void*const, R> : public false_type {}; |
| 64 | template <> |
| 65 | struct has_dereference<void*const, boost::binary_op_detail::dont_care> : public false_type {}; |
| 66 | template <> |
| 67 | struct has_dereference<void*const, void> : public false_type {}; |
| 68 | |
| 69 | template <class R> |
| 70 | struct has_dereference<const void*const, R> : public false_type {}; |
| 71 | template <> |
| 72 | struct has_dereference<const void*const, boost::binary_op_detail::dont_care> : public false_type {}; |
| 73 | template <> |
| 74 | struct has_dereference<const void*const, void> : public false_type {}; |
| 75 | |
| 76 | template <class R> |
| 77 | struct has_dereference<volatile void*const, R> : public false_type {}; |
| 78 | template <> |
| 79 | struct has_dereference<volatile void*const, boost::binary_op_detail::dont_care> : public false_type {}; |
| 80 | template <> |
| 81 | struct has_dereference<volatile void*const, void> : public false_type {}; |
| 82 | |
| 83 | template <class R> |
| 84 | struct has_dereference<const volatile void*const, R> : public false_type {}; |
| 85 | template <> |
| 86 | struct has_dereference<const volatile void*const, boost::binary_op_detail::dont_care> : public false_type {}; |
| 87 | template <> |
| 88 | struct has_dereference<const volatile void*const, void> : public false_type {}; |
| 89 | |
| 90 | template <class R> |
| 91 | struct has_dereference<void*volatile, R> : public false_type {}; |
| 92 | template <> |
| 93 | struct has_dereference<void*volatile, boost::binary_op_detail::dont_care> : public false_type {}; |
| 94 | template <> |
| 95 | struct has_dereference<void*volatile, void> : public false_type {}; |
| 96 | |
| 97 | template <class R> |
| 98 | struct has_dereference<const void*volatile, R> : public false_type {}; |
| 99 | template <> |
| 100 | struct has_dereference<const void*volatile, boost::binary_op_detail::dont_care> : public false_type {}; |
| 101 | template <> |
| 102 | struct has_dereference<const void*volatile, void> : public false_type {}; |
| 103 | |
| 104 | template <class R> |
| 105 | struct has_dereference<volatile void*volatile, R> : public false_type {}; |
| 106 | template <> |
| 107 | struct has_dereference<volatile void*volatile, boost::binary_op_detail::dont_care> : public false_type {}; |
| 108 | template <> |
| 109 | struct has_dereference<volatile void*volatile, void> : public false_type {}; |
| 110 | |
| 111 | template <class R> |
| 112 | struct has_dereference<const volatile void*volatile, R> : public false_type {}; |
| 113 | template <> |
| 114 | struct has_dereference<const volatile void*volatile, boost::binary_op_detail::dont_care> : public false_type {}; |
| 115 | template <> |
| 116 | struct has_dereference<const volatile void*volatile, void> : public false_type {}; |
| 117 | |
| 118 | template <class R> |
| 119 | struct has_dereference<void*const volatile, R> : public false_type {}; |
| 120 | template <> |
| 121 | struct has_dereference<void*const volatile, boost::binary_op_detail::dont_care> : public false_type {}; |
| 122 | template <> |
| 123 | struct has_dereference<void*const volatile, void> : public false_type {}; |
| 124 | |
| 125 | template <class R> |
| 126 | struct has_dereference<const void*const volatile, R> : public false_type {}; |
| 127 | template <> |
| 128 | struct has_dereference<const void*const volatile, boost::binary_op_detail::dont_care> : public false_type {}; |
| 129 | template <> |
| 130 | struct has_dereference<const void*const volatile, void> : public false_type {}; |
| 131 | |
| 132 | template <class R> |
| 133 | struct has_dereference<volatile void*const volatile, R> : public false_type {}; |
| 134 | template <> |
| 135 | struct has_dereference<volatile void*const volatile, boost::binary_op_detail::dont_care> : public false_type {}; |
| 136 | template <> |
| 137 | struct has_dereference<volatile void*const volatile, void> : public false_type {}; |
| 138 | |
| 139 | template <class R> |
| 140 | struct has_dereference<const volatile void*const volatile, R> : public false_type {}; |
| 141 | template <> |
| 142 | struct has_dereference<const volatile void*const volatile, boost::binary_op_detail::dont_care> : public false_type {}; |
| 143 | template <> |
| 144 | struct has_dereference<const volatile void*const volatile, void> : public false_type {}; |
| 145 | |
| 146 | // references: |
| 147 | template <class R> |
| 148 | struct has_dereference<void*&, R> : public false_type {}; |
| 149 | template <> |
| 150 | struct has_dereference<void*&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 151 | template <> |
| 152 | struct has_dereference<void*&, void> : public false_type {}; |
| 153 | |
| 154 | template <class R> |
| 155 | struct has_dereference<const void*&, R> : public false_type {}; |
| 156 | template <> |
| 157 | struct has_dereference<const void*&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 158 | template <> |
| 159 | struct has_dereference<const void*&, void> : public false_type {}; |
| 160 | |
| 161 | template <class R> |
| 162 | struct has_dereference<volatile void*&, R> : public false_type {}; |
| 163 | template <> |
| 164 | struct has_dereference<volatile void*&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 165 | template <> |
| 166 | struct has_dereference<volatile void*&, void> : public false_type {}; |
| 167 | |
| 168 | template <class R> |
| 169 | struct has_dereference<const volatile void*&, R> : public false_type {}; |
| 170 | template <> |
| 171 | struct has_dereference<const volatile void*&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 172 | template <> |
| 173 | struct has_dereference<const volatile void*&, void> : public false_type {}; |
| 174 | |
| 175 | template <class R> |
| 176 | struct has_dereference<void*const&, R> : public false_type {}; |
| 177 | template <> |
| 178 | struct has_dereference<void*const&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 179 | template <> |
| 180 | struct has_dereference<void*const&, void> : public false_type {}; |
| 181 | |
| 182 | template <class R> |
| 183 | struct has_dereference<const void*const&, R> : public false_type {}; |
| 184 | template <> |
| 185 | struct has_dereference<const void*const&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 186 | template <> |
| 187 | struct has_dereference<const void*const&, void> : public false_type {}; |
| 188 | |
| 189 | template <class R> |
| 190 | struct has_dereference<volatile void*const&, R> : public false_type {}; |
| 191 | template <> |
| 192 | struct has_dereference<volatile void*const&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 193 | template <> |
| 194 | struct has_dereference<volatile void*const&, void> : public false_type {}; |
| 195 | |
| 196 | template <class R> |
| 197 | struct has_dereference<const volatile void*const&, R> : public false_type {}; |
| 198 | template <> |
| 199 | struct has_dereference<const volatile void*const&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 200 | template <> |
| 201 | struct has_dereference<const volatile void*const&, void> : public false_type {}; |
| 202 | |
| 203 | template <class R> |
| 204 | struct has_dereference<void*volatile&, R> : public false_type {}; |
| 205 | template <> |
| 206 | struct has_dereference<void*volatile&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 207 | template <> |
| 208 | struct has_dereference<void*volatile&, void> : public false_type {}; |
| 209 | |
| 210 | template <class R> |
| 211 | struct has_dereference<const void*volatile&, R> : public false_type {}; |
| 212 | template <> |
| 213 | struct has_dereference<const void*volatile&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 214 | template <> |
| 215 | struct has_dereference<const void*volatile&, void> : public false_type {}; |
| 216 | |
| 217 | template <class R> |
| 218 | struct has_dereference<volatile void*volatile&, R> : public false_type {}; |
| 219 | template <> |
| 220 | struct has_dereference<volatile void*volatile&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 221 | template <> |
| 222 | struct has_dereference<volatile void*volatile&, void> : public false_type {}; |
| 223 | |
| 224 | template <class R> |
| 225 | struct has_dereference<const volatile void*volatile&, R> : public false_type {}; |
| 226 | template <> |
| 227 | struct has_dereference<const volatile void*volatile&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 228 | template <> |
| 229 | struct has_dereference<const volatile void*volatile&, void> : public false_type {}; |
| 230 | |
| 231 | template <class R> |
| 232 | struct has_dereference<void*const volatile&, R> : public false_type {}; |
| 233 | template <> |
| 234 | struct has_dereference<void*const volatile&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 235 | template <> |
| 236 | struct has_dereference<void*const volatile&, void> : public false_type {}; |
| 237 | |
| 238 | template <class R> |
| 239 | struct has_dereference<const void*const volatile&, R> : public false_type {}; |
| 240 | template <> |
| 241 | struct has_dereference<const void*const volatile&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 242 | template <> |
| 243 | struct has_dereference<const void*const volatile&, void> : public false_type {}; |
| 244 | |
| 245 | template <class R> |
| 246 | struct has_dereference<volatile void*const volatile&, R> : public false_type {}; |
| 247 | template <> |
| 248 | struct has_dereference<volatile void*const volatile&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 249 | template <> |
| 250 | struct has_dereference<volatile void*const volatile&, void> : public false_type {}; |
| 251 | |
| 252 | template <class R> |
| 253 | struct has_dereference<const volatile void*const volatile&, R> : public false_type {}; |
| 254 | template <> |
| 255 | struct has_dereference<const volatile void*const volatile&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 256 | template <> |
| 257 | struct has_dereference<const volatile void*const volatile&, void> : public false_type {}; |
| 258 | |
| 259 | // rvalue refs: |
| 260 | template <class R> |
| 261 | struct has_dereference<void*&&, R> : public false_type {}; |
| 262 | template <> |
| 263 | struct has_dereference<void*&&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 264 | template <> |
| 265 | struct has_dereference<void*&&, void> : public false_type {}; |
| 266 | |
| 267 | template <class R> |
| 268 | struct has_dereference<const void*&&, R> : public false_type {}; |
| 269 | template <> |
| 270 | struct has_dereference<const void*&&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 271 | template <> |
| 272 | struct has_dereference<const void*&&, void> : public false_type {}; |
| 273 | |
| 274 | template <class R> |
| 275 | struct has_dereference<volatile void*&&, R> : public false_type {}; |
| 276 | template <> |
| 277 | struct has_dereference<volatile void*&&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 278 | template <> |
| 279 | struct has_dereference<volatile void*&&, void> : public false_type {}; |
| 280 | |
| 281 | template <class R> |
| 282 | struct has_dereference<const volatile void*&&, R> : public false_type {}; |
| 283 | template <> |
| 284 | struct has_dereference<const volatile void*&&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 285 | template <> |
| 286 | struct has_dereference<const volatile void*&&, void> : public false_type {}; |
| 287 | |
| 288 | template <class R> |
| 289 | struct has_dereference<void*const&&, R> : public false_type {}; |
| 290 | template <> |
| 291 | struct has_dereference<void*const&&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 292 | template <> |
| 293 | struct has_dereference<void*const&&, void> : public false_type {}; |
| 294 | |
| 295 | template <class R> |
| 296 | struct has_dereference<const void*const&&, R> : public false_type {}; |
| 297 | template <> |
| 298 | struct has_dereference<const void*const&&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 299 | template <> |
| 300 | struct has_dereference<const void*const&&, void> : public false_type {}; |
| 301 | |
| 302 | template <class R> |
| 303 | struct has_dereference<volatile void*const&&, R> : public false_type {}; |
| 304 | template <> |
| 305 | struct has_dereference<volatile void*const&&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 306 | template <> |
| 307 | struct has_dereference<volatile void*const&&, void> : public false_type {}; |
| 308 | |
| 309 | template <class R> |
| 310 | struct has_dereference<const volatile void*const&&, R> : public false_type {}; |
| 311 | template <> |
| 312 | struct has_dereference<const volatile void*const&&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 313 | template <> |
| 314 | struct has_dereference<const volatile void*const&&, void> : public false_type {}; |
| 315 | |
| 316 | template <class R> |
| 317 | struct has_dereference<void*volatile&&, R> : public false_type {}; |
| 318 | template <> |
| 319 | struct has_dereference<void*volatile&&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 320 | template <> |
| 321 | struct has_dereference<void*volatile&&, void> : public false_type {}; |
| 322 | |
| 323 | template <class R> |
| 324 | struct has_dereference<const void*volatile&&, R> : public false_type {}; |
| 325 | template <> |
| 326 | struct has_dereference<const void*volatile&&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 327 | template <> |
| 328 | struct has_dereference<const void*volatile&&, void> : public false_type {}; |
| 329 | |
| 330 | template <class R> |
| 331 | struct has_dereference<volatile void*volatile&&, R> : public false_type {}; |
| 332 | template <> |
| 333 | struct has_dereference<volatile void*volatile&&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 334 | template <> |
| 335 | struct has_dereference<volatile void*volatile&&, void> : public false_type {}; |
| 336 | |
| 337 | template <class R> |
| 338 | struct has_dereference<const volatile void*volatile&&, R> : public false_type {}; |
| 339 | template <> |
| 340 | struct has_dereference<const volatile void*volatile&&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 341 | template <> |
| 342 | struct has_dereference<const volatile void*volatile&&, void> : public false_type {}; |
| 343 | |
| 344 | template <class R> |
| 345 | struct has_dereference<void*const volatile&&, R> : public false_type {}; |
| 346 | template <> |
| 347 | struct has_dereference<void*const volatile&&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 348 | template <> |
| 349 | struct has_dereference<void*const volatile&&, void> : public false_type {}; |
| 350 | |
| 351 | template <class R> |
| 352 | struct has_dereference<const void*const volatile&&, R> : public false_type {}; |
| 353 | template <> |
| 354 | struct has_dereference<const void*const volatile&&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 355 | template <> |
| 356 | struct has_dereference<const void*const volatile&&, void> : public false_type {}; |
| 357 | |
| 358 | template <class R> |
| 359 | struct has_dereference<volatile void*const volatile&&, R> : public false_type {}; |
| 360 | template <> |
| 361 | struct has_dereference<volatile void*const volatile&&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 362 | template <> |
| 363 | struct has_dereference<volatile void*const volatile&&, void> : public false_type {}; |
| 364 | |
| 365 | template <class R> |
| 366 | struct has_dereference<const volatile void*const volatile&&, R> : public false_type {}; |
| 367 | template <> |
| 368 | struct has_dereference<const volatile void*const volatile&&, boost::binary_op_detail::dont_care> : public false_type {}; |
| 369 | template <> |
| 370 | struct has_dereference<const volatile void*const volatile&&, void> : public false_type {}; |
| 371 | |
| 372 | |
| 373 | } |
| 374 | #endif |
| 375 | #endif |
| 376 | |