token_equal.cpp 960 B

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright Aleksey Gurtovoy 2003-2004
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (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/mpl for documentation.
  8. // $Id$
  9. // $Date$
  10. // $Revision$
  11. #include <boost/mpl/aux_/preprocessor/token_equal.hpp>
  12. #include <boost/preprocessor/logical/not.hpp>
  13. #include <boost/preprocessor/debug/assert.hpp>
  14. #define AUX_ASSERT_EQUAL(x, y) \
  15. BOOST_PP_ASSERT( BOOST_MPL_PP_TOKEN_EQUAL(x, y) ) \
  16. /**/
  17. #define AUX_ASSERT_NOT_EQUAL(x, y) \
  18. BOOST_PP_ASSERT( BOOST_PP_NOT( BOOST_MPL_PP_TOKEN_EQUAL(x, y) ) ) \
  19. /**/
  20. #define BOOST_MPL_PP_TOKEN_EQUAL_apple(x) x
  21. #define BOOST_MPL_PP_TOKEN_EQUAL_orange(x) x
  22. AUX_ASSERT_NOT_EQUAL( apple, abc )
  23. AUX_ASSERT_NOT_EQUAL( abc, apple )
  24. AUX_ASSERT_NOT_EQUAL( apple, orange )
  25. AUX_ASSERT_NOT_EQUAL( orange, apple )
  26. AUX_ASSERT_EQUAL( apple, apple )
  27. AUX_ASSERT_EQUAL( orange, orange )