has_dereference.hpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  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. #ifndef BOOST_TT_HAS_DEREFERENCE_HPP_INCLUDED
  9. #define BOOST_TT_HAS_DEREFERENCE_HPP_INCLUDED
  10. #define BOOST_TT_TRAIT_NAME has_dereference
  11. #define BOOST_TT_TRAIT_OP *
  12. #define BOOST_TT_FORBIDDEN_IF\
  13. /* void* or fundamental */\
  14. (\
  15. (\
  16. ::boost::is_pointer< Rhs_noref >::value && \
  17. ::boost::is_void< Rhs_noptr >::value\
  18. ) || \
  19. ::boost::is_fundamental< Rhs_nocv >::value\
  20. )
  21. #include <boost/type_traits/detail/has_prefix_operator.hpp>
  22. #undef BOOST_TT_TRAIT_NAME
  23. #undef BOOST_TT_TRAIT_OP
  24. #undef BOOST_TT_FORBIDDEN_IF
  25. #if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION)
  26. namespace boost {
  27. template <class R>
  28. struct has_dereference<void*, R> : public false_type {};
  29. template <>
  30. struct has_dereference<void*, boost::binary_op_detail::dont_care> : public false_type {};
  31. template <>
  32. struct has_dereference<void*, void> : public false_type {};
  33. template <class R>
  34. struct has_dereference<const void*, R> : public false_type {};
  35. template <>
  36. struct has_dereference<const void*, boost::binary_op_detail::dont_care> : public false_type {};
  37. template <>
  38. struct has_dereference<const void*, void> : public false_type {};
  39. template <class R>
  40. struct has_dereference<volatile void*, R> : public false_type {};
  41. template <>
  42. struct has_dereference<volatile void*, boost::binary_op_detail::dont_care> : public false_type {};
  43. template <>
  44. struct has_dereference<volatile void*, void> : public false_type {};
  45. template <class R>
  46. struct has_dereference<const volatile void*, R> : public false_type {};
  47. template <>
  48. struct has_dereference<const volatile void*, boost::binary_op_detail::dont_care> : public false_type {};
  49. template <>
  50. struct has_dereference<const volatile void*, void> : public false_type {};
  51. template <class R>
  52. struct has_dereference<void*const, R> : public false_type {};
  53. template <>
  54. struct has_dereference<void*const, boost::binary_op_detail::dont_care> : public false_type {};
  55. template <>
  56. struct has_dereference<void*const, void> : public false_type {};
  57. template <class R>
  58. struct has_dereference<const void*const, R> : public false_type {};
  59. template <>
  60. struct has_dereference<const void*const, boost::binary_op_detail::dont_care> : public false_type {};
  61. template <>
  62. struct has_dereference<const void*const, void> : public false_type {};
  63. template <class R>
  64. struct has_dereference<volatile void*const, R> : public false_type {};
  65. template <>
  66. struct has_dereference<volatile void*const, boost::binary_op_detail::dont_care> : public false_type {};
  67. template <>
  68. struct has_dereference<volatile void*const, void> : public false_type {};
  69. template <class R>
  70. struct has_dereference<const volatile void*const, R> : public false_type {};
  71. template <>
  72. struct has_dereference<const volatile void*const, boost::binary_op_detail::dont_care> : public false_type {};
  73. template <>
  74. struct has_dereference<const volatile void*const, void> : public false_type {};
  75. template <class R>
  76. struct has_dereference<void*volatile, R> : public false_type {};
  77. template <>
  78. struct has_dereference<void*volatile, boost::binary_op_detail::dont_care> : public false_type {};
  79. template <>
  80. struct has_dereference<void*volatile, void> : public false_type {};
  81. template <class R>
  82. struct has_dereference<const void*volatile, R> : public false_type {};
  83. template <>
  84. struct has_dereference<const void*volatile, boost::binary_op_detail::dont_care> : public false_type {};
  85. template <>
  86. struct has_dereference<const void*volatile, void> : public false_type {};
  87. template <class R>
  88. struct has_dereference<volatile void*volatile, R> : public false_type {};
  89. template <>
  90. struct has_dereference<volatile void*volatile, boost::binary_op_detail::dont_care> : public false_type {};
  91. template <>
  92. struct has_dereference<volatile void*volatile, void> : public false_type {};
  93. template <class R>
  94. struct has_dereference<const volatile void*volatile, R> : public false_type {};
  95. template <>
  96. struct has_dereference<const volatile void*volatile, boost::binary_op_detail::dont_care> : public false_type {};
  97. template <>
  98. struct has_dereference<const volatile void*volatile, void> : public false_type {};
  99. template <class R>
  100. struct has_dereference<void*const volatile, R> : public false_type {};
  101. template <>
  102. struct has_dereference<void*const volatile, boost::binary_op_detail::dont_care> : public false_type {};
  103. template <>
  104. struct has_dereference<void*const volatile, void> : public false_type {};
  105. template <class R>
  106. struct has_dereference<const void*const volatile, R> : public false_type {};
  107. template <>
  108. struct has_dereference<const void*const volatile, boost::binary_op_detail::dont_care> : public false_type {};
  109. template <>
  110. struct has_dereference<const void*const volatile, void> : public false_type {};
  111. template <class R>
  112. struct has_dereference<volatile void*const volatile, R> : public false_type {};
  113. template <>
  114. struct has_dereference<volatile void*const volatile, boost::binary_op_detail::dont_care> : public false_type {};
  115. template <>
  116. struct has_dereference<volatile void*const volatile, void> : public false_type {};
  117. template <class R>
  118. struct has_dereference<const volatile void*const volatile, R> : public false_type {};
  119. template <>
  120. struct has_dereference<const volatile void*const volatile, boost::binary_op_detail::dont_care> : public false_type {};
  121. template <>
  122. struct has_dereference<const volatile void*const volatile, void> : public false_type {};
  123. // references:
  124. template <class R>
  125. struct has_dereference<void*&, R> : public false_type {};
  126. template <>
  127. struct has_dereference<void*&, boost::binary_op_detail::dont_care> : public false_type {};
  128. template <>
  129. struct has_dereference<void*&, void> : public false_type {};
  130. template <class R>
  131. struct has_dereference<const void*&, R> : public false_type {};
  132. template <>
  133. struct has_dereference<const void*&, boost::binary_op_detail::dont_care> : public false_type {};
  134. template <>
  135. struct has_dereference<const void*&, void> : public false_type {};
  136. template <class R>
  137. struct has_dereference<volatile void*&, R> : public false_type {};
  138. template <>
  139. struct has_dereference<volatile void*&, boost::binary_op_detail::dont_care> : public false_type {};
  140. template <>
  141. struct has_dereference<volatile void*&, void> : public false_type {};
  142. template <class R>
  143. struct has_dereference<const volatile void*&, R> : public false_type {};
  144. template <>
  145. struct has_dereference<const volatile void*&, boost::binary_op_detail::dont_care> : public false_type {};
  146. template <>
  147. struct has_dereference<const volatile void*&, void> : public false_type {};
  148. template <class R>
  149. struct has_dereference<void*const&, R> : public false_type {};
  150. template <>
  151. struct has_dereference<void*const&, boost::binary_op_detail::dont_care> : public false_type {};
  152. template <>
  153. struct has_dereference<void*const&, void> : public false_type {};
  154. template <class R>
  155. struct has_dereference<const void*const&, R> : public false_type {};
  156. template <>
  157. struct has_dereference<const void*const&, boost::binary_op_detail::dont_care> : public false_type {};
  158. template <>
  159. struct has_dereference<const void*const&, void> : public false_type {};
  160. template <class R>
  161. struct has_dereference<volatile void*const&, R> : public false_type {};
  162. template <>
  163. struct has_dereference<volatile void*const&, boost::binary_op_detail::dont_care> : public false_type {};
  164. template <>
  165. struct has_dereference<volatile void*const&, void> : public false_type {};
  166. template <class R>
  167. struct has_dereference<const volatile void*const&, R> : public false_type {};
  168. template <>
  169. struct has_dereference<const volatile void*const&, boost::binary_op_detail::dont_care> : public false_type {};
  170. template <>
  171. struct has_dereference<const volatile void*const&, void> : public false_type {};
  172. template <class R>
  173. struct has_dereference<void*volatile&, R> : public false_type {};
  174. template <>
  175. struct has_dereference<void*volatile&, boost::binary_op_detail::dont_care> : public false_type {};
  176. template <>
  177. struct has_dereference<void*volatile&, void> : public false_type {};
  178. template <class R>
  179. struct has_dereference<const void*volatile&, R> : public false_type {};
  180. template <>
  181. struct has_dereference<const void*volatile&, boost::binary_op_detail::dont_care> : public false_type {};
  182. template <>
  183. struct has_dereference<const void*volatile&, void> : public false_type {};
  184. template <class R>
  185. struct has_dereference<volatile void*volatile&, R> : public false_type {};
  186. template <>
  187. struct has_dereference<volatile void*volatile&, boost::binary_op_detail::dont_care> : public false_type {};
  188. template <>
  189. struct has_dereference<volatile void*volatile&, void> : public false_type {};
  190. template <class R>
  191. struct has_dereference<const volatile void*volatile&, R> : public false_type {};
  192. template <>
  193. struct has_dereference<const volatile void*volatile&, boost::binary_op_detail::dont_care> : public false_type {};
  194. template <>
  195. struct has_dereference<const volatile void*volatile&, void> : public false_type {};
  196. template <class R>
  197. struct has_dereference<void*const volatile&, R> : public false_type {};
  198. template <>
  199. struct has_dereference<void*const volatile&, boost::binary_op_detail::dont_care> : public false_type {};
  200. template <>
  201. struct has_dereference<void*const volatile&, void> : public false_type {};
  202. template <class R>
  203. struct has_dereference<const void*const volatile&, R> : public false_type {};
  204. template <>
  205. struct has_dereference<const void*const volatile&, boost::binary_op_detail::dont_care> : public false_type {};
  206. template <>
  207. struct has_dereference<const void*const volatile&, void> : public false_type {};
  208. template <class R>
  209. struct has_dereference<volatile void*const volatile&, R> : public false_type {};
  210. template <>
  211. struct has_dereference<volatile void*const volatile&, boost::binary_op_detail::dont_care> : public false_type {};
  212. template <>
  213. struct has_dereference<volatile void*const volatile&, void> : public false_type {};
  214. template <class R>
  215. struct has_dereference<const volatile void*const volatile&, R> : public false_type {};
  216. template <>
  217. struct has_dereference<const volatile void*const volatile&, boost::binary_op_detail::dont_care> : public false_type {};
  218. template <>
  219. struct has_dereference<const volatile void*const volatile&, void> : public false_type {};
  220. // rvalue refs:
  221. template <class R>
  222. struct has_dereference<void*&&, R> : public false_type {};
  223. template <>
  224. struct has_dereference<void*&&, boost::binary_op_detail::dont_care> : public false_type {};
  225. template <>
  226. struct has_dereference<void*&&, void> : public false_type {};
  227. template <class R>
  228. struct has_dereference<const void*&&, R> : public false_type {};
  229. template <>
  230. struct has_dereference<const void*&&, boost::binary_op_detail::dont_care> : public false_type {};
  231. template <>
  232. struct has_dereference<const void*&&, void> : public false_type {};
  233. template <class R>
  234. struct has_dereference<volatile void*&&, R> : public false_type {};
  235. template <>
  236. struct has_dereference<volatile void*&&, boost::binary_op_detail::dont_care> : public false_type {};
  237. template <>
  238. struct has_dereference<volatile void*&&, void> : public false_type {};
  239. template <class R>
  240. struct has_dereference<const volatile void*&&, R> : public false_type {};
  241. template <>
  242. struct has_dereference<const volatile void*&&, boost::binary_op_detail::dont_care> : public false_type {};
  243. template <>
  244. struct has_dereference<const volatile void*&&, void> : public false_type {};
  245. template <class R>
  246. struct has_dereference<void*const&&, R> : public false_type {};
  247. template <>
  248. struct has_dereference<void*const&&, boost::binary_op_detail::dont_care> : public false_type {};
  249. template <>
  250. struct has_dereference<void*const&&, void> : public false_type {};
  251. template <class R>
  252. struct has_dereference<const void*const&&, R> : public false_type {};
  253. template <>
  254. struct has_dereference<const void*const&&, boost::binary_op_detail::dont_care> : public false_type {};
  255. template <>
  256. struct has_dereference<const void*const&&, void> : public false_type {};
  257. template <class R>
  258. struct has_dereference<volatile void*const&&, R> : public false_type {};
  259. template <>
  260. struct has_dereference<volatile void*const&&, boost::binary_op_detail::dont_care> : public false_type {};
  261. template <>
  262. struct has_dereference<volatile void*const&&, void> : public false_type {};
  263. template <class R>
  264. struct has_dereference<const volatile void*const&&, R> : public false_type {};
  265. template <>
  266. struct has_dereference<const volatile void*const&&, boost::binary_op_detail::dont_care> : public false_type {};
  267. template <>
  268. struct has_dereference<const volatile void*const&&, void> : public false_type {};
  269. template <class R>
  270. struct has_dereference<void*volatile&&, R> : public false_type {};
  271. template <>
  272. struct has_dereference<void*volatile&&, boost::binary_op_detail::dont_care> : public false_type {};
  273. template <>
  274. struct has_dereference<void*volatile&&, void> : public false_type {};
  275. template <class R>
  276. struct has_dereference<const void*volatile&&, R> : public false_type {};
  277. template <>
  278. struct has_dereference<const void*volatile&&, boost::binary_op_detail::dont_care> : public false_type {};
  279. template <>
  280. struct has_dereference<const void*volatile&&, void> : public false_type {};
  281. template <class R>
  282. struct has_dereference<volatile void*volatile&&, R> : public false_type {};
  283. template <>
  284. struct has_dereference<volatile void*volatile&&, boost::binary_op_detail::dont_care> : public false_type {};
  285. template <>
  286. struct has_dereference<volatile void*volatile&&, void> : public false_type {};
  287. template <class R>
  288. struct has_dereference<const volatile void*volatile&&, R> : public false_type {};
  289. template <>
  290. struct has_dereference<const volatile void*volatile&&, boost::binary_op_detail::dont_care> : public false_type {};
  291. template <>
  292. struct has_dereference<const volatile void*volatile&&, void> : public false_type {};
  293. template <class R>
  294. struct has_dereference<void*const volatile&&, R> : public false_type {};
  295. template <>
  296. struct has_dereference<void*const volatile&&, boost::binary_op_detail::dont_care> : public false_type {};
  297. template <>
  298. struct has_dereference<void*const volatile&&, void> : public false_type {};
  299. template <class R>
  300. struct has_dereference<const void*const volatile&&, R> : public false_type {};
  301. template <>
  302. struct has_dereference<const void*const volatile&&, boost::binary_op_detail::dont_care> : public false_type {};
  303. template <>
  304. struct has_dereference<const void*const volatile&&, void> : public false_type {};
  305. template <class R>
  306. struct has_dereference<volatile void*const volatile&&, R> : public false_type {};
  307. template <>
  308. struct has_dereference<volatile void*const volatile&&, boost::binary_op_detail::dont_care> : public false_type {};
  309. template <>
  310. struct has_dereference<volatile void*const volatile&&, void> : public false_type {};
  311. template <class R>
  312. struct has_dereference<const volatile void*const volatile&&, R> : public false_type {};
  313. template <>
  314. struct has_dereference<const volatile void*const volatile&&, boost::binary_op_detail::dont_care> : public false_type {};
  315. template <>
  316. struct has_dereference<const volatile void*const volatile&&, void> : public false_type {};
  317. }
  318. #endif
  319. #endif