From 1406f145b0d369e5763119b8bb0745fc6d07c82a Mon Sep 17 00:00:00 2001 From: Aleksey Gurtovoy Date: Mon, 7 Oct 2002 11:32:25 +0000 Subject: [PATCH] pre-1.29.0 update [SVN r15762] --- include/boost/mpl/always.hpp | 19 +--- include/boost/mpl/apply.hpp | 5 +- include/boost/mpl/arg.hpp | 42 ++++---- include/boost/mpl/arithmetic/divides.hpp | 2 +- include/boost/mpl/arithmetic/modulus.hpp | 2 +- include/boost/mpl/at.hpp | 14 +-- include/boost/mpl/at_fwd.hpp | 2 +- include/boost/mpl/aux_/advance_backward.hpp | 11 ++- include/boost/mpl/aux_/advance_forward.hpp | 16 ++- include/boost/mpl/aux_/apply.hpp | 4 +- include/boost/mpl/aux_/arity.hpp | 4 +- include/boost/mpl/aux_/arity_spec.hpp | 49 ++++++++++ include/boost/mpl/aux_/at_impl.hpp | 2 +- include/boost/mpl/aux_/bool_value_wknd.hpp | 5 +- include/boost/mpl/aux_/config/bind.hpp | 39 +++++--- include/boost/mpl/aux_/config/compiler.hpp | 22 ++++- include/boost/mpl/aux_/config/ctps.hpp | 27 ++++++ .../boost/mpl/aux_/config/dependent_nttp.hpp | 8 +- include/boost/mpl/aux_/config/dtp.hpp | 19 +++- include/boost/mpl/aux_/config/eti.hpp | 9 +- include/boost/mpl/aux_/config/internals.hpp | 3 +- .../config/{lambda_support.hpp => lambda.hpp} | 12 ++- .../mpl/aux_/config/overload_resolution.hpp | 6 +- .../boost/mpl/aux_/config/preprocessor.hpp | 30 ++++++ include/boost/mpl/aux_/config/ttp.hpp | 8 +- include/boost/mpl/aux_/count_args.hpp | 2 +- .../mpl/aux_/fold_backward_impl_body.hpp | 24 ++++- include/boost/mpl/aux_/fold_impl.hpp | 1 + include/boost/mpl/aux_/fold_impl_body.hpp | 14 ++- include/boost/mpl/aux_/full_lambda.hpp | 8 +- include/boost/mpl/aux_/iter_fold_if_impl.hpp | 8 +- include/boost/mpl/aux_/lambda_arity_param.hpp | 2 +- include/boost/mpl/aux_/lambda_expr.hpp | 2 +- include/boost/mpl/aux_/lambda_no_ctps.hpp | 2 +- include/boost/mpl/aux_/lambda_spec.hpp | 2 +- include/boost/mpl/aux_/lambda_support.hpp | 2 +- include/boost/mpl/aux_/nested_type_wknd.hpp | 6 +- include/boost/mpl/aux_/sequence_tag.hpp | 1 + include/boost/mpl/aux_/traits_lambda_spec.hpp | 2 +- include/boost/mpl/aux_/value_wknd.hpp | 6 +- include/boost/mpl/aux_/void_spec.hpp | 40 +++----- include/boost/mpl/bind.hpp | 97 ++++++++----------- include/boost/mpl/distance.hpp | 7 +- include/boost/mpl/int_c.hpp | 21 ++-- include/boost/mpl/integral_c.hpp | 9 +- include/boost/mpl/lambda.hpp | 2 +- include/boost/mpl/lambda_helper.hpp | 2 +- include/boost/mpl/lower_bound.hpp | 7 +- include/boost/mpl/placeholder.hpp | 5 - include/boost/mpl/protect.hpp | 12 +-- include/boost/mpl/same_as.hpp | 4 +- include/boost/mpl/sizeof.hpp | 43 ++++++++ include/boost/mpl/unique.hpp | 5 + include/boost/mpl/upper_bound.hpp | 7 +- include/boost/mpl/void.hpp | 25 +++-- 55 files changed, 485 insertions(+), 243 deletions(-) create mode 100644 include/boost/mpl/aux_/arity_spec.hpp create mode 100644 include/boost/mpl/aux_/config/ctps.hpp rename include/boost/mpl/aux_/config/{lambda_support.hpp => lambda.hpp} (76%) create mode 100644 include/boost/mpl/aux_/config/preprocessor.hpp create mode 100644 include/boost/mpl/sizeof.hpp diff --git a/include/boost/mpl/always.hpp b/include/boost/mpl/always.hpp index 8107b80..998b625 100644 --- a/include/boost/mpl/always.hpp +++ b/include/boost/mpl/always.hpp @@ -18,12 +18,9 @@ #define BOOST_MPL_ALWAYS_HPP_INCLUDED #include "boost/mpl/aux_/preprocessor/def_params_tail.hpp" -#include "boost/mpl/limits/arity.hpp" #include "boost/mpl/void.hpp" -#include "boost/mpl/aux_/arity.hpp" +#include "boost/mpl/aux_/arity_spec.hpp" #include "boost/mpl/aux_/lambda_spec.hpp" -#include "boost/mpl/aux_/config/dtp.hpp" -#include "boost/config.hpp" namespace boost { namespace mpl { @@ -33,7 +30,7 @@ struct always { template< typename T - BOOST_MPL_PP_DEF_PARAMS_TAIL(1, typename T) + BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(1, typename T, void_) > struct apply { @@ -41,18 +38,8 @@ struct always }; }; -#if defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) -namespace aux { -template< int N, typename T > -struct arity< always, N > -{ - BOOST_STATIC_CONSTANT(int - , value = BOOST_MPL_METAFUNCTION_MAX_ARITY - ); -}; -} -#endif +BOOST_MPL_AUX_ARITY_SPEC(1,always) BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(1,always) } // namespace mpl diff --git a/include/boost/mpl/apply.hpp b/include/boost/mpl/apply.hpp index 8818936..e87325e 100644 --- a/include/boost/mpl/apply.hpp +++ b/include/boost/mpl/apply.hpp @@ -46,7 +46,8 @@ # include "boost/mpl/aux_/preprocessor/add.hpp" # include "boost/mpl/aux_/preprocessor/sub.hpp" # include "boost/mpl/aux_/config/dtp.hpp" -# include "boost/mpl/aux_/config/lambda_support.hpp" +# include "boost/mpl/aux_/config/eti.hpp" +# include "boost/mpl/aux_/config/lambda.hpp" # include "boost/preprocessor/comma_if.hpp" # include "boost/preprocessor/inc.hpp" @@ -221,7 +222,7 @@ struct BOOST_PP_CAT(apply,i) typedef BOOST_PP_CAT(apply,i) type; }; -# elif defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) +# elif defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) // MWCW/Borland version namespace aux { diff --git a/include/boost/mpl/arg.hpp b/include/boost/mpl/arg.hpp index 7517d36..4cc9476 100644 --- a/include/boost/mpl/arg.hpp +++ b/include/boost/mpl/arg.hpp @@ -24,7 +24,8 @@ #if !defined(BOOST_MPL_PREPROCESSING_MODE) # include "boost/mpl/arg_fwd.hpp" # include "boost/mpl/void.hpp" -# include "boost/mpl/aux_/arity.hpp" +# include "boost/mpl/aux_/arity_spec.hpp" +# include "boost/static_assert.hpp" #endif #include "boost/mpl/aux_/config/use_preprocessed.hpp" @@ -39,7 +40,8 @@ # include "boost/mpl/limits/arity.hpp" # include "boost/mpl/aux_/preprocessor/default_params.hpp" # include "boost/mpl/aux_/preprocessor/params.hpp" -# include "boost/mpl/aux_/config/lambda_support.hpp" +# include "boost/mpl/aux_/config/lambda.hpp" +# include "boost/mpl/aux_/config/dtp.hpp" # include "boost/preprocessor/iterate.hpp" # include "boost/preprocessor/inc.hpp" @@ -50,6 +52,7 @@ namespace boost { namespace mpl { // local macro, #undef-ined at the end of the header +#if !defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) # define AUX_ARG_N_DEFAULT_PARAMS(param,value) \ BOOST_MPL_PP_DEFAULT_PARAMS( \ BOOST_MPL_METAFUNCTION_MAX_ARITY \ @@ -57,6 +60,14 @@ namespace mpl { , value \ ) \ /**/ +#else +# define AUX_ARG_N_DEFAULT_PARAMS(param,value) \ + BOOST_MPL_PP_PARAMS( \ + BOOST_MPL_METAFUNCTION_MAX_ARITY \ + , param \ + ) \ + /**/ +#endif #define BOOST_PP_ITERATION_PARAMS_1 \ (3,(0, BOOST_MPL_METAFUNCTION_MAX_ARITY, "boost/mpl/arg.hpp")) @@ -65,18 +76,7 @@ namespace mpl { # undef AUX_ARG_N_DEFAULT_PARAMS -#if defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) -// MWCW/Borland workaround -namespace aux { -template< int N, int A > -struct arity< arg, A > -{ - BOOST_STATIC_CONSTANT(int - , value = BOOST_MPL_METAFUNCTION_MAX_ARITY - ); -}; -} -#endif +BOOST_MPL_AUX_NONTYPE_ARITY_SPEC(1,int,arg) } // namespace mpl } // namespace boost @@ -105,10 +105,10 @@ template<> struct arg struct apply { typedef BOOST_PP_CAT(U,i) type; - typedef char arity_constraint[ - ::boost::mpl::aux::reject_if_void_::value - ]; - }; +#if !defined(__BORLANDC__) || (__BORLANDC__ > 0x561 && defined(BOOST_STRICT_CONFIG)) + BOOST_STATIC_ASSERT(!is_void_::value); +#endif + }; }; #else @@ -126,9 +126,9 @@ template<> struct arg<-1> struct apply { typedef U1 type; - typedef char arity_constraint[ - ::boost::mpl::aux::reject_if_void_::value - ]; +#if !defined(__BORLANDC__) || (__BORLANDC__ > 0x561 && defined(BOOST_STRICT_CONFIG)) + BOOST_STATIC_ASSERT(!is_void_::value); +#endif }; }; diff --git a/include/boost/mpl/arithmetic/divides.hpp b/include/boost/mpl/arithmetic/divides.hpp index c17f5ad..0248fb0 100644 --- a/include/boost/mpl/arithmetic/divides.hpp +++ b/include/boost/mpl/arithmetic/divides.hpp @@ -40,7 +40,7 @@ struct divides_c #endif }; -#if defined(BOOST_MPL_MSVC_ETI_BUG) +#if defined(BOOST_MPL_MSVC_70_ETI_BUG) template<> struct divides_c { diff --git a/include/boost/mpl/arithmetic/modulus.hpp b/include/boost/mpl/arithmetic/modulus.hpp index 5b23b5b..dcf5e5e 100644 --- a/include/boost/mpl/arithmetic/modulus.hpp +++ b/include/boost/mpl/arithmetic/modulus.hpp @@ -40,7 +40,7 @@ struct modulus_c #endif }; -#if defined(BOOST_MPL_MSVC_ETI_BUG) +#if defined(BOOST_MPL_MSVC_70_ETI_BUG) template<> struct modulus_c { diff --git a/include/boost/mpl/at.hpp b/include/boost/mpl/at.hpp index 6dd7ee1..17cc51b 100644 --- a/include/boost/mpl/at.hpp +++ b/include/boost/mpl/at.hpp @@ -28,23 +28,23 @@ namespace boost { namespace mpl { template< - typename BOOST_MPL_AUX_VOID_SPEC_PARAM(N) - , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(Sequence) + typename BOOST_MPL_AUX_VOID_SPEC_PARAM(Sequence) + , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(N) > struct at : at_traits< typename BOOST_MPL_AUX_SEQUENCE_TAG(Sequence) > - ::template algorithm< N,Sequence > + ::template algorithm< Sequence,N > { - BOOST_MPL_AUX_LAMBDA_SUPPORT(2,at,(N,Sequence)) + BOOST_MPL_AUX_LAMBDA_SUPPORT(2,at,(Sequence,N)) }; template< - long N - , typename Sequence + typename Sequence + , long N > struct at_c : at_traits< typename BOOST_MPL_AUX_SEQUENCE_TAG(Sequence) > - ::template algorithm< integral_c,Sequence > + ::template algorithm< Sequence,integral_c > { }; diff --git a/include/boost/mpl/at_fwd.hpp b/include/boost/mpl/at_fwd.hpp index d33d557..d873a2d 100644 --- a/include/boost/mpl/at_fwd.hpp +++ b/include/boost/mpl/at_fwd.hpp @@ -21,7 +21,7 @@ namespace boost { namespace mpl { template< typename Tag > struct at_traits; -template< typename N, typename Sequence > struct at; +template< typename Sequence, typename N > struct at; } // namespace mpl } // namespace boost diff --git a/include/boost/mpl/aux_/advance_backward.hpp b/include/boost/mpl/aux_/advance_backward.hpp index ac3e234..5b94a9b 100644 --- a/include/boost/mpl/aux_/advance_backward.hpp +++ b/include/boost/mpl/aux_/advance_backward.hpp @@ -83,6 +83,7 @@ struct advance_backward ///// iteration, depth == 1 #elif BOOST_PP_ITERATION_DEPTH() == 1 +#define i BOOST_PP_FRAME_ITERATION(1) template<> struct advance_backward< BOOST_PP_FRAME_ITERATION(1) > @@ -91,18 +92,26 @@ struct advance_backward< BOOST_PP_FRAME_ITERATION(1) > { typedef Iterator iter0; +#if i > 0 # define BOOST_PP_ITERATION_PARAMS_2 \ (3,(1, BOOST_PP_FRAME_ITERATION(1), "boost/mpl/aux_/advance_backward.hpp")) # include BOOST_PP_ITERATE() +#endif typedef BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(1)) type; }; #if defined(BOOST_MPL_MSVC_ETI_BUG) - template<> struct apply { typedef int type; }; + //: ETI workaround + template<> struct apply + { + typedef int type; + }; #endif }; +#undef i + ///// iteration, depth == 2 #elif BOOST_PP_ITERATION_DEPTH() == 2 diff --git a/include/boost/mpl/aux_/advance_forward.hpp b/include/boost/mpl/aux_/advance_forward.hpp index 97cc74b..bdf14c4 100644 --- a/include/boost/mpl/aux_/advance_forward.hpp +++ b/include/boost/mpl/aux_/advance_forward.hpp @@ -83,6 +83,7 @@ struct advance_forward ///// iteration, depth == 1 #elif BOOST_PP_ITERATION_DEPTH() == 1 +#define i BOOST_PP_FRAME_ITERATION(1) template<> struct advance_forward< BOOST_PP_FRAME_ITERATION(1) > @@ -91,18 +92,25 @@ struct advance_forward< BOOST_PP_FRAME_ITERATION(1) > { typedef Iterator iter0; +#if i > 0 # define BOOST_PP_ITERATION_PARAMS_2 \ - (3,(1, BOOST_PP_FRAME_ITERATION(1), "boost/mpl/aux_/advance_forward.hpp")) + (3,(1, i, "boost/mpl/aux_/advance_forward.hpp")) # include BOOST_PP_ITERATE() - - typedef BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(1)) type; +#endif + typedef BOOST_PP_CAT(iter,i) type; }; #if defined(BOOST_MPL_MSVC_ETI_BUG) - template<> struct apply { typedef int type; }; + //: ETI workaround + template<> struct apply + { + typedef int type; + }; #endif }; +#undef i + ///// iteration, depth == 2 #elif BOOST_PP_ITERATION_DEPTH() == 2 diff --git a/include/boost/mpl/aux_/apply.hpp b/include/boost/mpl/aux_/apply.hpp index 9ec72ff..9d94f1e 100644 --- a/include/boost/mpl/aux_/apply.hpp +++ b/include/boost/mpl/aux_/apply.hpp @@ -25,8 +25,8 @@ /**/ #if defined(BOOST_MPL_USE_APPLY_INTERNALLY) \ - || defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) \ - || (defined(BOOST_MSVC) && (BOOST_MSVC < 1300)) + || defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) \ + || (defined(BOOST_MSVC) && (BOOST_MSVC <= 1300)) # if !defined(BOOST_MPL_PREPROCESSING_MODE) # include "boost/mpl/apply.hpp" diff --git a/include/boost/mpl/aux_/arity.hpp b/include/boost/mpl/aux_/arity.hpp index d951c33..59f76f5 100644 --- a/include/boost/mpl/aux_/arity.hpp +++ b/include/boost/mpl/aux_/arity.hpp @@ -19,7 +19,7 @@ #include "boost/mpl/aux_/config/dtp.hpp" -#if defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) +#if defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) # include "boost/config.hpp" @@ -40,6 +40,6 @@ struct arity } // namespace mpl } // namespace boost -#endif // BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES +#endif // BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES #endif // BOOST_MPL_AUX_ARITY_HPP_INCLUDED diff --git a/include/boost/mpl/aux_/arity_spec.hpp b/include/boost/mpl/aux_/arity_spec.hpp new file mode 100644 index 0000000..d7a0478 --- /dev/null +++ b/include/boost/mpl/aux_/arity_spec.hpp @@ -0,0 +1,49 @@ +//----------------------------------------------------------------------------- +// boost mpl/aux_/arity_spec.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2001-02 +// 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. + +#ifndef BOOST_MPL_AUX_ARITY_SPEC_HPP_INCLUDED +#define BOOST_MPL_AUX_ARITY_SPEC_HPP_INCLUDED + +#include "boost/mpl/aux_/config/dtp.hpp" +#include "boost/mpl/aux_/preprocessor/params.hpp" +#include "boost/mpl/aux_/arity.hpp" +#include "boost/mpl/limits/arity.hpp" +#include "boost/config.hpp" + +#if defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) +# define BOOST_MPL_AUX_NONTYPE_ARITY_SPEC(i,type,name) \ +namespace aux { \ +template< int N, BOOST_MPL_PP_PARAMS(i,type T) > \ +struct arity< \ + name< BOOST_MPL_PP_PARAMS(i,T) > \ + , N \ + > \ +{ \ + BOOST_STATIC_CONSTANT(int \ + , value = BOOST_MPL_METAFUNCTION_MAX_ARITY \ + ); \ +}; \ +} \ +/**/ +#else +# define BOOST_MPL_AUX_NONTYPE_ARITY_SPEC(i,type,name) /**/ +#endif + +# define BOOST_MPL_AUX_ARITY_SPEC(i,name) \ + BOOST_MPL_AUX_NONTYPE_ARITY_SPEC(i,typename,name) \ +/**/ + +#endif // BOOST_MPL_AUX_ARITY_SPEC_HPP_INCLUDED diff --git a/include/boost/mpl/aux_/at_impl.hpp b/include/boost/mpl/aux_/at_impl.hpp index 996b0f8..3cf61fd 100644 --- a/include/boost/mpl/aux_/at_impl.hpp +++ b/include/boost/mpl/aux_/at_impl.hpp @@ -31,7 +31,7 @@ namespace mpl { template< typename Tag > struct at_traits { - template< typename N, typename Sequence > struct algorithm + template< typename Sequence, typename N > struct algorithm { typedef typename advance< typename begin::type diff --git a/include/boost/mpl/aux_/bool_value_wknd.hpp b/include/boost/mpl/aux_/bool_value_wknd.hpp index b3d9a59..aa49637 100644 --- a/include/boost/mpl/aux_/bool_value_wknd.hpp +++ b/include/boost/mpl/aux_/bool_value_wknd.hpp @@ -17,7 +17,10 @@ #ifndef BOOST_MPL_AUX_BOOL_VALUE_WKND_HPP_INCLUDED #define BOOST_MPL_AUX_BOOL_VALUE_WKND_HPP_INCLUDED -#if defined(__BORLANDC__) || defined(BOOST_MSVC) && BOOST_MSVC < 1300 +#include "boost/config.hpp" + +#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \ + || defined(BOOST_MSVC) && BOOST_MSVC < 1300 # include "boost/mpl/bool_c.hpp" diff --git a/include/boost/mpl/aux_/config/bind.hpp b/include/boost/mpl/aux_/config/bind.hpp index 6796003..cc2e5ce 100644 --- a/include/boost/mpl/aux_/config/bind.hpp +++ b/include/boost/mpl/aux_/config/bind.hpp @@ -1,13 +1,28 @@ -// Copyright David Abrahams 2002. Permission to copy, use, -// modify, sell and distribute this software is granted provided this -// copyright notice appears in all copies. This software is provided -// "as is" without express or implied warranty, and with no claim as -// to its suitability for any purpose. -#ifndef BIND_DWA2002910_HPP -# define BIND_DWA2002910_HPP +//----------------------------------------------------------------------------- +// boost mpl/aux_/config/bind.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2002 +// David Abrahams, 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. -# include -# if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 -# define BOOST_MPL_NO_BIND_TEMPLATE -# endif -#endif // BIND_DWA2002910_HPP +#ifndef BOOST_MPL_AUX_CONFIG_BIND_HPP_INCLUDED +#define BOOST_MPL_AUX_CONFIG_BIND_HPP_INCLUDED + +#include "boost/config.hpp" + +#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 \ + || defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \ + && !defined(BOOST_MPL_NO_BIND_TEMPLATE) +# define BOOST_MPL_NO_BIND_TEMPLATE +#endif + +#endif // BOOST_MPL_AUX_CONFIG_BIND_HPP_INCLUDED diff --git a/include/boost/mpl/aux_/config/compiler.hpp b/include/boost/mpl/aux_/config/compiler.hpp index 35417c3..dcbb070 100644 --- a/include/boost/mpl/aux_/config/compiler.hpp +++ b/include/boost/mpl/aux_/config/compiler.hpp @@ -22,16 +22,30 @@ #if defined(BOOST_MSVC) && BOOST_MSVC < 1300 # define BOOST_MPL_COMPILER_DIR msvc60 + #elif defined(BOOST_MSVC) && BOOST_MSVC == 1300 # define BOOST_MPL_COMPILER_DIR msvc70 + #elif defined(__GNUC__) # define BOOST_MPL_COMPILER_DIR gcc -#elif defined(__BORLANDC__) -# define BOOST_MPL_COMPILER_DIR bcc -#elif defined(__MWERKS__) && __MWERKS__ <= 0x3001 -# define BOOST_MPL_COMPILER_DIR mwcw + +#elif defined(__BORLANDC__) +# if !defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) +# define BOOST_MPL_COMPILER_DIR bcc551 +# else +# define BOOST_MPL_COMPILER_DIR bcc +# endif + +#elif defined(__MWERKS__) +# if defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) +# define BOOST_MPL_COMPILER_DIR mwcw +# else +# define BOOST_MPL_COMPILER_DIR plain +# endif + #elif defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) # define BOOST_MPL_COMPILER_DIR no_ctps + #else # define BOOST_MPL_COMPILER_DIR plain #endif diff --git a/include/boost/mpl/aux_/config/ctps.hpp b/include/boost/mpl/aux_/config/ctps.hpp new file mode 100644 index 0000000..55c0adc --- /dev/null +++ b/include/boost/mpl/aux_/config/ctps.hpp @@ -0,0 +1,27 @@ +//----------------------------------------------------------------------------- +// boost mpl/aux_/config/ctps.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2000-02 +// 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. + +#ifndef BOOST_MPL_AUX_CONFIG_CTPS_HPP_INCLUDED +#define BOOST_MPL_AUX_CONFIG_CTPS_HPP_INCLUDED + +#include "boost/config.hpp" + +#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \ + && !defined(BOOST_NO_NON_TYPE_TEMPLATE_PARTIAL_SPECIALIZATION) +# define BOOST_NO_NON_TYPE_TEMPLATE_PARTIAL_SPECIALIZATION +#endif + +#endif // BOOST_MPL_AUX_CONFIG_CTPS_HPP_INCLUDED diff --git a/include/boost/mpl/aux_/config/dependent_nttp.hpp b/include/boost/mpl/aux_/config/dependent_nttp.hpp index 997b68e..b6605c8 100644 --- a/include/boost/mpl/aux_/config/dependent_nttp.hpp +++ b/include/boost/mpl/aux_/config/dependent_nttp.hpp @@ -17,13 +17,17 @@ #ifndef BOOST_MPL_AUX_CONFIG_DEPENDENT_NTTP_HPP_INCLUDED #define BOOST_MPL_AUX_CONFIG_DEPENDENT_NTTP_HPP_INCLUDED +#include "boost/config.hpp" + // GCC and EDG-based compilers incorrectly reject the following code: // template< typename T, T n > struct a; // template< typename T > struct b; // template< typename T, T n > struct b< a > {}; -#if defined(__EDG__) \ - || defined(__GNUC__) +#if defined(__EDG__) && (__EDG_VERSION__ <= 300 || !defined(BOOST_STRICT_CONFIG)) \ + || defined(__GNUC__) && (__GNUC__ < 3 || __GNUC__ == 3 && __GNUC_MINOR__ <= 2 \ + || !defined(BOOST_STRICT_CONFIG)) \ + && !defined(BOOST_NO_DEPENDENT_NON_TYPE_PARAMETER_IN_PARTIAL_SPECIALIZATION) # define BOOST_NO_DEPENDENT_NON_TYPE_PARAMETER_IN_PARTIAL_SPECIALIZATION #endif diff --git a/include/boost/mpl/aux_/config/dtp.hpp b/include/boost/mpl/aux_/config/dtp.hpp index 70c330b..81772fb 100644 --- a/include/boost/mpl/aux_/config/dtp.hpp +++ b/include/boost/mpl/aux_/config/dtp.hpp @@ -21,12 +21,21 @@ // MWCW 7.x-8.0 "losts" default template parameters of nested class // templates when their owner classes are passed as arguments to other -// templates; Borland "forgets" them from the very beginning (if the owner -// class is a class template). -#if defined(__MWERKS__) && __MWERKS__ <= 0x3001 \ - || defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \ - && !defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) +// templates; Borland 5.5.1 "forgets" them from the very beginning (if +// the owner class is a class template), and Borland 5.6 isn't even +// able to compile a definition of nested class template with DTP + +#if defined(__BORLANDC__) && __BORLANDC__ >= 0x560 && \ + (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \ + && !defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) # define BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES #endif +#if defined(__MWERKS__) && __MWERKS__ <= 0x3001 \ + || defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \ + || defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) \ + && !defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) +# define BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES +#endif + #endif // BOOST_MPL_AUX_CONFIG_DTP_HPP_INCLUDED diff --git a/include/boost/mpl/aux_/config/eti.hpp b/include/boost/mpl/aux_/config/eti.hpp index fe7c4af..e7269e8 100644 --- a/include/boost/mpl/aux_/config/eti.hpp +++ b/include/boost/mpl/aux_/config/eti.hpp @@ -19,9 +19,12 @@ #include "boost/config.hpp" -// flag for MSVC 6.5's so-called "early template instantiation bug" -#if defined(BOOST_MSVC) && BOOST_MSVC < 1300 -# define BOOST_MPL_MSVC_ETI_BUG +// flags for MSVC 6.5's so-called "early template instantiation bug" +#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 +# if BOOST_MSVC < 1300 +# define BOOST_MPL_MSVC_ETI_BUG +# endif +# define BOOST_MPL_MSVC_70_ETI_BUG #endif #endif // BOOST_MPL_AUX_CONFIG_ETI_HPP_INCLUDED diff --git a/include/boost/mpl/aux_/config/internals.hpp b/include/boost/mpl/aux_/config/internals.hpp index 67fd57f..b6ea727 100644 --- a/include/boost/mpl/aux_/config/internals.hpp +++ b/include/boost/mpl/aux_/config/internals.hpp @@ -19,7 +19,8 @@ #include "boost/config.hpp" -#if defined(BOOST_MSVC) && BOOST_MSVC < 1300 +#if defined(BOOST_MSVC) && BOOST_MSVC < 1300 \ + && !defined(BOOST_MPL_INTERNALS_USE_ITERATOR_CATEGORY) # define BOOST_MPL_INTERNALS_USE_ITERATOR_CATEGORY #endif diff --git a/include/boost/mpl/aux_/config/lambda_support.hpp b/include/boost/mpl/aux_/config/lambda.hpp similarity index 76% rename from include/boost/mpl/aux_/config/lambda_support.hpp rename to include/boost/mpl/aux_/config/lambda.hpp index 559718e..50630b0 100644 --- a/include/boost/mpl/aux_/config/lambda_support.hpp +++ b/include/boost/mpl/aux_/config/lambda.hpp @@ -1,5 +1,5 @@ //----------------------------------------------------------------------------- -// boost mpl/aux_/config/lambda_support.hpp header file +// boost mpl/aux_/config/lambda.hpp header file // See http://www.boost.org for updates, documentation, and revision history. //----------------------------------------------------------------------------- // @@ -14,8 +14,8 @@ // suitability of this software for any purpose. It is provided "as is" // without express or implied warranty. -#ifndef BOOST_MPL_AUX_CONFIG_LAMBDA_SUPPORT_HPP_INCLUDED -#define BOOST_MPL_AUX_CONFIG_LAMBDA_SUPPORT_HPP_INCLUDED +#ifndef BOOST_MPL_AUX_CONFIG_LAMBDA_HPP_INCLUDED +#define BOOST_MPL_AUX_CONFIG_LAMBDA_HPP_INCLUDED #include "boost/mpl/aux_/config/ttp.hpp" #include "boost/config.hpp" @@ -24,10 +24,12 @@ // template template parameters _and_ partial specialization #if defined(BOOST_NO_TEMPLATE_TEMPLATE_PARAMETERS) \ - || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ + && !defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT) # define BOOST_MPL_NO_FULL_LAMBDA_SUPPORT #endif //#define BOOST_MPL_NO_UNNAMED_PLACEHOLDER_SUPPORT +//#define BOOST_MPL_NO_LAMBDA_HEURISTIC -#endif // BOOST_MPL_AUX_CONFIG_LAMBDA_SUPPORT_HPP_INCLUDED +#endif // BOOST_MPL_AUX_CONFIG_LAMBDA_HPP_INCLUDED diff --git a/include/boost/mpl/aux_/config/overload_resolution.hpp b/include/boost/mpl/aux_/config/overload_resolution.hpp index fb363c7..009ccc8 100644 --- a/include/boost/mpl/aux_/config/overload_resolution.hpp +++ b/include/boost/mpl/aux_/config/overload_resolution.hpp @@ -17,7 +17,11 @@ #ifndef BOOST_MPL_AUX_CONFIG_OVERLOAD_RESOLUTION_HPP_INCLUDED #define BOOST_MPL_AUX_CONFIG_OVERLOAD_RESOLUTION_HPP_INCLUDED -#if defined(__BORLANDC__) || defined(__MWERKS__) && __MWERKS__ < 0x3001 +#include "boost/config.hpp" + +#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \ + || defined(__MWERKS__) && __MWERKS__ < 0x3001 \ + && !defined(BOOST_MPL_BROKEN_OVERLOAD_RESOLUTION) # define BOOST_MPL_BROKEN_OVERLOAD_RESOLUTION #endif diff --git a/include/boost/mpl/aux_/config/preprocessor.hpp b/include/boost/mpl/aux_/config/preprocessor.hpp new file mode 100644 index 0000000..eb088c6 --- /dev/null +++ b/include/boost/mpl/aux_/config/preprocessor.hpp @@ -0,0 +1,30 @@ +//----------------------------------------------------------------------------- +// boost mpl/aux_/config/preprocessor.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2000-02 +// 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. + +#ifndef BOOST_MPL_AUX_CONFIG_PREPROCESSOR_HPP_INCLUDED +#define BOOST_MPL_AUX_CONFIG_PREPROCESSOR_HPP_INCLUDED + +#include "boost/config.hpp" + +#if defined(__MWERKS__) && (__MWERKS__ <= 0x3002 || !defined(BOOST_STRICT_CONFIG)) \ + || defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \ + || defined(__IBMCPP__) && (__IBMCPP__ <= 502 || !defined(BOOST_STRICT_CONFIG)) +# define BOOST_MPL_BROKEN_PP_MACRO_EXPANSION +#endif + +//#define BOOST_MPL_NO_OWN_PP_PRIMITIVES + +#endif // BOOST_MPL_AUX_CONFIG_PREPROCESSOR_HPP_INCLUDED diff --git a/include/boost/mpl/aux_/config/ttp.hpp b/include/boost/mpl/aux_/config/ttp.hpp index e2c15cf..29f1fc6 100644 --- a/include/boost/mpl/aux_/config/ttp.hpp +++ b/include/boost/mpl/aux_/config/ttp.hpp @@ -19,11 +19,15 @@ #include "boost/config.hpp" -#if defined(BOOST_NO_TEMPLATE_TEMPLATES) +#if defined(BOOST_NO_TEMPLATE_TEMPLATES) \ + && (!defined(BOOST_MSVC) || BOOST_MSVC < 1300) # define BOOST_NO_TEMPLATE_TEMPLATE_PARAMETERS #endif -#if defined(__GNUC__) && !defined(BOOST_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) +#if defined(__GNUC__) && (__GNUC__ < 3 || __GNUC__ == 3 && __GNUC_MINOR__ <= 2 \ + || !defined(BOOST_STRICT_CONFIG)) \ + || defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \ + && !defined(BOOST_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) # define BOOST_EXTENDED_TEMPLATE_PARAMETERS_MATCHING #endif diff --git a/include/boost/mpl/aux_/count_args.hpp b/include/boost/mpl/aux_/count_args.hpp index 067371c..11c0b57 100644 --- a/include/boost/mpl/aux_/count_args.hpp +++ b/include/boost/mpl/aux_/count_args.hpp @@ -45,7 +45,7 @@ # include "boost/preprocessor/repeat.hpp" # include "boost/preprocessor/inc.hpp" -# define AUX_COUNT_ARGS_REPEAT BOOST_PP_REPEAT_1ST +# define AUX_COUNT_ARGS_REPEAT BOOST_PP_REPEAT_1 # define AUX_COUNT_ARGS_PARAMS(param) \ BOOST_PP_ENUM_SHIFTED_PARAMS( \ BOOST_PP_INC(BOOST_MPL_AUX_COUNT_ARGS_ARITY) \ diff --git a/include/boost/mpl/aux_/fold_backward_impl_body.hpp b/include/boost/mpl/aux_/fold_backward_impl_body.hpp index 53bb1ae..22687a6 100644 --- a/include/boost/mpl/aux_/fold_backward_impl_body.hpp +++ b/include/boost/mpl/aux_/fold_backward_impl_body.hpp @@ -20,7 +20,7 @@ # include "boost/mpl/aux_/apply.hpp" # include "boost/mpl/aux_/next.hpp" -# include "boost/config.hpp" +# include "boost/mpl/aux_/config/ctps.hpp" # include "boost/mpl/limits/unrolling.hpp" # include "boost/mpl/aux_/preprocessor/repeat.hpp" @@ -33,7 +33,7 @@ // local macros, #undef-ined at the end of the header -# define AUX_ITER_FOLD_FORWARD_STEP(i, unused) \ +# define AUX_ITER_FOLD_FORWARD_STEP(unused, i, unused2) \ typedef typename BOOST_MPL_AUX_APPLY2( \ ForwardOp \ , BOOST_PP_CAT(fwd_state,i) \ @@ -51,7 +51,7 @@ )::type BOOST_PP_CAT(bkwd_state,BOOST_PP_DEC(i)); \ /**/ -# define AUX_ITER_FOLD_BACKWARD_STEP(i, j) \ +# define AUX_ITER_FOLD_BACKWARD_STEP(unused, i, j) \ AUX_ITER_FOLD_BACKWARD_STEP_FUNC( \ BOOST_PP_SUB_D(1,j,i) \ ) \ @@ -84,7 +84,8 @@ template< > struct AUX_FOLD_IMPL_NAME; -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ + && !defined(BOOST_NO_NON_TYPE_TEMPLATE_PARTIAL_SPECIALIZATION) # define BOOST_PP_ITERATION_PARAMS_1 \ (3,(0, BOOST_MPL_UNROLLING_LIMIT, "boost/mpl/aux_/fold_backward_impl_body.hpp")) @@ -265,6 +266,15 @@ struct AUX_FOLD_CHUNK_NAME<-1> typedef typename res_::state state; typedef typename res_::iterator iterator; }; + +#if defined(BOOST_MPL_MSVC_ETI_BUG) + //: ETI workaround + template<> struct result_ + { + typedef int state; + typedef int iterator; + }; +#endif }; template< @@ -326,7 +336,8 @@ struct AUX_FOLD_IMPL_NAME #else #define i BOOST_PP_FRAME_ITERATION(1) -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ + && !defined(BOOST_NO_NON_TYPE_TEMPLATE_PARTIAL_SPECIALIZATION) template< typename First @@ -393,11 +404,14 @@ struct AUX_FOLD_CHUNK_NAME typedef BOOST_PP_CAT(iter,i) iterator; }; +#if defined(BOOST_MPL_MSVC_ETI_BUG) + //: ETI workaround template<> struct result_ { typedef int state; typedef int iterator; }; +#endif }; #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION diff --git a/include/boost/mpl/aux_/fold_impl.hpp b/include/boost/mpl/aux_/fold_impl.hpp index b1f9562..766d237 100644 --- a/include/boost/mpl/aux_/fold_impl.hpp +++ b/include/boost/mpl/aux_/fold_impl.hpp @@ -19,6 +19,7 @@ #include "boost/mpl/aux_/apply.hpp" #include "boost/mpl/aux_/next.hpp" +#include "boost/mpl/aux_/config/eti.hpp" #include "boost/config.hpp" #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && \ diff --git a/include/boost/mpl/aux_/fold_impl_body.hpp b/include/boost/mpl/aux_/fold_impl_body.hpp index b7d2f89..30de111 100644 --- a/include/boost/mpl/aux_/fold_impl_body.hpp +++ b/include/boost/mpl/aux_/fold_impl_body.hpp @@ -31,7 +31,7 @@ // local macros, #undef-ined at the end of the header -# define AUX_ITER_FOLD_STEP(i, unused) \ +# define AUX_ITER_FOLD_STEP(unused, i, unused2) \ typedef typename BOOST_MPL_AUX_APPLY2( \ ForwardOp \ , BOOST_PP_CAT(state,i) \ @@ -252,6 +252,15 @@ struct AUX_FOLD_CHUNK_NAME<-1> typedef typename res_::state state; typedef typename res_::iterator iterator; }; + +#if defined(BOOST_MPL_MSVC_ETI_BUG) + //: ETI workaround + template<> struct result_ + { + typedef int state; + typedef int iterator; + }; +#endif }; template< @@ -353,11 +362,14 @@ struct AUX_FOLD_CHUNK_NAME typedef BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(1)) iterator; }; +#if defined(BOOST_MPL_MSVC_ETI_BUG) + //: ETI workaround template<> struct result_ { typedef int state; typedef int iterator; }; +#endif }; #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION diff --git a/include/boost/mpl/aux_/full_lambda.hpp b/include/boost/mpl/aux_/full_lambda.hpp index f4eabd5..f7cbb51 100644 --- a/include/boost/mpl/aux_/full_lambda.hpp +++ b/include/boost/mpl/aux_/full_lambda.hpp @@ -203,7 +203,7 @@ struct lambda_impl< bind2nd, Protect AUX_ARITY_PARAM(-1) > #else // BOOST_MPL_NO_LAMBDA_HEURISTIC -# define AUX_LAMBDA_RESULT(i, T) \ +# define AUX_LAMBDA_RESULT(unused, i, T) \ BOOST_PP_COMMA_IF(i) \ typename BOOST_PP_CAT(T, BOOST_PP_INC(i))::type \ /**/ @@ -249,12 +249,12 @@ struct BOOST_PP_CAT(le_result,i)< true,true,F,AUX_LAMBDA_PARAMS(i, L) > } // namespace aux -# define AUX_LAMBDA_INVOCATION(i, T) \ +# define AUX_LAMBDA_INVOCATION(unused, i, T) \ typedef lambda_impl< BOOST_PP_CAT(T, BOOST_PP_INC(i)) > \ BOOST_PP_CAT(l,BOOST_PP_INC(i)); \ /**/ -# define AUX_IS_LAMBDA_EXPR(i, unused) \ +# define AUX_IS_LAMBDA_EXPR(unused, i, unused2) \ BOOST_PP_COMMA_IF(i) \ BOOST_PP_CAT(l,BOOST_PP_INC(i))::is_le::value \ /**/ @@ -322,7 +322,7 @@ template< > struct lambda_impl< F, Protect AUX_LAMBDA_IMPL_ARITY > { -# define AUX_LAMBDA_INVOCATION(i, T) \ +# define AUX_LAMBDA_INVOCATION(unused, i, T) \ BOOST_PP_COMMA_IF(i) \ typename lambda_impl< BOOST_PP_CAT(T, BOOST_PP_INC(i)) >::type \ /**/ diff --git a/include/boost/mpl/aux_/iter_fold_if_impl.hpp b/include/boost/mpl/aux_/iter_fold_if_impl.hpp index cd0cea2..1611e69 100644 --- a/include/boost/mpl/aux_/iter_fold_if_impl.hpp +++ b/include/boost/mpl/aux_/iter_fold_if_impl.hpp @@ -126,7 +126,7 @@ struct iter_fold_if_backward_step // local macros, #undef-ined at the end of the header -# define AUX_ITER_FOLD_FORWARD_STEP(i, unused) \ +# define AUX_ITER_FOLD_FORWARD_STEP(unused, i, unused2) \ typedef iter_fold_if_forward_step< \ typename BOOST_PP_CAT(forward_step,i)::iterator \ , typename BOOST_PP_CAT(forward_step,i)::state \ @@ -144,7 +144,7 @@ struct iter_fold_if_backward_step > BOOST_PP_CAT(backward_step,BOOST_PP_DEC(i)); \ /**/ -# define AUX_ITER_FOLD_BACKWARD_STEP(i, unused) \ +# define AUX_ITER_FOLD_BACKWARD_STEP(unused, i, unused2) \ AUX_ITER_FOLD_BACKWARD_STEP_FUNC( \ BOOST_PP_SUB_D(1,BOOST_MPL_UNROLLING_LIMIT,i) \ ) \ @@ -170,7 +170,7 @@ struct iter_fold_if_impl { private: typedef iter_fold_if_null_step forward_step0; - BOOST_PP_REPEAT_1ST( + BOOST_PP_REPEAT_1( BOOST_MPL_UNROLLING_LIMIT , AUX_ITER_FOLD_FORWARD_STEP , unused @@ -192,7 +192,7 @@ struct iter_fold_if_impl > >::type AUX_LAST_BACKWARD_STEP; - BOOST_PP_REPEAT_1ST( + BOOST_PP_REPEAT_1( BOOST_MPL_UNROLLING_LIMIT , AUX_ITER_FOLD_BACKWARD_STEP , unused diff --git a/include/boost/mpl/aux_/lambda_arity_param.hpp b/include/boost/mpl/aux_/lambda_arity_param.hpp index a692c53..926e3a3 100644 --- a/include/boost/mpl/aux_/lambda_arity_param.hpp +++ b/include/boost/mpl/aux_/lambda_arity_param.hpp @@ -17,7 +17,7 @@ #ifndef BOOST_MPL_AUX_LAMBDA_ARITY_PARAM_HPP_INCLUDED #define BOOST_MPL_AUX_LAMBDA_ARITY_PARAM_HPP_INCLUDED -#include "boost/mpl/aux_/config/lambda_support.hpp" +#include "boost/mpl/aux_/config/ttp.hpp" #if !defined(BOOST_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) # define BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(param) diff --git a/include/boost/mpl/aux_/lambda_expr.hpp b/include/boost/mpl/aux_/lambda_expr.hpp index f9d3af4..a821e7b 100644 --- a/include/boost/mpl/aux_/lambda_expr.hpp +++ b/include/boost/mpl/aux_/lambda_expr.hpp @@ -17,7 +17,7 @@ #ifndef BOOST_MPL_AUX_LAMBDA_EXPR_HPP_INCLUDED #define BOOST_MPL_AUX_LAMBDA_EXPR_HPP_INCLUDED -#include "boost/mpl/aux_/config/lambda_support.hpp" +#include "boost/mpl/aux_/config/lambda.hpp" #if defined(BOOST_MPL_NO_LAMBDA_HEURISTIC) # define BOOST_MPL_AUX_IS_LAMBDA_EXPR(value) /**/ diff --git a/include/boost/mpl/aux_/lambda_no_ctps.hpp b/include/boost/mpl/aux_/lambda_no_ctps.hpp index 22ef1a3..7210b1a 100644 --- a/include/boost/mpl/aux_/lambda_no_ctps.hpp +++ b/include/boost/mpl/aux_/lambda_no_ctps.hpp @@ -97,7 +97,7 @@ struct lambda #else #define i BOOST_PP_FRAME_ITERATION(1) -# define AUX_LAMBDA_INVOCATION(i, T) \ +# define AUX_LAMBDA_INVOCATION(unused, i, T) \ , typename lambda< \ typename f_::BOOST_PP_CAT(arg,BOOST_PP_INC(i)) \ , false \ diff --git a/include/boost/mpl/aux_/lambda_spec.hpp b/include/boost/mpl/aux_/lambda_spec.hpp index c0f673c..1595388 100644 --- a/include/boost/mpl/aux_/lambda_spec.hpp +++ b/include/boost/mpl/aux_/lambda_spec.hpp @@ -20,7 +20,7 @@ #include "boost/mpl/lambda_fwd.hpp" #include "boost/mpl/aux_/preprocessor/params.hpp" #include "boost/mpl/aux_/lambda_arity_param.hpp" -#include "boost/mpl/aux_/config/lambda_support.hpp" +#include "boost/mpl/aux_/config/lambda.hpp" #if !defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT) diff --git a/include/boost/mpl/aux_/lambda_support.hpp b/include/boost/mpl/aux_/lambda_support.hpp index feff9d6..65c158a 100644 --- a/include/boost/mpl/aux_/lambda_support.hpp +++ b/include/boost/mpl/aux_/lambda_support.hpp @@ -17,7 +17,7 @@ #ifndef BOOST_MPL_AUX_LAMBDA_SUPPORT_HPP_INCLUDED #define BOOST_MPL_AUX_LAMBDA_SUPPORT_HPP_INCLUDED -#include "boost/mpl/aux_/config/lambda_support.hpp" +#include "boost/mpl/aux_/config/lambda.hpp" #if !defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT) diff --git a/include/boost/mpl/aux_/nested_type_wknd.hpp b/include/boost/mpl/aux_/nested_type_wknd.hpp index e771124..51f0252 100644 --- a/include/boost/mpl/aux_/nested_type_wknd.hpp +++ b/include/boost/mpl/aux_/nested_type_wknd.hpp @@ -17,7 +17,11 @@ #ifndef BOOST_MPL_AUX_NESTED_TYPE_WKND_HPP_INCLUDED #define BOOST_MPL_AUX_NESTED_TYPE_WKND_HPP_INCLUDED -#if defined(__GNUC__) || defined(__BORLANDC__) +#include "boost/config.hpp" + +#if defined(__GNUC__) && (__GNUC__ < 3 || __GNUC__ == 3 && __GNUC_MINOR__ <= 2 \ + || !defined(BOOST_STRICT_CONFIG)) \ + || defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) namespace boost { namespace mpl { namespace aux { diff --git a/include/boost/mpl/aux_/sequence_tag.hpp b/include/boost/mpl/aux_/sequence_tag.hpp index a95698d..a0a1fab 100644 --- a/include/boost/mpl/aux_/sequence_tag.hpp +++ b/include/boost/mpl/aux_/sequence_tag.hpp @@ -17,6 +17,7 @@ #ifndef BOOST_MPL_AUX_SEQUENCE_TAG_HPP_INCLUDED #define BOOST_MPL_AUX_SEQUENCE_TAG_HPP_INCLUDED +//#include "boost/mpl/aux_/config/internal.hpp" #include "boost/config.hpp" #if defined(BOOST_MPL_INTERNAL_USE_SEQUENCE_TAG) || \ diff --git a/include/boost/mpl/aux_/traits_lambda_spec.hpp b/include/boost/mpl/aux_/traits_lambda_spec.hpp index a2627e7..e65bb88 100644 --- a/include/boost/mpl/aux_/traits_lambda_spec.hpp +++ b/include/boost/mpl/aux_/traits_lambda_spec.hpp @@ -19,7 +19,7 @@ #include "boost/mpl/void.hpp" #include "boost/mpl/aux_/preprocessor/params.hpp" -#include "boost/mpl/aux_/config/lambda_support.hpp" +#include "boost/mpl/aux_/config/lambda.hpp" #if !defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT) diff --git a/include/boost/mpl/aux_/value_wknd.hpp b/include/boost/mpl/aux_/value_wknd.hpp index 2463412..4fb0283 100644 --- a/include/boost/mpl/aux_/value_wknd.hpp +++ b/include/boost/mpl/aux_/value_wknd.hpp @@ -17,7 +17,9 @@ #ifndef BOOST_MPL_AUX_VALUE_WKND_HPP_INCLUDED #define BOOST_MPL_AUX_VALUE_WKND_HPP_INCLUDED -#if defined(__BORLANDC__) +#include "boost/config.hpp" + +#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) namespace boost { namespace mpl { namespace aux { @@ -29,7 +31,7 @@ struct value_wknd }}} // namespace boost::mpl::aux -# define BOOST_MPL_AUX_VALUE_WKND(C) ::boost::mpl::aux::value_wknd +# define BOOST_MPL_AUX_VALUE_WKND(C) ::boost::mpl::aux::value_wknd< C > #else diff --git a/include/boost/mpl/aux_/void_spec.hpp b/include/boost/mpl/aux_/void_spec.hpp index 820257c..e7425a4 100644 --- a/include/boost/mpl/aux_/void_spec.hpp +++ b/include/boost/mpl/aux_/void_spec.hpp @@ -20,13 +20,13 @@ #include "boost/mpl/void.hpp" #include "boost/mpl/aux_/arity.hpp" #include "boost/mpl/aux_/template_arity_fwd.hpp" -#include "boost/mpl/aux_/config/dtp.hpp" -#include "boost/mpl/aux_/config/ttp.hpp" -#include "boost/mpl/aux_/config/lambda_support.hpp" -#include "boost/mpl/aux_/config/overload_resolution.hpp" #include "boost/mpl/aux_/preprocessor/params.hpp" #include "boost/mpl/aux_/preprocessor/enum.hpp" #include "boost/mpl/aux_/preprocessor/def_params_tail.hpp" +#include "boost/mpl/aux_/config/dtp.hpp" +#include "boost/mpl/aux_/config/ttp.hpp" +#include "boost/mpl/aux_/config/lambda.hpp" +#include "boost/mpl/aux_/config/overload_resolution.hpp" #include "boost/config.hpp" @@ -34,7 +34,7 @@ BOOST_MPL_PP_ENUM(i, void_) \ /**/ -#if defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) +#if defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) # define BOOST_MPL_AUX_VOID_SPEC_ARITY(i, name) \ namespace aux { \ template< int N > \ @@ -49,28 +49,17 @@ struct arity< \ }; \ } \ /**/ -# define BOOST_MPL_AUX_VOID_SPEC_MAIN(i, name) \ -template<> \ -struct name< BOOST_MPL_AUX_VOID_SPEC_PARAMS(i) > \ -{ \ - template< \ - BOOST_MPL_PP_PARAMS(BOOST_MPL_METAFUNCTION_MAX_ARITY, typename T) \ - > \ - struct apply \ - : name< BOOST_MPL_PP_PARAMS(i, T) > \ - { \ - }; \ -}; \ -/**/ #else # define BOOST_MPL_AUX_VOID_SPEC_ARITY(i, name) /**/ -# define BOOST_MPL_AUX_VOID_SPEC_MAIN(i, name) \ +#endif + +#define BOOST_MPL_AUX_VOID_SPEC_MAIN(i, name) \ template<> \ struct name< BOOST_MPL_AUX_VOID_SPEC_PARAMS(i) > \ { \ template< \ BOOST_MPL_PP_PARAMS(i, typename T) \ - BOOST_MPL_PP_DEF_PARAMS_TAIL(i, typename T) \ + BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, typename T, void_) \ > \ struct apply \ : name< BOOST_MPL_PP_PARAMS(i, T) > \ @@ -78,7 +67,6 @@ struct name< BOOST_MPL_AUX_VOID_SPEC_PARAMS(i) > \ }; \ }; \ /**/ -#endif #if defined(BOOST_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) || \ defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT) && \ @@ -90,7 +78,7 @@ struct template_arity< \ name< BOOST_MPL_PP_PARAMS(j, T) > \ > \ { \ - BOOST_STATIC_CONSTANT(int, value = j ); \ + BOOST_STATIC_CONSTANT(int, value = j); \ }; \ \ template<> \ @@ -98,7 +86,7 @@ struct template_arity< \ name< BOOST_MPL_PP_ENUM(i, void_) > \ > \ { \ - BOOST_STATIC_CONSTANT(int, value = j ); \ + BOOST_STATIC_CONSTANT(int, value = -1); \ }; \ } \ /**/ @@ -109,11 +97,6 @@ struct template_arity< \ #define BOOST_MPL_AUX_VOID_SPEC_PARAM(param) param = void_ -// agurt, 16/sep/02: temporary fix for VisualAge C++ -#if defined(__IBMCPP__) -# define BOOST_MPL_AUX_VOID_SPEC(i, name) /**/ -# define BOOST_MPL_AUX_VOID_SPEC_EXT(i, j, name) /**/ -#else #define BOOST_MPL_AUX_VOID_SPEC(i, name) \ BOOST_MPL_AUX_VOID_SPEC_MAIN(i, name) \ BOOST_MPL_AUX_VOID_SPEC_ARITY(i, name) \ @@ -125,6 +108,5 @@ BOOST_MPL_AUX_VOID_SPEC_MAIN(i, name) \ BOOST_MPL_AUX_VOID_SPEC_ARITY(i, name) \ BOOST_MPL_AUX_VOID_SPEC_TEMPLATE_ARITY(i, j, name) \ /**/ -#endif #endif // BOOST_MPL_AUX_VOID_SPEC_HPP_INCLUDED diff --git a/include/boost/mpl/bind.hpp b/include/boost/mpl/bind.hpp index dc34c19..4730285 100644 --- a/include/boost/mpl/bind.hpp +++ b/include/boost/mpl/bind.hpp @@ -23,14 +23,14 @@ #include "boost/mpl/aux_/apply.hpp" #include "boost/mpl/aux_/config/bind.hpp" -#include "boost/mpl/aux_/config/lambda_support.hpp" +#include "boost/mpl/aux_/config/lambda.hpp" #if !defined(BOOST_MPL_PREPROCESSING_MODE) # include "boost/mpl/placeholder.hpp" # include "boost/mpl/void.hpp" # include "boost/mpl/protect.hpp" # include "boost/mpl/limits/arity.hpp" -# include "boost/mpl/aux_/arity.hpp" +# include "boost/mpl/aux_/arity_spec.hpp" # include "boost/mpl/aux_/type_wrapper.hpp" # include "boost/mpl/aux_/yes_no.hpp" # include "boost/type_traits/same_traits.hpp" @@ -101,6 +101,16 @@ namespace mpl { ) \ /**/ +#if !defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) +# define AUX_BIND_NESTED_DEFAULT_PARAMS(param, value) \ + AUX_BIND_DEFAULT_PARAMS(param, value) \ + /**/ +#else +# define AUX_BIND_NESTED_DEFAULT_PARAMS(param, value) \ + AUX_BIND_PARAMS(param) \ + /**/ +#endif + namespace aux { #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) @@ -208,11 +218,13 @@ struct replace_unnamed_arg } // namespace aux +#if !defined(BOOST_MPL_NO_BIND_TEMPLATE) // forward declaration template< typename F, AUX_BIND_DEFAULT_PARAMS(typename T, void_) > struct bind; +#endif // fwd, for 'resolve_bind_arg'/'is_bind_template' specializations template< typename F, typename T > struct bind1st; @@ -229,6 +241,7 @@ struct resolve_bind_arg< arg,AUX_BIND_PARAMS(U) > typedef typename AUX_APPLY((arg, AUX_BIND_PARAMS(U)))::type type; }; +#if !defined(BOOST_MPL_NO_BIND_TEMPLATE) template< typename F, AUX_BIND_PARAMS(typename T), AUX_BIND_PARAMS(typename U) > @@ -237,6 +250,7 @@ struct resolve_bind_arg< bind,AUX_BIND_PARAMS(U) > typedef bind f_; typedef typename AUX_APPLY((f_, AUX_BIND_PARAMS(U)))::type type; }; +#endif template< typename F, typename T, AUX_BIND_PARAMS(typename U) @@ -268,10 +282,12 @@ template< typename T > aux::no_tag is_bind_helper(protect*); // agurt, 15/mar/02: MSVC 6.5 fails to properly resolve the overload // in case if we use 'aux::type_wrapper< bind<...> >' here, and all // 'bind' instantiations form a complete type anyway +#if !defined(BOOST_MPL_NO_BIND_TEMPLATE) template< typename F, AUX_BIND_PARAMS(typename T) > aux::yes_tag is_bind_helper(bind*); +#endif template< int N > aux::yes_tag is_bind_helper(arg*); @@ -289,46 +305,25 @@ template< typename T > struct is_bind_template #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -#if defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) -// MWCW/Borland workaround - -template< - typename F, AUX_BIND_PARAMS(typename T), int N - > -struct arity< bind,N > -{ - BOOST_STATIC_CONSTANT(int - , value = BOOST_MPL_METAFUNCTION_MAX_ARITY - ); -}; - -template< typename F, typename T, int N > -struct arity< bind1st,N > -{ - BOOST_STATIC_CONSTANT(int - , value = BOOST_MPL_METAFUNCTION_MAX_ARITY - ); -}; - -template< typename F, typename T, int N > -struct arity< bind2nd,N > -{ - BOOST_STATIC_CONSTANT(int - , value = BOOST_MPL_METAFUNCTION_MAX_ARITY - ); -}; - -#endif // BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES - } // namespace aux +#if !defined(BOOST_MPL_NO_BIND_TEMPLATE) +BOOST_MPL_AUX_ARITY_SPEC( + BOOST_PP_INC(BOOST_MPL_METAFUNCTION_MAX_ARITY) + , bind + ) +#endif + +BOOST_MPL_AUX_ARITY_SPEC(2,bind1st) +BOOST_MPL_AUX_ARITY_SPEC(2,bind2nd) + #define BOOST_PP_ITERATION_PARAMS_1 \ (3,(0, BOOST_MPL_METAFUNCTION_MAX_ARITY, "boost/mpl/bind.hpp")) #include BOOST_PP_ITERATE() // real C++ version is already taken care of #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ - && !defined(BOOST_MPL_NO_BIND_TEMPLATE) + && !defined(BOOST_MPL_NO_BIND_TEMPLATE) namespace aux { // apply_count_args @@ -350,14 +345,14 @@ struct bind }; #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - // && !defined(BOOST_MPL_NO_BIND_TEMPLATE) // bind1st/bind2nd, lightweight, for simple cases/backward compatibility template< typename F, typename T > struct bind1st { template< - typename U BOOST_MPL_PP_DEF_PARAMS_TAIL(1, typename U) + typename U + BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(1, typename U, void_) > struct apply : BOOST_MPL_AUX_APPLY2(F,T,U) @@ -369,7 +364,8 @@ template< typename F, typename T > struct bind2nd { template< - typename U BOOST_MPL_PP_DEF_PARAMS_TAIL(1, typename U) + typename U + BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(1, typename U, void_) > struct apply : BOOST_MPL_AUX_APPLY2(F,U,T) @@ -377,6 +373,7 @@ struct bind2nd }; }; +# undef AUX_BIND_NESTED_DEFAULT_PARAMS # undef AUX_BIND_N_SPEC_PARAMS # undef AUX_BIND_N_PARAMS # undef AUX_BIND_DEFAULT_PARAMS @@ -401,7 +398,7 @@ template< struct BOOST_PP_CAT(bind,i) { template< - AUX_BIND_DEFAULT_PARAMS(typename U, void_) + AUX_BIND_NESTED_DEFAULT_PARAMS(typename U, void_) > struct apply { @@ -418,8 +415,10 @@ struct BOOST_PP_CAT(bind,i) # endif // BOOST_MPL_NO_UNNAMED_PLACEHOLDER_SUPPORT +# if i > 0 # define BOOST_PP_ITERATION_PARAMS_2 (3,(1, i, "boost/mpl/bind.hpp")) # include BOOST_PP_ITERATE() +# endif public: typedef typename BOOST_MPL_AUX_APPLY( @@ -455,27 +454,14 @@ is_bind_helper(BOOST_PP_CAT(bind,i)*); #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - -// MWCW/Borland workaround -#if defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) -template< - typename F AUX_BIND_N_PARAMS(i, typename T), int N - > -struct arity< - BOOST_PP_CAT(bind,i), N - > -{ - BOOST_STATIC_CONSTANT(int - , value = BOOST_MPL_METAFUNCTION_MAX_ARITY - ); -}; -#endif - } // namespace aux +BOOST_MPL_AUX_ARITY_SPEC(BOOST_PP_INC(i), BOOST_PP_CAT(bind,i)) + +# if !defined(BOOST_MPL_NO_BIND_TEMPLATE) # if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - + #if i == BOOST_MPL_METAFUNCTION_MAX_ARITY //: primary template (not a specialization!) @@ -518,6 +504,7 @@ struct bind_impl_chooser } // namespace aux # endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# endif // BOOST_MPL_NO_BIND_TEMPLATE # undef i diff --git a/include/boost/mpl/distance.hpp b/include/boost/mpl/distance.hpp index c03ff97..2abeb08 100644 --- a/include/boost/mpl/distance.hpp +++ b/include/boost/mpl/distance.hpp @@ -58,12 +58,13 @@ template< , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(Last) > struct distance - : aux::distance_impl< +{ + // agurt, 29/sep/02: Borland doesn't like inheritance here + typedef typename aux::distance_impl< typename BOOST_MPL_AUX_ITERATOR_CATEGORY(First) , First , Last - > -{ + >::type type; }; #else diff --git a/include/boost/mpl/int_c.hpp b/include/boost/mpl/int_c.hpp index 37cb294..149a5b6 100644 --- a/include/boost/mpl/int_c.hpp +++ b/include/boost/mpl/int_c.hpp @@ -30,13 +30,22 @@ struct int_c typedef int value_type; // have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC), - // while some other don't like 'value + 1' (Borland) -#if !defined(__BORLANDC__) - typedef int_c next; - typedef int_c prior; + // while some other don't like 'value + 1' (Borland), and some don't like + // either +#if defined(__EDG_VERSION__) && __EDG_VERSION__ <= 243 + private: + BOOST_STATIC_CONSTANT(T, next_value = (N + 1)); + BOOST_STATIC_CONSTANT(T, prior_value = (N - 1)); + public: + typedef int_c next; + typedef int_c prior; +#elif defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \ + || defined(__IBMCPP__) && (__IBMCPP__ <= 502 || !defined(BOOST_STRICT_CONFIG)) + typedef int_c<(N + 1)> next; + typedef int_c<(N - 1)> prior; #else - typedef int_c next; - typedef int_c prior; + typedef int_c<(value + 1)> next; + typedef int_c<(value - 1)> prior; #endif operator int() const { return this->value; } diff --git a/include/boost/mpl/integral_c.hpp b/include/boost/mpl/integral_c.hpp index a5eea33..15cfd47 100644 --- a/include/boost/mpl/integral_c.hpp +++ b/include/boost/mpl/integral_c.hpp @@ -30,7 +30,8 @@ struct integral_c typedef T value_type; // have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC), - // while some other don't like 'value + 1' (Borland) + // while some other don't like 'value + 1' (Borland), and some don't like + // either #if defined(__EDG_VERSION__) && __EDG_VERSION__ <= 243 private: BOOST_STATIC_CONSTANT(T, next_value = (N + 1)); @@ -38,7 +39,8 @@ struct integral_c public: typedef integral_c next; typedef integral_c prior; -#elif defined(__BORLANDC__) || defined(__IBMCPP__) +#elif defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \ + || defined(__IBMCPP__) && (__IBMCPP__ <= 502 || !defined(BOOST_STRICT_CONFIG)) typedef integral_c next; typedef integral_c prior; #else @@ -54,8 +56,7 @@ struct integral_c }; #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ - && (!defined(BOOST_MSVC) || BOOST_MSVC != 1301) \ - && !defined(__BORLANDC__) + && !defined(__BORLANDC__) || __BORLANDC__ > 0x551 // 'bool' constant doesn't have 'next'/'prior' members template< bool C > struct integral_c diff --git a/include/boost/mpl/lambda.hpp b/include/boost/mpl/lambda.hpp index 3914cfa..8a46c0a 100644 --- a/include/boost/mpl/lambda.hpp +++ b/include/boost/mpl/lambda.hpp @@ -17,7 +17,7 @@ #ifndef BOOST_MPL_LAMBDA_HPP_INCLUDED #define BOOST_MPL_LAMBDA_HPP_INCLUDED -#include "boost/mpl/aux_/config/lambda_support.hpp" +#include "boost/mpl/aux_/config/lambda.hpp" #if !defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT) # include "boost/mpl/aux_/full_lambda.hpp" diff --git a/include/boost/mpl/lambda_helper.hpp b/include/boost/mpl/lambda_helper.hpp index 3a87fab..4d3efba 100644 --- a/include/boost/mpl/lambda_helper.hpp +++ b/include/boost/mpl/lambda_helper.hpp @@ -58,7 +58,7 @@ namespace mpl { #else #define i BOOST_PP_FRAME_ITERATION(1) -#define MPL_AUX_ARG_TYPEDEF(i, T) \ +#define MPL_AUX_ARG_TYPEDEF(unused, i, T) \ typedef BOOST_PP_CAT(T, BOOST_PP_INC(i)) \ BOOST_PP_CAT(arg, BOOST_PP_INC(i)); \ /**/ diff --git a/include/boost/mpl/lower_bound.hpp b/include/boost/mpl/lower_bound.hpp index d30a56b..cf210fd 100644 --- a/include/boost/mpl/lower_bound.hpp +++ b/include/boost/mpl/lower_bound.hpp @@ -25,6 +25,7 @@ #include "boost/mpl/apply_if.hpp" #include "boost/mpl/aux_/apply.hpp" #include "boost/mpl/aux_/deref_wknd.hpp" +#include "boost/mpl/aux_/value_wknd.hpp" #include "boost/mpl/aux_/void_spec.hpp" namespace boost { @@ -69,9 +70,9 @@ struct lower_bound_step , typename BOOST_MPL_AUX_DEREF_WNKD(middle_) , T )::type - , typename lower_bound_step + , typename lower_bound_step< Distance - BOOST_MPL_AUX_VALUE_WKND(offset_)::value - 1 > ::template result_< Predicate,T,next > - , typename lower_bound_step + , typename lower_bound_step< BOOST_MPL_AUX_VALUE_WKND(offset_)::value > ::template result_< Predicate,T,DeferredIterator > >::type type; }; @@ -90,7 +91,7 @@ struct lower_bound typedef typename lambda::type pred_; public: - typedef typename aux::lower_bound_step< size::value > + typedef typename aux::lower_bound_step< BOOST_MPL_AUX_VALUE_WKND(size)::value > ::template result_< pred_,T,begin >::type type; }; diff --git a/include/boost/mpl/placeholder.hpp b/include/boost/mpl/placeholder.hpp index f247cc8..5e8d16c 100644 --- a/include/boost/mpl/placeholder.hpp +++ b/include/boost/mpl/placeholder.hpp @@ -60,11 +60,6 @@ using boost::mpl::_; } // namespace mpl } // namespace boost -#if !defined(_) || defined(BOOST_MPL_NO_UNNAMED_PLACEHOLDER_SUPPORT) -//: injecting the unnumbered placeholder into global namespace -using boost::mpl::_; -#endif - #endif // BOOST_MPL_USE_PREPROCESSED_HEADERS #endif // BOOST_MPL_PLACEHOLDER_HPP_INCLUDED diff --git a/include/boost/mpl/protect.hpp b/include/boost/mpl/protect.hpp index 79b31ad..76fdb8a 100644 --- a/include/boost/mpl/protect.hpp +++ b/include/boost/mpl/protect.hpp @@ -29,14 +29,14 @@ struct protect : T typedef protect type; }; -#if defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) -namespace aux { -template< typename T, int N > -struct arity< protect, N > +#if defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) +namespace aux { +template< int N, typename T > +struct arity< protect, N > : arity -{ +{ }; -} +} // namespace aux #endif } // namespace mpl diff --git a/include/boost/mpl/same_as.hpp b/include/boost/mpl/same_as.hpp index f5c1a59..a83e22f 100644 --- a/include/boost/mpl/same_as.hpp +++ b/include/boost/mpl/same_as.hpp @@ -28,7 +28,7 @@ template< typename T1 > struct same_as { template< typename T2 > struct apply -#if !defined(__BORLANDC__) +#if !defined(__BORLANDC__) || (__BORLANDC__ > 0x551 && defined(BOOST_STRICT_CONFIG)) : is_same { #else @@ -42,7 +42,7 @@ template< typename T1 > struct not_same_as { template< typename T2 > struct apply -#if !defined(__BORLANDC__) +#if !defined(__BORLANDC__) || (__BORLANDC__ > 0x51 && defined(BOOST_STRICT_CONFIG)) : logical_not< is_same > { #else diff --git a/include/boost/mpl/sizeof.hpp b/include/boost/mpl/sizeof.hpp new file mode 100644 index 0000000..ef60131 --- /dev/null +++ b/include/boost/mpl/sizeof.hpp @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------------- +// boost mpl/sizeof.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2001-02 +// 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. + +#ifndef BOOST_MPL_SIZEOF_HPP_INCLUDED +#define BOOST_MPL_SIZEOF_HPP_INCLUDED + +#include "boost/mpl/size_t_c.hpp" +#include "boost/mpl/aux_/void_spec.hpp" +#include "boost/mpl/aux_/lambda_support.hpp" + +#include // for std::size_t + +namespace boost { +namespace mpl { + +template< + typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T) + > +struct sizeof_ + : size_t_c +{ + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,sizeof_,(T)) +}; + +BOOST_MPL_AUX_VOID_SPEC(1, sizeof_) + +} // namespace mpl +} // namespace boost + +#endif // BOOST_MPL_SIZEOF_HPP_INCLUDED diff --git a/include/boost/mpl/unique.hpp b/include/boost/mpl/unique.hpp index d30fa01..0403d22 100644 --- a/include/boost/mpl/unique.hpp +++ b/include/boost/mpl/unique.hpp @@ -30,6 +30,7 @@ #include "boost/mpl/void.hpp" #include "boost/mpl/aux_/void_spec.hpp" #include "boost/mpl/aux_/lambda_spec.hpp" +#include "boost/mpl/aux_/config/eti.hpp" #include "boost/type_traits/is_same.hpp" namespace boost { @@ -75,9 +76,13 @@ struct unique >::type fold_result_; public: +#if defined(BOOST_MPL_MSVC_ETI_BUG) // MSVC6.5 forces us to use 'select1st::type' instead of // simple 'fold_result_::first' here typedef typename select1st::type type; +#else + typedef typename fold_result_::first type; +#endif }; BOOST_MPL_AUX_VOID_SPEC(1, unique) diff --git a/include/boost/mpl/upper_bound.hpp b/include/boost/mpl/upper_bound.hpp index 183208f..f1c6a00 100644 --- a/include/boost/mpl/upper_bound.hpp +++ b/include/boost/mpl/upper_bound.hpp @@ -26,6 +26,7 @@ #include "boost/mpl/apply.hpp" #include "boost/mpl/aux_/apply.hpp" #include "boost/mpl/aux_/deref_wknd.hpp" +#include "boost/mpl/aux_/value_wknd.hpp" #include "boost/mpl/aux_/void_spec.hpp" namespace boost { @@ -70,9 +71,9 @@ struct upper_bound_step , T , typename BOOST_MPL_AUX_DEREF_WNKD(middle_) )::type - , typename upper_bound_step + , typename upper_bound_step< BOOST_MPL_AUX_VALUE_WKND(offset_)::value > ::template result_< Predicate,T,DeferredIterator > - , typename upper_bound_step + , typename upper_bound_step< Distance - BOOST_MPL_AUX_VALUE_WKND(offset_)::value - 1 > ::template result_< Predicate,T,next > >::type type; }; @@ -91,7 +92,7 @@ struct upper_bound typedef typename lambda::type pred_; public: - typedef typename aux::upper_bound_step< size::value > + typedef typename aux::upper_bound_step< BOOST_MPL_AUX_VALUE_WKND(size)::value > ::template result_< pred_,T,begin >::type type; }; diff --git a/include/boost/mpl/void.hpp b/include/boost/mpl/void.hpp index d3250e7..2f6c06b 100644 --- a/include/boost/mpl/void.hpp +++ b/include/boost/mpl/void.hpp @@ -17,18 +17,31 @@ #ifndef BOOST_MPL_VOID_HPP_INCLUDED #define BOOST_MPL_VOID_HPP_INCLUDED +#include "boost/mpl/bool_c.hpp" +#include "boost/config.hpp" + namespace boost { namespace mpl { struct void_; -namespace aux { -template< typename > struct reject_if_void_ { enum { value = 1 }; }; -template<> struct reject_if_void_; // never defined +template< typename T > +struct is_void_ + : false_c +{ +#if defined(BOOST_MSVC) && BOOST_MSVC < 1300 + using false_c::value; +#endif +}; -template< typename > struct reject_if_not_void_; // never defined -template<> struct reject_if_not_void_ { enum { value = 1 }; }; -} +template<> +struct is_void_ + : true_c +{ +#if defined(BOOST_MSVC) && BOOST_MSVC < 1300 + using true_c::value; +#endif +}; } // namespace mpl } // namespace boost