diff --git a/include/boost/mpl/aux_/has_xxx.hpp b/include/boost/mpl/aux_/has_xxx.hpp index 987ae12..c3da2aa 100644 --- a/include/boost/mpl/aux_/has_xxx.hpp +++ b/include/boost/mpl/aux_/has_xxx.hpp @@ -154,7 +154,7 @@ template<> struct trait \ #else // agurt, 11/jan/03: signals a stub-only implementation -# define BOOST_NO_MPL_AUX_HAS_XXX +# define BOOST_MPL_NO_AUX_HAS_XXX # define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, default_value) \ template< typename T > \ diff --git a/include/boost/mpl/aux_/preprocessed/gcc/advance_backward.hpp b/include/boost/mpl/aux_/preprocessed/gcc/advance_backward.hpp index 6aa78dc..ba065eb 100644 --- a/include/boost/mpl/aux_/preprocessed/gcc/advance_backward.hpp +++ b/include/boost/mpl/aux_/preprocessed/gcc/advance_backward.hpp @@ -5,8 +5,11 @@ namespace boost { namespace mpl { namespace aux { -template< long N > struct advance_backward; +#if !defined(PRIOR) +# define PRIOR(x) x::prior +#endif +template< long N > struct advance_backward; template<> struct advance_backward<0> { @@ -15,7 +18,6 @@ struct advance_backward<0> typedef Iterator iter0; typedef iter0 type; }; - }; template<> @@ -24,10 +26,9 @@ struct advance_backward<1> template< typename Iterator > struct apply { typedef Iterator iter0; - typedef typename iter0::prior iter1; + typedef typename PRIOR(iter0) iter1; typedef iter1 type; }; - }; template<> @@ -36,11 +37,10 @@ struct advance_backward<2> template< typename Iterator > struct apply { typedef Iterator iter0; - typedef typename iter0::prior iter1; - typedef typename iter1::prior iter2; + typedef typename PRIOR(iter0) iter1; + typedef typename PRIOR(iter1) iter2; typedef iter2 type; }; - }; template<> @@ -49,12 +49,11 @@ struct advance_backward<3> template< typename Iterator > struct apply { typedef Iterator iter0; - typedef typename iter0::prior iter1; - typedef typename iter1::prior iter2; - typedef typename iter2::prior iter3; + typedef typename PRIOR(iter0) iter1; + typedef typename PRIOR(iter1) iter2; + typedef typename PRIOR(iter2) iter3; typedef iter3 type; }; - }; template<> @@ -63,13 +62,12 @@ struct advance_backward<4> template< typename Iterator > struct apply { typedef Iterator iter0; - typedef typename iter0::prior iter1; - typedef typename iter1::prior iter2; - typedef typename iter2::prior iter3; - typedef typename iter3::prior iter4; + typedef typename PRIOR(iter0) iter1; + typedef typename PRIOR(iter1) iter2; + typedef typename PRIOR(iter2) iter3; + typedef typename PRIOR(iter3) iter4; typedef iter4 type; }; - }; template< long N > diff --git a/include/boost/mpl/aux_/preprocessed/gcc/advance_forward.hpp b/include/boost/mpl/aux_/preprocessed/gcc/advance_forward.hpp index a6a075e..a3f39f5 100644 --- a/include/boost/mpl/aux_/preprocessed/gcc/advance_forward.hpp +++ b/include/boost/mpl/aux_/preprocessed/gcc/advance_forward.hpp @@ -5,8 +5,11 @@ namespace boost { namespace mpl { namespace aux { -template< long N > struct advance_forward; +#if !defined(NEXT) +# define NEXT(x) x::next +#endif +template< long N > struct advance_forward; template<> struct advance_forward<0> { @@ -15,7 +18,6 @@ struct advance_forward<0> typedef Iterator iter0; typedef iter0 type; }; - }; template<> @@ -24,10 +26,9 @@ struct advance_forward<1> template< typename Iterator > struct apply { typedef Iterator iter0; - typedef typename iter0::next iter1; + typedef typename NEXT(iter0) iter1; typedef iter1 type; }; - }; template<> @@ -36,11 +37,10 @@ struct advance_forward<2> template< typename Iterator > struct apply { typedef Iterator iter0; - typedef typename iter0::next iter1; - typedef typename iter1::next iter2; + typedef typename NEXT(iter0) iter1; + typedef typename NEXT(iter1) iter2; typedef iter2 type; }; - }; template<> @@ -49,12 +49,11 @@ struct advance_forward<3> template< typename Iterator > struct apply { typedef Iterator iter0; - typedef typename iter0::next iter1; - typedef typename iter1::next iter2; - typedef typename iter2::next iter3; + typedef typename NEXT(iter0) iter1; + typedef typename NEXT(iter1) iter2; + typedef typename NEXT(iter2) iter3; typedef iter3 type; }; - }; template<> @@ -63,16 +62,15 @@ struct advance_forward<4> template< typename Iterator > struct apply { typedef Iterator iter0; - typedef typename iter0::next iter1; - typedef typename iter1::next iter2; - typedef typename iter2::next iter3; - typedef typename iter3::next iter4; + typedef typename NEXT(iter0) iter1; + typedef typename NEXT(iter1) iter2; + typedef typename NEXT(iter2) iter3; + typedef typename NEXT(iter3) iter4; typedef iter4 type; }; - }; -template< long N > +template< long N > struct advance_forward { template< typename Iterator > struct apply diff --git a/include/boost/mpl/aux_/preprocessed/plain/advance_backward.hpp b/include/boost/mpl/aux_/preprocessed/plain/advance_backward.hpp index bea9b5f..ba065eb 100644 --- a/include/boost/mpl/aux_/preprocessed/plain/advance_backward.hpp +++ b/include/boost/mpl/aux_/preprocessed/plain/advance_backward.hpp @@ -5,6 +5,10 @@ namespace boost { namespace mpl { namespace aux { +#if !defined(PRIOR) +# define PRIOR(x) x::prior +#endif + template< long N > struct advance_backward; template<> struct advance_backward<0> @@ -22,7 +26,7 @@ struct advance_backward<1> template< typename Iterator > struct apply { typedef Iterator iter0; - typedef typename iter0::prior iter1; + typedef typename PRIOR(iter0) iter1; typedef iter1 type; }; }; @@ -33,8 +37,8 @@ struct advance_backward<2> template< typename Iterator > struct apply { typedef Iterator iter0; - typedef typename iter0::prior iter1; - typedef typename iter1::prior iter2; + typedef typename PRIOR(iter0) iter1; + typedef typename PRIOR(iter1) iter2; typedef iter2 type; }; }; @@ -45,9 +49,9 @@ struct advance_backward<3> template< typename Iterator > struct apply { typedef Iterator iter0; - typedef typename iter0::prior iter1; - typedef typename iter1::prior iter2; - typedef typename iter2::prior iter3; + typedef typename PRIOR(iter0) iter1; + typedef typename PRIOR(iter1) iter2; + typedef typename PRIOR(iter2) iter3; typedef iter3 type; }; }; @@ -58,10 +62,10 @@ struct advance_backward<4> template< typename Iterator > struct apply { typedef Iterator iter0; - typedef typename iter0::prior iter1; - typedef typename iter1::prior iter2; - typedef typename iter2::prior iter3; - typedef typename iter3::prior iter4; + typedef typename PRIOR(iter0) iter1; + typedef typename PRIOR(iter1) iter2; + typedef typename PRIOR(iter2) iter3; + typedef typename PRIOR(iter3) iter4; typedef iter4 type; }; }; diff --git a/include/boost/mpl/aux_/preprocessed/plain/advance_forward.hpp b/include/boost/mpl/aux_/preprocessed/plain/advance_forward.hpp index accb46c..a3f39f5 100644 --- a/include/boost/mpl/aux_/preprocessed/plain/advance_forward.hpp +++ b/include/boost/mpl/aux_/preprocessed/plain/advance_forward.hpp @@ -5,6 +5,10 @@ namespace boost { namespace mpl { namespace aux { +#if !defined(NEXT) +# define NEXT(x) x::next +#endif + template< long N > struct advance_forward; template<> struct advance_forward<0> @@ -22,7 +26,7 @@ struct advance_forward<1> template< typename Iterator > struct apply { typedef Iterator iter0; - typedef typename iter0::next iter1; + typedef typename NEXT(iter0) iter1; typedef iter1 type; }; }; @@ -33,8 +37,8 @@ struct advance_forward<2> template< typename Iterator > struct apply { typedef Iterator iter0; - typedef typename iter0::next iter1; - typedef typename iter1::next iter2; + typedef typename NEXT(iter0) iter1; + typedef typename NEXT(iter1) iter2; typedef iter2 type; }; }; @@ -45,9 +49,9 @@ struct advance_forward<3> template< typename Iterator > struct apply { typedef Iterator iter0; - typedef typename iter0::next iter1; - typedef typename iter1::next iter2; - typedef typename iter2::next iter3; + typedef typename NEXT(iter0) iter1; + typedef typename NEXT(iter1) iter2; + typedef typename NEXT(iter2) iter3; typedef iter3 type; }; }; @@ -58,10 +62,10 @@ struct advance_forward<4> template< typename Iterator > struct apply { typedef Iterator iter0; - typedef typename iter0::next iter1; - typedef typename iter1::next iter2; - typedef typename iter2::next iter3; - typedef typename iter3::next iter4; + typedef typename NEXT(iter0) iter1; + typedef typename NEXT(iter1) iter2; + typedef typename NEXT(iter2) iter3; + typedef typename NEXT(iter3) iter4; typedef iter4 type; }; }; diff --git a/include/boost/mpl/is_sequence.hpp b/include/boost/mpl/is_sequence.hpp index 3c1985f..1eb96d7 100644 --- a/include/boost/mpl/is_sequence.hpp +++ b/include/boost/mpl/is_sequence.hpp @@ -69,7 +69,7 @@ struct is_sequence BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_sequence,(T)) }; -#elif defined(BOOST_NO_MPL_AUX_HAS_XXX) +#elif defined(BOOST_MPL_NO_AUX_HAS_XXX) template< typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T) diff --git a/test/aux_/has_xxx.cpp b/test/aux_/has_xxx.cpp index c806f3b..9e33273 100644 --- a/test/aux_/has_xxx.cpp +++ b/test/aux_/has_xxx.cpp @@ -1,9 +1,8 @@ -//----------------------------------------------------------------------------- -// boost mpl/test/aux_/has_xxx.cpp source file -// See http://www.boost.org for updates, documentation, and revision history. -//----------------------------------------------------------------------------- -// -// Copyright (c) 2000-02 + +// + file: libs/mpl/test/aux_/has_xxx.cpp +// + last modified: 09/jun/03 + +// Copyright (c) 2000-03 // Aleksey Gurtovoy // // Permission to use, copy, modify, distribute and sell this software @@ -13,42 +12,52 @@ // 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_/has_xxx.hpp" #include "boost/mpl/aux_/config/workaround.hpp" #include "boost/static_assert.hpp" -BOOST_MPL_HAS_XXX_TRAIT_DEF(xxx_type) +BOOST_MPL_HAS_XXX_TRAIT_DEF(xxx) struct a1; struct a2 {}; -struct a3 { typedef int xxx_type; }; -struct a4 { struct xxx_type; }; -struct a5 { typedef int& xxx_type; }; -struct a6 { typedef int* xxx_type; }; -struct a7 { typedef int xxx_type[10]; }; -struct a8 { typedef void (*xxx_type)(); }; -struct a9 { typedef void (xxx_type)(); }; +struct a3 { void xxx(); }; +struct a4 { int xxx; }; +struct a5 { static int xxx(); }; + +struct b1 { typedef int xxx; }; +struct b2 { struct xxx; }; +struct b3 { typedef int& xxx; }; +struct b4 { typedef int* xxx; }; +struct b5 { typedef int xxx[10]; }; +struct b6 { typedef void (*xxx)(); }; +struct b7 { typedef void (xxx)(); }; + int main() { #if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - BOOST_STATIC_ASSERT(!has_xxx_type::value); - BOOST_STATIC_ASSERT(!has_xxx_type::value); - BOOST_STATIC_ASSERT(!has_xxx_type::value); - BOOST_STATIC_ASSERT(!has_xxx_type::value); + BOOST_STATIC_ASSERT(!has_xxx::value); + BOOST_STATIC_ASSERT(!has_xxx::value); + BOOST_STATIC_ASSERT(!has_xxx::value); + BOOST_STATIC_ASSERT(!has_xxx::value); #endif + BOOST_STATIC_ASSERT(!has_xxx::value); + BOOST_STATIC_ASSERT(!has_xxx::value); + BOOST_STATIC_ASSERT(!has_xxx::value); + BOOST_STATIC_ASSERT(!has_xxx::value); + BOOST_STATIC_ASSERT(!has_xxx::value); + BOOST_STATIC_ASSERT(!has_xxx::value); - BOOST_STATIC_ASSERT(!has_xxx_type::value); - BOOST_STATIC_ASSERT(!has_xxx_type::value); - BOOST_STATIC_ASSERT(!has_xxx_type::value); - BOOST_STATIC_ASSERT(has_xxx_type::value); - BOOST_STATIC_ASSERT(has_xxx_type::value); - BOOST_STATIC_ASSERT(has_xxx_type::value); - BOOST_STATIC_ASSERT(has_xxx_type::value); - BOOST_STATIC_ASSERT(has_xxx_type::value); - BOOST_STATIC_ASSERT(has_xxx_type::value); - BOOST_STATIC_ASSERT(has_xxx_type::value); + BOOST_STATIC_ASSERT(has_xxx::value); + BOOST_STATIC_ASSERT(has_xxx::value); + BOOST_STATIC_ASSERT(has_xxx::value); + BOOST_STATIC_ASSERT(has_xxx::value); + BOOST_STATIC_ASSERT(has_xxx::value); + BOOST_STATIC_ASSERT(has_xxx::value); + BOOST_STATIC_ASSERT(has_xxx::value); return 0; } diff --git a/test/aux_/no_has_xxx.cpp b/test/aux_/no_has_xxx.cpp index 06b5f69..4d9b4b8 100755 --- a/test/aux_/no_has_xxx.cpp +++ b/test/aux_/no_has_xxx.cpp @@ -32,7 +32,7 @@ struct a9 { typedef void (xxx_type)(); }; // // This file tests that we have the right value for -// BOOST_NO_MPL_AUX_HAS_XXX, and that has_xxx doesn't just fail to +// BOOST_MPL_NO_AUX_HAS_XXX, and that has_xxx doesn't just fail to // compile arbitrarily. Could be used as part of the config tests. // @@ -40,7 +40,7 @@ struct a9 { typedef void (xxx_type)(); }; #undef TRUE #define FALSE false -#ifdef BOOST_NO_MPL_AUX_HAS_XXX +#ifdef BOOST_MPL_NO_AUX_HAS_XXX # define TRUE FALSE #else # define TRUE true