diff --git a/include/boost/lambda/bind.hpp b/include/boost/lambda/bind.hpp index 7f4e92a..623c33e 100644 --- a/include/boost/lambda/bind.hpp +++ b/include/boost/lambda/bind.hpp @@ -20,5 +20,5 @@ #include "boost/lambda/core.hpp" #include "boost/lambda/detail/bind_functions.hpp" - + #endif diff --git a/include/boost/lambda/casts.hpp b/include/boost/lambda/casts.hpp index 366e738..6f8bbec 100644 --- a/include/boost/lambda/casts.hpp +++ b/include/boost/lambda/casts.hpp @@ -158,8 +158,8 @@ inline const lambda_functor< ll_const_cast(const Arg1& a1) { return lambda_functor_base< - action<1, cast_action > >, - tuple::type> + action<1, cast_action > >, + tuple::type> > ( tuple::type>(a1)); } @@ -176,7 +176,7 @@ ll_reinterpret_cast(const Arg1& a1) { return lambda_functor_base< action<1, cast_action > >, - tuple::type> + tuple::type> > ( tuple::type>(a1)); } @@ -213,7 +213,7 @@ ll_sizeof(const lambda_functor& a1) { return lambda_functor_base< action<1, sizeof_action>, - tuple > + tuple > > ( tuple >(a1)); } diff --git a/include/boost/lambda/core.hpp b/include/boost/lambda/core.hpp index ef9f856..06738aa 100644 --- a/include/boost/lambda/core.hpp +++ b/include/boost/lambda/core.hpp @@ -57,9 +57,9 @@ namespace { boost::lambda::placeholder2_type free2 = boost::lambda::placeholder2_type(); boost::lambda::placeholder3_type free3 = boost::lambda::placeholder3_type(); - boost::lambda::placeholder1_type& _1 = free1; - boost::lambda::placeholder2_type& _2 = free2; - boost::lambda::placeholder3_type& _3 = free3; + boost::lambda::placeholder1_type& _1 = free1; + boost::lambda::placeholder2_type& _2 = free2; + boost::lambda::placeholder3_type& _3 = free3; // _1, _2, ... naming scheme by Peter Dimov } // unnamed diff --git a/include/boost/lambda/detail/arity_code.hpp b/include/boost/lambda/detail/arity_code.hpp index 05ec77c..41dc7b6 100644 --- a/include/boost/lambda/detail/arity_code.hpp +++ b/include/boost/lambda/detail/arity_code.hpp @@ -32,12 +32,12 @@ namespace lambda { // freeE placeholders and maybe free1 and free2 (EXCEPTION). // RETHROW means, that a rethrow expression is used somewhere in the lambda_functor. -enum { NONE = 0x00, // Notice we are using bits as flags here. - FIRST = 0x01, - SECOND = 0x02, - THIRD = 0x04, - EXCEPTION = 0x08, - RETHROW = 0x10}; +enum { NONE = 0x00, // Notice we are using bits as flags here. + FIRST = 0x01, + SECOND = 0x02, + THIRD = 0x04, + EXCEPTION = 0x08, + RETHROW = 0x10}; template diff --git a/include/boost/lambda/detail/control_structures_impl.hpp b/include/boost/lambda/detail/control_structures_impl.hpp index 5373d03..7ce428e 100644 --- a/include/boost/lambda/detail/control_structures_impl.hpp +++ b/include/boost/lambda/detail/control_structures_impl.hpp @@ -202,21 +202,21 @@ inline const other_action, tuple, typename const_copy_argument::type, - typename const_copy_argument::type> + typename const_copy_argument::type> > > if_then_else_return(const lambda_functor& a1, - const Arg2 & a2, - const Arg3 & a3) { + const Arg2 & a2, + const Arg3 & a3) { return lambda_functor_base< other_action, tuple, typename const_copy_argument::type, - typename const_copy_argument::type> + typename const_copy_argument::type> > ( tuple, typename const_copy_argument::type, - typename const_copy_argument::type> (a1, a2, a3) ); + typename const_copy_argument::type> (a1, a2, a3) ); } namespace detail { @@ -271,7 +271,7 @@ struct return_type_2_ifthenelsereturn<1, false, false, false, A, B> { 2, boost::is_convertible::value, boost::is_convertible::value, - boost::is_same::value, + boost::is_same::value, plainA, plainB>::type type; }; @@ -445,7 +445,7 @@ public: template RET call(CALL_FORMAL_ARGS) const { - while(detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS)) {} + while(detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS)) {} } }; @@ -480,7 +480,7 @@ public: template RET call(CALL_FORMAL_ARGS) const { - do {} while (detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS) ); + do {} while (detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS) ); } }; @@ -527,7 +527,7 @@ lambda_functor_base, Args> { public: Args args; - template struct sig { + template struct sig { private: typedef typename detail::nth_return_type_sig<1, Args, SigArgs>::type ret1; typedef typename detail::nth_return_type_sig<2, Args, SigArgs>::type ret2; diff --git a/include/boost/lambda/detail/is_instance_of.hpp b/include/boost/lambda/detail/is_instance_of.hpp index 0c88a5f..e784e28 100644 --- a/include/boost/lambda/detail/is_instance_of.hpp +++ b/include/boost/lambda/detail/is_instance_of.hpp @@ -56,30 +56,30 @@ namespace boost { namespace lambda { -#define BOOST_LAMBDA_IS_INSTANCE_OF_TEMPLATE(INDEX) \ - \ -namespace detail { \ - \ -template class F> \ -struct BOOST_PP_CAT(conversion_tester_,INDEX) { \ - template \ - BOOST_PP_CAT(conversion_tester_,INDEX) \ - (const F&); \ -}; \ - \ -} /* end detail */ \ - \ +#define BOOST_LAMBDA_IS_INSTANCE_OF_TEMPLATE(INDEX) \ + \ +namespace detail { \ + \ +template class F> \ +struct BOOST_PP_CAT(conversion_tester_,INDEX) { \ + template \ + BOOST_PP_CAT(conversion_tester_,INDEX) \ + (const F&); \ +}; \ + \ +} /* end detail */ \ + \ template class To> \ -struct BOOST_PP_CAT(is_instance_of_,INDEX) \ -{ \ - private: \ - typedef ::boost::is_convertible< \ - From, \ - BOOST_PP_CAT(detail::conversion_tester_,INDEX) \ - > helper_type; \ - \ -public: \ - BOOST_STATIC_CONSTANT(bool, value = helper_type::value); \ +struct BOOST_PP_CAT(is_instance_of_,INDEX) \ +{ \ + private: \ + typedef ::boost::is_convertible< \ + From, \ + BOOST_PP_CAT(detail::conversion_tester_,INDEX) \ + > helper_type; \ + \ +public: \ + BOOST_STATIC_CONSTANT(bool, value = helper_type::value); \ }; diff --git a/include/boost/lambda/detail/lambda_functor_base.hpp b/include/boost/lambda/detail/lambda_functor_base.hpp index 5b31d56..7f534a1 100644 --- a/include/boost/lambda/detail/lambda_functor_base.hpp +++ b/include/boost/lambda/detail/lambda_functor_base.hpp @@ -332,58 +332,58 @@ public: // Function actions, casts, throws,... all go via these classes. -template -class lambda_functor_base, Args> -{ -public: +template +class lambda_functor_base, Args> +{ +public: // Args args; not needed - explicit lambda_functor_base(const Args& a) {} - - template struct sig { + explicit lambda_functor_base(const Args& a) {} + + template struct sig { typedef typename return_type_N::type type; }; - - template - RET call(CALL_FORMAL_ARGS) const { + + template + RET call(CALL_FORMAL_ARGS) const { return Act::template apply(); } }; -#if defined BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART +#if defined BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART #error "Multiple defines of BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART" -#endif - - -#define BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(ARITY) \ -template \ -class lambda_functor_base, Args> \ -{ \ -public: \ - Args args; \ - \ - explicit lambda_functor_base(const Args& a) : args(a) {} \ - \ - template struct sig { \ - typedef typename \ - detail::deduce_non_ref_argument_types::type rets_t; \ - public: \ - typedef typename \ - return_type_N_prot::type type; \ - }; \ - \ - \ - template \ - RET call(CALL_FORMAL_ARGS) const { \ - using boost::tuples::get; \ - using detail::constify_rvals; \ - using detail::r_select; \ - using detail::element_or_null; \ +#endif + + +#define BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(ARITY) \ +template \ +class lambda_functor_base, Args> \ +{ \ +public: \ + Args args; \ + \ + explicit lambda_functor_base(const Args& a) : args(a) {} \ + \ + template struct sig { \ + typedef typename \ + detail::deduce_non_ref_argument_types::type rets_t; \ + public: \ + typedef typename \ + return_type_N_prot::type type; \ + }; \ + \ + \ + template \ + RET call(CALL_FORMAL_ARGS) const { \ + using boost::tuples::get; \ + using detail::constify_rvals; \ + using detail::r_select; \ + using detail::element_or_null; \ using detail::deduce_argument_types; BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(1) - typedef typename + typedef typename deduce_argument_types >::type rets_t; typedef typename element_or_null<0, rets_t>::type rt0; @@ -396,7 +396,7 @@ BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(1) BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(2) - typedef typename + typedef typename deduce_argument_types >::type rets_t; typedef typename element_or_null<0, rets_t>::type rt0; typedef typename element_or_null<1, rets_t>::type rt1; @@ -410,7 +410,7 @@ BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(2) BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(3) - typedef typename + typedef typename deduce_argument_types >::type rets_t; typedef typename element_or_null<0, rets_t>::type rt0; @@ -426,7 +426,7 @@ BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(3) }; BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(4) - typedef typename + typedef typename deduce_argument_types >::type rets_t; typedef typename element_or_null<0, rets_t>::type rt0; typedef typename element_or_null<1, rets_t>::type rt1; @@ -443,7 +443,7 @@ BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(4) }; BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(5) - typedef typename + typedef typename deduce_argument_types >::type rets_t; typedef typename element_or_null<0, rets_t>::type rt0; typedef typename element_or_null<1, rets_t>::type rt1; @@ -463,7 +463,7 @@ BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(5) BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(6) - typedef typename + typedef typename deduce_argument_types >::type rets_t; typedef typename element_or_null<0, rets_t>::type rt0; typedef typename element_or_null<1, rets_t>::type rt1; @@ -485,7 +485,7 @@ BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(6) }; BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(7) - typedef typename + typedef typename deduce_argument_types >::type rets_t; typedef typename element_or_null<0, rets_t>::type rt0; typedef typename element_or_null<1, rets_t>::type rt1; @@ -509,7 +509,7 @@ BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(7) }; BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(8) - typedef typename + typedef typename deduce_argument_types >::type rets_t; typedef typename element_or_null<0, rets_t>::type rt0; typedef typename element_or_null<1, rets_t>::type rt1; @@ -534,7 +534,7 @@ BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(8) }; BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(9) - typedef typename + typedef typename deduce_argument_types >::type rets_t; typedef typename element_or_null<0, rets_t>::type rt0; typedef typename element_or_null<1, rets_t>::type rt1; @@ -561,7 +561,7 @@ BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(9) }; BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(10) - typedef typename + typedef typename deduce_argument_types >::type rets_t; typedef typename element_or_null<0, rets_t>::type rt0; typedef typename element_or_null<1, rets_t>::type rt1; diff --git a/include/boost/lambda/detail/lambda_functors.hpp b/include/boost/lambda/detail/lambda_functors.hpp index e68d747..b34ccb7 100644 --- a/include/boost/lambda/detail/lambda_functors.hpp +++ b/include/boost/lambda/detail/lambda_functors.hpp @@ -178,33 +178,33 @@ public: sig >::type>(CALL_ACTUAL_ARGS); } - template - const lambda_functor, - boost::tuple + const lambda_functor, + boost::tuple::type> > > - operator=(const A& a) const { - return lambda_functor_base< - other_action, - boost::tuple, + boost::tuple::type> > - ( boost::tuple::type>(*this, a) ); - } + ( boost::tuple::type>(*this, a) ); + } - template - const lambda_functor, - boost::tuple::type> > > - operator[](const A& a) const { - return lambda_functor_base< - other_action, - boost::tuple + const lambda_functor, + boost::tuple::type> > > + operator[](const A& a) const { + return lambda_functor_base< + other_action, + boost::tuple::type> > - ( boost::tuple::type>(*this, a ) ); - } + } }; diff --git a/include/boost/lambda/detail/lambda_traits.hpp b/include/boost/lambda/detail/lambda_traits.hpp index 644290d..071cb81 100644 --- a/include/boost/lambda/detail/lambda_traits.hpp +++ b/include/boost/lambda/detail/lambda_traits.hpp @@ -529,4 +529,4 @@ template inline const T& make_const(const T& t) { return t; } -#endif // BOOST_LAMBDA_TRAITS_HPP +#endif // BOOST_LAMBDA_TRAITS_HPP diff --git a/include/boost/lambda/detail/operator_lambda_func_base.hpp b/include/boost/lambda/detail/operator_lambda_func_base.hpp index 190733a..fa09591 100644 --- a/include/boost/lambda/detail/operator_lambda_func_base.hpp +++ b/include/boost/lambda/detail/operator_lambda_func_base.hpp @@ -43,13 +43,13 @@ public: template struct sig { private: - typedef typename + typedef typename detail::deduce_argument_types::type rets_t; - public: + public: typedef typename return_type_2_comma< // comma needs special handling typename detail::element_or_null<0, rets_t>::type, typename detail::element_or_null<1, rets_t>::type - >::type type; + >::type type; }; }; @@ -61,27 +61,27 @@ namespace detail { template class binary_rt { private: - typedef typename + typedef typename detail::deduce_argument_types::type rets_t; - public: + public: typedef typename return_type_2_prot< Action, typename detail::element_or_null<0, rets_t>::type, typename detail::element_or_null<1, rets_t>::type - >::type type; + >::type type; }; // same for unary actions template class unary_rt { private: - typedef typename + typedef typename detail::deduce_argument_types::type rets_t; - public: + public: typedef typename return_type_1_prot< Action, typename detail::element_or_null<0, rets_t>::type - >::type type; + >::type type; }; @@ -102,7 +102,7 @@ public: detail::select(boost::tuples::get<1>(args), CALL_ACTUAL_ARGS); } template struct sig { - typedef typename + typedef typename detail::binary_rt, Args, SigArgs>::type type; }; }; @@ -123,7 +123,7 @@ public: } template struct sig { - typedef typename + typedef typename detail::binary_rt, Args, SigArgs>::type type; }; }; @@ -143,69 +143,69 @@ public: } template struct sig { - typedef typename + typedef typename detail::binary_rt, Args, SigArgs>::type type; }; }; -#define BOOST_LAMBDA_BINARY_ACTION(SYMBOL, ACTION_CLASS) \ -template \ -class lambda_functor_base { \ -public: \ - Args args; \ -public: \ - explicit lambda_functor_base(const Args& a) : args(a) {} \ - \ - template \ - RET call(CALL_FORMAL_ARGS) const { \ +#define BOOST_LAMBDA_BINARY_ACTION(SYMBOL, ACTION_CLASS) \ +template \ +class lambda_functor_base { \ +public: \ + Args args; \ +public: \ + explicit lambda_functor_base(const Args& a) : args(a) {} \ + \ + template \ + RET call(CALL_FORMAL_ARGS) const { \ return detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS) \ - SYMBOL \ + SYMBOL \ detail::select(boost::tuples::get<1>(args), CALL_ACTUAL_ARGS); \ - } \ - template struct sig { \ - typedef typename \ - detail::binary_rt::type type; \ - }; \ + } \ + template struct sig { \ + typedef typename \ + detail::binary_rt::type type; \ + }; \ }; -#define BOOST_LAMBDA_PREFIX_UNARY_ACTION(SYMBOL, ACTION_CLASS) \ -template \ -class lambda_functor_base { \ -public: \ - Args args; \ -public: \ - explicit lambda_functor_base(const Args& a) : args(a) {} \ - \ - template \ - RET call(CALL_FORMAL_ARGS) const { \ - return SYMBOL \ +#define BOOST_LAMBDA_PREFIX_UNARY_ACTION(SYMBOL, ACTION_CLASS) \ +template \ +class lambda_functor_base { \ +public: \ + Args args; \ +public: \ + explicit lambda_functor_base(const Args& a) : args(a) {} \ + \ + template \ + RET call(CALL_FORMAL_ARGS) const { \ + return SYMBOL \ detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); \ - } \ - template struct sig { \ - typedef typename \ - detail::unary_rt::type type; \ - }; \ + } \ + template struct sig { \ + typedef typename \ + detail::unary_rt::type type; \ + }; \ }; -#define BOOST_LAMBDA_POSTFIX_UNARY_ACTION(SYMBOL, ACTION_CLASS) \ -template \ -class lambda_functor_base { \ -public: \ - Args args; \ -public: \ - explicit lambda_functor_base(const Args& a) : args(a) {} \ - \ - template \ - RET call(CALL_FORMAL_ARGS) const { \ - return \ +#define BOOST_LAMBDA_POSTFIX_UNARY_ACTION(SYMBOL, ACTION_CLASS) \ +template \ +class lambda_functor_base { \ +public: \ + Args args; \ +public: \ + explicit lambda_functor_base(const Args& a) : args(a) {} \ + \ + template \ + RET call(CALL_FORMAL_ARGS) const { \ + return \ detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS) SYMBOL; \ - } \ - template struct sig { \ - typedef typename \ - detail::unary_rt::type type; \ - }; \ + } \ + template struct sig { \ + typedef typename \ + detail::unary_rt::type type; \ + }; \ }; BOOST_LAMBDA_BINARY_ACTION(+,arithmetic_action) diff --git a/include/boost/lambda/detail/operator_return_type_traits.hpp b/include/boost/lambda/detail/operator_return_type_traits.hpp index 61ffb0c..a6493e2 100644 --- a/include/boost/lambda/detail/operator_return_type_traits.hpp +++ b/include/boost/lambda/detail/operator_return_type_traits.hpp @@ -87,11 +87,11 @@ template <> struct promote_to_int { typedef int type; }; // of unsigned short int, otherwise go to unsigned int. template <> struct promote_to_int { - typedef - detail::IF" messes up the parsing. - unsigned int, - int>::RET type; + unsigned int, + int>::RET type; }; @@ -490,22 +490,22 @@ struct return_type_2_arithmetic_phase_2 { // struct so I don't have to type this twice. struct promotion_of_unsigned_int { - typedef - detail::IF" messes up the parsing. - unsigned long, - long>::RET type; + unsigned long, + long>::RET type; }; template<> struct return_type_2_arithmetic_phase_2 { - typedef promotion_of_unsigned_int::type type; + typedef promotion_of_unsigned_int::type type; }; template<> struct return_type_2_arithmetic_phase_2 { - typedef promotion_of_unsigned_int::type type; + typedef promotion_of_unsigned_int::type type; }; diff --git a/include/boost/lambda/detail/operators.hpp b/include/boost/lambda/detail/operators.hpp index 5165e36..53bdc51 100644 --- a/include/boost/lambda/detail/operators.hpp +++ b/include/boost/lambda/detail/operators.hpp @@ -27,21 +27,21 @@ namespace lambda { #error "Multiple defines of BOOST_LAMBDA_BE1" #endif -#define BOOST_LAMBDA_BE1(OPER_NAME, ACTION, CONSTA, CONSTB, CONVERSION) \ -template \ -inline const \ -lambda_functor< \ - lambda_functor_base< \ - ACTION, \ - tuple, typename CONVERSION ::type> \ - > \ -> \ -OPER_NAME (const lambda_functor& a, CONSTB B& b) { \ - return \ - lambda_functor_base< \ - ACTION, \ - tuple, typename CONVERSION ::type> \ - > \ +#define BOOST_LAMBDA_BE1(OPER_NAME, ACTION, CONSTA, CONSTB, CONVERSION) \ +template \ +inline const \ +lambda_functor< \ + lambda_functor_base< \ + ACTION, \ + tuple, typename CONVERSION ::type> \ + > \ +> \ +OPER_NAME (const lambda_functor& a, CONSTB B& b) { \ + return \ + lambda_functor_base< \ + ACTION, \ + tuple, typename CONVERSION ::type> \ + > \ (tuple, typename CONVERSION ::type>(a, b)); \ } @@ -50,21 +50,21 @@ OPER_NAME (const lambda_functor& a, CONSTB B& b) { \ #error "Multiple defines of BOOST_LAMBDA_BE2" #endif -#define BOOST_LAMBDA_BE2(OPER_NAME, ACTION, CONSTA, CONSTB, CONVERSION) \ -template \ -inline const \ -lambda_functor< \ - lambda_functor_base< \ - ACTION, \ - tuple::type, lambda_functor > \ - > \ -> \ -OPER_NAME (CONSTA A& a, const lambda_functor& b) { \ - return \ - lambda_functor_base< \ - ACTION, \ - tuple::type, lambda_functor > \ - > \ +#define BOOST_LAMBDA_BE2(OPER_NAME, ACTION, CONSTA, CONSTB, CONVERSION) \ +template \ +inline const \ +lambda_functor< \ + lambda_functor_base< \ + ACTION, \ + tuple::type, lambda_functor > \ + > \ +> \ +OPER_NAME (CONSTA A& a, const lambda_functor& b) { \ + return \ + lambda_functor_base< \ + ACTION, \ + tuple::type, lambda_functor > \ + > \ (tuple::type, lambda_functor >(a, b)); \ } @@ -73,22 +73,22 @@ OPER_NAME (CONSTA A& a, const lambda_functor& b) { \ #error "Multiple defines of BOOST_LAMBDA_BE3" #endif -#define BOOST_LAMBDA_BE3(OPER_NAME, ACTION, CONSTA, CONSTB, CONVERSION) \ -template \ -inline const \ -lambda_functor< \ - lambda_functor_base< \ - ACTION, \ - tuple, lambda_functor > \ - > \ -> \ +#define BOOST_LAMBDA_BE3(OPER_NAME, ACTION, CONSTA, CONSTB, CONVERSION) \ +template \ +inline const \ +lambda_functor< \ + lambda_functor_base< \ + ACTION, \ + tuple, lambda_functor > \ + > \ +> \ OPER_NAME (const lambda_functor& a, const lambda_functor& b) { \ - return \ - lambda_functor_base< \ - ACTION, \ - tuple, lambda_functor > \ - > \ - (tuple, lambda_functor >(a, b)); \ + return \ + lambda_functor_base< \ + ACTION, \ + tuple, lambda_functor > \ + > \ + (tuple, lambda_functor >(a, b)); \ } #if defined BOOST_LAMBDA_BE @@ -96,8 +96,8 @@ OPER_NAME (const lambda_functor& a, const lambda_functor& b) { \ #endif #define BOOST_LAMBDA_BE(OPER_NAME, ACTION, CONSTA, CONSTB, CONST_CONVERSION) \ -BOOST_LAMBDA_BE1(OPER_NAME, ACTION, CONSTA, CONSTB, CONST_CONVERSION) \ -BOOST_LAMBDA_BE2(OPER_NAME, ACTION, CONSTA, CONSTB, CONST_CONVERSION) \ +BOOST_LAMBDA_BE1(OPER_NAME, ACTION, CONSTA, CONSTB, CONST_CONVERSION) \ +BOOST_LAMBDA_BE2(OPER_NAME, ACTION, CONSTA, CONSTB, CONST_CONVERSION) \ BOOST_LAMBDA_BE3(OPER_NAME, ACTION, CONSTA, CONSTB, CONST_CONVERSION) @@ -253,17 +253,17 @@ operator>>(const lambda_functor& a, Ret(&b)(ManipArg)) #error "Multiple defines of BOOST_LAMBDA_PTR_ARITHMETIC_E1" #endif -#define BOOST_LAMBDA_PTR_ARITHMETIC_E1(OPER_NAME, ACTION, CONST) \ -template \ -inline const \ -lambda_functor< \ +#define BOOST_LAMBDA_PTR_ARITHMETIC_E1(OPER_NAME, ACTION, CONST) \ +template \ +inline const \ +lambda_functor< \ lambda_functor_base, CONST B(&)[N]> > \ -> \ -OPER_NAME (const lambda_functor& a, CONST B(&b)[N]) \ -{ \ - return lambda_functor< \ +> \ +OPER_NAME (const lambda_functor& a, CONST B(&b)[N]) \ +{ \ + return lambda_functor< \ lambda_functor_base, CONST B(&)[N]> > \ - >(tuple, CONST B(&)[N]>(a, b)); \ + >(tuple, CONST B(&)[N]>(a, b)); \ } @@ -271,17 +271,17 @@ OPER_NAME (const lambda_functor& a, CONST B(&b)[N]) \ #error "Multiple defines of BOOST_LAMBDA_PTR_ARITHMETIC_E2" #endif -#define BOOST_LAMBDA_PTR_ARITHMETIC_E2(OPER_NAME, ACTION, CONST) \ -template \ -inline const \ -lambda_functor< \ +#define BOOST_LAMBDA_PTR_ARITHMETIC_E2(OPER_NAME, ACTION, CONST) \ +template \ +inline const \ +lambda_functor< \ lambda_functor_base > > \ -> \ -OPER_NAME (CONST A(&a)[N], const lambda_functor& b) \ -{ \ - return \ +> \ +OPER_NAME (CONST A(&a)[N], const lambda_functor& b) \ +{ \ + return \ lambda_functor_base > > \ - (tuple >(a, b)); \ + (tuple >(a, b)); \ } @@ -316,15 +316,15 @@ BOOST_LAMBDA_PTR_ARITHMETIC_E2(operator-, arithmetic_action, const #error "Multiple defines of BOOST_LAMBDA_UE" #endif -#define BOOST_LAMBDA_UE(OPER_NAME, ACTION) \ -template \ -inline const \ +#define BOOST_LAMBDA_UE(OPER_NAME, ACTION) \ +template \ +inline const \ lambda_functor > > > \ -OPER_NAME (const lambda_functor& a) \ -{ \ - return \ - lambda_functor_base > > \ - ( tuple >(a) ); \ +OPER_NAME (const lambda_functor& a) \ +{ \ + return \ + lambda_functor_base > > \ + ( tuple >(a) ); \ } @@ -341,15 +341,15 @@ BOOST_LAMBDA_UE(operator&, other_action) #error "Multiple defines of BOOST_LAMBDA_POSTFIX_UE" #endif -#define BOOST_LAMBDA_POSTFIX_UE(OPER_NAME, ACTION) \ -template \ -inline const \ +#define BOOST_LAMBDA_POSTFIX_UE(OPER_NAME, ACTION) \ +template \ +inline const \ lambda_functor > > > \ -OPER_NAME (const lambda_functor& a, int) \ -{ \ - return \ - lambda_functor_base > > \ - ( tuple >(a) ); \ +OPER_NAME (const lambda_functor& a, int) \ +{ \ + return \ + lambda_functor_base > > \ + ( tuple >(a) ); \ } diff --git a/include/boost/lambda/detail/return_type_traits.hpp b/include/boost/lambda/detail/return_type_traits.hpp index 05c98b6..f9aad74 100644 --- a/include/boost/lambda/detail/return_type_traits.hpp +++ b/include/boost/lambda/detail/return_type_traits.hpp @@ -117,7 +117,7 @@ namespace detail { typedef typename detail::IF_type< // boost::is_reference::value && !boost::is_const::value, ice_and::value, - ice_not::value>::value>::value, + ice_not::value>::value>::value, detail::identity_mapping, const_copy_argument // handles funtion and array >::type type; // types correctly diff --git a/include/boost/lambda/exceptions.hpp b/include/boost/lambda/exceptions.hpp index 4f5bb27..ea8eb44 100644 --- a/include/boost/lambda/exceptions.hpp +++ b/include/boost/lambda/exceptions.hpp @@ -419,7 +419,7 @@ try_catch( template + class Catch3, class LF3> inline const lambda_functor< lambda_functor_base< action<4, try_catch_action, detail::catch_block, Catch3> > >, @@ -442,8 +442,8 @@ try_catch( template + class Catch3, class LF3, + class Catch4, class LF4> inline const lambda_functor< lambda_functor_base< @@ -476,9 +476,9 @@ try_catch( template + class Catch3, class LF3, + class Catch4, class LF4, + class Catch5, class LF5> inline const lambda_functor< lambda_functor_base< @@ -514,10 +514,10 @@ try_catch( template + class Catch3, class LF3, + class Catch4, class LF4, + class Catch5, class LF5, + class Catch6, class LF6> inline const lambda_functor< lambda_functor_base< @@ -555,10 +555,10 @@ try_catch( template inline const lambda_functor< @@ -600,12 +600,12 @@ try_catch( template + class Catch3, class LF3, + class Catch4, class LF4, + class Catch5, class LF5, + class Catch6, class LF6, + class Catch7, class LF7, + class Catch8, class LF8> inline const lambda_functor< lambda_functor_base< @@ -649,13 +649,13 @@ try_catch( template + class Catch5, class LF5, + class Catch6, class LF6, + class Catch7, class LF7, + class Catch8, class LF8, + class Catch9, class LF9> inline const lambda_functor< lambda_functor_base< diff --git a/include/boost/lambda/if.hpp b/include/boost/lambda/if.hpp index f0015fe..b9fe603 100644 --- a/include/boost/lambda/if.hpp +++ b/include/boost/lambda/if.hpp @@ -122,21 +122,21 @@ inline const other_action, tuple, typename const_copy_argument::type, - typename const_copy_argument::type> + typename const_copy_argument::type> > > if_then_else_return(const lambda_functor& a1, - const Arg2 & a2, - const Arg3 & a3) { + const Arg2 & a2, + const Arg3 & a3) { return lambda_functor_base< other_action, tuple, typename const_copy_argument::type, - typename const_copy_argument::type> + typename const_copy_argument::type> > ( tuple, typename const_copy_argument::type, - typename const_copy_argument::type> (a1, a2, a3) ); + typename const_copy_argument::type> (a1, a2, a3) ); } namespace detail { @@ -191,7 +191,7 @@ struct return_type_2_ifthenelsereturn<1, false, false, false, A, B> { 2, boost::is_convertible::value, boost::is_convertible::value, - boost::is_same::value, + boost::is_same::value, plainA, plainB>::type type; }; @@ -299,7 +299,7 @@ lambda_functor_base, Args> { public: Args args; - template struct sig { + template struct sig { private: typedef typename detail::nth_return_type_sig<1, Args, SigArgs>::type ret1; typedef typename detail::nth_return_type_sig<2, Args, SigArgs>::type ret2; diff --git a/include/boost/lambda/loops.hpp b/include/boost/lambda/loops.hpp index 6b0d5ff..b7602af 100644 --- a/include/boost/lambda/loops.hpp +++ b/include/boost/lambda/loops.hpp @@ -223,7 +223,7 @@ public: template RET call(CALL_FORMAL_ARGS) const { - while(detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS)) {} + while(detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS)) {} } }; @@ -258,7 +258,7 @@ public: template RET call(CALL_FORMAL_ARGS) const { - do {} while (detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS) ); + do {} while (detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS) ); } }; diff --git a/include/boost/lambda/switch.hpp b/include/boost/lambda/switch.hpp index 7fc0f5a..4dab2b2 100644 --- a/include/boost/lambda/switch.hpp +++ b/include/boost/lambda/switch.hpp @@ -184,29 +184,29 @@ public: // switch with default being the sole label - doesn't make much sense but // it is there for completeness -// template -// class -// lambda_functor_base< -// action< -// 2, -// return_void_action > -// >, -// Args -// > -// { -// Args args; -// public: -// explicit lambda_functor_base(const Args& a) : args(a) {} -// -// template -// RET call(A& a, B& b, C& c) const { -// switch( detail::select(::boost::tuples::get<0>(args), a, b, c) ) -// { -// default: -// detail::select(::boost::tuples::get<1>(args), a, b, c); -// break; -// } -// } +// template +// class +// lambda_functor_base< +// action< +// 2, +// return_void_action > +// >, +// Args +// > +// { +// Args args; +// public: +// explicit lambda_functor_base(const Args& a) : args(a) {} +// +// template +// RET call(A& a, B& b, C& c) const { +// switch( detail::select(::boost::tuples::get<0>(args), a, b, c) ) +// { +// default: +// detail::select(::boost::tuples::get<1>(args), a, b, c); +// break; +// } +// } // }; @@ -287,88 +287,88 @@ public: // BOOST_LAMBDA_A_I_LIST(N, X) is a list of form X0, X1, ..., XN // BOOST_LAMBDA_A_I_B_LIST(N, X, Y) is a list of form X0 Y, X1 Y, ..., XN Y -#define BOOST_LAMBDA_A_I(i, A) \ +#define BOOST_LAMBDA_A_I(i, A) \ BOOST_PP_COMMA_IF(i) BOOST_PP_CAT(A,i) -#define BOOST_LAMBDA_A_I_B(i, T) \ +#define BOOST_LAMBDA_A_I_B(i, T) \ BOOST_PP_COMMA_IF(i) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,T),i) BOOST_PP_TUPLE_ELEM(2,1,T) -#define BOOST_LAMBDA_A_I_LIST(i, A) \ -BOOST_PP_REPEAT(i,BOOST_LAMBDA_A_I, A) +#define BOOST_LAMBDA_A_I_LIST(i, A) \ +BOOST_PP_REPEAT(i,BOOST_LAMBDA_A_I, A) -#define BOOST_LAMBDA_A_I_B_LIST(i, A, B) \ -BOOST_PP_REPEAT(i,BOOST_LAMBDA_A_I_B, (A,B)) +#define BOOST_LAMBDA_A_I_B_LIST(i, A, B) \ +BOOST_PP_REPEAT(i,BOOST_LAMBDA_A_I_B, (A,B)) // Switch related macros ------------------------------------------- -#define BOOST_LAMBDA_SWITCH_CASE_BLOCK(N, A) \ - case Case##N: \ +#define BOOST_LAMBDA_SWITCH_CASE_BLOCK(N, A) \ + case Case##N: \ detail::select(::boost::tuples::get(args), CALL_ACTUAL_ARGS); \ break; -#define BOOST_LAMBDA_SWITCH_CASE_BLOCK_LIST(N) \ +#define BOOST_LAMBDA_SWITCH_CASE_BLOCK_LIST(N) \ BOOST_PP_REPEAT(N, BOOST_LAMBDA_SWITCH_CASE_BLOCK, FOO) // 2 case type: -#define BOOST_LAMBDA_SWITCH_NO_DEFAULT_CASE(N) \ -template \ -class \ -lambda_functor_base< \ - switch_action) \ - >, \ - Args \ -> \ -{ \ -public: \ - Args args; \ - template struct sig { typedef void type; }; \ -public: \ - explicit lambda_functor_base(const Args& a) : args(a) {} \ - \ - template \ - RET call(CALL_FORMAL_ARGS) const { \ +#define BOOST_LAMBDA_SWITCH_NO_DEFAULT_CASE(N) \ +template \ +class \ +lambda_functor_base< \ + switch_action) \ + >, \ + Args \ +> \ +{ \ +public: \ + Args args; \ + template struct sig { typedef void type; }; \ +public: \ + explicit lambda_functor_base(const Args& a) : args(a) {} \ + \ + template \ + RET call(CALL_FORMAL_ARGS) const { \ switch( detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS) ) \ - { \ - BOOST_LAMBDA_SWITCH_CASE_BLOCK_LIST(N) \ - } \ - } \ + { \ + BOOST_LAMBDA_SWITCH_CASE_BLOCK_LIST(N) \ + } \ + } \ }; - + -#define BOOST_LAMBDA_SWITCH_WITH_DEFAULT_CASE(N) \ -template< \ - class Args BOOST_PP_COMMA_IF(BOOST_PP_DEC(N)) \ - BOOST_LAMBDA_A_I_LIST(BOOST_PP_DEC(N), int Case) \ -> \ -class \ -lambda_functor_base< \ - switch_action) \ - BOOST_PP_COMMA_IF(BOOST_PP_DEC(N)) \ - detail::default_label \ - >, \ - Args \ -> \ -{ \ -public: \ - Args args; \ - template struct sig { typedef void type; }; \ -public: \ - explicit lambda_functor_base(const Args& a) : args(a) {} \ - \ - template \ - RET call(CALL_FORMAL_ARGS) const { \ +#define BOOST_LAMBDA_SWITCH_WITH_DEFAULT_CASE(N) \ +template< \ + class Args BOOST_PP_COMMA_IF(BOOST_PP_DEC(N)) \ + BOOST_LAMBDA_A_I_LIST(BOOST_PP_DEC(N), int Case) \ +> \ +class \ +lambda_functor_base< \ + switch_action) \ + BOOST_PP_COMMA_IF(BOOST_PP_DEC(N)) \ + detail::default_label \ + >, \ + Args \ +> \ +{ \ +public: \ + Args args; \ + template struct sig { typedef void type; }; \ +public: \ + explicit lambda_functor_base(const Args& a) : args(a) {} \ + \ + template \ + RET call(CALL_FORMAL_ARGS) const { \ switch( detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS) ) \ - { \ - BOOST_LAMBDA_SWITCH_CASE_BLOCK_LIST(BOOST_PP_DEC(N)) \ - default: \ + { \ + BOOST_LAMBDA_SWITCH_CASE_BLOCK_LIST(BOOST_PP_DEC(N)) \ + default: \ detail::select(::boost::tuples::get(args), CALL_ACTUAL_ARGS); \ - break; \ - } \ - } \ + break; \ + } \ + } \ }; @@ -414,43 +414,43 @@ switch_statement(const lambda_functor& a1) { } -#define HELPER(N, FOO) \ -BOOST_PP_COMMA_IF(N) \ -BOOST_PP_CAT( \ - const tagged_lambda_functor) \ +#define HELPER(N, FOO) \ +BOOST_PP_COMMA_IF(N) \ +BOOST_PP_CAT( \ + const tagged_lambda_functor) \ BOOST_PP_COMMA() Arg##N>& a##N #define HELPER_LIST(N) BOOST_PP_REPEAT(N, HELPER, FOO) -#define BOOST_LAMBDA_SWITCH_STATEMENT(N) \ -template \ -inline const \ -lambda_functor< \ - lambda_functor_base< \ - switch_action, \ - tuple, BOOST_LAMBDA_A_I_LIST(N, Arg)> \ - > \ -> \ -switch_statement( \ - const lambda_functor& ta, \ - HELPER_LIST(N) \ -) \ -{ \ - return \ - lambda_functor_base< \ - switch_action, \ - tuple, BOOST_LAMBDA_A_I_LIST(N, Arg)> \ - > \ - ( tuple, BOOST_LAMBDA_A_I_LIST(N, Arg)> \ - (ta, BOOST_LAMBDA_A_I_LIST(N, a) )); \ +#define BOOST_LAMBDA_SWITCH_STATEMENT(N) \ +template \ +inline const \ +lambda_functor< \ + lambda_functor_base< \ + switch_action, \ + tuple, BOOST_LAMBDA_A_I_LIST(N, Arg)> \ + > \ +> \ +switch_statement( \ + const lambda_functor& ta, \ + HELPER_LIST(N) \ +) \ +{ \ + return \ + lambda_functor_base< \ + switch_action, \ + tuple, BOOST_LAMBDA_A_I_LIST(N, Arg)> \ + > \ + ( tuple, BOOST_LAMBDA_A_I_LIST(N, Arg)> \ + (ta, BOOST_LAMBDA_A_I_LIST(N, a) )); \ } @@ -458,16 +458,16 @@ switch_statement( \ // Here's the actual generation -#define BOOST_LAMBDA_SWITCH(N) \ -BOOST_LAMBDA_SWITCH_NO_DEFAULT_CASE(N) \ +#define BOOST_LAMBDA_SWITCH(N) \ +BOOST_LAMBDA_SWITCH_NO_DEFAULT_CASE(N) \ BOOST_LAMBDA_SWITCH_WITH_DEFAULT_CASE(N) // Use this to avoid case 0, these macros work only from case 1 upwards -#define BOOST_LAMBDA_SWITCH_HELPER(N, A) \ +#define BOOST_LAMBDA_SWITCH_HELPER(N, A) \ BOOST_LAMBDA_SWITCH( BOOST_PP_INC(N) ) // Use this to avoid cases 0 and 1, these macros work only from case 2 upwards -#define BOOST_LAMBDA_SWITCH_STATEMENT_HELPER(N, A) \ +#define BOOST_LAMBDA_SWITCH_STATEMENT_HELPER(N, A) \ BOOST_LAMBDA_SWITCH_STATEMENT(BOOST_PP_INC(N))