equal.hpp 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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_EQUAL_HPP)
  6. #define BOOST_VMD_EQUAL_HPP
  7. #include <boost/vmd/detail/setup.hpp>
  8. #if BOOST_PP_VARIADICS
  9. #include <boost/vmd/detail/equal.hpp>
  10. /*
  11. The succeeding comments in this file are in doxygen format.
  12. */
  13. /** \file
  14. */
  15. /** \def BOOST_VMD_EQUAL(sequence,...)
  16. \brief Tests any two sequences for equality.
  17. sequence = First sequence. <br/>
  18. ... = variadic parameters, maximum of 2.
  19. The first variadic parameter is required and is the second sequence to test.
  20. The optional second variadic parameter is a VMD type as a filter.
  21. The macro tests any two sequences for equality. For sequences to be equal the
  22. VMD types of each sequence must be equal and the individual elements of the
  23. sequence must be equal. For Boost PP composite types the macro tests that
  24. the composite types have the same size and then tests that each element
  25. of the composite type is equal. This means that all elements of a composite
  26. type must be a VMD type in order to use this macro successfully.
  27. The single optional parameter is a filter. The filter is a VMD type which specifies
  28. that both sequences to test must be of that VMD type, as well as being equal to
  29. each other, for the test to succeed.
  30. returns = 1 upon success or 0 upon failure. Success means that both sequences are
  31. equal and, if the optional parameter is specified, that the sequences are
  32. of the optional VMD type.
  33. */
  34. #define BOOST_VMD_EQUAL(sequence,...) \
  35. BOOST_VMD_DETAIL_EQUAL(sequence,__VA_ARGS__) \
  36. /**/
  37. /** \def BOOST_VMD_EQUAL_D(d,sequence,...)
  38. \brief Tests any two sequences for equality. Re-entrant version.
  39. d = The next available BOOST_PP_WHILE iteration. <br/>
  40. sequence = First sequence. <br/>
  41. ... = variadic parameters, maximum of 2.
  42. The first variadic parameter is required and is the second sequence to test.
  43. The optional second variadic parameter is a VMD type as a filter.
  44. The macro tests any two sequences for equality. For sequences to be equal the
  45. VMD types of each sequence must be equal and the individual elements of the
  46. sequence must be equal. For Boost PP composite types the macro tests that
  47. the composite types have the same size and then tests that each element
  48. of the composite type is equal. This means that all elements of a composite
  49. type must be a VMD type in order to use this macro successfully.
  50. The single optional parameter is a filter. The filter is a VMD type which specifies
  51. that both sequences to test must be of that VMD type, as well as being equal to
  52. each other, for the test to succeed.
  53. returns = 1 upon success or 0 upon failure. Success means that both sequences are
  54. equal and, if the optional parameter is specified, that the sequences are
  55. of the optional VMD type.
  56. */
  57. #define BOOST_VMD_EQUAL_D(d,sequence,...) \
  58. BOOST_VMD_DETAIL_EQUAL_D(d,sequence,__VA_ARGS__) \
  59. /**/
  60. #endif /* BOOST_PP_VARIADICS */
  61. #endif /* BOOST_VMD_EQUAL_HPP */