diff --git a/include/boost/mpl/aux_/preprocessor/is_seq.hpp b/include/boost/mpl/aux_/preprocessor/is_seq.hpp new file mode 100644 index 0000000..c642b8a --- /dev/null +++ b/include/boost/mpl/aux_/preprocessor/is_seq.hpp @@ -0,0 +1,57 @@ + +#ifndef BOOST_MPL_AUX_PREPROCESSOR_IS_SEQ_HPP_INCLUDED +#define BOOST_MPL_AUX_PREPROCESSOR_IS_SEQ_HPP_INCLUDED + +// + file: boost/mpl/aux_/preprocessor/is_seq.hpp +// + last modified: 03/may/03 + +// Copyright (c) 2003 +// Paul Mensonides, Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. +// +// See http://www.boost.org/libs/mpl for documentation. + +#include "boost/preprocessor/seq/size.hpp" +#include "boost/preprocessor/arithmetic/dec.hpp" +#include "boost/preprocessor/punctuation/paren.hpp" +#include "boost/preprocessor/cat.hpp" +#include "boost/preprocessor/config/config.hpp" + +// returns 1 if 'seq' is a PP-sequence, 0 otherwise: +// +// BOOST_PP_ASSERT( BOOST_PP_NOT( BOOST_MPL_PP_IS_SEQ( int ) ) ) +// BOOST_PP_ASSERT( BOOST_MPL_PP_IS_SEQ( (int) ) ) +// BOOST_PP_ASSERT( BOOST_MPL_PP_IS_SEQ( (1)(2) ) ) + +#if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_BCC() + +# define BOOST_MPL_PP_IS_SEQ(seq) BOOST_PP_DEC( BOOST_PP_SEQ_SIZE( BOOST_MPL_PP_IS_SEQ_(seq) ) ) +# define BOOST_MPL_PP_IS_SEQ_(seq) BOOST_MPL_PP_IS_SEQ_SEQ_( BOOST_MPL_PP_IS_SEQ_SPLIT_ seq ) +# define BOOST_MPL_PP_IS_SEQ_SEQ_(x) (x) +# define BOOST_MPL_PP_IS_SEQ_SPLIT_(unused) unused)((unused) + +#else + +# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC() +# define BOOST_MPL_PP_IS_SEQ(seq) BOOST_MPL_PP_IS_SEQ_MWCC_((seq)) +# define BOOST_MPL_PP_IS_SEQ_MWCC_(args) BOOST_MPL_PP_IS_SEQ_ ## args +# else +# define BOOST_MPL_PP_IS_SEQ(seq) BOOST_MPL_PP_IS_SEQ_(seq) +# endif + +# define BOOST_MPL_PP_IS_SEQ_(seq) BOOST_PP_CAT(BOOST_MPL_PP_IS_SEQ_, BOOST_MPL_PP_IS_SEQ_0 seq BOOST_PP_RPAREN()) +# define BOOST_MPL_PP_IS_SEQ_0(x) BOOST_MPL_PP_IS_SEQ_1(x +# define BOOST_MPL_PP_IS_SEQ_ALWAYS_0(unused) 0 +# define BOOST_MPL_PP_IS_SEQ_BOOST_MPL_PP_IS_SEQ_0 BOOST_MPL_PP_IS_SEQ_ALWAYS_0( +# define BOOST_MPL_PP_IS_SEQ_BOOST_MPL_PP_IS_SEQ_1(unused) 1 + +#endif + +#endif // BOOST_MPL_AUX_PREPROCESSOR_IS_SEQ_HPP_INCLUDED diff --git a/include/boost/mpl/aux_/preprocessor/token_equal.hpp b/include/boost/mpl/aux_/preprocessor/token_equal.hpp new file mode 100644 index 0000000..2a209ac --- /dev/null +++ b/include/boost/mpl/aux_/preprocessor/token_equal.hpp @@ -0,0 +1,59 @@ + +#ifndef BOOST_MPL_AUX_PREPROCESSOR_TOKEN_EQUAL_HPP_INCLUDED +#define BOOST_MPL_AUX_PREPROCESSOR_TOKEN_EQUAL_HPP_INCLUDED + +// + file: boost/mpl/aux_/preprocessor/token_equal.hpp +// + last modified: 03/may/03 + +// Copyright (c) 2003 +// Paul Mensonides, Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. +// +// See http://www.boost.org/libs/mpl for documentation. + +#include "boost/mpl/aux_/preprocessor/is_seq.hpp" + +#include "boost/preprocessor/if.hpp" +#include "boost/preprocessor/logical/bitand.hpp" +#include "boost/preprocessor/logical/compl.hpp" +#include "boost/preprocessor/tuple/eat.hpp" +#include "boost/preprocessor/cat.hpp" + +// compares tokens 'a' and 'b' for equality: +// +// #define BOOST_MPL_PP_TOKEN_EQUAL_apple(x) x +// #define BOOST_MPL_PP_TOKEN_EQUAL_orange(x) x +// +// BOOST_PP_ASSERT( BOOST_PP_NOT( BOOST_MPL_PP_TOKEN_EQUAL(apple, abc) ) ) +// BOOST_PP_ASSERT( BOOST_PP_NOT( BOOST_MPL_PP_TOKEN_EQUAL(abc, apple) ) ) +// BOOST_PP_ASSERT( BOOST_PP_NOT( BOOST_MPL_PP_TOKEN_EQUAL(apple, orange) ) ) +// BOOST_PP_ASSERT( BOOST_MPL_PP_TOKEN_EQUAL(apple, apple) ) +// BOOST_PP_ASSERT( BOOST_MPL_PP_TOKEN_EQUAL(orange, orange) ) + +#define BOOST_MPL_PP_TOKEN_EQUAL(a, b) \ + BOOST_PP_IIF( \ + BOOST_PP_BITAND( \ + BOOST_MPL_PP_IS_SEQ( BOOST_PP_CAT(BOOST_MPL_PP_TOKEN_EQUAL_, a)((unused)) ) \ + , BOOST_MPL_PP_IS_SEQ( BOOST_PP_CAT(BOOST_MPL_PP_TOKEN_EQUAL_, b)((unused)) ) \ + ) \ + , BOOST_MPL_PP_TOKEN_EQUAL_I \ + , 0 BOOST_PP_TUPLE_EAT(2) \ + )(a, b) \ +/**/ + +#define BOOST_MPL_PP_TOKEN_EQUAL_I(a, b) \ + BOOST_PP_COMPL(BOOST_MPL_PP_IS_SEQ( \ + BOOST_MPL_PP_TOKEN_EQUAL_ ## a( \ + BOOST_MPL_PP_TOKEN_EQUAL_ ## b \ + )((unused)) \ + )) \ +/**/ + +#endif // BOOST_MPL_AUX_PREPROCESSOR_TOKEN_EQUAL_HPP_INCLUDED diff --git a/include/boost/mpl/aux_/test.hpp b/include/boost/mpl/aux_/test.hpp new file mode 100644 index 0000000..755a3e0 --- /dev/null +++ b/include/boost/mpl/aux_/test.hpp @@ -0,0 +1,27 @@ + +#ifndef BOOST_MPL_AUX_TEST_HPP_INCLUDED +#define BOOST_MPL_AUX_TEST_HPP_INCLUDED + +// + file: boost/mpl/aux_/test.hpp +// + last modified: 04/may/03 + +// Copyright (c) 2002-03 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. +// +// See http://www.boost.org/libs/mpl for documentation. + +#include "boost/mpl/aux_/test/assert.hpp" +#include "boost/mpl/aux_/test/data.hpp" +#include "boost/mpl/aux_/test/test_case.hpp" +#include "boost/mpl/aux_/test/for_each.hpp" +#include "boost/mpl/aux_/config/msvc_typename.hpp" + +#endif // BOOST_MPL_AUX_TEST_HPP_INCLUDED diff --git a/include/boost/mpl/aux_/yes_no.hpp b/include/boost/mpl/aux_/yes_no.hpp index b7a1999..59395a7 100644 --- a/include/boost/mpl/aux_/yes_no.hpp +++ b/include/boost/mpl/aux_/yes_no.hpp @@ -1,10 +1,12 @@ -//----------------------------------------------------------------------------- -// boost mpl/aux_/yes_no.hpp header file -// See http://www.boost.org for updates, documentation, and revision history. -//----------------------------------------------------------------------------- -// -// Copyright (c) 2001-02 -// Peter Dimov, Aleksey Gurtovoy + +#ifndef BOOST_MPL_AUX_YES_NO_HPP_INCLUDED +#define BOOST_MPL_AUX_YES_NO_HPP_INCLUDED + +// + file: boost/mpl/aux_/yes_no.hpp +// + last modified: 05/may/03 + +// Copyright (c) 2000-03 +// Aleksey Gurtovoy // // Permission to use, copy, modify, distribute and sell this software // and its documentation for any purpose is hereby granted without fee, @@ -13,19 +15,24 @@ // supporting documentation. No representations are made about the // suitability of this software for any purpose. It is provided "as is" // without express or implied warranty. +// +// See http://www.boost.org/libs/mpl for documentation. -#ifndef BOOST_MPL_AUX_YES_NO_HPP_INCLUDED -#define BOOST_MPL_AUX_YES_NO_HPP_INCLUDED - -namespace boost { -namespace mpl { -namespace aux { +namespace boost { namespace mpl { namespace aux { typedef char (&no_tag)[1]; typedef char (&yes_tag)[2]; -} // namespace aux -} // namespace mpl -} // namespace boost +template< bool C_ > struct yes_no_tag +{ + typedef no_tag type; +}; + +template<> struct yes_no_tag +{ + typedef yes_tag type; +}; + +}}} #endif // BOOST_MPL_AUX_YES_NO_HPP_INCLUDED diff --git a/include/boost/mpl/if.hpp b/include/boost/mpl/if.hpp index 559f16e..15faa35 100644 --- a/include/boost/mpl/if.hpp +++ b/include/boost/mpl/if.hpp @@ -115,7 +115,7 @@ struct if_ // on the result of is_reference. template struct bind3; -template