Index: boost/proto/literal.hpp =================================================================== --- boost/proto/literal.hpp (revision 75076) +++ boost/proto/literal.hpp (working copy) @@ -65,7 +65,7 @@ : base_type(terminal_type::make(u.get())) {} - BOOST_PROTO_EXTENDS_USING_ASSIGN(literal_t) + BOOST_PROTO_EXTENDS_USING_ASSIGN(terminal_type, literal_t, Domain) reference get() { Index: boost/proto/extends.hpp =================================================================== --- boost/proto/extends.hpp (revision 75076) +++ boost/proto/extends.hpp (working copy) @@ -26,11 +26,14 @@ #include #include #include +#include +#include #include #include #include #include #include +#include #include #include @@ -65,25 +68,41 @@ /// INTERNAL ONLY /// - #define BOOST_PROTO_TEMPLATE_YES_(Z, N) template + #define BOOST_PROTO_TEMPLATE_YES_(Z, N, Const, R) \ + template \ + typename R::type const \ + /**/ /// INTERNAL ONLY /// - #define BOOST_PROTO_TEMPLATE_NO_(Z, N) + #define BOOST_PROTO_TEMPLATE_NO_(Z, N, Const, R) \ + typename boost::mpl::eval_if_c< \ + boost::proto::matches< \ + typename boost::proto::result_of::funop0< \ + proto_base_expr Const() \ + , proto_domain \ + >::type \ + , proto_domain_grammar_ \ + >::value \ + , R \ + , boost::proto::detail::invalid_expression \ + >::type const \ + /**/ /// INTERNAL ONLY /// #define BOOST_PROTO_DEFINE_FUN_OP_IMPL_(Z, N, DATA, Const) \ - BOOST_PP_IF(N, BOOST_PROTO_TEMPLATE_YES_, BOOST_PROTO_TEMPLATE_NO_)(Z, N) \ - typename BOOST_PROTO_RESULT_OF< \ - proto_generator( \ - typename boost::proto::result_of::BOOST_PP_CAT(funop, N)< \ - proto_derived_expr Const() \ - , proto_domain \ - BOOST_PP_ENUM_TRAILING_PARAMS_Z(Z, N, const A) \ - >::type \ - ) \ - >::type const \ + BOOST_PP_IF(N, BOOST_PROTO_TEMPLATE_YES_, BOOST_PROTO_TEMPLATE_NO_)(Z, N, Const, \ + BOOST_PROTO_RESULT_OF< \ + proto_generator( \ + typename boost::proto::result_of::BOOST_PP_CAT(funop, N)< \ + proto_derived_expr Const() \ + , proto_domain \ + BOOST_PP_ENUM_TRAILING_PARAMS_Z(Z, N, const A) \ + >::type \ + ) \ + > \ + ) \ operator ()(BOOST_PP_ENUM_BINARY_PARAMS_Z(Z, N, A, const &a)) Const() \ { \ typedef boost::proto::result_of::BOOST_PP_CAT(funop, N)< \ @@ -164,6 +183,7 @@ typedef BOOST_PROTO_REMOVE_TYPENAME(Domain) proto_domain; \ typedef Derived proto_derived_expr; \ typedef Domain::proto_generator proto_generator; \ + typedef Domain::proto_grammar proto_domain_grammar_; /**< INTERNAL ONLY */ \ typedef typename proto_base_expr::proto_tag proto_tag; \ typedef typename proto_base_expr::proto_args proto_args; \ typedef typename proto_base_expr::proto_arity proto_arity; \ @@ -201,29 +221,42 @@ typedef void proto_is_aggregate_; \ /**< INTERNAL ONLY */ - #define BOOST_PROTO_EXTENDS_COPY_ASSIGN_IMPL_(This, Const, Typename) \ + #define BOOST_PROTO_EXTENDS_COPY_ASSIGN_IMPL_(Base, Derived, Domain, Const, Typename) \ BOOST_PROTO_DISABLE_MSVC_C4522 \ - Typename() BOOST_PROTO_RESULT_OF< \ - Typename() This::proto_generator( \ - Typename() boost::proto::base_expr< \ - Typename() This::proto_domain \ - , boost::proto::tag::assign \ + Typename() boost::mpl::eval_if_c< \ + boost::proto::matches< \ + boost::proto::basic_expr< \ + boost::proto::tag::assign \ , boost::proto::list2< \ - This & \ - , This Const() & \ + Base & \ + , Base Const() & \ > \ - >::type \ - ) \ + > \ + , Typename() Domain::proto_grammar \ + >::value \ + , BOOST_PROTO_RESULT_OF< \ + Typename() Domain::proto_generator( \ + Typename() boost::proto::base_expr< \ + Domain \ + , boost::proto::tag::assign \ + , boost::proto::list2< \ + Derived & \ + , Derived Const() & \ + > \ + >::type \ + ) \ + > \ + , boost::proto::detail::invalid_expression \ >::type const \ - operator =(This Const() &a) \ + operator =(Derived Const() &a) \ { \ typedef \ Typename() boost::proto::base_expr< \ - Typename() This::proto_domain \ + Domain \ , boost::proto::tag::assign \ , boost::proto::list2< \ - This & \ - , This Const() & \ + Derived & \ + , Derived Const() & \ > \ >::type \ that_type; \ @@ -231,20 +264,20 @@ *this \ , a \ }; \ - return Typename() This::proto_generator()(that); \ + return Typename() Domain::proto_generator()(that); \ } \ /**/ // MSVC 8.0 and higher seem to need copy-assignment operator to be overloaded on *both* // const and non-const rhs arguments. #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600)) && (BOOST_MSVC > 1310) - #define BOOST_PROTO_EXTENDS_COPY_ASSIGN_(This, Typename) \ - BOOST_PROTO_EXTENDS_COPY_ASSIGN_IMPL_(This, BOOST_PP_EMPTY, Typename) \ - BOOST_PROTO_EXTENDS_COPY_ASSIGN_IMPL_(This, BOOST_PROTO_CONST, Typename) \ + #define BOOST_PROTO_EXTENDS_COPY_ASSIGN_(Base, Derived, Domain, Typename) \ + BOOST_PROTO_EXTENDS_COPY_ASSIGN_IMPL_(Base, Derived, Domain, BOOST_PP_EMPTY, Typename) \ + BOOST_PROTO_EXTENDS_COPY_ASSIGN_IMPL_(Base, Derived, Domain, BOOST_PROTO_CONST, Typename) \ /**/ #else - #define BOOST_PROTO_EXTENDS_COPY_ASSIGN_(This, Typename) \ - BOOST_PROTO_EXTENDS_COPY_ASSIGN_IMPL_(This, BOOST_PROTO_CONST, Typename) \ + #define BOOST_PROTO_EXTENDS_COPY_ASSIGN_(Base, Derived, Domain, Typename) \ + BOOST_PROTO_EXTENDS_COPY_ASSIGN_IMPL_(Base, Derived, Domain, BOOST_PROTO_CONST, Typename) \ /**/ #endif @@ -300,17 +333,32 @@ /**/ #define BOOST_PROTO_EXTENDS_ASSIGN_CONST() \ - BOOST_PROTO_EXTENDS_COPY_ASSIGN_(proto_derived_expr, BOOST_PROTO_TYPENAME) \ + BOOST_PROTO_EXTENDS_COPY_ASSIGN_( \ + proto_base_expr \ + , proto_derived_expr \ + , proto_domain \ + , BOOST_PROTO_TYPENAME \ + ) \ BOOST_PROTO_EXTENDS_ASSIGN_CONST_() \ /**/ #define BOOST_PROTO_EXTENDS_ASSIGN_NON_CONST() \ - BOOST_PROTO_EXTENDS_COPY_ASSIGN_(proto_derived_expr, BOOST_PROTO_TYPENAME) \ + BOOST_PROTO_EXTENDS_COPY_ASSIGN_( \ + proto_base_expr \ + , proto_derived_expr \ + , proto_domain \ + , BOOST_PROTO_TYPENAME \ + ) \ BOOST_PROTO_EXTENDS_ASSIGN_NON_CONST_() \ /**/ #define BOOST_PROTO_EXTENDS_ASSIGN() \ - BOOST_PROTO_EXTENDS_COPY_ASSIGN_(proto_derived_expr, BOOST_PROTO_TYPENAME) \ + BOOST_PROTO_EXTENDS_COPY_ASSIGN_( \ + proto_base_expr \ + , proto_derived_expr \ + , proto_domain \ + , BOOST_PROTO_TYPENAME \ + ) \ BOOST_PROTO_EXTENDS_ASSIGN_() \ /**/ @@ -440,18 +488,33 @@ BOOST_PROTO_EXTENDS_FUNCTION() \ /**/ - #define BOOST_PROTO_EXTENDS_USING_ASSIGN(Derived) \ + #define BOOST_PROTO_EXTENDS_USING_ASSIGN(Base, Derived, Domain) \ typedef typename Derived::proto_extends proto_extends; \ using proto_extends::operator =; \ - BOOST_PROTO_EXTENDS_COPY_ASSIGN_(Derived, BOOST_PROTO_TYPENAME) \ + BOOST_PROTO_EXTENDS_COPY_ASSIGN_(Base, Derived, Domain, BOOST_PROTO_TYPENAME) \ /**/ - #define BOOST_PROTO_EXTENDS_USING_ASSIGN_NON_DEPENDENT(Derived) \ + #define BOOST_PROTO_EXTENDS_USING_ASSIGN_NON_DEPENDENT(Base, Derived, Domain) \ typedef Derived::proto_extends proto_extends; \ using proto_extends::operator =; \ - BOOST_PROTO_EXTENDS_COPY_ASSIGN_(Derived, BOOST_PP_EMPTY) \ + BOOST_PROTO_EXTENDS_COPY_ASSIGN_(Base, Derived, Domain, BOOST_PP_EMPTY) \ /**/ + namespace detail + { + template + struct invalid_expression + { + typedef invalid_expression type; + + template + invalid_expression(Expr const &) + { + BOOST_MPL_ASSERT_MSG(false, EXPRESSION_IS_NOT_VALID_IN_THIS_DOMAIN, (Expr, Domain)); + } + }; + } + namespace exprns_ { /// \brief Empty type to be used as a dummy template parameter of @@ -550,6 +613,7 @@ { typedef Domain proto_domain; typedef typename Domain::proto_generator proto_generator; + typedef typename Domain::proto_grammar proto_domain_grammar_; /**< INTERNAL ONLY */ typedef virtual_member proto_derived_expr; typedef tag::member proto_tag; typedef list2 > const &> proto_args; @@ -623,4 +687,4 @@ }} -#endif +#endif \ No newline at end of file Index: boost/proto/detail/preprocessed/extends_funop.hpp =================================================================== --- boost/proto/detail/preprocessed/extends_funop.hpp (revision 75076) +++ boost/proto/detail/preprocessed/extends_funop.hpp (working copy) @@ -6,13 +6,13 @@ // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) template struct result { typedef typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop< Sig , proto_derived_expr , proto_domain >::type ) >::type const type; }; - typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop0< proto_derived_expr const , proto_domain >::type ) >::type const operator ()() const { typedef boost::proto::result_of::funop0< proto_derived_expr const , proto_domain > funop; return proto_generator()( funop::call( *static_cast(this) ) ); } typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop0< proto_derived_expr , proto_domain >::type ) >::type const operator ()() { typedef boost::proto::result_of::funop0< proto_derived_expr , proto_domain > funop; return proto_generator()( funop::call( *static_cast(this) ) ); } - template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 >::type ) >::type const operator ()(A0 const &a0) const { typedef boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 ) ); } template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop1< proto_derived_expr , proto_domain , const A0 >::type ) >::type const operator ()(A0 const &a0) { typedef boost::proto::result_of::funop1< proto_derived_expr , proto_domain , const A0 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 ) ); } - template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1) const { typedef boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 ) ); } template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop2< proto_derived_expr , proto_domain , const A0 , const A1 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1) { typedef boost::proto::result_of::funop2< proto_derived_expr , proto_domain , const A0 , const A1 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 ) ); } - template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const { typedef boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 ) ); } template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop3< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) { typedef boost::proto::result_of::funop3< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 ) ); } - template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const { typedef boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 ) ); } template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop4< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) { typedef boost::proto::result_of::funop4< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 ) ); } - template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const { typedef boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 ) ); } template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop5< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) { typedef boost::proto::result_of::funop5< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 ) ); } - template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const { typedef boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 ) ); } template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop6< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) { typedef boost::proto::result_of::funop6< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 ) ); } - template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const { typedef boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 ) ); } template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop7< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) { typedef boost::proto::result_of::funop7< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 ) ); } - template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const { typedef boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 ) ); } template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop8< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) { typedef boost::proto::result_of::funop8< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 ) ); } - template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const { typedef boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 ) ); } template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop9< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) { typedef boost::proto::result_of::funop9< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 ) ); } + typename boost::mpl::eval_if_c< boost::proto::matches< typename boost::proto::result_of::funop0< proto_base_expr const , proto_domain >::type , proto_domain_grammar_ >::value , BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop0< proto_derived_expr const , proto_domain >::type ) > , boost::proto::detail::invalid_expression >::type const operator ()() const { typedef boost::proto::result_of::funop0< proto_derived_expr const , proto_domain > funop; return proto_generator()( funop::call( *static_cast(this) ) ); } typename boost::mpl::eval_if_c< boost::proto::matches< typename boost::proto::result_of::funop0< proto_base_expr , proto_domain >::type , proto_domain_grammar_ >::value , BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop0< proto_derived_expr , proto_domain >::type ) > , boost::proto::detail::invalid_expression >::type const operator ()() { typedef boost::proto::result_of::funop0< proto_derived_expr , proto_domain > funop; return proto_generator()( funop::call( *static_cast(this) ) ); } + template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 >::type ) > ::type const operator ()(A0 const &a0) const { typedef boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 ) ); } template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop1< proto_derived_expr , proto_domain , const A0 >::type ) > ::type const operator ()(A0 const &a0) { typedef boost::proto::result_of::funop1< proto_derived_expr , proto_domain , const A0 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 ) ); } + template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1) const { typedef boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 ) ); } template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop2< proto_derived_expr , proto_domain , const A0 , const A1 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1) { typedef boost::proto::result_of::funop2< proto_derived_expr , proto_domain , const A0 , const A1 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 ) ); } + template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const { typedef boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 ) ); } template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop3< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) { typedef boost::proto::result_of::funop3< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 ) ); } + template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const { typedef boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 ) ); } template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop4< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) { typedef boost::proto::result_of::funop4< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 ) ); } + template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const { typedef boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 ) ); } template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop5< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) { typedef boost::proto::result_of::funop5< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 ) ); } + template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const { typedef boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 ) ); } template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop6< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) { typedef boost::proto::result_of::funop6< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 ) ); } + template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const { typedef boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 ) ); } template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop7< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) { typedef boost::proto::result_of::funop7< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 ) ); } + template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const { typedef boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 ) ); } template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop8< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) { typedef boost::proto::result_of::funop8< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 ) ); } + template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const { typedef boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 ) ); } template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop9< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) { typedef boost::proto::result_of::funop9< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 ) ); } Index: boost/proto/detail/preprocessed/extends_funop_const.hpp =================================================================== --- boost/proto/detail/preprocessed/extends_funop_const.hpp (revision 75076) +++ boost/proto/detail/preprocessed/extends_funop_const.hpp (working copy) @@ -6,13 +6,13 @@ // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) template struct result { typedef typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop< Sig , proto_derived_expr , proto_domain >::type ) >::type const type; }; - typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop0< proto_derived_expr const , proto_domain >::type ) >::type const operator ()() const { typedef boost::proto::result_of::funop0< proto_derived_expr const , proto_domain > funop; return proto_generator()( funop::call( *static_cast(this) ) ); } - template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 >::type ) >::type const operator ()(A0 const &a0) const { typedef boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 ) ); } - template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1) const { typedef boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 ) ); } - template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const { typedef boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 ) ); } - template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const { typedef boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 ) ); } - template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const { typedef boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 ) ); } - template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const { typedef boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 ) ); } - template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const { typedef boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 ) ); } - template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const { typedef boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 ) ); } - template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const { typedef boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 ) ); } + typename boost::mpl::eval_if_c< boost::proto::matches< typename boost::proto::result_of::funop0< proto_base_expr const , proto_domain >::type , proto_domain_grammar_ >::value , BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop0< proto_derived_expr const , proto_domain >::type ) > , boost::proto::detail::invalid_expression >::type const operator ()() const { typedef boost::proto::result_of::funop0< proto_derived_expr const , proto_domain > funop; return proto_generator()( funop::call( *static_cast(this) ) ); } + template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 >::type ) > ::type const operator ()(A0 const &a0) const { typedef boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 ) ); } + template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1) const { typedef boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 ) ); } + template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const { typedef boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 ) ); } + template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const { typedef boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 ) ); } + template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const { typedef boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 ) ); } + template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const { typedef boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 ) ); } + template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const { typedef boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 ) ); } + template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const { typedef boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 ) ); } + template typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 >::type ) > ::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const { typedef boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 > funop; return proto_generator()( funop::call( *static_cast(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 ) ); } Index: libs/proto/example/calc2.cpp =================================================================== --- libs/proto/example/calc2.cpp (revision 75076) +++ libs/proto/example/calc2.cpp (working copy) @@ -60,7 +60,7 @@ : calculator_expression::proto_extends(expr) {} - BOOST_PROTO_EXTENDS_USING_ASSIGN(calculator_expression) + BOOST_PROTO_EXTENDS_USING_ASSIGN(Expr, calculator_expression, calculator_domain) // Override operator () to evaluate the expression double operator ()() const Index: libs/proto/example/calc3.cpp =================================================================== --- libs/proto/example/calc3.cpp (revision 75076) +++ libs/proto/example/calc3.cpp (working copy) @@ -101,7 +101,7 @@ : base_type(expr) {} - BOOST_PROTO_EXTENDS_USING_ASSIGN(calculator_expression) + BOOST_PROTO_EXTENDS_USING_ASSIGN(Expr, calculator_expression, calculator_domain) // Override operator () to evaluate the expression double operator ()() const