Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:41:37

0001 
0002 #ifndef BOOST_MPL_AUX_PREPROCESSOR_TOKEN_EQUAL_HPP_INCLUDED
0003 #define BOOST_MPL_AUX_PREPROCESSOR_TOKEN_EQUAL_HPP_INCLUDED
0004 
0005 // Copyright Paul Mensonides 2003
0006 // Copyright Aleksey Gurtovoy 2003-2004
0007 //
0008 // Distributed under the Boost Software License, Version 1.0. 
0009 // (See accompanying file LICENSE_1_0.txt or copy at 
0010 // http://www.boost.org/LICENSE_1_0.txt)
0011 //
0012 // See http://www.boost.org/libs/mpl for documentation.
0013 
0014 // $Id$
0015 // $Date$
0016 // $Revision$
0017 
0018 #include <boost/mpl/aux_/preprocessor/is_seq.hpp>
0019 
0020 #include <boost/preprocessor/if.hpp>
0021 #include <boost/preprocessor/logical/bitand.hpp>
0022 #include <boost/preprocessor/logical/compl.hpp>
0023 #include <boost/preprocessor/tuple/eat.hpp>
0024 #include <boost/preprocessor/cat.hpp>
0025 
0026 // compares tokens 'a' and 'b' for equality:
0027 //
0028 //   #define BOOST_MPL_PP_TOKEN_EQUAL_apple(x) x
0029 //   #define BOOST_MPL_PP_TOKEN_EQUAL_orange(x) x
0030 //
0031 //   BOOST_PP_ASSERT( BOOST_PP_NOT( BOOST_MPL_PP_TOKEN_EQUAL(apple, abc) ) )
0032 //   BOOST_PP_ASSERT( BOOST_PP_NOT( BOOST_MPL_PP_TOKEN_EQUAL(abc, apple) ) )
0033 //   BOOST_PP_ASSERT( BOOST_PP_NOT( BOOST_MPL_PP_TOKEN_EQUAL(apple, orange) ) )
0034 //   BOOST_PP_ASSERT( BOOST_MPL_PP_TOKEN_EQUAL(apple, apple) )
0035 //   BOOST_PP_ASSERT( BOOST_MPL_PP_TOKEN_EQUAL(orange, orange) )
0036 
0037 #define BOOST_MPL_PP_TOKEN_EQUAL(a, b) \
0038     BOOST_PP_IIF( \
0039         BOOST_PP_BITAND( \
0040               BOOST_MPL_PP_IS_SEQ( BOOST_PP_CAT(BOOST_MPL_PP_TOKEN_EQUAL_, a)((unused)) ) \
0041             , BOOST_MPL_PP_IS_SEQ( BOOST_PP_CAT(BOOST_MPL_PP_TOKEN_EQUAL_, b)((unused)) ) \
0042             ) \
0043         , BOOST_MPL_PP_TOKEN_EQUAL_I \
0044         , 0 BOOST_PP_TUPLE_EAT(2) \
0045         )(a, b) \
0046 /**/
0047 
0048 #define BOOST_MPL_PP_TOKEN_EQUAL_I(a, b) \
0049     BOOST_PP_COMPL(BOOST_MPL_PP_IS_SEQ( \
0050         BOOST_MPL_PP_TOKEN_EQUAL_ ## a( \
0051             BOOST_MPL_PP_TOKEN_EQUAL_ ## b \
0052             )((unused)) \
0053         )) \
0054 /**/
0055 
0056 #endif // BOOST_MPL_AUX_PREPROCESSOR_TOKEN_EQUAL_HPP_INCLUDED