not_equal.hpp 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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_NOT_EQUAL_HPP)
  6. #define BOOST_VMD_NOT_EQUAL_HPP
  7. #include <boost/vmd/detail/setup.hpp>
  8. #if BOOST_PP_VARIADICS
  9. #include <boost/preprocessor/logical/compl.hpp>
  10. #include <boost/vmd/equal.hpp>
  11. /*
  12. The succeeding comments in this file are in doxygen format.
  13. */
  14. /** \file
  15. */
  16. /** \def BOOST_VMD_NOT_EQUAL(sequence,...)
  17. \brief Tests any two sequences for inequality.
  18. sequence = First sequence.
  19. ... = variadic parameters, maximum of 2.
  20. The first variadic parameter is required and is the second sequence to test.
  21. The optional second variadic parameter is a VMD type as a filter.
  22. The macro tests any two sequences for inequality. For sequences to be unequal
  23. either the VMD types of each sequence must be unequal or the individual elements of the
  24. sequence must be unequal.
  25. The single optional parameter is a filter. The filter is a VMD type which specifies
  26. that both sequences to test must be of that VMD type, as well as being equal to
  27. each other, for the test to fail, else it succeeds.
  28. returns = 1 upon success or 0 upon failure. Success means that the sequences are
  29. unequal or, if the optional parameter is specified, that the sequences are
  30. not of the optional VMD type; otherwise 0 is returned if the sequences
  31. are equal.
  32. The macro is implemented as the complement of BOOST_VMD_EQUAL, so that whenever
  33. BOOST_VMD_EQUAL would return 1 the macro returns 0 and whenever BOOST_VMD_EQUAL
  34. would return 0 the macro would return 1.
  35. */
  36. #define BOOST_VMD_NOT_EQUAL(sequence,...) \
  37. BOOST_PP_COMPL(BOOST_VMD_EQUAL(sequence,__VA_ARGS__)) \
  38. /**/
  39. /** \def BOOST_VMD_NOT_EQUAL_D(d,sequence,...)
  40. \brief Tests any two sequences for inequality. Re-entrant version.
  41. d = The next available BOOST_PP_WHILE iteration.
  42. sequence = First sequence.
  43. ... = variadic parameters, maximum of 2.
  44. The first variadic parameter is required and is the second sequence to test.
  45. The optional second variadic parameter is a VMD type as a filter.
  46. The macro tests any two sequences for inequality. For sequences to be unequal
  47. either the VMD types of each sequence must be unequal or the individual elements of the
  48. sequence must be unequal.
  49. The single optional parameter is a filter. The filter is a VMD type which specifies
  50. that both sequences to test must be of that VMD type, as well as being equal to
  51. each other, for the test to fail, else it succeeds.
  52. returns = 1 upon success or 0 upon failure. Success means that the sequences are
  53. unequal or, if the optional parameter is specified, that the sequences are
  54. not of the optional VMD type; otherwise 0 is returned if the sequences
  55. are equal.
  56. The macro is implemented as the complement of BOOST_VMD_EQUAL, so that whenever
  57. BOOST_VMD_EQUAL would return 1 the macro returns 0 and whenever BOOST_VMD_EQUAL
  58. would return 0 the macro would return 1.
  59. */
  60. #define BOOST_VMD_NOT_EQUAL_D(d,sequence,...) \
  61. BOOST_PP_COMPL(BOOST_VMD_EQUAL_D(d,sequence,__VA_ARGS__)) \
  62. /**/
  63. #endif /* BOOST_PP_VARIADICS */
  64. #endif /* BOOST_VMD_NOT_EQUAL_HPP */