equal_15.hpp 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. // (C) Copyright Edward Diener 2011-2015
  2. // Use, modification and distribution are subject to the Boost Software License,
  3. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt).
  5. #if !defined(BOOST_VMD_DETAIL_EQUAL_15_HPP)
  6. #define BOOST_VMD_DETAIL_EQUAL_15_HPP
  7. #include <boost/vmd/detail/recurse/equal/equal_headers.hpp>
  8. #define BOOST_VMD_DETAIL_EQUAL_15_CNI_CHK(vseq1,vseq2,vtype) \
  9. BOOST_PP_IIF \
  10. ( \
  11. BOOST_PP_BITOR \
  12. ( \
  13. BOOST_PP_BITOR \
  14. ( \
  15. BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \
  16. BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \
  17. ), \
  18. BOOST_PP_BITOR \
  19. ( \
  20. BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \
  21. BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \
  22. ) \
  23. ), \
  24. BOOST_VMD_DETAIL_DATA_EQUAL_15, \
  25. BOOST_VMD_DETAIL_EQUAL_CNI_SMP \
  26. ) \
  27. (vseq1,vseq2,vtype) \
  28. /**/
  29. #define BOOST_VMD_DETAIL_EQUAL_15_CNI_CHK_D(d,vseq1,vseq2,vtype) \
  30. BOOST_PP_IIF \
  31. ( \
  32. BOOST_PP_BITOR \
  33. ( \
  34. BOOST_PP_BITOR \
  35. ( \
  36. BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \
  37. BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \
  38. ), \
  39. BOOST_PP_BITOR \
  40. ( \
  41. BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \
  42. BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \
  43. ) \
  44. ), \
  45. BOOST_VMD_DETAIL_DATA_EQUAL_15_D, \
  46. BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \
  47. ) \
  48. (d,vseq1,vseq2,vtype) \
  49. /**/
  50. #define BOOST_VMD_DETAIL_EQUAL_15_VSEQ(vseq1,vseq2,vtype) \
  51. BOOST_VMD_DETAIL_DATA_EQUAL_15 \
  52. ( \
  53. BOOST_VMD_TO_SEQ(vseq1), \
  54. BOOST_VMD_TO_SEQ(vseq2), \
  55. BOOST_VMD_TYPE_SEQ \
  56. ) \
  57. /**/
  58. #define BOOST_VMD_DETAIL_EQUAL_15_VSEQ_D(d,vseq1,vseq2,vtype) \
  59. BOOST_VMD_DETAIL_DATA_EQUAL_15_D \
  60. ( \
  61. d, \
  62. BOOST_VMD_TO_SEQ_D(d,vseq1), \
  63. BOOST_VMD_TO_SEQ_D(d,vseq2), \
  64. BOOST_VMD_TYPE_SEQ \
  65. ) \
  66. /**/
  67. #define BOOST_VMD_DETAIL_EQUAL_15_CNI(vseq1,vseq2,vtype) \
  68. BOOST_PP_IIF \
  69. ( \
  70. BOOST_VMD_DETAIL_EQUAL_TYPE \
  71. ( \
  72. vtype, \
  73. BOOST_VMD_TYPE_SEQUENCE \
  74. ), \
  75. BOOST_VMD_DETAIL_EQUAL_15_VSEQ, \
  76. BOOST_VMD_DETAIL_EQUAL_15_CNI_CHK \
  77. ) \
  78. (vseq1,vseq2,vtype) \
  79. /**/
  80. #define BOOST_VMD_DETAIL_EQUAL_15_CNI_D(d,vseq1,vseq2,vtype) \
  81. BOOST_PP_IIF \
  82. ( \
  83. BOOST_VMD_DETAIL_EQUAL_TYPE_D \
  84. ( \
  85. d, \
  86. vtype, \
  87. BOOST_VMD_TYPE_SEQUENCE \
  88. ), \
  89. BOOST_VMD_DETAIL_EQUAL_15_VSEQ_D, \
  90. BOOST_VMD_DETAIL_EQUAL_15_CNI_CHK_D \
  91. ) \
  92. (d,vseq1,vseq2,vtype) \
  93. /**/
  94. #define BOOST_VMD_DETAIL_EQUAL_15_WT_CHECK(vseq1,vseq2,vtype1,vtype2) \
  95. BOOST_VMD_IDENTITY_RESULT \
  96. ( \
  97. BOOST_PP_IIF \
  98. ( \
  99. BOOST_VMD_DETAIL_EQUAL_TYPE \
  100. ( \
  101. vtype1, \
  102. vtype2 \
  103. ), \
  104. BOOST_VMD_DETAIL_EQUAL_15_CNI, \
  105. BOOST_VMD_IDENTITY(0) \
  106. ) \
  107. (vseq1,vseq2,vtype1) \
  108. ) \
  109. /**/
  110. #define BOOST_VMD_DETAIL_EQUAL_15_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2) \
  111. BOOST_VMD_IDENTITY_RESULT \
  112. ( \
  113. BOOST_PP_IIF \
  114. ( \
  115. BOOST_VMD_DETAIL_EQUAL_TYPE_D \
  116. ( \
  117. d, \
  118. vtype1, \
  119. vtype2 \
  120. ), \
  121. BOOST_VMD_DETAIL_EQUAL_15_CNI_D, \
  122. BOOST_VMD_IDENTITY(0) \
  123. ) \
  124. (d,vseq1,vseq2,vtype1) \
  125. ) \
  126. /**/
  127. #define BOOST_VMD_DETAIL_EQUAL_15_WT_CONVERT(vseq1,vseq2,vtype1,vtype2) \
  128. BOOST_VMD_DETAIL_EQUAL_15_WT_CHECK \
  129. ( \
  130. vseq1, \
  131. vseq2, \
  132. BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \
  133. BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2) \
  134. ) \
  135. /**/
  136. #define BOOST_VMD_DETAIL_EQUAL_15_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2) \
  137. BOOST_VMD_DETAIL_EQUAL_15_WT_CHECK_D \
  138. ( \
  139. d, \
  140. vseq1, \
  141. vseq2, \
  142. BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \
  143. BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2) \
  144. ) \
  145. /**/
  146. #define BOOST_VMD_DETAIL_EQUAL_15_WT(vseq1,vseq2,vtype1,vtype2) \
  147. BOOST_VMD_IDENTITY_RESULT \
  148. ( \
  149. BOOST_PP_IIF \
  150. ( \
  151. BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \
  152. BOOST_VMD_IDENTITY(0), \
  153. BOOST_VMD_DETAIL_EQUAL_15_WT_CONVERT \
  154. ) \
  155. (vseq1,vseq2,vtype1,vtype2) \
  156. ) \
  157. /**/
  158. #define BOOST_VMD_DETAIL_EQUAL_15_WT_D(d,vseq1,vseq2,vtype1,vtype2) \
  159. BOOST_VMD_IDENTITY_RESULT \
  160. ( \
  161. BOOST_PP_IIF \
  162. ( \
  163. BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \
  164. BOOST_VMD_IDENTITY(0), \
  165. BOOST_VMD_DETAIL_EQUAL_15_WT_CONVERT_D \
  166. ) \
  167. (d,vseq1,vseq2,vtype1,vtype2) \
  168. ) \
  169. /**/
  170. #define BOOST_VMD_DETAIL_EQUAL_15_GTYPE(vseq1,vseq2) \
  171. BOOST_VMD_DETAIL_EQUAL_15_WT \
  172. ( \
  173. vseq1, \
  174. vseq2, \
  175. BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \
  176. BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \
  177. ) \
  178. /**/
  179. #define BOOST_VMD_DETAIL_EQUAL_15_GTYPE_D(d,vseq1,vseq2) \
  180. BOOST_VMD_DETAIL_EQUAL_15_WT_D \
  181. ( \
  182. d, \
  183. vseq1, \
  184. vseq2, \
  185. BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \
  186. BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \
  187. ) \
  188. /**/
  189. #define BOOST_VMD_DETAIL_EQUAL_15_EBP(vseq1,vseq2,be1,be2) \
  190. BOOST_VMD_IDENTITY_RESULT \
  191. ( \
  192. BOOST_PP_IIF \
  193. ( \
  194. BOOST_PP_BITAND \
  195. ( \
  196. BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \
  197. BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \
  198. ), \
  199. BOOST_VMD_DETAIL_EQUAL_15_GTYPE, \
  200. BOOST_VMD_IDENTITY(0) \
  201. ) \
  202. (vseq1,vseq2) \
  203. ) \
  204. /**/
  205. #define BOOST_VMD_DETAIL_EQUAL_15_EBP_D(d,vseq1,vseq2,be1,be2) \
  206. BOOST_VMD_IDENTITY_RESULT \
  207. ( \
  208. BOOST_PP_IIF \
  209. ( \
  210. BOOST_PP_BITAND \
  211. ( \
  212. BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \
  213. BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \
  214. ), \
  215. BOOST_VMD_DETAIL_EQUAL_15_GTYPE_D, \
  216. BOOST_VMD_IDENTITY(0) \
  217. ) \
  218. (d,vseq1,vseq2) \
  219. ) \
  220. /**/
  221. #define BOOST_VMD_DETAIL_EQUAL_15_EMPTY(vseq1,vseq2,be1,be2) \
  222. BOOST_PP_IIF \
  223. ( \
  224. BOOST_PP_BITAND(be1,be2), \
  225. BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \
  226. BOOST_VMD_DETAIL_EQUAL_15_EBP \
  227. ) \
  228. (vseq1,vseq2,be1,be2) \
  229. /**/
  230. #define BOOST_VMD_DETAIL_EQUAL_15_EMPTY_D(d,vseq1,vseq2,be1,be2) \
  231. BOOST_PP_IIF \
  232. ( \
  233. BOOST_PP_BITAND(be1,be2), \
  234. BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \
  235. BOOST_VMD_DETAIL_EQUAL_15_EBP_D \
  236. ) \
  237. (d,vseq1,vseq2,be1,be2) \
  238. /**/
  239. #define BOOST_VMD_DETAIL_EQUAL_15(vseq1,vseq2) \
  240. BOOST_VMD_DETAIL_EQUAL_15_EMPTY \
  241. ( \
  242. vseq1, \
  243. vseq2, \
  244. BOOST_VMD_IS_EMPTY(vseq1), \
  245. BOOST_VMD_IS_EMPTY(vseq2) \
  246. ) \
  247. /**/
  248. #define BOOST_VMD_DETAIL_EQUAL_15_D(d,vseq1,vseq2) \
  249. BOOST_VMD_DETAIL_EQUAL_15_EMPTY_D \
  250. ( \
  251. d, \
  252. vseq1, \
  253. vseq2, \
  254. BOOST_VMD_IS_EMPTY(vseq1), \
  255. BOOST_VMD_IS_EMPTY(vseq2) \
  256. ) \
  257. /**/
  258. #endif /* BOOST_VMD_DETAIL_EQUAL_15_HPP */