equal.hpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  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_HPP)
  6. #define BOOST_VMD_DETAIL_EQUAL_HPP
  7. #include <boost/preprocessor/cat.hpp>
  8. #include <boost/preprocessor/detail/auto_rec.hpp>
  9. #include <boost/preprocessor/facilities/empty.hpp>
  10. #include <boost/preprocessor/facilities/overload.hpp>
  11. #include <boost/preprocessor/logical/compl.hpp>
  12. #include <boost/vmd/detail/recurse/equal/equal_headers.hpp>
  13. #include <boost/vmd/is_identifier.hpp>
  14. #include <boost/vmd/is_empty_list.hpp>
  15. #include <boost/vmd/detail/not_empty.hpp>
  16. #include <boost/vmd/detail/recurse/equal/equal_1.hpp>
  17. #include <boost/vmd/detail/recurse/equal/equal_2.hpp>
  18. #include <boost/vmd/detail/recurse/equal/equal_3.hpp>
  19. #include <boost/vmd/detail/recurse/equal/equal_4.hpp>
  20. #include <boost/vmd/detail/recurse/equal/equal_5.hpp>
  21. #include <boost/vmd/detail/recurse/equal/equal_6.hpp>
  22. #include <boost/vmd/detail/recurse/equal/equal_7.hpp>
  23. #include <boost/vmd/detail/recurse/equal/equal_8.hpp>
  24. #include <boost/vmd/detail/recurse/equal/equal_9.hpp>
  25. #include <boost/vmd/detail/recurse/equal/equal_10.hpp>
  26. #include <boost/vmd/detail/recurse/equal/equal_11.hpp>
  27. #include <boost/vmd/detail/recurse/equal/equal_12.hpp>
  28. #include <boost/vmd/detail/recurse/equal/equal_13.hpp>
  29. #include <boost/vmd/detail/recurse/equal/equal_14.hpp>
  30. #include <boost/vmd/detail/recurse/equal/equal_15.hpp>
  31. #include <boost/vmd/detail/recurse/equal/equal_16.hpp>
  32. #define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_1(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_1_D(d,vseq1,vseq2)
  33. #define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_2(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_2_D(d,vseq1,vseq2)
  34. #define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_3(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_3_D(d,vseq1,vseq2)
  35. #define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_4(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_4_D(d,vseq1,vseq2)
  36. #define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_5(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_5_D(d,vseq1,vseq2)
  37. #define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_6(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_6_D(d,vseq1,vseq2)
  38. #define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_7(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_7_D(d,vseq1,vseq2)
  39. #define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_8(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_8_D(d,vseq1,vseq2)
  40. #define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_9(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_9_D(d,vseq1,vseq2)
  41. #define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_10(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_10_D(d,vseq1,vseq2)
  42. #define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_11(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_11_D(d,vseq1,vseq2)
  43. #define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_12(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_12_D(d,vseq1,vseq2)
  44. #define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_13(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_13_D(d,vseq1,vseq2)
  45. #define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_14(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_14_D(d,vseq1,vseq2)
  46. #define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_15(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_15_D(d,vseq1,vseq2)
  47. #define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_16(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_16_D(d,vseq1,vseq2)
  48. #define BOOST_VMD_DETAIL_EQUAL_SIMPLE_AUTO_REC_D(n) \
  49. BOOST_VMD_DETAIL_EQUAL_IS_1 \
  50. ( \
  51. BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_ ## n(1,,) \
  52. ) \
  53. /**/
  54. #define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \
  55. BOOST_PP_CAT \
  56. ( \
  57. BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_, \
  58. BOOST_PP_AUTO_REC(BOOST_VMD_DETAIL_EQUAL_SIMPLE_AUTO_REC_D,16) \
  59. ) \
  60. /**/
  61. #define BOOST_VMD_DETAIL_EQUAL_CNI_CHK(vseq1,vseq2,vtype) \
  62. BOOST_PP_IIF \
  63. ( \
  64. BOOST_PP_BITOR \
  65. ( \
  66. BOOST_PP_BITOR \
  67. ( \
  68. BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \
  69. BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \
  70. ), \
  71. BOOST_PP_BITOR \
  72. ( \
  73. BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \
  74. BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \
  75. ) \
  76. ), \
  77. BOOST_VMD_DETAIL_DATA_EQUAL, \
  78. BOOST_VMD_DETAIL_EQUAL_CNI_SMP \
  79. ) \
  80. (vseq1,vseq2,vtype) \
  81. /**/
  82. #define BOOST_VMD_DETAIL_EQUAL_CNI_CHK_D(d,vseq1,vseq2,vtype) \
  83. BOOST_PP_IIF \
  84. ( \
  85. BOOST_PP_BITOR \
  86. ( \
  87. BOOST_PP_BITOR \
  88. ( \
  89. BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \
  90. BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \
  91. ), \
  92. BOOST_PP_BITOR \
  93. ( \
  94. BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \
  95. BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \
  96. ) \
  97. ), \
  98. BOOST_VMD_DETAIL_DATA_EQUAL_D, \
  99. BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \
  100. ) \
  101. (d,vseq1,vseq2,vtype) \
  102. /**/
  103. #define BOOST_VMD_DETAIL_EQUAL_VSEQ(vseq1,vseq2,vtype) \
  104. BOOST_VMD_DETAIL_DATA_EQUAL \
  105. ( \
  106. BOOST_VMD_TO_SEQ(vseq1), \
  107. BOOST_VMD_TO_SEQ(vseq2), \
  108. BOOST_VMD_TYPE_SEQ \
  109. ) \
  110. /**/
  111. #define BOOST_VMD_DETAIL_EQUAL_VSEQ_D(d,vseq1,vseq2,vtype) \
  112. BOOST_VMD_DETAIL_DATA_EQUAL_D \
  113. ( \
  114. d, \
  115. BOOST_VMD_TO_SEQ_D(d,vseq1), \
  116. BOOST_VMD_TO_SEQ_D(d,vseq2), \
  117. BOOST_VMD_TYPE_SEQ \
  118. ) \
  119. /**/
  120. #define BOOST_VMD_DETAIL_EQUAL_CNI(vseq1,vseq2,vtype) \
  121. BOOST_PP_IIF \
  122. ( \
  123. BOOST_VMD_DETAIL_EQUAL_TYPE \
  124. ( \
  125. vtype, \
  126. BOOST_VMD_TYPE_SEQUENCE \
  127. ), \
  128. BOOST_VMD_DETAIL_EQUAL_VSEQ, \
  129. BOOST_VMD_DETAIL_EQUAL_CNI_CHK \
  130. ) \
  131. (vseq1,vseq2,vtype) \
  132. /**/
  133. #define BOOST_VMD_DETAIL_EQUAL_CNI_D(d,vseq1,vseq2,vtype) \
  134. BOOST_PP_IIF \
  135. ( \
  136. BOOST_VMD_DETAIL_EQUAL_TYPE_D \
  137. ( \
  138. d, \
  139. vtype, \
  140. BOOST_VMD_TYPE_SEQUENCE \
  141. ), \
  142. BOOST_VMD_DETAIL_EQUAL_VSEQ_D, \
  143. BOOST_VMD_DETAIL_EQUAL_CNI_CHK_D \
  144. ) \
  145. (d,vseq1,vseq2,vtype) \
  146. /**/
  147. #define BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_TUPLE(vseq1,vtype1,type) \
  148. BOOST_PP_BITOR \
  149. ( \
  150. BOOST_VMD_DETAIL_EQUAL_TYPE \
  151. ( \
  152. BOOST_VMD_TYPE_ARRAY, \
  153. vtype1 \
  154. ), \
  155. BOOST_PP_BITAND \
  156. ( \
  157. BOOST_VMD_DETAIL_EQUAL_TYPE \
  158. ( \
  159. BOOST_VMD_TYPE_LIST, \
  160. vtype1 \
  161. ), \
  162. BOOST_PP_COMPL \
  163. ( \
  164. BOOST_VMD_IS_EMPTY_LIST(vseq1) \
  165. ) \
  166. ) \
  167. ) \
  168. /**/
  169. #define BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_TUPLE_D(d,vseq1,vtype1,type) \
  170. BOOST_PP_BITOR \
  171. ( \
  172. BOOST_VMD_DETAIL_EQUAL_TYPE_D \
  173. ( \
  174. d, \
  175. BOOST_VMD_TYPE_ARRAY, \
  176. vtype1 \
  177. ), \
  178. BOOST_PP_BITAND \
  179. ( \
  180. BOOST_VMD_DETAIL_EQUAL_TYPE_D \
  181. ( \
  182. d, \
  183. BOOST_VMD_TYPE_LIST, \
  184. vtype1 \
  185. ), \
  186. BOOST_PP_COMPL \
  187. ( \
  188. BOOST_VMD_IS_EMPTY_LIST_D(d,vseq1) \
  189. ) \
  190. ) \
  191. ) \
  192. /**/
  193. #define BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_IDENTIFIER(vseq1,vtype1,type) \
  194. BOOST_VMD_IDENTITY_RESULT \
  195. ( \
  196. BOOST_PP_IIF \
  197. ( \
  198. BOOST_VMD_DETAIL_EQUAL_TYPE \
  199. ( \
  200. BOOST_VMD_TYPE_IDENTIFIER, \
  201. type \
  202. ), \
  203. BOOST_VMD_IS_IDENTIFIER, \
  204. BOOST_VMD_IDENTITY(0) \
  205. ) \
  206. (vseq1) \
  207. ) \
  208. /**/
  209. #define BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_IDENTIFIER_D(d,vseq1,vtype1,type) \
  210. BOOST_VMD_IDENTITY_RESULT \
  211. ( \
  212. BOOST_PP_IIF \
  213. ( \
  214. BOOST_VMD_DETAIL_EQUAL_TYPE_D \
  215. ( \
  216. d, \
  217. BOOST_VMD_TYPE_IDENTIFIER, \
  218. type \
  219. ), \
  220. BOOST_VMD_IS_IDENTIFIER_D, \
  221. BOOST_VMD_IDENTITY(0) \
  222. ) \
  223. (d,vseq1) \
  224. ) \
  225. /**/
  226. #define BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK(vseq1,vtype1,type) \
  227. BOOST_PP_IIF \
  228. ( \
  229. BOOST_VMD_DETAIL_EQUAL_TYPE \
  230. ( \
  231. BOOST_VMD_TYPE_TUPLE, \
  232. type \
  233. ), \
  234. BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_TUPLE, \
  235. BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_IDENTIFIER \
  236. ) \
  237. (vseq1,vtype1,type) \
  238. /**/
  239. #define BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_D(d,vseq1,vtype1,type) \
  240. BOOST_PP_IIF \
  241. ( \
  242. BOOST_VMD_DETAIL_EQUAL_TYPE_D \
  243. ( \
  244. d, \
  245. BOOST_VMD_TYPE_TUPLE, \
  246. type \
  247. ), \
  248. BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_TUPLE_D, \
  249. BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_IDENTIFIER_D \
  250. ) \
  251. (d,vseq1,vtype1,type) \
  252. /**/
  253. #define BOOST_VMD_DETAIL_EQUAL_TEST_TYPE(vseq1,vtype1,type) \
  254. BOOST_VMD_IDENTITY_RESULT \
  255. ( \
  256. BOOST_PP_IIF \
  257. ( \
  258. BOOST_VMD_DETAIL_EQUAL_TYPE \
  259. ( \
  260. vtype1, \
  261. type \
  262. ), \
  263. BOOST_VMD_IDENTITY(1), \
  264. BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK \
  265. ) \
  266. (vseq1,vtype1,type) \
  267. ) \
  268. /**/
  269. #define BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_D(d,vseq1,vtype1,type) \
  270. BOOST_VMD_IDENTITY_RESULT \
  271. ( \
  272. BOOST_PP_IIF \
  273. ( \
  274. BOOST_VMD_DETAIL_EQUAL_TYPE_D \
  275. ( \
  276. d, \
  277. vtype1, \
  278. type \
  279. ), \
  280. BOOST_VMD_IDENTITY(1), \
  281. BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_D \
  282. ) \
  283. (d,vseq1,vtype1,type) \
  284. ) \
  285. /**/
  286. #define BOOST_VMD_DETAIL_EQUAL_WT_CHECK(vseq1,vseq2,vtype1,vtype2,type) \
  287. BOOST_VMD_IDENTITY_RESULT \
  288. ( \
  289. BOOST_PP_IIF \
  290. ( \
  291. BOOST_PP_BITAND \
  292. ( \
  293. BOOST_VMD_DETAIL_EQUAL_TYPE \
  294. ( \
  295. vtype1, \
  296. vtype2 \
  297. ), \
  298. BOOST_VMD_IDENTITY_RESULT \
  299. ( \
  300. BOOST_PP_IIF \
  301. ( \
  302. BOOST_VMD_DETAIL_NOT_EMPTY(type), \
  303. BOOST_VMD_DETAIL_EQUAL_TEST_TYPE, \
  304. BOOST_VMD_IDENTITY(1) \
  305. ) \
  306. (vseq1,vtype1,type) \
  307. ) \
  308. ), \
  309. BOOST_VMD_DETAIL_EQUAL_CNI, \
  310. BOOST_VMD_IDENTITY(0) \
  311. ) \
  312. (vseq1,vseq2,vtype1) \
  313. ) \
  314. /**/
  315. #define BOOST_VMD_DETAIL_EQUAL_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2,type) \
  316. BOOST_VMD_IDENTITY_RESULT \
  317. ( \
  318. BOOST_PP_IIF \
  319. ( \
  320. BOOST_PP_BITAND \
  321. ( \
  322. BOOST_VMD_DETAIL_EQUAL_TYPE_D \
  323. ( \
  324. d, \
  325. vtype1, \
  326. vtype2 \
  327. ), \
  328. BOOST_VMD_IDENTITY_RESULT \
  329. ( \
  330. BOOST_PP_IIF \
  331. ( \
  332. BOOST_VMD_DETAIL_NOT_EMPTY(type), \
  333. BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_D, \
  334. BOOST_VMD_IDENTITY(1) \
  335. ) \
  336. (d,vseq1,vtype1,type) \
  337. ) \
  338. ), \
  339. BOOST_VMD_DETAIL_EQUAL_CNI_D, \
  340. BOOST_VMD_IDENTITY(0) \
  341. ) \
  342. (d,vseq1,vseq2,vtype1) \
  343. ) \
  344. /**/
  345. #define BOOST_VMD_DETAIL_EQUAL_WT_CONVERT(vseq1,vseq2,vtype1,vtype2,type) \
  346. BOOST_VMD_DETAIL_EQUAL_WT_CHECK \
  347. ( \
  348. vseq1, \
  349. vseq2, \
  350. BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \
  351. BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2), \
  352. type \
  353. ) \
  354. /**/
  355. #define BOOST_VMD_DETAIL_EQUAL_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2,type) \
  356. BOOST_VMD_DETAIL_EQUAL_WT_CHECK_D \
  357. ( \
  358. d, \
  359. vseq1, \
  360. vseq2, \
  361. BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \
  362. BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2), \
  363. type \
  364. ) \
  365. /**/
  366. #define BOOST_VMD_DETAIL_EQUAL_WT(vseq1,vseq2,vtype1,vtype2,type) \
  367. BOOST_VMD_IDENTITY_RESULT \
  368. ( \
  369. BOOST_PP_IIF \
  370. ( \
  371. BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \
  372. BOOST_VMD_IDENTITY(0), \
  373. BOOST_VMD_DETAIL_EQUAL_WT_CONVERT \
  374. ) \
  375. (vseq1,vseq2,vtype1,vtype2,type) \
  376. ) \
  377. /**/
  378. #define BOOST_VMD_DETAIL_EQUAL_WT_D(d,vseq1,vseq2,vtype1,vtype2,type) \
  379. BOOST_VMD_IDENTITY_RESULT \
  380. ( \
  381. BOOST_PP_IIF \
  382. ( \
  383. BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \
  384. BOOST_VMD_IDENTITY(0), \
  385. BOOST_VMD_DETAIL_EQUAL_WT_CONVERT_D \
  386. ) \
  387. (d,vseq1,vseq2,vtype1,vtype2,type) \
  388. ) \
  389. /**/
  390. #define BOOST_VMD_DETAIL_EQUAL_GTYPE(vseq1,vseq2,type) \
  391. BOOST_VMD_DETAIL_EQUAL_WT \
  392. ( \
  393. vseq1, \
  394. vseq2, \
  395. BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \
  396. BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE), \
  397. type \
  398. ) \
  399. /**/
  400. #define BOOST_VMD_DETAIL_EQUAL_GTYPE_D(d,vseq1,vseq2,type) \
  401. BOOST_VMD_DETAIL_EQUAL_WT_D \
  402. ( \
  403. d, \
  404. vseq1, \
  405. vseq2, \
  406. BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \
  407. BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE), \
  408. type \
  409. ) \
  410. /**/
  411. #define BOOST_VMD_DETAIL_EQUAL_EBP(vseq1,vseq2,be1,be2,type) \
  412. BOOST_VMD_IDENTITY_RESULT \
  413. ( \
  414. BOOST_PP_IIF \
  415. ( \
  416. BOOST_PP_BITAND \
  417. ( \
  418. BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \
  419. BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \
  420. ), \
  421. BOOST_VMD_DETAIL_EQUAL_GTYPE, \
  422. BOOST_VMD_IDENTITY(0) \
  423. ) \
  424. (vseq1,vseq2,type) \
  425. ) \
  426. /**/
  427. #define BOOST_VMD_DETAIL_EQUAL_EBP_D(d,vseq1,vseq2,be1,be2,type) \
  428. BOOST_VMD_IDENTITY_RESULT \
  429. ( \
  430. BOOST_PP_IIF \
  431. ( \
  432. BOOST_PP_BITAND \
  433. ( \
  434. BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \
  435. BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \
  436. ), \
  437. BOOST_VMD_DETAIL_EQUAL_GTYPE_D, \
  438. BOOST_VMD_IDENTITY(0) \
  439. ) \
  440. (d,vseq1,vseq2,type) \
  441. ) \
  442. /**/
  443. #define BOOST_VMD_DETAIL_EQUAL_EMPTY(vseq1,vseq2,be1,be2,type) \
  444. BOOST_PP_IIF \
  445. ( \
  446. BOOST_PP_BITAND(be1,be2), \
  447. BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \
  448. BOOST_VMD_DETAIL_EQUAL_EBP \
  449. ) \
  450. (vseq1,vseq2,be1,be2,type) \
  451. /**/
  452. #define BOOST_VMD_DETAIL_EQUAL_EMPTY_D(d,vseq1,vseq2,be1,be2,type) \
  453. BOOST_PP_IIF \
  454. ( \
  455. BOOST_PP_BITAND(be1,be2), \
  456. BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \
  457. BOOST_VMD_DETAIL_EQUAL_EBP_D \
  458. ) \
  459. (d,vseq1,vseq2,be1,be2,type) \
  460. /**/
  461. #define BOOST_VMD_DETAIL_EQUAL_OV0(vseq1,vseq2) \
  462. BOOST_VMD_DETAIL_EQUAL_EMPTY \
  463. ( \
  464. vseq1, \
  465. , \
  466. BOOST_VMD_IS_EMPTY(vseq1), \
  467. 1, \
  468. ) \
  469. /**/
  470. #define BOOST_VMD_DETAIL_EQUAL_OV1(vseq1,vseq2) \
  471. BOOST_VMD_DETAIL_EQUAL_EMPTY \
  472. ( \
  473. vseq1, \
  474. vseq2, \
  475. BOOST_VMD_IS_EMPTY(vseq1), \
  476. BOOST_VMD_IS_EMPTY(vseq2), \
  477. ) \
  478. /**/
  479. #define BOOST_VMD_DETAIL_EQUAL_OV2(vseq1,vseq2,type) \
  480. BOOST_VMD_DETAIL_EQUAL_EMPTY \
  481. ( \
  482. vseq1, \
  483. vseq2, \
  484. BOOST_VMD_IS_EMPTY(vseq1), \
  485. BOOST_VMD_IS_EMPTY(vseq2), \
  486. type \
  487. ) \
  488. /**/
  489. #define BOOST_VMD_DETAIL_EQUAL_D_OV0(d,vseq1,vseq2) \
  490. BOOST_VMD_DETAIL_EQUAL_EMPTY_D \
  491. ( \
  492. d, \
  493. vseq1, \
  494. , \
  495. BOOST_VMD_IS_EMPTY(vseq1), \
  496. 1, \
  497. ) \
  498. /**/
  499. #define BOOST_VMD_DETAIL_EQUAL_D_OV1(d,vseq1,vseq2) \
  500. BOOST_VMD_DETAIL_EQUAL_EMPTY_D \
  501. ( \
  502. d, \
  503. vseq1, \
  504. vseq2, \
  505. BOOST_VMD_IS_EMPTY(vseq1), \
  506. BOOST_VMD_IS_EMPTY(vseq2), \
  507. ) \
  508. /**/
  509. #define BOOST_VMD_DETAIL_EQUAL_D_OV2(d,vseq1,vseq2,type) \
  510. BOOST_VMD_DETAIL_EQUAL_EMPTY_D \
  511. ( \
  512. d, \
  513. vseq1, \
  514. vseq2, \
  515. BOOST_VMD_IS_EMPTY(vseq1), \
  516. BOOST_VMD_IS_EMPTY(vseq2), \
  517. type \
  518. ) \
  519. /**/
  520. #if BOOST_VMD_MSVC
  521. #define BOOST_VMD_DETAIL_EQUAL(vseq1,...) \
  522. BOOST_PP_CAT(BOOST_PP_OVERLOAD(BOOST_VMD_DETAIL_EQUAL_OV,__VA_ARGS__)(vseq1,__VA_ARGS__),BOOST_PP_EMPTY()) \
  523. /**/
  524. #define BOOST_VMD_DETAIL_EQUAL_D(d,vseq1,...) \
  525. BOOST_PP_CAT(BOOST_PP_OVERLOAD(BOOST_VMD_DETAIL_EQUAL_D_OV,__VA_ARGS__)(d,vseq1,__VA_ARGS__),BOOST_PP_EMPTY()) \
  526. /**/
  527. #else
  528. #define BOOST_VMD_DETAIL_EQUAL(vseq1,...) \
  529. BOOST_PP_OVERLOAD(BOOST_VMD_DETAIL_EQUAL_OV,__VA_ARGS__)(vseq1,__VA_ARGS__) \
  530. /**/
  531. #define BOOST_VMD_DETAIL_EQUAL_D(d,vseq1,...) \
  532. BOOST_PP_OVERLOAD(BOOST_VMD_DETAIL_EQUAL_D_OV,__VA_ARGS__)(d,vseq1,__VA_ARGS__) \
  533. /**/
  534. #endif
  535. #endif /* BOOST_VMD_DETAIL_EQUAL_HPP */