?????????? ????????? - ??????????????? - /home/agenciai/public_html/cd38d8/proto.zip
???????
PK �J�[X�6�x, x, repeat.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file repeat.hpp /// Contains macros to ease the generation of repetitious code constructs // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_REPEAT_HPP_EAN_11_24_2008 #define BOOST_PROTO_REPEAT_HPP_EAN_11_24_2008 #include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/facilities/intercept.hpp> #include <boost/preprocessor/repetition/enum.hpp> #include <boost/preprocessor/repetition/enum_params.hpp> #include <boost/preprocessor/repetition/enum_binary_params.hpp> #include <boost/preprocessor/iteration/local.hpp> #include <boost/preprocessor/tuple/elem.hpp> #include <boost/proto/proto_fwd.hpp> // for BOOST_PROTO_MAX_ARITY //////////////////////////////////////////// /// INTERNAL ONLY #define BOOST_PROTO_ref_a_aux(Z, N, DATA)\ boost::ref(BOOST_PP_CAT(proto_a, N)) /// \brief Generates a sequence like <tt>typename A0, typename A1, ...</tt> /// #define BOOST_PROTO_typename_A(N)\ BOOST_PP_ENUM_PARAMS(N, typename proto_A) /// \brief Generates a sequence like <tt>A0 const &, A1 const &, ...</tt> /// #define BOOST_PROTO_A_const_ref(N)\ BOOST_PP_ENUM_BINARY_PARAMS(N, proto_A, const & BOOST_PP_INTERCEPT) /// \brief Generates a sequence like <tt>A0 &, A1 &, ...</tt> /// #define BOOST_PROTO_A_ref(N)\ BOOST_PP_ENUM_BINARY_PARAMS(N, proto_A, & BOOST_PP_INTERCEPT) /// \brief Generates a sequence like <tt>A0, A1, ...</tt> /// #define BOOST_PROTO_A(N)\ BOOST_PP_ENUM_PARAMS(N, proto_A) /// \brief Generates a sequence like <tt>A0 const, A1 const, ...</tt> /// #define BOOST_PROTO_A_const(N)\ BOOST_PP_ENUM_PARAMS(N, const proto_A) /// \brief Generates a sequence like <tt>A0 const &a0, A1 const &a0, ...</tt> /// #define BOOST_PROTO_A_const_ref_a(N)\ BOOST_PP_ENUM_BINARY_PARAMS(N, proto_A, const &proto_a) /// \brief Generates a sequence like <tt>A0 &a0, A1 &a0, ...</tt> /// #define BOOST_PROTO_A_ref_a(N)\ BOOST_PP_ENUM_BINARY_PARAMS(N, proto_A, &proto_a) /// \brief Generates a sequence like <tt>boost::ref(a0), boost::ref(a1), ...</tt> /// #define BOOST_PROTO_ref_a(N)\ BOOST_PP_ENUM(N, BOOST_PROTO_ref_a_aux, ~) /// \brief Generates a sequence like <tt>a0, a1, ...</tt> /// #define BOOST_PROTO_a(N)\ BOOST_PP_ENUM_PARAMS(N, proto_a) //////////////////////////////////////////// /// INTERNAL ONLY #define BOOST_PROTO_invoke(Z, N, DATA)\ BOOST_PP_TUPLE_ELEM(5,0,DATA)(N, BOOST_PP_TUPLE_ELEM(5,1,DATA), BOOST_PP_TUPLE_ELEM(5,2,DATA), BOOST_PP_TUPLE_ELEM(5,3,DATA), BOOST_PP_TUPLE_ELEM(5,4,DATA)) /// \brief Repeatedly invoke the specified macro. /// /// BOOST_PROTO_REPEAT_FROM_TO_EX() is used generate the kind of repetitive code that is typical /// of EDSLs built with Proto. BOOST_PROTO_REPEAT_FROM_TO_EX(FROM, TO, MACRO, typename_A, A, A_a, a) is equivalent to: /// /// \code /// MACRO(FROM, typename_A, A, A_a, a) /// MACRO(FROM+1, typename_A, A, A_a, a) /// ... /// MACRO(TO-1, typename_A, A, A_a, a) /// \endcode #define BOOST_PROTO_REPEAT_FROM_TO_EX(FROM, TO, MACRO, typename_A, A, A_a, a)\ BOOST_PP_REPEAT_FROM_TO(FROM, TO, BOOST_PROTO_invoke, (MACRO, typename_A, A, A_a, a)) /// \brief Repeatedly invoke the specified macro. /// /// BOOST_PROTO_REPEAT_FROM_TO() is used generate the kind of repetitive code that is typical /// of EDSLs built with Proto. BOOST_PROTO_REPEAT_FROM_TO(FROM, TO, MACRO) is equivalent to: /// /// \code /// MACRO(FROM, BOOST_PROTO_typename_A, BOOST_PROTO_A_const_ref, BOOST_PROTO_A_const_ref_a, BOOST_PROTO_ref_a) /// MACRO(FROM+1, BOOST_PROTO_typename_A, BOOST_PROTO_A_const_ref, BOOST_PROTO_A_const_ref_a, BOOST_PROTO_ref_a) /// ... /// MACRO(TO-1, BOOST_PROTO_typename_A, BOOST_PROTO_A_const_ref, BOOST_PROTO_A_const_ref_a, BOOST_PROTO_ref_a) /// \endcode /// /// Example: /// /** \code // Generate BOOST_PROTO_MAX_ARITY-1 overloads of the // following construct() function template. #define M0(N, typename_A, A_const_ref, A_const_ref_a, ref_a) \ template<typename T, typename_A(N)> \ typename proto::result_of::make_expr< \ proto::tag::function \ , construct_helper<T> \ , A_const_ref(N) \ >::type const \ construct(A_const_ref_a(N)) \ { \ return proto::make_expr< \ proto::tag::function \ >( \ construct_helper<T>() \ , ref_a(N) \ ); \ } BOOST_PROTO_REPEAT_FROM_TO(1, BOOST_PROTO_MAX_ARITY, M0) #undef M0 \endcode **/ /// The above invocation of BOOST_PROTO_REPEAT_FROM_TO() will generate /// the following code: /// /// \code /// template<typename T, typename A0> /// typename proto::result_of::make_expr< /// proto::tag::function /// , construct_helper<T> /// , A0 const & /// >::type const /// construct(A0 const & a0) /// { /// return proto::make_expr< /// proto::tag::function /// >( /// construct_helper<T>() /// , boost::ref(a0) /// ); /// } /// /// template<typename T, typename A0, typename A1> /// typename proto::result_of::make_expr< /// proto::tag::function /// , construct_helper<T> /// , A0 const & /// , A1 const & /// >::type const /// construct(A0 const & a0, A1 const & a1) /// { /// return proto::make_expr< /// proto::tag::function /// >( /// construct_helper<T>() /// , boost::ref(a0) /// , boost::ref(a1) /// ); /// } /// /// // ... and so on, up to BOOST_PROTO_MAX_ARITY-1 arguments ... /// \endcode #define BOOST_PROTO_REPEAT_FROM_TO(FROM, TO, MACRO)\ BOOST_PROTO_REPEAT_FROM_TO_EX(FROM, TO, MACRO, BOOST_PROTO_typename_A, BOOST_PROTO_A_const_ref, BOOST_PROTO_A_const_ref_a, BOOST_PROTO_ref_a) /// \brief Repeatedly invoke the specified macro. /// /// BOOST_PROTO_REPEAT_EX() is used generate the kind of repetitive code that is typical /// of EDSLs built with Proto. BOOST_PROTO_REPEAT_EX(MACRO, typename_A, A, A_a, a) is equivalent to: /// /// \code /// MACRO(1, typename_A, A, A_a, a) /// MACRO(2, typename_A, A, A_a, a) /// ... /// MACRO(BOOST_PROTO_MAX_ARITY, typename_A, A, A_a, a) /// \endcode #define BOOST_PROTO_REPEAT_EX(MACRO, typename_A, A, A_a, a)\ BOOST_PROTO_REPEAT_FROM_TO_EX(1, BOOST_PP_INC(BOOST_PROTO_MAX_ARITY), MACRO, BOOST_PROTO_typename_A, BOOST_PROTO_A_const_ref, BOOST_PROTO_A_const_ref_a, BOOST_PROTO_ref_a) /// \brief Repeatedly invoke the specified macro. /// /// BOOST_PROTO_REPEAT() is used generate the kind of repetitive code that is typical /// of EDSLs built with Proto. BOOST_PROTO_REPEAT(MACRO) is equivalent to: /// /// \code /// MACRO(1, BOOST_PROTO_typename_A, BOOST_PROTO_A_const_ref, BOOST_PROTO_A_const_ref_a, BOOST_PROTO_ref_a) /// MACRO(2, BOOST_PROTO_typename_A, BOOST_PROTO_A_const_ref, BOOST_PROTO_A_const_ref_a, BOOST_PROTO_ref_a) /// ... /// MACRO(BOOST_PROTO_MAX_ARITY, BOOST_PROTO_typename_A, BOOST_PROTO_A_const_ref, BOOST_PROTO_A_const_ref_a, BOOST_PROTO_ref_a) /// \endcode #define BOOST_PROTO_REPEAT(MACRO)\ BOOST_PROTO_REPEAT_FROM_TO(1, BOOST_PP_INC(BOOST_PROTO_MAX_ARITY), MACRO) /// \brief Repeatedly invoke the specified macro. /// /// BOOST_PROTO_LOCAL_ITERATE() is used generate the kind of repetitive code that is typical /// of EDSLs built with Proto. This macro causes the user-defined macro BOOST_PROTO_LOCAL_MACRO to /// be expanded with values in the range specified by BOOST_PROTO_LOCAL_LIMITS. /// /// Usage: /// /// \code /// #include BOOST_PROTO_LOCAL_ITERATE() /// \endcode /// /// Example: /// /** \code // Generate BOOST_PROTO_MAX_ARITY-1 overloads of the // following construct() function template. #define BOOST_PROTO_LOCAL_MACRO(N, typename_A, A_const_ref, \ A_const_ref_a, ref_a) \ template<typename T, typename_A(N)> \ typename proto::result_of::make_expr< \ proto::tag::function \ , construct_helper<T> \ , A_const_ref(N) \ >::type const \ construct(A_const_ref_a(N)) \ { \ return proto::make_expr< \ proto::tag::function \ >( \ construct_helper<T>() \ , ref_a(N) \ ); \ } #define BOOST_PROTO_LOCAL_LIMITS (1, BOOST_PP_DEC(BOOST_PROTO_MAX_ARITY)) #include BOOST_PROTO_LOCAL_ITERATE() \endcode **/ /// The above inclusion of BOOST_PROTO_LOCAL_ITERATE() will generate /// the following code: /// /// \code /// template<typename T, typename A0> /// typename proto::result_of::make_expr< /// proto::tag::function /// , construct_helper<T> /// , A0 const & /// >::type const /// construct(A0 const & a0) /// { /// return proto::make_expr< /// proto::tag::function /// >( /// construct_helper<T>() /// , boost::ref(a0) /// ); /// } /// /// template<typename T, typename A0, typename A1> /// typename proto::result_of::make_expr< /// proto::tag::function /// , construct_helper<T> /// , A0 const & /// , A1 const & /// >::type const /// construct(A0 const & a0, A1 const & a1) /// { /// return proto::make_expr< /// proto::tag::function /// >( /// construct_helper<T>() /// , boost::ref(a0) /// , boost::ref(a1) /// ); /// } /// /// // ... and so on, up to BOOST_PROTO_MAX_ARITY-1 arguments ... /// \endcode /// /// If BOOST_PROTO_LOCAL_LIMITS is not defined by the user, it defaults /// to (1, BOOST_PROTO_MAX_ARITY) /// /// At each iteration, BOOST_PROTO_LOCAL_MACRO is invoked with the current /// iteration number and the following 4 macro parameters: /// /// \li BOOST_PROTO_LOCAL_typename_A /// \li BOOST_PROTO_LOCAL_A /// \li BOOST_PROTO_LOCAL_A_a /// \li BOOST_PROTO_LOCAL_a /// /// If these macros are not defined by the user, they default respectively to: /// /// \li BOOST_PROTO_typename_A /// \li BOOST_PROTO_A_const_ref /// \li BOOST_PROTO_A_const_ref_a /// \li BOOST_PROTO_ref_a /// /// After including BOOST_PROTO_LOCAL_ITERATE(), the following macros are /// automatically undefined: /// /// \li BOOST_PROTO_LOCAL_MACRO /// \li BOOST_PROTO_LOCAL_LIMITS /// \li BOOST_PROTO_LOCAL_typename_A /// \li BOOST_PROTO_LOCAL_A /// \li BOOST_PROTO_LOCAL_A_a /// \li BOOST_PROTO_LOCAL_a #define BOOST_PROTO_LOCAL_ITERATE() <boost/proto/detail/local.hpp> #endif PK �J�[�W��� � proto_typeof.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file proto_typeof.hpp /// Type registrations so that proto expression templates can be used together /// with the Boost.Typeof library. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_XPRESSIVE_PROTO_PROTO_TYPEOF_H #define BOOST_XPRESSIVE_PROTO_PROTO_TYPEOF_H #include <boost/config.hpp> #include <boost/typeof/typeof.hpp> #include <boost/proto/proto_fwd.hpp> #include <boost/proto/deep_copy.hpp> #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::terminal) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::unary_plus) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::negate) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::dereference) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::complement) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::address_of) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::logical_not) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::pre_inc) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::pre_dec) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::post_inc) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::post_dec) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::shift_left) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::shift_right) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::multiplies) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::divides) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::modulus) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::plus) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::minus) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::less) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::greater) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::less_equal) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::greater_equal) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::equal_to) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::not_equal_to) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::logical_or) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::logical_and) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::bitwise_and) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::bitwise_or) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::bitwise_xor) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::comma) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::mem_ptr) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::assign) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::shift_left_assign) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::shift_right_assign) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::multiplies_assign) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::divides_assign) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::modulus_assign) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::plus_assign) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::minus_assign) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::bitwise_and_assign) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::bitwise_or_assign) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::bitwise_xor_assign) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::subscript) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::member) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::if_else_) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::function) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::exprns_::is_proto_expr) BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::exprns_::expr, (typename)(typename)(long)) BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::exprns_::basic_expr, (typename)(typename)(long)) BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::utility::literal, (typename)(typename)) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::detail::not_a_generator) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::detail::not_a_grammar) BOOST_TYPEOF_REGISTER_TYPE(boost::proto::detail::not_a_domain) BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::domain, 3) BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::term, 1) BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list1, 1) BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list2, 2) // can't use PP metaprogramming here because all typeof registrations // must be on separate lines. #if BOOST_PROTO_MAX_ARITY >= 3 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list3, 3) #endif #if BOOST_PROTO_MAX_ARITY >= 4 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list4, 4) #endif #if BOOST_PROTO_MAX_ARITY >= 5 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list5, 5) #endif #if BOOST_PROTO_MAX_ARITY >= 6 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list6, 6) #endif #if BOOST_PROTO_MAX_ARITY >= 7 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list7, 7) #endif #if BOOST_PROTO_MAX_ARITY >= 8 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list8, 8) #endif #if BOOST_PROTO_MAX_ARITY >= 9 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list9, 9) #endif #if BOOST_PROTO_MAX_ARITY >= 10 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list10, 10) #endif #if BOOST_PROTO_MAX_ARITY >= 11 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list11, 11) #endif #if BOOST_PROTO_MAX_ARITY >= 12 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list12, 12) #endif #if BOOST_PROTO_MAX_ARITY >= 13 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list13, 13) #endif #if BOOST_PROTO_MAX_ARITY >= 14 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list14, 14) #endif #if BOOST_PROTO_MAX_ARITY >= 15 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list15, 15) #endif #if BOOST_PROTO_MAX_ARITY >= 16 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list16, 16) #endif #if BOOST_PROTO_MAX_ARITY >= 17 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list17, 17) #endif #if BOOST_PROTO_MAX_ARITY >= 18 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list18, 18) #endif #if BOOST_PROTO_MAX_ARITY >= 19 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list19, 19) #endif #if BOOST_PROTO_MAX_ARITY >= 20 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::list20, 20) #endif #define BOOST_PROTO_AUTO(Var, Expr) BOOST_AUTO(Var, boost::proto::deep_copy(Expr)) #define BOOST_PROTO_AUTO_TPL(Var, Expr) BOOST_AUTO_TPL(Var, boost::proto::deep_copy(Expr)) #endif PK �J�[��� core.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file core.hpp /// Includes the core of Proto. Not included are the contexts, transforms and /// debugging utilities. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_CORE_HPP_EAN_04_01_2005 #define BOOST_PROTO_CORE_HPP_EAN_04_01_2005 #include <boost/proto/proto_fwd.hpp> #include <boost/proto/args.hpp> #include <boost/proto/tags.hpp> #include <boost/proto/eval.hpp> #include <boost/proto/expr.hpp> #include <boost/proto/repeat.hpp> #include <boost/proto/traits.hpp> #include <boost/proto/domain.hpp> #include <boost/proto/fusion.hpp> #include <boost/proto/matches.hpp> #include <boost/proto/extends.hpp> #include <boost/proto/literal.hpp> #include <boost/proto/generate.hpp> #include <boost/proto/operators.hpp> #include <boost/proto/deep_copy.hpp> #include <boost/proto/make_expr.hpp> #endif PK �J�[��V}7� 7� extends.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file extends.hpp /// Macros and a base class for defining end-user expression types // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_EXTENDS_HPP_EAN_11_1_2006 #define BOOST_PROTO_EXTENDS_HPP_EAN_11_1_2006 #include <cstddef> // for offsetof #include <boost/config.hpp> #include <boost/detail/workaround.hpp> #include <boost/preprocessor/facilities/empty.hpp> #include <boost/preprocessor/tuple/elem.hpp> #include <boost/preprocessor/control/if.hpp> #include <boost/preprocessor/arithmetic/inc.hpp> #include <boost/preprocessor/arithmetic/dec.hpp> #include <boost/preprocessor/iteration/local.hpp> #include <boost/preprocessor/repetition/enum_params.hpp> #include <boost/preprocessor/repetition/repeat_from_to.hpp> #include <boost/preprocessor/repetition/enum_binary_params.hpp> #include <boost/preprocessor/repetition/enum_trailing_params.hpp> #include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp> #include <boost/preprocessor/seq/for_each.hpp> #include <boost/utility/addressof.hpp> #include <boost/utility/result_of.hpp> #include <boost/proto/proto_fwd.hpp> #include <boost/proto/traits.hpp> #include <boost/proto/expr.hpp> #include <boost/proto/args.hpp> #include <boost/proto/traits.hpp> #include <boost/proto/generate.hpp> #include <boost/proto/detail/remove_typename.hpp> #if defined(_MSC_VER) # pragma warning(push) # pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined #endif namespace boost { namespace proto { #ifdef __GNUC__ /// INTERNAL ONLY /// # define BOOST_PROTO_ADDROF(x) ((char const volatile*)boost::addressof(x)) /// INTERNAL ONLY /// # define BOOST_PROTO_OFFSETOF(s,m) (BOOST_PROTO_ADDROF((((s *)this)->m)) - BOOST_PROTO_ADDROF(*((s *)this))) #else /// INTERNAL ONLY /// # define BOOST_PROTO_OFFSETOF offsetof #endif /// INTERNAL ONLY /// #define BOOST_PROTO_CONST() const /// INTERNAL ONLY /// #define BOOST_PROTO_TYPENAME() typename /// INTERNAL ONLY /// #define BOOST_PROTO_TEMPLATE_YES_(Z, N) template<BOOST_PP_ENUM_PARAMS_Z(Z, N, typename A)> /// INTERNAL ONLY /// #define BOOST_PROTO_TEMPLATE_NO_(Z, N) /// 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) \ BOOST_PROTO_PUSH_WARNINGS \ BOOST_PROTO_DISABLE_MSVC_C4180 \ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \ 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 \ operator ()(BOOST_PP_ENUM_BINARY_PARAMS_Z(Z, N, A, const &a)) Const() \ { \ typedef 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) \ > funop; \ return proto_generator()( \ funop::call( \ *static_cast<proto_derived_expr Const() *>(this) \ BOOST_PP_ENUM_TRAILING_PARAMS_Z(Z, N, a) \ ) \ ); \ } \ BOOST_PROTO_POP_WARNINGS \ /**/ /// INTERNAL ONLY /// #define BOOST_PROTO_DEFINE_FUN_OP_VARIADIC_IMPL_(Const) \ template<typename... A> \ BOOST_PROTO_PUSH_WARNINGS \ BOOST_PROTO_DISABLE_MSVC_C4180 \ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \ typename BOOST_PROTO_RESULT_OF< \ proto_generator( \ typename boost::proto::result_of::funop< \ proto_derived_expr Const()(A const &...) \ , proto_derived_expr \ , proto_domain \ >::type \ ) \ >::type const \ operator ()(A const &...a) Const() \ { \ typedef boost::proto::result_of::funop< \ proto_derived_expr Const()(A const &...) \ , proto_derived_expr \ , proto_domain \ > funop; \ return proto_generator()( \ funop::call( \ *static_cast<proto_derived_expr Const() *>(this) \ , a... \ ) \ ); \ } \ BOOST_PROTO_POP_WARNINGS \ /**/ /// INTERNAL ONLY /// #define BOOST_PROTO_DEFINE_FUN_OP_CONST(Z, N, DATA) \ BOOST_PROTO_DEFINE_FUN_OP_IMPL_(Z, N, DATA, BOOST_PROTO_CONST) \ /**/ /// INTERNAL ONLY /// #define BOOST_PROTO_DEFINE_FUN_OP_NON_CONST(Z, N, DATA) \ BOOST_PROTO_DEFINE_FUN_OP_IMPL_(Z, N, DATA, BOOST_PP_EMPTY) \ /**/ /// INTERNAL ONLY /// #define BOOST_PROTO_DEFINE_FUN_OP(Z, N, DATA) \ BOOST_PROTO_DEFINE_FUN_OP_CONST(Z, N, DATA) \ BOOST_PROTO_DEFINE_FUN_OP_NON_CONST(Z, N, DATA) \ /**/ /// INTERNAL ONLY /// #define BOOST_PROTO_EXTENDS_CHILD(Z, N, DATA) \ typedef \ typename proto_base_expr::BOOST_PP_CAT(proto_child, N) \ BOOST_PP_CAT(proto_child, N); \ /**/ #define BOOST_PROTO_BASIC_EXTENDS_(Expr, Derived, Domain) \ Expr proto_expr_; \ \ typedef Expr proto_base_expr_; /**< INTERNAL ONLY */ \ typedef typename proto_base_expr_::proto_base_expr proto_base_expr; \ typedef BOOST_PROTO_REMOVE_TYPENAME(Domain) proto_domain; \ typedef Derived proto_derived_expr; \ typedef Domain::proto_generator proto_generator; \ 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; \ typedef typename proto_base_expr::proto_grammar proto_grammar; \ typedef typename proto_base_expr::address_of_hack_type_ proto_address_of_hack_type_; \ typedef void proto_is_expr_; /**< INTERNAL ONLY */ \ static const long proto_arity_c = proto_base_expr::proto_arity_c; \ typedef boost::proto::tag::proto_expr<proto_tag, proto_domain> fusion_tag; \ BOOST_PP_REPEAT(BOOST_PROTO_MAX_ARITY, BOOST_PROTO_EXTENDS_CHILD, ~) \ \ BOOST_PROTO_PUSH_WARNINGS \ \ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \ static proto_derived_expr const make(Expr const &e) \ { \ proto_derived_expr that = {e}; \ return that; \ } \ \ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \ proto_base_expr &proto_base() \ { \ return this->proto_expr_.proto_base(); \ } \ \ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \ proto_base_expr const &proto_base() const \ { \ return this->proto_expr_.proto_base(); \ } \ \ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \ operator proto_address_of_hack_type_() const \ { \ return boost::addressof(this->proto_base().child0); \ } \ \ BOOST_PROTO_POP_WARNINGS \ /**/ #define BOOST_PROTO_BASIC_EXTENDS(Expr, Derived, Domain) \ BOOST_PROTO_BASIC_EXTENDS_(Expr, Derived, Domain) \ typedef void proto_is_aggregate_; \ /**< INTERNAL ONLY */ #define BOOST_PROTO_EXTENDS_COPY_ASSIGN_IMPL_(This, Const, Typename) \ BOOST_PROTO_PUSH_WARNINGS \ BOOST_PROTO_DISABLE_MSVC_C4522 \ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \ Typename() BOOST_PROTO_RESULT_OF< \ Typename() This::proto_generator( \ Typename() boost::proto::base_expr< \ Typename() This::proto_domain \ , boost::proto::tag::assign \ , boost::proto::list2< \ This & \ , This Const() & \ > \ >::type \ ) \ >::type const \ operator =(This Const() &a) \ { \ typedef \ Typename() boost::proto::base_expr< \ Typename() This::proto_domain \ , boost::proto::tag::assign \ , boost::proto::list2< \ This & \ , This Const() & \ > \ >::type \ that_type; \ that_type const that = { \ *this \ , a \ }; \ return Typename() This::proto_generator()(that); \ } \ BOOST_PROTO_POP_WARNINGS \ /**/ // 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) \ /**/ #else #define BOOST_PROTO_EXTENDS_COPY_ASSIGN_(This, Typename) \ BOOST_PROTO_EXTENDS_COPY_ASSIGN_IMPL_(This, BOOST_PROTO_CONST, Typename) \ /**/ #endif /// INTERNAL ONLY /// #define BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(ThisConst, ThatConst) \ template<typename A> \ BOOST_PROTO_PUSH_WARNINGS \ BOOST_PROTO_DISABLE_MSVC_C4180 \ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \ typename BOOST_PROTO_RESULT_OF< \ proto_generator( \ typename boost::proto::base_expr< \ proto_domain \ , boost::proto::tag::assign \ , boost::proto::list2< \ proto_derived_expr ThisConst() & \ , typename boost::proto::result_of::as_child<A ThatConst(), proto_domain>::type \ > \ >::type \ ) \ >::type const \ operator =(A ThatConst() &a) ThisConst() \ { \ typedef \ typename boost::proto::base_expr< \ proto_domain \ , boost::proto::tag::assign \ , boost::proto::list2< \ proto_derived_expr ThisConst() & \ , typename boost::proto::result_of::as_child<A ThatConst(), proto_domain>::type \ > \ >::type \ that_type; \ that_type const that = { \ *static_cast<proto_derived_expr ThisConst() *>(this) \ , boost::proto::as_child<proto_domain>(a) \ }; \ return proto_generator()(that); \ } \ BOOST_PROTO_POP_WARNINGS \ /**/ #define BOOST_PROTO_EXTENDS_ASSIGN_CONST_() \ BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(BOOST_PROTO_CONST, BOOST_PP_EMPTY) \ BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(BOOST_PROTO_CONST, BOOST_PROTO_CONST) \ /**/ #define BOOST_PROTO_EXTENDS_ASSIGN_NON_CONST_() \ BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(BOOST_PP_EMPTY, BOOST_PP_EMPTY) \ BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(BOOST_PP_EMPTY, BOOST_PROTO_CONST) \ /**/ #define BOOST_PROTO_EXTENDS_ASSIGN_() \ BOOST_PROTO_EXTENDS_ASSIGN_CONST_() \ BOOST_PROTO_EXTENDS_ASSIGN_NON_CONST_() \ /**/ #define BOOST_PROTO_EXTENDS_ASSIGN_CONST() \ BOOST_PROTO_EXTENDS_COPY_ASSIGN_(proto_derived_expr, 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_ASSIGN_NON_CONST_() \ /**/ #define BOOST_PROTO_EXTENDS_ASSIGN() \ BOOST_PROTO_EXTENDS_COPY_ASSIGN_(proto_derived_expr, BOOST_PROTO_TYPENAME) \ BOOST_PROTO_EXTENDS_ASSIGN_() \ /**/ /// INTERNAL ONLY /// #define BOOST_PROTO_EXTENDS_SUBSCRIPT_IMPL_(ThisConst, ThatConst) \ template<typename A> \ BOOST_PROTO_PUSH_WARNINGS \ BOOST_PROTO_DISABLE_MSVC_C4180 \ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \ typename BOOST_PROTO_RESULT_OF< \ proto_generator( \ typename boost::proto::base_expr< \ proto_domain \ , boost::proto::tag::subscript \ , boost::proto::list2< \ proto_derived_expr ThisConst() & \ , typename boost::proto::result_of::as_child<A ThatConst(), proto_domain>::type \ > \ >::type \ ) \ >::type const \ operator [](A ThatConst() &a) ThisConst() \ { \ typedef \ typename boost::proto::base_expr< \ proto_domain \ , boost::proto::tag::subscript \ , boost::proto::list2< \ proto_derived_expr ThisConst() & \ , typename boost::proto::result_of::as_child<A ThatConst(), proto_domain>::type \ > \ >::type \ that_type; \ that_type const that = { \ *static_cast<proto_derived_expr ThisConst() *>(this) \ , boost::proto::as_child<proto_domain>(a) \ }; \ return proto_generator()(that); \ } \ BOOST_PROTO_POP_WARNINGS \ /**/ #define BOOST_PROTO_EXTENDS_SUBSCRIPT_CONST() \ BOOST_PROTO_EXTENDS_SUBSCRIPT_IMPL_(BOOST_PROTO_CONST, BOOST_PP_EMPTY) \ BOOST_PROTO_EXTENDS_SUBSCRIPT_IMPL_(BOOST_PROTO_CONST, BOOST_PROTO_CONST) \ /**/ #define BOOST_PROTO_EXTENDS_SUBSCRIPT_NON_CONST() \ BOOST_PROTO_EXTENDS_SUBSCRIPT_IMPL_(BOOST_PP_EMPTY, BOOST_PP_EMPTY) \ BOOST_PROTO_EXTENDS_SUBSCRIPT_IMPL_(BOOST_PP_EMPTY, BOOST_PROTO_CONST) \ /**/ #define BOOST_PROTO_EXTENDS_SUBSCRIPT() \ BOOST_PROTO_EXTENDS_SUBSCRIPT_CONST() \ BOOST_PROTO_EXTENDS_SUBSCRIPT_NON_CONST() \ /**/ /// INTERNAL ONLY /// #define BOOST_PROTO_EXTENDS_FUNCTION_() \ template<typename Sig> \ 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; \ }; \ /**/ #ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES #define BOOST_PROTO_EXTENDS_FUNCTION_CONST() \ BOOST_PROTO_EXTENDS_FUNCTION_() \ BOOST_PROTO_DEFINE_FUN_OP_VARIADIC_IMPL_(BOOST_PROTO_CONST) \ /**/ #define BOOST_PROTO_EXTENDS_FUNCTION_NON_CONST() \ BOOST_PROTO_EXTENDS_FUNCTION_() \ BOOST_PROTO_DEFINE_FUN_OP_VARIADIC_IMPL_(BOOST_PP_EMPTY) \ /**/ #define BOOST_PROTO_EXTENDS_FUNCTION() \ BOOST_PROTO_EXTENDS_FUNCTION_() \ BOOST_PROTO_DEFINE_FUN_OP_VARIADIC_IMPL_(BOOST_PP_EMPTY) \ BOOST_PROTO_DEFINE_FUN_OP_VARIADIC_IMPL_(BOOST_PROTO_CONST) \ /**/ #else #define BOOST_PROTO_EXTENDS_FUNCTION_CONST() \ BOOST_PROTO_EXTENDS_FUNCTION_() \ BOOST_PP_REPEAT_FROM_TO( \ 0 \ , BOOST_PROTO_MAX_FUNCTION_CALL_ARITY \ , BOOST_PROTO_DEFINE_FUN_OP_CONST \ , ~ \ ) \ /**/ #define BOOST_PROTO_EXTENDS_FUNCTION_NON_CONST() \ BOOST_PROTO_EXTENDS_FUNCTION_() \ BOOST_PP_REPEAT_FROM_TO( \ 0 \ , BOOST_PROTO_MAX_FUNCTION_CALL_ARITY \ , BOOST_PROTO_DEFINE_FUN_OP_NON_CONST \ , ~ \ ) \ /**/ #define BOOST_PROTO_EXTENDS_FUNCTION() \ BOOST_PROTO_EXTENDS_FUNCTION_() \ BOOST_PP_REPEAT_FROM_TO( \ 0 \ , BOOST_PROTO_MAX_FUNCTION_CALL_ARITY \ , BOOST_PROTO_DEFINE_FUN_OP \ , ~ \ ) \ /**/ #endif #define BOOST_PROTO_EXTENDS(Expr, Derived, Domain) \ BOOST_PROTO_BASIC_EXTENDS(Expr, Derived, Domain) \ BOOST_PROTO_EXTENDS_ASSIGN() \ BOOST_PROTO_EXTENDS_SUBSCRIPT() \ BOOST_PROTO_EXTENDS_FUNCTION() \ /**/ #define BOOST_PROTO_EXTENDS_USING_ASSIGN(Derived) \ typedef typename Derived::proto_extends proto_extends; \ using proto_extends::operator =; \ BOOST_PROTO_EXTENDS_COPY_ASSIGN_(Derived, BOOST_PROTO_TYPENAME) \ /**/ #define BOOST_PROTO_EXTENDS_USING_ASSIGN_NON_DEPENDENT(Derived) \ typedef Derived::proto_extends proto_extends; \ using proto_extends::operator =; \ BOOST_PROTO_EXTENDS_COPY_ASSIGN_(Derived, BOOST_PP_EMPTY) \ /**/ namespace exprns_ { /// \brief Empty type to be used as a dummy template parameter of /// POD expression wrappers. It allows argument-dependent lookup /// to find Proto's operator overloads. /// /// \c proto::is_proto_expr allows argument-dependent lookup /// to find Proto's operator overloads. For example: /// /// \code /// template<typename T, typename Dummy = proto::is_proto_expr> /// struct my_terminal /// { /// BOOST_PROTO_BASIC_EXTENDS( /// typename proto::terminal<T>::type /// , my_terminal<T> /// , default_domain /// ) /// }; /// /// // ... /// my_terminal<int> _1, _2; /// _1 + _2; // OK, uses proto::operator+ /// \endcode /// /// Without the second \c Dummy template parameter, Proto's operator /// overloads would not be considered by name lookup. struct is_proto_expr {}; /// \brief extends\<\> class template for adding behaviors to a Proto expression template /// template< typename Expr , typename Derived , typename Domain // = proto::default_domain , long Arity // = Expr::proto_arity_c > struct extends { BOOST_FORCEINLINE extends() : proto_expr_() {} BOOST_FORCEINLINE extends(Expr const &expr_) : proto_expr_(expr_) {} typedef extends proto_extends; BOOST_PROTO_BASIC_EXTENDS_(Expr, Derived, typename Domain) BOOST_PROTO_EXTENDS_ASSIGN_CONST_() BOOST_PROTO_EXTENDS_SUBSCRIPT_CONST() // Instead of using BOOST_PROTO_EXTENDS_FUNCTION, which uses // nested preprocessor loops, use file iteration here to generate // the operator() overloads, which is more efficient. #include <boost/proto/detail/extends_funop_const.hpp> }; /// \brief extends\<\> class template for adding behaviors to a Proto expression template /// template<typename Expr, typename Derived, typename Domain> struct extends<Expr, Derived, Domain, 0> { BOOST_FORCEINLINE extends() : proto_expr_() {} BOOST_FORCEINLINE extends(Expr const &expr_) : proto_expr_(expr_) {} typedef extends proto_extends; BOOST_PROTO_BASIC_EXTENDS_(Expr, Derived, typename Domain) BOOST_PROTO_EXTENDS_ASSIGN_() BOOST_PROTO_EXTENDS_SUBSCRIPT() // Instead of using BOOST_PROTO_EXTENDS_FUNCTION, which uses // nested preprocessor loops, use file iteration here to generate // the operator() overloads, which is more efficient. #include <boost/proto/detail/extends_funop.hpp> }; /// INTERNAL ONLY /// template<typename This, typename Fun, typename Domain> struct virtual_member { typedef Domain proto_domain; typedef typename Domain::proto_generator proto_generator; typedef virtual_member<This, Fun, Domain> proto_derived_expr; typedef tag::member proto_tag; typedef list2<This &, expr<tag::terminal, term<Fun> > const &> proto_args; typedef mpl::long_<2> proto_arity; typedef detail::not_a_valid_type proto_address_of_hack_type_; typedef void proto_is_expr_; /**< INTERNAL ONLY */ static const long proto_arity_c = 2; typedef boost::proto::tag::proto_expr<proto_tag, Domain> fusion_tag; typedef This &proto_child0; typedef expr<tag::terminal, term<Fun> > const &proto_child1; typedef expr<proto_tag, proto_args, proto_arity_c> proto_base_expr; typedef basic_expr<proto_tag, proto_args, proto_arity_c> proto_grammar; typedef void proto_is_aggregate_; /**< INTERNAL ONLY */ BOOST_PROTO_EXTENDS_ASSIGN_() BOOST_PROTO_EXTENDS_SUBSCRIPT() // Instead of using BOOST_PROTO_EXTENDS_FUNCTION, which uses // nested preprocessor loops, use file iteration here to generate // the operator() overloads, which is more efficient. #define BOOST_PROTO_NO_WAVE_OUTPUT #include <boost/proto/detail/extends_funop.hpp> #undef BOOST_PROTO_NO_WAVE_OUTPUT BOOST_FORCEINLINE proto_base_expr const proto_base() const { proto_base_expr that = {this->child0(), this->child1()}; return that; } BOOST_FORCEINLINE proto_child0 child0() const { using std::size_t; return *(This *)((char *)this - BOOST_PROTO_OFFSETOF(This, proto_member_union_start_)); } BOOST_FORCEINLINE proto_child1 child1() const { static expr<tag::terminal, term<Fun>, 0> const that = {Fun()}; return that; } }; /// INTERNAL ONLY /// #define BOOST_PROTO_EXTENDS_MEMBER_(R, DOMAIN, ELEM) \ boost::proto::exprns_::virtual_member< \ proto_derived_expr \ , BOOST_PP_TUPLE_ELEM(2, 0, ELEM) \ , DOMAIN \ > BOOST_PP_TUPLE_ELEM(2, 1, ELEM); \ /**/ /// \brief For declaring virtual data members in an extension class. /// #define BOOST_PROTO_EXTENDS_MEMBERS_WITH_DOMAIN(SEQ, DOMAIN) \ union \ { \ char proto_member_union_start_; \ BOOST_PP_SEQ_FOR_EACH(BOOST_PROTO_EXTENDS_MEMBER_, DOMAIN, SEQ) \ }; \ /**/ /// \brief For declaring virtual data members in an extension class. /// #define BOOST_PROTO_EXTENDS_MEMBERS(SEQ) \ BOOST_PROTO_EXTENDS_MEMBERS_WITH_DOMAIN(SEQ, proto_domain) \ /**/ } }} #if defined(_MSC_VER) # pragma warning(pop) #endif #endif PK �J�[Z!^x x tags.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file tags.hpp /// Contains the tags for all the overloadable operators in C++ // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_TAGS_HPP_EAN_04_01_2005 #define BOOST_PROTO_TAGS_HPP_EAN_04_01_2005 #include <boost/proto/proto_fwd.hpp> namespace boost { namespace proto { namespace tagns_ { namespace tag { /// Tag type for terminals; aka, leaves in the expression tree. struct terminal {}; /// Tag type for the unary + operator. struct unary_plus {}; /// Tag type for the unary - operator. struct negate {}; /// Tag type for the unary * operator. struct dereference {}; /// Tag type for the unary ~ operator. struct complement {}; /// Tag type for the unary & operator. struct address_of {}; /// Tag type for the unary ! operator. struct logical_not {}; /// Tag type for the unary prefix ++ operator. struct pre_inc {}; /// Tag type for the unary prefix -- operator. struct pre_dec {}; /// Tag type for the unary postfix ++ operator. struct post_inc {}; /// Tag type for the unary postfix -- operator. struct post_dec {}; /// Tag type for the binary \<\< operator. struct shift_left {}; /// Tag type for the binary \>\> operator. struct shift_right {}; /// Tag type for the binary * operator. struct multiplies {}; /// Tag type for the binary / operator. struct divides {}; /// Tag type for the binary % operator. struct modulus {}; /// Tag type for the binary + operator. struct plus {}; /// Tag type for the binary - operator. struct minus {}; /// Tag type for the binary \< operator. struct less {}; /// Tag type for the binary \> operator. struct greater {}; /// Tag type for the binary \<= operator. struct less_equal {}; /// Tag type for the binary \>= operator. struct greater_equal {}; /// Tag type for the binary == operator. struct equal_to {}; /// Tag type for the binary != operator. struct not_equal_to {}; /// Tag type for the binary || operator. struct logical_or {}; /// Tag type for the binary && operator. struct logical_and {}; /// Tag type for the binary & operator. struct bitwise_and {}; /// Tag type for the binary | operator. struct bitwise_or {}; /// Tag type for the binary ^ operator. struct bitwise_xor {}; /// Tag type for the binary , operator. struct comma {}; /// Tag type for the binary ->* operator. struct mem_ptr {}; /// Tag type for the binary = operator. struct assign {}; /// Tag type for the binary \<\<= operator. struct shift_left_assign {}; /// Tag type for the binary \>\>= operator. struct shift_right_assign {}; /// Tag type for the binary *= operator. struct multiplies_assign {}; /// Tag type for the binary /= operator. struct divides_assign {}; /// Tag type for the binary %= operator. struct modulus_assign {}; /// Tag type for the binary += operator. struct plus_assign {}; /// Tag type for the binary -= operator. struct minus_assign {}; /// Tag type for the binary &= operator. struct bitwise_and_assign {}; /// Tag type for the binary |= operator. struct bitwise_or_assign {}; /// Tag type for the binary ^= operator. struct bitwise_xor_assign {}; /// Tag type for the binary subscript operator. struct subscript {}; /// Tag type for the binary virtual data members. struct member {}; /// Tag type for the ternary ?: conditional operator. struct if_else_ {}; /// Tag type for the n-ary function call operator. struct function {}; }}}} #endif PK �J�[�ʗ�@ @ functional.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file functional.hpp /// Proto callables for various things // // Copyright 2010 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUNCTIONAL_HPP_EAN_11_27_2010 #define BOOST_PROTO_FUNCTIONAL_HPP_EAN_11_27_2010 #include <boost/proto/functional/std.hpp> #include <boost/proto/functional/fusion.hpp> #include <boost/proto/functional/range.hpp> #endif PK �J�[���� � transform.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file transform.hpp /// Includes all the transforms in the transform/ sub-directory. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_TRANSFORM_HPP_EAN_06_23_2007 #define BOOST_PROTO_TRANSFORM_HPP_EAN_06_23_2007 #include <boost/proto/transform/arg.hpp> #include <boost/proto/transform/call.hpp> #include <boost/proto/transform/default.hpp> #include <boost/proto/transform/env.hpp> #include <boost/proto/transform/fold.hpp> #include <boost/proto/transform/fold_tree.hpp> #include <boost/proto/transform/integral_c.hpp> #include <boost/proto/transform/lazy.hpp> #include <boost/proto/transform/make.hpp> #include <boost/proto/transform/pass_through.hpp> #include <boost/proto/transform/when.hpp> #endif PK �J�[6�u�8 �8 generate.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file generate.hpp /// Contains definition of generate\<\> class template, which end users can /// specialize for generating domain-specific expression wrappers. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_GENERATE_HPP_EAN_02_13_2007 #define BOOST_PROTO_GENERATE_HPP_EAN_02_13_2007 #include <boost/config.hpp> #include <boost/version.hpp> #include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/iteration/iterate.hpp> #include <boost/preprocessor/facilities/intercept.hpp> #include <boost/preprocessor/repetition/enum_params.hpp> #include <boost/preprocessor/repetition/enum_binary_params.hpp> #include <boost/preprocessor/repetition/enum_trailing_params.hpp> #include <boost/mpl/bool.hpp> #include <boost/utility/enable_if.hpp> #include <boost/utility/result_of.hpp> #include <boost/proto/proto_fwd.hpp> #include <boost/proto/args.hpp> #if defined(_MSC_VER) # pragma warning(push) # pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined #endif namespace boost { namespace proto { namespace detail { template<typename Expr> struct by_value_generator_; template<typename Tag, typename Arg> struct by_value_generator_<proto::expr<Tag, term<Arg>, 0> > { typedef proto::expr< Tag , term<typename detail::term_traits<Arg>::value_type> , 0 > type; BOOST_FORCEINLINE static type const call(proto::expr<Tag, term<Arg>, 0> const &e) { type that = {e.child0}; return that; } }; template<typename Tag, typename Arg> struct by_value_generator_<proto::basic_expr<Tag, term<Arg>, 0> > { typedef proto::basic_expr< Tag , term<typename detail::term_traits<Arg>::value_type> , 0 > type; BOOST_FORCEINLINE static type const call(proto::basic_expr<Tag, term<Arg>, 0> const &e) { type that = {e.child0}; return that; } }; // Include the other specializations of by_value_generator_ #include <boost/proto/detail/generate_by_value.hpp> } /// \brief Annotate a generator to indicate that it would /// prefer to be passed instances of \c proto::basic_expr\<\> rather /// than \c proto::expr\<\>. <tt>use_basic_expr\<Generator\></tt> is /// itself a generator. /// template<typename Generator> struct use_basic_expr : Generator { BOOST_PROTO_USE_BASIC_EXPR() }; /// \brief A simple generator that passes an expression /// through unchanged. /// /// Generators are intended for use as the first template parameter /// to the \c domain\<\> class template and control if and how /// expressions within that domain are to be customized. /// The \c default_generator makes no modifications to the expressions /// passed to it. struct default_generator { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Expr> struct result<This(Expr)> { typedef Expr type; }; /// \param expr A Proto expression /// \return expr template<typename Expr> BOOST_FORCEINLINE BOOST_PROTO_RETURN_TYPE_STRICT_LOOSE(Expr, Expr const &) operator ()(Expr const &e) const { return e; } }; /// \brief A simple generator that passes an expression /// through unchanged and specifies a preference for /// \c proto::basic_expr\<\> over \c proto::expr\<\>. /// /// Generators are intended for use as the first template parameter /// to the \c domain\<\> class template and control if and how /// expressions within that domain are to be customized. /// The \c default_generator makes no modifications to the expressions /// passed to it. struct basic_default_generator : proto::use_basic_expr<default_generator> {}; /// \brief A generator that wraps expressions passed /// to it in the specified extension wrapper. /// /// Generators are intended for use as the first template parameter /// to the \c domain\<\> class template and control if and how /// expressions within that domain are to be customized. /// \c generator\<\> wraps each expression passed to it in /// the \c Extends\<\> wrapper. template<template<typename> class Extends> struct generator { BOOST_PROTO_CALLABLE() BOOST_PROTO_USE_BASIC_EXPR() template<typename Sig> struct result; template<typename This, typename Expr> struct result<This(Expr)> { typedef Extends<Expr> type; }; template<typename This, typename Expr> struct result<This(Expr &)> { typedef Extends<Expr> type; }; template<typename This, typename Expr> struct result<This(Expr const &)> { typedef Extends<Expr> type; }; /// \param expr A Proto expression /// \return Extends<Expr>(expr) template<typename Expr> BOOST_FORCEINLINE Extends<Expr> operator ()(Expr const &e) const { return Extends<Expr>(e); } }; /// \brief A generator that wraps expressions passed /// to it in the specified extension wrapper and uses /// aggregate initialization for the wrapper. /// /// Generators are intended for use as the first template parameter /// to the \c domain\<\> class template and control if and how /// expressions within that domain are to be customized. /// \c pod_generator\<\> wraps each expression passed to it in /// the \c Extends\<\> wrapper, and uses aggregate initialzation /// for the wrapped object. template<template<typename> class Extends> struct pod_generator { BOOST_PROTO_CALLABLE() BOOST_PROTO_USE_BASIC_EXPR() template<typename Sig> struct result; template<typename This, typename Expr> struct result<This(Expr)> { typedef Extends<Expr> type; }; template<typename This, typename Expr> struct result<This(Expr &)> { typedef Extends<Expr> type; }; template<typename This, typename Expr> struct result<This(Expr const &)> { typedef Extends<Expr> type; }; /// \param expr The expression to wrap /// \return <tt>Extends\<Expr\> that = {expr}; return that;</tt> template<typename Expr> BOOST_FORCEINLINE Extends<Expr> operator ()(Expr const &e) const { Extends<Expr> that = {e}; return that; } // Work-around for: // https://connect.microsoft.com/VisualStudio/feedback/details/765449/codegen-stack-corruption-using-runtime-checks-when-aggregate-initializing-struct #if BOOST_WORKAROUND(BOOST_MSVC, < 1800) template<typename Class, typename Member> BOOST_FORCEINLINE Extends<expr<tag::terminal, proto::term<Member Class::*> > > operator ()(expr<tag::terminal, proto::term<Member Class::*> > const &e) const { Extends<expr<tag::terminal, proto::term<Member Class::*> > > that; proto::value(that.proto_expr_) = proto::value(e); return that; } template<typename Class, typename Member> BOOST_FORCEINLINE Extends<basic_expr<tag::terminal, proto::term<Member Class::*> > > operator ()(basic_expr<tag::terminal, proto::term<Member Class::*> > const &e) const { Extends<basic_expr<tag::terminal, proto::term<Member Class::*> > > that; proto::value(that.proto_expr_) = proto::value(e); return that; } #endif }; /// \brief A generator that replaces child nodes held by /// reference with ones held by value. Use with /// \c compose_generators to forward that result to another /// generator. /// /// Generators are intended for use as the first template parameter /// to the \c domain\<\> class template and control if and how /// expressions within that domain are to be customized. /// \c by_value_generator ensures all child nodes are /// held by value. This generator is typically composed with a /// second generator for further processing, as /// <tt>compose_generators\<by_value_generator, MyGenerator\></tt>. struct by_value_generator { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Expr> struct result<This(Expr)> { typedef typename detail::by_value_generator_<Expr>::type type; }; template<typename This, typename Expr> struct result<This(Expr &)> { typedef typename detail::by_value_generator_<Expr>::type type; }; template<typename This, typename Expr> struct result<This(Expr const &)> { typedef typename detail::by_value_generator_<Expr>::type type; }; /// \param expr The expression to modify. /// \return <tt>deep_copy(expr)</tt> template<typename Expr> BOOST_FORCEINLINE typename result<by_value_generator(Expr)>::type operator ()(Expr const &e) const { return detail::by_value_generator_<Expr>::call(e); } }; /// \brief A composite generator that first applies one /// transform to an expression and then forwards the result /// on to another generator for further transformation. /// /// Generators are intended for use as the first template parameter /// to the \c domain\<\> class template and control if and how /// expressions within that domain are to be customized. /// \c compose_generators\<\> is a composite generator that first /// applies one transform to an expression and then forwards the /// result on to another generator for further transformation. template<typename First, typename Second> struct compose_generators { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Expr> struct result<This(Expr)> { typedef typename Second::template result< Second(typename First::template result<First(Expr)>::type) >::type type; }; template<typename This, typename Expr> struct result<This(Expr &)> { typedef typename Second::template result< Second(typename First::template result<First(Expr)>::type) >::type type; }; template<typename This, typename Expr> struct result<This(Expr const &)> { typedef typename Second::template result< Second(typename First::template result<First(Expr)>::type) >::type type; }; /// \param expr The expression to modify. /// \return Second()(First()(expr)) template<typename Expr> BOOST_FORCEINLINE typename result<compose_generators(Expr)>::type operator ()(Expr const &e) const { return Second()(First()(e)); } }; /// \brief Tests a generator to see whether it would prefer /// to be passed instances of \c proto::basic_expr\<\> rather than /// \c proto::expr\<\>. /// template<typename Generator, typename Void> struct wants_basic_expr : mpl::false_ {}; template<typename Generator> struct wants_basic_expr<Generator, typename Generator::proto_use_basic_expr_> : mpl::true_ {}; /// INTERNAL ONLY template<> struct is_callable<default_generator> : mpl::true_ {}; /// INTERNAL ONLY template<template<typename> class Extends> struct is_callable<generator<Extends> > : mpl::true_ {}; /// INTERNAL ONLY template<template<typename> class Extends> struct is_callable<pod_generator<Extends> > : mpl::true_ {}; /// INTERNAL ONLY template<> struct is_callable<by_value_generator> : mpl::true_ {}; /// INTERNAL ONLY template<typename First, typename Second> struct is_callable<compose_generators<First, Second> > : mpl::true_ {}; }} // Specializations of boost::result_of and boost::tr1_result_of to eliminate // some unnecessary template instantiations namespace boost { template<typename Expr> struct result_of<proto::default_domain(Expr)> { typedef Expr type; }; template<typename Expr> struct result_of<proto::basic_default_domain(Expr)> { typedef Expr type; }; template<typename Expr> struct result_of<proto::default_generator(Expr)> { typedef Expr type; }; template<typename Expr> struct result_of<proto::basic_default_generator(Expr)> { typedef Expr type; }; #if BOOST_VERSION >= 104400 template<typename Expr> struct tr1_result_of<proto::default_domain(Expr)> { typedef Expr type; }; template<typename Expr> struct tr1_result_of<proto::basic_default_domain(Expr)> { typedef Expr type; }; template<typename Expr> struct tr1_result_of<proto::default_generator(Expr)> { typedef Expr type; }; template<typename Expr> struct tr1_result_of<proto::basic_default_generator(Expr)> { typedef Expr type; }; #endif } #if defined(_MSC_VER) # pragma warning(pop) #endif #endif // BOOST_PROTO_GENERATE_HPP_EAN_02_13_2007 PK �J�[B�6��r �r proto_fwd.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file proto_fwd.hpp /// Forward declarations of all of proto's public types and functions. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FWD_HPP_EAN_04_01_2005 #define BOOST_PROTO_FWD_HPP_EAN_04_01_2005 #include <cstddef> #include <climits> #include <boost/config.hpp> #include <boost/detail/workaround.hpp> #include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/arithmetic/inc.hpp> #include <boost/preprocessor/punctuation/comma.hpp> #include <boost/preprocessor/repetition/enum_params.hpp> #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> #include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp> #include <boost/preprocessor/repetition/repeat_from_to.hpp> #include <boost/ref.hpp> #include <boost/mpl/long.hpp> #include <boost/type_traits/remove_const.hpp> #include <boost/type_traits/remove_reference.hpp> #include <boost/mpl/aux_/config/ttp.hpp> #include <boost/utility/result_of.hpp> #ifndef BOOST_PROTO_MAX_ARITY # define BOOST_PROTO_MAX_ARITY 10 #endif #ifndef BOOST_PROTO_MAX_LOGICAL_ARITY # define BOOST_PROTO_MAX_LOGICAL_ARITY 10 #endif #ifndef BOOST_PROTO_MAX_FUNCTION_CALL_ARITY # define BOOST_PROTO_MAX_FUNCTION_CALL_ARITY BOOST_PROTO_MAX_ARITY #endif #if BOOST_PROTO_MAX_ARITY < 3 # error BOOST_PROTO_MAX_ARITY must be at least 3 #endif #if BOOST_PROTO_MAX_FUNCTION_CALL_ARITY > BOOST_PROTO_MAX_ARITY # error BOOST_PROTO_MAX_FUNCTION_CALL_ARITY cannot be larger than BOOST_PROTO_MAX_ARITY #endif #ifndef BOOST_PROTO_DONT_USE_PREPROCESSED_FILES #if 10 < BOOST_PROTO_MAX_ARITY || \ 10 < BOOST_PROTO_MAX_LOGICAL_ARITY || \ 10 < BOOST_PROTO_MAX_FUNCTION_CALL_ARITY #define BOOST_PROTO_DONT_USE_PREPROCESSED_FILES #endif #endif #ifndef BOOST_PROTO_BROKEN_CONST_OVERLOADS # if BOOST_WORKAROUND(__GNUC__, == 3) \ || BOOST_WORKAROUND(__EDG_VERSION__, BOOST_TESTED_AT(310)) # define BOOST_PROTO_BROKEN_CONST_OVERLOADS # endif #endif #ifndef BOOST_PROTO_BROKEN_CONST_QUALIFIED_FUNCTIONS # if BOOST_WORKAROUND(__GNUC__, == 3) \ || BOOST_WORKAROUND(__EDG_VERSION__, BOOST_TESTED_AT(310)) # define BOOST_PROTO_BROKEN_CONST_QUALIFIED_FUNCTIONS # endif #endif #ifdef BOOST_PROTO_BROKEN_CONST_OVERLOADS # include <boost/utility/enable_if.hpp> # include <boost/type_traits/is_const.hpp> # define BOOST_PROTO_DISABLE_IF_IS_CONST(T)\ , typename boost::disable_if_c<boost::is_const<T>::value, boost::proto::detail::undefined>::type * = 0 #else # define BOOST_PROTO_DISABLE_IF_IS_CONST(T) #endif #ifdef BOOST_PROTO_BROKEN_CONST_QUALIFIED_FUNCTIONS # include <boost/utility/enable_if.hpp> # include <boost/type_traits/is_function.hpp> # define BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T)\ , typename boost::disable_if_c<boost::is_function<T>::value, boost::proto::detail::undefined>::type * = 0 #else # define BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T) #endif #ifndef BOOST_PROTO_BROKEN_PTS # if BOOST_WORKAROUND(BOOST_MSVC, <= 1400) # define BOOST_PROTO_BROKEN_PTS # endif #endif #ifdef BOOST_NO_CXX11_DECLTYPE_N3276 # // Proto can only use the decltype-based result_of if N3276 has been # // implemented by the compiler. # // See http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2011/n3276.pdf # ifndef BOOST_PROTO_USE_NORMAL_RESULT_OF # define BOOST_PROTO_USE_NORMAL_RESULT_OF # endif #endif // Unless compiler support is there, use tr1_result_of instead of // result_of to avoid the problems addressed by N3276. #ifdef BOOST_PROTO_USE_NORMAL_RESULT_OF # define BOOST_PROTO_RESULT_OF boost::result_of #else # define BOOST_PROTO_RESULT_OF boost::tr1_result_of #endif // If we're using the decltype-based result_of, we need to be a bit // stricter about the return types of some functions. #if defined(BOOST_RESULT_OF_USE_DECLTYPE) && defined(BOOST_PROTO_USE_NORMAL_RESULT_OF) # define BOOST_PROTO_STRICT_RESULT_OF # define BOOST_PROTO_RETURN_TYPE_STRICT_LOOSE(X, Y) X #else # define BOOST_PROTO_RETURN_TYPE_STRICT_LOOSE(X, Y) Y #endif #ifdef BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING # define BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING #endif #if defined(_MSC_VER) # define BOOST_PROTO_PUSH_WARNINGS __pragma(warning(push)) # define BOOST_PROTO_POP_WARNINGS __pragma(warning(pop)) # define BOOST_PROTO_DISABLE_MSVC_C4180 __pragma(warning(disable : 4180)) // qualifier applied to function type has no meaning; ignored # define BOOST_PROTO_DISABLE_MSVC_C4522 __pragma(warning(disable : 4522)) // 'class' : multiple assignment operators specified # define BOOST_PROTO_DISABLE_MSVC_C4714 __pragma(warning(disable : 4714)) // function 'xxx' marked as __forceinline not inlined #else # define BOOST_PROTO_PUSH_WARNINGS # define BOOST_PROTO_POP_WARNINGS # define BOOST_PROTO_DISABLE_MSVC_C4180 # define BOOST_PROTO_DISABLE_MSVC_C4522 # define BOOST_PROTO_DISABLE_MSVC_C4714 #endif namespace boost { namespace proto { namespace detail { typedef char yes_type; typedef char (&no_type)[2]; template<int N> struct sized_type { typedef char (&type)[N]; }; struct dont_care; struct undefined; // leave this undefined struct not_a_valid_type; struct private_type_ { private_type_ operator ,(int) const; }; template<typename T> struct uncvref { typedef T type; }; template<typename T> struct uncvref<T const> { typedef T type; }; template<typename T> struct uncvref<T &> { typedef T type; }; template<typename T> struct uncvref<T const &> { typedef T type; }; template<typename T, std::size_t N> struct uncvref<T const[N]> { typedef T type[N]; }; template<typename T, std::size_t N> struct uncvref<T (&)[N]> { typedef T type[N]; }; template<typename T, std::size_t N> struct uncvref<T const (&)[N]> { typedef T type[N]; }; struct ignore { ignore() {} template<typename T> ignore(T const &) {} }; /// INTERNAL ONLY /// #define BOOST_PROTO_UNCVREF(X) \ typename boost::proto::detail::uncvref<X>::type \ /**/ struct _default; struct not_a_domain; struct not_a_grammar; struct not_a_generator; template<typename T, typename Void = void> struct is_transform_; template<typename T, typename Void = void> struct is_aggregate_; template<typename Expr> struct flat_view; } typedef detail::ignore const ignore; namespace argsns_ { template<typename Arg0> struct term; #define M0(Z, N, DATA) \ template<BOOST_PP_ENUM_PARAMS_Z(Z, N, typename Arg)> struct BOOST_PP_CAT(list, N); \ /**/ BOOST_PP_REPEAT_FROM_TO(1, BOOST_PP_INC(BOOST_PROTO_MAX_ARITY), M0, ~) #undef M0 } using namespace argsns_; /////////////////////////////////////////////////////////////////////////////// // Operator tags namespace tagns_ { namespace tag { struct terminal; struct unary_plus; struct negate; struct dereference; struct complement; struct address_of; struct logical_not; struct pre_inc; struct pre_dec; struct post_inc; struct post_dec; struct shift_left; struct shift_right; struct multiplies; struct divides; struct modulus; struct plus; struct minus; struct less; struct greater; struct less_equal; struct greater_equal; struct equal_to; struct not_equal_to; struct logical_or; struct logical_and; struct bitwise_and; struct bitwise_or; struct bitwise_xor; struct comma; struct mem_ptr; struct assign; struct shift_left_assign; struct shift_right_assign; struct multiplies_assign; struct divides_assign; struct modulus_assign; struct plus_assign; struct minus_assign; struct bitwise_and_assign; struct bitwise_or_assign; struct bitwise_xor_assign; struct subscript; struct member; struct if_else_; struct function; // Fusion tags template<typename Tag, typename Domain> struct proto_expr; template<typename Tag, typename Domain> struct proto_expr_iterator; template<typename Tag, typename Domain> struct proto_flat_view; } } using namespace tagns_; template<typename Expr> struct tag_of; //////////////////////////////////////////////////////////////////////////////////////////////// struct _; //////////////////////////////////////////////////////////////////////////////////////////////// struct default_generator; struct basic_default_generator; template<template<typename> class Extends> struct generator; template<template<typename> class Extends> struct pod_generator; struct by_value_generator; template<typename First, typename Second> struct compose_generators; template<typename Generator, typename Void = void> struct wants_basic_expr; template<typename Generator> struct use_basic_expr; //////////////////////////////////////////////////////////////////////////////////////////////// namespace domainns_ { typedef detail::not_a_domain no_super_domain; template< typename Generator = default_generator , typename Grammar = proto::_ , typename Super = no_super_domain > struct domain; struct default_domain; struct basic_default_domain; struct deduce_domain; template<typename Domain, typename Tag, typename Args, bool WantsBasicExpr = wants_basic_expr<typename Domain::proto_generator>::value> struct base_expr; } using namespace domainns_; //////////////////////////////////////////////////////////////////////////////////////////////// namespace exprns_ { template<typename Tag, typename Args, long Arity = Args::arity> struct basic_expr; template<typename Tag, typename Args, long Arity = Args::arity> struct expr; template< typename Expr , typename Derived , typename Domain = default_domain , long Arity = Expr::proto_arity_c > struct extends; template<typename This, typename Fun, typename Domain> struct virtual_member; struct is_proto_expr; } //////////////////////////////////////////////////////////////////////////////////////////////// using exprns_::expr; using exprns_::basic_expr; using exprns_::extends; using exprns_::is_proto_expr; template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G, void)> struct or_; template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G, void)> struct and_; template<typename Grammar> struct not_; template<typename Condition, typename Then = _, typename Else = not_<_> > struct if_; template<typename Cases, typename Transform = tag_of<_>()> struct switch_; template<typename T> struct exact; template<typename T> struct convertible_to; template<typename Grammar> struct vararg; struct pack; // Boost bug https://svn.boost.org/trac/boost/ticket/4602 //int const N = INT_MAX; int const N = (INT_MAX >> 10); namespace context { struct null_context; template<typename Expr, typename Context, long Arity = Expr::proto_arity_c> struct null_eval; struct default_context; template<typename Expr, typename Context, typename Tag = typename Expr::proto_tag, long Arity = Expr::proto_arity_c> struct default_eval; template<typename Derived, typename DefaultCtx = default_context> struct callable_context; template<typename Expr, typename Context, long Arity = Expr::proto_arity_c> struct callable_eval; } using context::null_context; using context::null_eval; using context::default_context; using context::default_eval; using context::callable_context; using context::callable_eval; namespace utility { template<typename T, typename Domain = default_domain> struct literal; } using utility::literal; namespace result_of { template<typename T, typename Domain = default_domain> struct as_expr; template<typename T, typename Domain = default_domain> struct as_child; template<typename Expr, typename N = mpl::long_<0> > struct child; template<typename Expr, long N> struct child_c; template<typename Expr> struct left; template<typename Expr> struct right; template<typename Expr> struct deep_copy; template<typename Expr, typename Context> struct eval; template< typename Tag , typename DomainOrA0 BOOST_PP_ENUM_TRAILING_BINARY_PARAMS( BOOST_PROTO_MAX_ARITY , typename A , = void BOOST_PP_INTERCEPT ) , typename Void = void > struct make_expr; template<typename Tag, typename DomainOrSequence, typename SequenceOrVoid = void, typename Void = void> struct unpack_expr; template<typename T> struct as_env; template<typename Env, typename Tag> struct has_env_var; template<typename Env, typename Tag> struct env_var; } template<typename T, typename Void = void> struct is_expr; template<typename T, typename Void = void> struct is_domain; template<typename SubDomain, typename SuperDomain> struct is_sub_domain_of; template<typename T, typename Void = void> struct is_env; template<typename Expr> struct arity_of; template<typename T, typename Void = void> struct domain_of; template<typename Expr, typename Grammar> struct matches; // Generic expression metafunctions and // grammar elements template<typename Tag, typename Arg> struct unary_expr; template<typename Tag, typename Left, typename Right> struct binary_expr; template<typename Tag, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_ARITY, typename A, void)> struct nary_expr; // Specific expression metafunctions and // grammar elements, for convenience template<typename T> struct terminal; template<typename T> struct unary_plus; template<typename T> struct negate; template<typename T> struct dereference; template<typename T> struct complement; template<typename T> struct address_of; template<typename T> struct logical_not; template<typename T> struct pre_inc; template<typename T> struct pre_dec; template<typename T> struct post_inc; template<typename T> struct post_dec; template<typename T, typename U> struct shift_left; template<typename T, typename U> struct shift_right; template<typename T, typename U> struct multiplies; template<typename T, typename U> struct divides; template<typename T, typename U> struct modulus; template<typename T, typename U> struct plus; template<typename T, typename U> struct minus; template<typename T, typename U> struct less; template<typename T, typename U> struct greater; template<typename T, typename U> struct less_equal; template<typename T, typename U> struct greater_equal; template<typename T, typename U> struct equal_to; template<typename T, typename U> struct not_equal_to; template<typename T, typename U> struct logical_or; template<typename T, typename U> struct logical_and; template<typename T, typename U> struct bitwise_and; template<typename T, typename U> struct bitwise_or; template<typename T, typename U> struct bitwise_xor; template<typename T, typename U> struct comma; template<typename T, typename U> struct mem_ptr; template<typename T, typename U> struct assign; template<typename T, typename U> struct shift_left_assign; template<typename T, typename U> struct shift_right_assign; template<typename T, typename U> struct multiplies_assign; template<typename T, typename U> struct divides_assign; template<typename T, typename U> struct modulus_assign; template<typename T, typename U> struct plus_assign; template<typename T, typename U> struct minus_assign; template<typename T, typename U> struct bitwise_and_assign; template<typename T, typename U> struct bitwise_or_assign; template<typename T, typename U> struct bitwise_xor_assign; template<typename T, typename U> struct subscript; template<typename T, typename U> struct member; template<typename T, typename U, typename V> struct if_else_; template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_ARITY, typename A, void)> struct function; namespace functional { struct left; struct right; struct eval; struct deep_copy; template<typename Domain = default_domain> struct as_expr; template<typename Domain = default_domain> struct as_child; template<typename N = mpl::long_<0> > struct child; template<long N> struct child_c; struct as_env; template<typename Tag> struct has_env_var; template<typename Tag> struct env_var; template<typename Tag, typename Domain = deduce_domain> struct make_expr; template<typename Tag, typename Domain = deduce_domain> struct unpack_expr; typedef make_expr<tag::terminal> make_terminal; typedef make_expr<tag::unary_plus> make_unary_plus; typedef make_expr<tag::negate> make_negate; typedef make_expr<tag::dereference> make_dereference; typedef make_expr<tag::complement> make_complement; typedef make_expr<tag::address_of> make_address_of; typedef make_expr<tag::logical_not> make_logical_not; typedef make_expr<tag::pre_inc> make_pre_inc; typedef make_expr<tag::pre_dec> make_pre_dec; typedef make_expr<tag::post_inc> make_post_inc; typedef make_expr<tag::post_dec> make_post_dec; typedef make_expr<tag::shift_left> make_shift_left; typedef make_expr<tag::shift_right> make_shift_right; typedef make_expr<tag::multiplies> make_multiplies; typedef make_expr<tag::divides> make_divides; typedef make_expr<tag::modulus> make_modulus; typedef make_expr<tag::plus> make_plus; typedef make_expr<tag::minus> make_minus; typedef make_expr<tag::less> make_less; typedef make_expr<tag::greater> make_greater; typedef make_expr<tag::less_equal> make_less_equal; typedef make_expr<tag::greater_equal> make_greater_equal; typedef make_expr<tag::equal_to> make_equal_to; typedef make_expr<tag::not_equal_to> make_not_equal_to; typedef make_expr<tag::logical_or> make_logical_or; typedef make_expr<tag::logical_and> make_logical_and; typedef make_expr<tag::bitwise_and> make_bitwise_and; typedef make_expr<tag::bitwise_or> make_bitwise_or; typedef make_expr<tag::bitwise_xor> make_bitwise_xor; typedef make_expr<tag::comma> make_comma; typedef make_expr<tag::mem_ptr> make_mem_ptr; typedef make_expr<tag::assign> make_assign; typedef make_expr<tag::shift_left_assign> make_shift_left_assign; typedef make_expr<tag::shift_right_assign> make_shift_right_assign; typedef make_expr<tag::multiplies_assign> make_multiplies_assign; typedef make_expr<tag::divides_assign> make_divides_assign; typedef make_expr<tag::modulus_assign> make_modulus_assign; typedef make_expr<tag::plus_assign> make_plus_assign; typedef make_expr<tag::minus_assign> make_minus_assign; typedef make_expr<tag::bitwise_and_assign> make_bitwise_and_assign; typedef make_expr<tag::bitwise_or_assign> make_bitwise_or_assign; typedef make_expr<tag::bitwise_xor_assign> make_bitwise_xor_assign; typedef make_expr<tag::subscript> make_subscript; typedef make_expr<tag::if_else_> make_if_else; typedef make_expr<tag::function> make_function; struct flatten; struct make_pair; struct first; struct second; struct at; struct pop_front; struct push_front; struct pop_back; struct push_back; struct reverse; } typedef functional::flatten _flatten; typedef functional::make_pair _make_pair; typedef functional::first _first; typedef functional::second _second; typedef functional::at _at; typedef functional::pop_front _pop_front; typedef functional::push_front _push_front; typedef functional::pop_back _pop_back; typedef functional::push_back _push_back; typedef functional::reverse _reverse; typedef functional::eval _eval; struct _deep_copy; typedef functional::make_expr<tag::terminal> _make_terminal; typedef functional::make_expr<tag::unary_plus> _make_unary_plus; typedef functional::make_expr<tag::negate> _make_negate; typedef functional::make_expr<tag::dereference> _make_dereference; typedef functional::make_expr<tag::complement> _make_complement; typedef functional::make_expr<tag::address_of> _make_address_of; typedef functional::make_expr<tag::logical_not> _make_logical_not; typedef functional::make_expr<tag::pre_inc> _make_pre_inc; typedef functional::make_expr<tag::pre_dec> _make_pre_dec; typedef functional::make_expr<tag::post_inc> _make_post_inc; typedef functional::make_expr<tag::post_dec> _make_post_dec; typedef functional::make_expr<tag::shift_left> _make_shift_left; typedef functional::make_expr<tag::shift_right> _make_shift_right; typedef functional::make_expr<tag::multiplies> _make_multiplies; typedef functional::make_expr<tag::divides> _make_divides; typedef functional::make_expr<tag::modulus> _make_modulus; typedef functional::make_expr<tag::plus> _make_plus; typedef functional::make_expr<tag::minus> _make_minus; typedef functional::make_expr<tag::less> _make_less; typedef functional::make_expr<tag::greater> _make_greater; typedef functional::make_expr<tag::less_equal> _make_less_equal; typedef functional::make_expr<tag::greater_equal> _make_greater_equal; typedef functional::make_expr<tag::equal_to> _make_equal_to; typedef functional::make_expr<tag::not_equal_to> _make_not_equal_to; typedef functional::make_expr<tag::logical_or> _make_logical_or; typedef functional::make_expr<tag::logical_and> _make_logical_and; typedef functional::make_expr<tag::bitwise_and> _make_bitwise_and; typedef functional::make_expr<tag::bitwise_or> _make_bitwise_or; typedef functional::make_expr<tag::bitwise_xor> _make_bitwise_xor; typedef functional::make_expr<tag::comma> _make_comma; typedef functional::make_expr<tag::mem_ptr> _make_mem_ptr; typedef functional::make_expr<tag::assign> _make_assign; typedef functional::make_expr<tag::shift_left_assign> _make_shift_left_assign; typedef functional::make_expr<tag::shift_right_assign> _make_shift_right_assign; typedef functional::make_expr<tag::multiplies_assign> _make_multiplies_assign; typedef functional::make_expr<tag::divides_assign> _make_divides_assign; typedef functional::make_expr<tag::modulus_assign> _make_modulus_assign; typedef functional::make_expr<tag::plus_assign> _make_plus_assign; typedef functional::make_expr<tag::minus_assign> _make_minus_assign; typedef functional::make_expr<tag::bitwise_and_assign> _make_bitwise_and_assign; typedef functional::make_expr<tag::bitwise_or_assign> _make_bitwise_or_assign; typedef functional::make_expr<tag::bitwise_xor_assign> _make_bitwise_xor_assign; typedef functional::make_expr<tag::subscript> _make_subscript; typedef functional::make_expr<tag::if_else_> _make_if_else; typedef functional::make_expr<tag::function> _make_function; template<typename T> struct is_callable; template<typename T> struct is_transform; template<typename T> struct is_aggregate; #define BOOST_PROTO_UNEXPR() typedef int proto_is_expr_; #define BOOST_PROTO_CALLABLE() typedef void proto_is_callable_; #define BOOST_PROTO_AGGREGATE() typedef void proto_is_aggregate_; #define BOOST_PROTO_USE_BASIC_EXPR() typedef void proto_use_basic_expr_; struct callable { BOOST_PROTO_CALLABLE() }; namespace envns_ { struct key_not_found; struct empty_env; typedef int empty_state; template<typename Tag, typename Value, typename Base = empty_env> struct env; struct data_type; struct transforms_type; } using envns_::key_not_found; using envns_::empty_env; using envns_::empty_state; using envns_::env; using envns_::data_type; using envns_::transforms_type; struct external_transform; template<typename PrimitiveTransform = void, typename X = void> struct transform; template<typename Grammar, typename Fun = Grammar> struct when; template<typename Fun> struct otherwise; template<typename Fun> struct call; template<typename Fun> struct make; template<typename PrimitiveTransform> struct protect; template<typename T> struct noinvoke; template<typename Fun> struct lazy; template<typename Sequence, typename State, typename Fun> struct fold; template<typename Sequence, typename State, typename Fun> struct reverse_fold; // Q: can we replace fold_tree with fold<flatten(_), state, fun> ? // A: once segmented Fusion works well. template<typename Sequence, typename State, typename Fun> struct fold_tree; template<typename Sequence, typename State, typename Fun> struct reverse_fold_tree; template<typename Grammar, typename Domain = deduce_domain> struct pass_through; template<typename Grammar = detail::_default> struct _default; struct _expr; struct _state; struct _data; struct _value; struct _void; template<typename T, T I> struct integral_c; template<char I> struct char_; template<int I> struct int_; template<long I> struct long_; template<std::size_t I> struct size_t; template<int I> struct _child_c; typedef _child_c<0> _child0; typedef _child_c<1> _child1; typedef _child0 _child; typedef _child0 _left; typedef _child1 _right; // _child2, _child3, _child4, ... #define M0(Z, N, DATA) typedef _child_c<N> BOOST_PP_CAT(_child, N); BOOST_PP_REPEAT_FROM_TO( 2 , BOOST_PP_DEC(BOOST_PROTO_MAX_ARITY) , M0 , ~ ) #undef M0 struct _byref; struct _byval; template<typename Tag> struct _env_var; struct _env; template<typename T> struct is_extension; namespace exops = exprns_; }} // namespace boost::proto #endif PK �J�[֧�� functional/range.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file range.hpp /// Proto callables for things found in the boost range library // // Copyright 2012 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUNCTIONAL_RANGE_HPP_EAN_27_08_2012 #define BOOST_PROTO_FUNCTIONAL_RANGE_HPP_EAN_27_08_2012 #include <boost/proto/functional/range/begin.hpp> #include <boost/proto/functional/range/empty.hpp> #include <boost/proto/functional/range/end.hpp> #include <boost/proto/functional/range/rbegin.hpp> #include <boost/proto/functional/range/rend.hpp> #include <boost/proto/functional/range/size.hpp> #endif PK �J�[E~qq q functional/range/begin.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file begin.hpp /// Proto callables for boost::begin() // // Copyright 2012 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUNCTIONAL_RANGE_BEGIN_HPP_EAN_27_08_2012 #define BOOST_PROTO_FUNCTIONAL_RANGE_BEGIN_HPP_EAN_27_08_2012 #include <boost/range/begin.hpp> #include <boost/proto/proto_fwd.hpp> namespace boost { namespace proto { namespace functional { // A PolymorphicFunctionObject that wraps boost::begin() struct begin { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Rng> struct result<This(Rng)> : boost::range_iterator<Rng const> {}; template<typename This, typename Rng> struct result<This(Rng &)> : boost::range_iterator<Rng> {}; template<typename Rng> typename boost::range_iterator<Rng>::type operator()(Rng &rng) const { return boost::begin(rng); } template<typename Rng> typename boost::range_iterator<Rng const>::type operator()(Rng const &rng) const { return boost::begin(rng); } }; }}} #endif PK �J�[��'� � functional/range/rbegin.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file rbegin.hpp /// Proto callables for boost::rbegin() // // Copyright 2012 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUNCTIONAL_RANGE_RBEGIN_HPP_EAN_27_08_2012 #define BOOST_PROTO_FUNCTIONAL_RANGE_RBEGIN_HPP_EAN_27_08_2012 #include <boost/range/rbegin.hpp> #include <boost/proto/proto_fwd.hpp> namespace boost { namespace proto { namespace functional { // A PolymorphicFunctionObject that wraps boost::rbegin() struct rbegin { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Rng> struct result<This(Rng)> : boost::range_reverse_iterator<Rng const> {}; template<typename This, typename Rng> struct result<This(Rng &)> : boost::range_reverse_iterator<Rng> {}; template<typename Rng> typename boost::range_reverse_iterator<Rng>::type operator()(Rng &rng) const { return boost::rbegin(rng); } template<typename Rng> typename boost::range_reverse_iterator<Rng const>::type operator()(Rng const &rng) const { return boost::rbegin(rng); } }; }}} #endif PK �J�[�L�U} } functional/range/empty.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file empty.hpp /// Proto callables for boost::empty() // // Copyright 2012 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUNCTIONAL_RANGE_EMPTY_HPP_EAN_27_08_2012 #define BOOST_PROTO_FUNCTIONAL_RANGE_EMPTY_HPP_EAN_27_08_2012 #include <boost/range/empty.hpp> #include <boost/proto/proto_fwd.hpp> namespace boost { namespace proto { namespace functional { // A PolymorphicFunctionObject that wraps boost::empty() struct empty { BOOST_PROTO_CALLABLE() typedef bool result_type; template<typename Rng> bool operator()(Rng const &rng) const { return boost::empty(rng); } }; }}} #endif PK �J�[�h��_ _ functional/range/end.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file end.hpp /// Proto callables for boost::end() // // Copyright 2012 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUNCTIONAL_RANGE_END_HPP_EAN_27_08_2012 #define BOOST_PROTO_FUNCTIONAL_RANGE_END_HPP_EAN_27_08_2012 #include <boost/range/end.hpp> #include <boost/proto/proto_fwd.hpp> namespace boost { namespace proto { namespace functional { // A PolymorphicFunctionObject that wraps boost::end() struct end { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Rng> struct result<This(Rng)> : boost::range_iterator<Rng const> {}; template<typename This, typename Rng> struct result<This(Rng &)> : boost::range_iterator<Rng> {}; template<typename Rng> typename boost::range_iterator<Rng>::type operator()(Rng &rng) const { return boost::end(rng); } template<typename Rng> typename boost::range_iterator<Rng const>::type operator()(Rng const &rng) const { return boost::end(rng); } }; }}} #endif PK �J�[��a� � functional/range/size.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file size.hpp /// Proto callables for boost::size() // // Copyright 2012 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUNCTIONAL_RANGE_SIZE_HPP_EAN_27_08_2012 #define BOOST_PROTO_FUNCTIONAL_RANGE_SIZE_HPP_EAN_27_08_2012 #include <boost/range/size.hpp> #include <boost/proto/proto_fwd.hpp> namespace boost { namespace proto { namespace functional { // A PolymorphicFunctionObject that wraps boost::size() struct size { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Rng> struct result<This(Rng)> : boost::range_size<Rng> {}; template<typename This, typename Rng> struct result<This(Rng &)> : boost::range_size<Rng> {}; template<typename Rng> typename boost::range_size<Rng>::type operator()(Rng const &rng) const { return boost::size(rng); } }; }}} #endif PK �J�[Gy�� � functional/range/rend.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file rend.hpp /// Proto callables for boost::rend() // // Copyright 2012 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUNCTIONAL_RANGE_REND_HPP_EAN_27_08_2012 #define BOOST_PROTO_FUNCTIONAL_RANGE_REND_HPP_EAN_27_08_2012 #include <boost/range/rend.hpp> #include <boost/proto/proto_fwd.hpp> namespace boost { namespace proto { namespace functional { // A PolymorphicFunctionObject that wraps boost::rend() struct rend { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Rng> struct result<This(Rng)> : boost::range_reverse_iterator<Rng const> {}; template<typename This, typename Rng> struct result<This(Rng &)> : boost::range_reverse_iterator<Rng> {}; template<typename Rng> typename boost::range_reverse_iterator<Rng>::type operator()(Rng &rng) const { return boost::rend(rng); } template<typename Rng> typename boost::range_reverse_iterator<Rng const>::type operator()(Rng const &rng) const { return boost::rend(rng); } }; }}} #endif PK �J�[[�� � functional/fusion/push_front.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file push_front.hpp /// Proto callables Fusion push_front // // Copyright 2010 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUNCTIONAL_FUSION_PUSH_FRONT_HPP_EAN_11_27_2010 #define BOOST_PROTO_FUNCTIONAL_FUSION_PUSH_FRONT_HPP_EAN_11_27_2010 #include <boost/type_traits/add_const.hpp> #include <boost/type_traits/remove_const.hpp> #include <boost/type_traits/remove_reference.hpp> #include <boost/fusion/include/push_front.hpp> #include <boost/proto/proto_fwd.hpp> namespace boost { namespace proto { namespace functional { /// \brief A PolymorphicFunctionObject type that invokes the /// \c fusion::push_front() algorithm on its argument. /// /// A PolymorphicFunctionObject type that invokes the /// \c fusion::push_front() algorithm on its argument. struct push_front { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Seq, typename T> struct result<This(Seq, T)> : fusion::result_of::push_front< typename boost::add_const<typename boost::remove_reference<Seq>::type>::type , typename boost::remove_const<typename boost::remove_reference<T>::type>::type > {}; template<typename Seq, typename T> typename fusion::result_of::push_front<Seq const, T>::type operator ()(Seq const &seq, T const &t) const { return fusion::push_front(seq, t); } }; }}} #endif PK �J�[���;� � functional/fusion/push_back.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file push_back.hpp /// Proto callables Fusion push_back // // Copyright 2010 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUNCTIONAL_FUSION_PUSH_BACK_HPP_EAN_11_27_2010 #define BOOST_PROTO_FUNCTIONAL_FUSION_PUSH_BACK_HPP_EAN_11_27_2010 #include <boost/type_traits/add_const.hpp> #include <boost/type_traits/remove_const.hpp> #include <boost/type_traits/remove_reference.hpp> #include <boost/fusion/include/push_back.hpp> #include <boost/proto/proto_fwd.hpp> namespace boost { namespace proto { namespace functional { /// \brief A PolymorphicFunctionObject type that invokes the /// \c fusion::push_back() algorithm on its argument. /// /// A PolymorphicFunctionObject type that invokes the /// \c fusion::push_back() algorithm on its argument. struct push_back { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Seq, typename T> struct result<This(Seq, T)> : fusion::result_of::push_back< typename boost::add_const<typename boost::remove_reference<Seq>::type>::type , typename boost::remove_const<typename boost::remove_reference<T>::type>::type > {}; template<typename Seq, typename T> typename fusion::result_of::push_back<Seq const, T>::type operator ()(Seq const &seq, T const &t) const { return fusion::push_back(seq, t); } }; }}} #endif PK �J�[?;�;� � functional/fusion/pop_front.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file pop_front.hpp /// Proto callables Fusion pop_front // // Copyright 2010 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUNCTIONAL_FUSION_POP_FRONT_HPP_EAN_11_27_2010 #define BOOST_PROTO_FUNCTIONAL_FUSION_POP_FRONT_HPP_EAN_11_27_2010 #include <boost/fusion/include/begin.hpp> #include <boost/fusion/include/end.hpp> #include <boost/fusion/include/next.hpp> #include <boost/fusion/include/pop_front.hpp> #include <boost/proto/proto_fwd.hpp> namespace boost { namespace proto { namespace functional { /// \brief A PolymorphicFunctionObject type that invokes the /// \c fusion::pop_front() algorithm on its argument. /// /// A PolymorphicFunctionObject type that invokes the /// \c fusion::pop_front() algorithm on its argument. This is /// useful for defining a CallableTransform like \c pop_front(_) /// which removes the first child from a Proto expression node. /// Such a transform might be used as the first argument to the /// \c proto::fold\<\> transform; that is, fold all but /// the first child. struct pop_front { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Seq> struct result<This(Seq)> : result<This(Seq const &)> {}; template<typename This, typename Seq> struct result<This(Seq &)> : fusion::result_of::pop_front<Seq> {}; template<typename Seq> typename fusion::result_of::pop_front<Seq>::type operator ()(Seq &seq) const { // Work around a const-correctness issue in Fusion typedef typename fusion::result_of::pop_front<Seq>::type result_type; return result_type(fusion::next(fusion::begin(seq)), fusion::end(seq)); } template<typename Seq> typename fusion::result_of::pop_front<Seq const>::type operator ()(Seq const &seq) const { return fusion::pop_front(seq); } }; }}} #endif PK �J�[�pꁁ � functional/fusion/reverse.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file reverse.hpp /// Proto callables Fusion reverse // // Copyright 2010 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUNCTIONAL_FUSION_REVERSE_HPP_EAN_11_27_2010 #define BOOST_PROTO_FUNCTIONAL_FUSION_REVERSE_HPP_EAN_11_27_2010 #include <boost/fusion/include/reverse.hpp> #include <boost/proto/proto_fwd.hpp> namespace boost { namespace proto { namespace functional { /// \brief A PolymorphicFunctionObject type that invokes the /// \c fusion::reverse() algorithm on its argument. /// /// A PolymorphicFunctionObject type that invokes the /// \c fusion::reverse() algorithm on its argument. This is /// useful for defining a CallableTransform like \c reverse(_) /// which reverses the order of the children of a Proto /// expression node. struct reverse { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Seq> struct result<This(Seq)> : result<This(Seq const &)> {}; template<typename This, typename Seq> struct result<This(Seq &)> : fusion::result_of::reverse<Seq> {}; template<typename Seq> typename fusion::result_of::reverse<Seq>::type operator ()(Seq &seq) const { // Work around a const-correctness issue in Fusion typedef typename fusion::result_of::reverse<Seq>::type result_type; return result_type(seq); } template<typename Seq> typename fusion::result_of::reverse<Seq const>::type operator ()(Seq const &seq) const { return fusion::reverse(seq); } }; }}} #endif PK �J�[��� � functional/fusion/pop_back.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file pop_back.hpp /// Proto callables Fusion pop_back // // Copyright 2010 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUNCTIONAL_FUSION_POP_BACK_HPP_EAN_11_27_2010 #define BOOST_PROTO_FUNCTIONAL_FUSION_POP_BACK_HPP_EAN_11_27_2010 #include <boost/fusion/include/begin.hpp> #include <boost/fusion/include/end.hpp> #include <boost/fusion/include/prior.hpp> #include <boost/fusion/include/pop_back.hpp> #include <boost/proto/proto_fwd.hpp> namespace boost { namespace proto { namespace functional { /// \brief A PolymorphicFunctionObject type that invokes the /// \c fusion::pop_back() algorithm on its argument. /// /// A PolymorphicFunctionObject type that invokes the /// \c fusion::pop_back() algorithm on its argument. struct pop_back { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Seq> struct result<This(Seq)> : result<This(Seq const &)> {}; template<typename This, typename Seq> struct result<This(Seq &)> : fusion::result_of::pop_back<Seq> {}; template<typename Seq> typename fusion::result_of::pop_back<Seq>::type operator ()(Seq &seq) const { // Work around a const-correctness issue in Fusion typedef typename fusion::result_of::pop_back<Seq>::type result_type; return result_type(fusion::begin(seq), fusion::prior(fusion::end(seq))); } template<typename Seq> typename fusion::result_of::pop_back<Seq const>::type operator ()(Seq const &seq) const { return fusion::pop_back(seq); } }; }}} #endif PK �J�[��8�, , functional/fusion/at.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file at.hpp /// Proto callables Fusion at // // Copyright 2010 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUNCTIONAL_FUSION_AT_HPP_EAN_11_27_2010 #define BOOST_PROTO_FUNCTIONAL_FUSION_AT_HPP_EAN_11_27_2010 #include <boost/type_traits/add_const.hpp> #include <boost/type_traits/remove_const.hpp> #include <boost/type_traits/remove_reference.hpp> #include <boost/fusion/include/at.hpp> #include <boost/proto/proto_fwd.hpp> namespace boost { namespace proto { namespace functional { /// \brief A PolymorphicFunctionObject type that invokes the /// \c fusion::at() accessor on its argument. /// /// A PolymorphicFunctionObject type that invokes the /// \c fusion::at() accessor on its argument. struct at { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Seq, typename N> struct result<This(Seq, N)> : fusion::result_of::at< typename boost::remove_reference<Seq>::type , typename boost::remove_const<typename boost::remove_reference<N>::type>::type > {}; template<typename Seq, typename N> typename fusion::result_of::at<Seq, N>::type operator ()(Seq &seq, N const & BOOST_PROTO_DISABLE_IF_IS_CONST(Seq)) const { return fusion::at<N>(seq); } template<typename Seq, typename N> typename fusion::result_of::at<Seq const, N>::type operator ()(Seq const &seq, N const &) const { return fusion::at<N>(seq); } }; }}} #endif PK �J�[��LO O functional/std/utility.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file utility.hpp /// Proto callables for things found in the std \<utility\> header // // Copyright 2010 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUNCTIONAL_STD_UTILITY_HPP_EAN_11_27_2010 #define BOOST_PROTO_FUNCTIONAL_STD_UTILITY_HPP_EAN_11_27_2010 #include <utility> #include <boost/type_traits/remove_const.hpp> #include <boost/type_traits/remove_reference.hpp> #include <boost/proto/proto_fwd.hpp> namespace boost { namespace proto { namespace functional { /// \brief A PolymorphicFunctionObject type that invokes the /// \c std::make_pair() algorithm on its arguments. /// /// A PolymorphicFunctionObject type that invokes the /// \c std::make_pair() algorithm on its arguments. struct make_pair { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename First, typename Second> struct result<This(First, Second)> { typedef std::pair< typename remove_const<typename remove_reference<First>::type>::type , typename remove_const<typename remove_reference<Second>::type>::type > type; }; template<typename First, typename Second> std::pair<First, Second> operator()(First const &first, Second const &second) const { return std::make_pair(first, second); } }; /// \brief A PolymorphicFunctionObject type that returns /// the first element of a std::pair. /// /// A PolymorphicFunctionObject type that returns /// the first element of a std::pair.. struct first { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Pair> struct result<This(Pair)> { typedef typename Pair::first_type type; }; template<typename This, typename Pair> struct result<This(Pair &)> { typedef typename Pair::first_type &type; }; template<typename This, typename Pair> struct result<This(Pair const &)> { typedef typename Pair::first_type const &type; }; template<typename Pair> typename Pair::first_type &operator()(Pair &pair) const { return pair.first; } template<typename Pair> typename Pair::first_type const &operator()(Pair const &pair) const { return pair.first; } }; /// \brief A PolymorphicFunctionObject type that returns /// the second element of a std::pair. /// /// A PolymorphicFunctionObject type that returns /// the second element of a std::pair.. struct second { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Pair> struct result<This(Pair)> { typedef typename Pair::second_type type; }; template<typename This, typename Pair> struct result<This(Pair &)> { typedef typename Pair::second_type &type; }; template<typename This, typename Pair> struct result<This(Pair const &)> { typedef typename Pair::second_type const &type; }; template<typename Pair> typename Pair::second_type &operator()(Pair &pair) const { return pair.second; } template<typename Pair> typename Pair::second_type const &operator()(Pair const &pair) const { return pair.second; } }; }}} #endif PK �J�[��S] ] functional/std/iterator.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file iterator.hpp /// Proto callables for std functions found in \<iterator\> // // Copyright 2012 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUNCTIONAL_STD_ITERATOR_HPP_EAN_27_08_2012 #define BOOST_PROTO_FUNCTIONAL_STD_ITERATOR_HPP_EAN_27_08_2012 #include <iterator> #include <boost/type_traits/remove_const.hpp> #include <boost/type_traits/remove_reference.hpp> #include <boost/proto/proto_fwd.hpp> namespace boost { namespace proto { namespace functional { // A PolymorphicFunctionObject wrapping std::advance struct advance { BOOST_PROTO_CALLABLE() typedef void result_type; template<typename InputIterator, typename Distance> void operator()(InputIterator &x, Distance n) const { std::advance(x, n); } }; // A PolymorphicFunctionObject wrapping std::distance struct distance { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename InputIter1, typename InputIter2> struct result<This(InputIter1, InputIter2)> { typedef typename std::iterator_traits< typename boost::remove_const< typename boost::remove_reference<InputIter1>::type >::type >::difference_type type; }; template<typename InputIterator> typename std::iterator_traits<InputIterator>::difference_type operator()(InputIterator first, InputIterator last) const { return std::distance(first, last); } }; // A PolymorphicFunctionObject wrapping std::next struct next { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename ForwardIterator> struct result<This(ForwardIterator)> { typedef typename boost::remove_const< typename boost::remove_reference<ForwardIterator>::type >::type type; }; template<typename This, typename ForwardIterator, typename Distance> struct result<This(ForwardIterator, Distance)> { typedef typename boost::remove_const< typename boost::remove_reference<ForwardIterator>::type >::type type; }; template<typename ForwardIterator> ForwardIterator operator()(ForwardIterator x) const { return std::advance( x , static_cast<typename std::iterator_traits<ForwardIterator>::difference_type>(1) ); } template<typename ForwardIterator> ForwardIterator operator()( ForwardIterator x , typename std::iterator_traits<ForwardIterator>::difference_type n ) const { return std::advance(x, n); } }; // A PolymorphicFunctionObject wrapping std::prior struct prior { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename BidirectionalIterator> struct result<This(BidirectionalIterator)> { typedef typename boost::remove_const< typename boost::remove_reference<BidirectionalIterator>::type >::type type; }; template<typename This, typename BidirectionalIterator, typename Distance> struct result<This(BidirectionalIterator, Distance)> { typedef typename boost::remove_const< typename boost::remove_reference<BidirectionalIterator>::type >::type type; }; template<typename BidirectionalIterator> BidirectionalIterator operator()(BidirectionalIterator x) const { return std::advance( x , -static_cast<typename std::iterator_traits<BidirectionalIterator>::difference_type>(1) ); } template<typename BidirectionalIterator> BidirectionalIterator operator()( BidirectionalIterator x , typename std::iterator_traits<BidirectionalIterator>::difference_type n ) const { return std::advance(x, -n); } }; }}} #endif PK �J�[m�" functional/fusion.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file fusion.hpp /// Proto callables for things found in the Fusion library // // Copyright 2010 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUNCTIONAL_FUSION_HPP_EAN_11_27_2010 #define BOOST_PROTO_FUNCTIONAL_FUSION_HPP_EAN_11_27_2010 #include <boost/proto/functional/fusion/at.hpp> #include <boost/proto/functional/fusion/pop_back.hpp> #include <boost/proto/functional/fusion/pop_front.hpp> #include <boost/proto/functional/fusion/push_back.hpp> #include <boost/proto/functional/fusion/push_front.hpp> #include <boost/proto/functional/fusion/reverse.hpp> #endif PK �J�[��4 4 functional/std.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file std.hpp /// Proto callables for things found in the std library // // Copyright 2010 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUNCTIONAL_STD_HPP_EAN_11_27_2010 #define BOOST_PROTO_FUNCTIONAL_STD_HPP_EAN_11_27_2010 #include <boost/proto/functional/std/utility.hpp> #include <boost/proto/functional/std/iterator.hpp> #endif PK �J�[�c:� � args.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file args.hpp /// Contains definition of \c term\<\>, \c list1\<\>, \c list2\<\>, ... /// class templates. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_ARGS_HPP_EAN_04_01_2005 #define BOOST_PROTO_ARGS_HPP_EAN_04_01_2005 #include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/arithmetic/dec.hpp> #include <boost/preprocessor/iteration/iterate.hpp> #include <boost/preprocessor/repetition/enum_params.hpp> #include <boost/preprocessor/repetition/repeat.hpp> #include <boost/preprocessor/repetition/repeat_from_to.hpp> #include <boost/mpl/if.hpp> #include <boost/mpl/void.hpp> #include <boost/proto/proto_fwd.hpp> #include <boost/proto/detail/is_noncopyable.hpp> #include <boost/mpl/or.hpp> #include <boost/type_traits/is_function.hpp> #include <boost/type_traits/is_abstract.hpp> namespace boost { namespace proto { namespace detail { /// INTERNAL ONLY template<typename Expr> struct expr_traits { typedef Expr value_type; typedef Expr &reference; typedef Expr const &const_reference; }; /// INTERNAL ONLY template<typename Expr> struct expr_traits<Expr &> { typedef Expr value_type; typedef Expr &reference; typedef Expr &const_reference; }; /// INTERNAL ONLY template<typename Expr> struct expr_traits<Expr const &> { typedef Expr value_type; typedef Expr const &reference; typedef Expr const &const_reference; }; /// INTERNAL ONLY template<typename T> struct term_traits { typedef T value_type; typedef T &reference; typedef T const &const_reference; }; /// INTERNAL ONLY template<typename T> struct term_traits<T &> { typedef typename mpl::if_c<is_noncopyable<T>::value, T &, T>::type value_type; typedef T &reference; typedef T &const_reference; }; /// INTERNAL ONLY template<typename T> struct term_traits<T const &> { typedef T value_type; typedef T const &reference; typedef T const &const_reference; }; /// INTERNAL ONLY template<typename T, std::size_t N> struct term_traits<T (&)[N]> { typedef T value_type[N]; typedef T (&reference)[N]; typedef T (&const_reference)[N]; }; /// INTERNAL ONLY template<typename T, std::size_t N> struct term_traits<T const (&)[N]> { typedef T value_type[N]; typedef T const (&reference)[N]; typedef T const (&const_reference)[N]; }; /// INTERNAL ONLY template<typename T, std::size_t N> struct term_traits<T[N]> { typedef T value_type[N]; typedef T (&reference)[N]; typedef T const (&const_reference)[N]; }; /// INTERNAL ONLY template<typename T, std::size_t N> struct term_traits<T const[N]> { typedef T value_type[N]; typedef T const (&reference)[N]; typedef T const (&const_reference)[N]; }; } namespace argsns_ { // This is where term and all the different listN templates are defined #include <boost/proto/detail/args.hpp> } }} #endif PK �J�[���� � matches.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file matches.hpp /// Contains definition of matches\<\> metafunction for determining if /// a given expression matches a given pattern. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_MATCHES_HPP_EAN_11_03_2006 #define BOOST_PROTO_MATCHES_HPP_EAN_11_03_2006 #include <boost/config.hpp> #include <boost/detail/workaround.hpp> #include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/arithmetic/dec.hpp> #include <boost/preprocessor/arithmetic/sub.hpp> #include <boost/preprocessor/iteration/iterate.hpp> #include <boost/preprocessor/facilities/intercept.hpp> #include <boost/preprocessor/punctuation/comma_if.hpp> #include <boost/preprocessor/repetition/enum.hpp> #include <boost/preprocessor/repetition/enum_params.hpp> #include <boost/preprocessor/repetition/enum_shifted.hpp> #include <boost/preprocessor/repetition/enum_binary_params.hpp> #include <boost/preprocessor/repetition/enum_shifted_params.hpp> #include <boost/preprocessor/repetition/enum_trailing_params.hpp> #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> #include <boost/preprocessor/repetition/repeat.hpp> #include <boost/config.hpp> #include <boost/mpl/logical.hpp> #include <boost/mpl/eval_if.hpp> #include <boost/proto/detail/template_arity.hpp> #include <boost/utility/enable_if.hpp> #if BOOST_WORKAROUND(BOOST_MSVC, == 1310) #include <boost/type_traits/is_array.hpp> #endif #include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_convertible.hpp> #include <boost/type_traits/is_reference.hpp> #include <boost/type_traits/is_pointer.hpp> #include <boost/proto/proto_fwd.hpp> #include <boost/proto/traits.hpp> #include <boost/proto/transform/when.hpp> #include <boost/proto/transform/impl.hpp> #if defined(_MSC_VER) # pragma warning(push) # pragma warning(disable:4305) // 'specialization' : truncation from 'const int' to 'bool' #endif #define BOOST_PROTO_LOGICAL_typename_G BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G) #define BOOST_PROTO_LOGICAL_G BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G) namespace boost { namespace proto { namespace detail { template<typename Expr, typename BasicExpr, typename Grammar> struct matches_; template<bool B, typename Pred> struct and_2; template<typename And, typename Expr, typename State, typename Data> struct _and_impl; template<typename T, typename U> struct array_matches : mpl::false_ {}; template<typename T, std::size_t M> struct array_matches<T[M], T *> : mpl::true_ {}; template<typename T, std::size_t M> struct array_matches<T[M], T const *> : mpl::true_ {}; template<typename T, std::size_t M> struct array_matches<T[M], T[proto::N]> : mpl::true_ {}; template<typename T, typename U BOOST_PROTO_TEMPLATE_ARITY_PARAM(long Arity = detail::template_arity<U>::value) > struct lambda_matches : mpl::false_ {}; template<typename T> struct lambda_matches<T, proto::_ BOOST_PROTO_TEMPLATE_ARITY_PARAM(-1)> : mpl::true_ {}; template<typename T> struct lambda_matches<T, T BOOST_PROTO_TEMPLATE_ARITY_PARAM(-1)> : mpl::true_ {}; template<typename T, std::size_t M, typename U> struct lambda_matches<T[M], U BOOST_PROTO_TEMPLATE_ARITY_PARAM(-1)> : array_matches<T[M], U> {}; template<typename T, std::size_t M> struct lambda_matches<T[M], _ BOOST_PROTO_TEMPLATE_ARITY_PARAM(-1)> : mpl::true_ {}; template<typename T, std::size_t M> struct lambda_matches<T[M], T[M] BOOST_PROTO_TEMPLATE_ARITY_PARAM(-1)> : mpl::true_ {}; template<template<typename> class T, typename Expr0, typename Grammar0> struct lambda_matches<T<Expr0>, T<Grammar0> BOOST_PROTO_TEMPLATE_ARITY_PARAM(1) > : lambda_matches<Expr0, Grammar0> {}; // vararg_matches_impl template<typename Args1, typename Back, long From, long To> struct vararg_matches_impl; // vararg_matches template<typename Expr, typename Args1, typename Args2, typename Back, bool Can, bool Zero, typename Void = void> struct vararg_matches : mpl::false_ {}; template<typename Expr, typename Args1, typename Args2, typename Back> struct vararg_matches<Expr, Args1, Args2, Back, true, true, typename Back::proto_is_vararg_> : matches_< Expr , proto::basic_expr<ignore, Args1, Args1::arity> , proto::basic_expr<ignore, Args2, Args1::arity> > {}; template<typename Expr, typename Args1, typename Args2, typename Back> struct vararg_matches<Expr, Args1, Args2, Back, true, false, typename Back::proto_is_vararg_> : and_2< matches_< Expr , proto::basic_expr<ignore, Args1, Args2::arity> , proto::basic_expr<ignore, Args2, Args2::arity> >::value , vararg_matches_impl<Args1, typename Back::proto_grammar, Args2::arity + 1, Args1::arity> > {}; // How terminal_matches<> handles references and cv-qualifiers. // The cv and ref matter *only* if the grammar has a top-level ref. // // Expr | Grammar | Matches? // ------------------------------------- // T T yes // T & T yes // T const & T yes // T T & no // T & T & yes // T const & T & no // T T const & no // T & T const & no // T const & T const & yes template<typename T, typename U> struct is_cv_ref_compatible : mpl::true_ {}; template<typename T, typename U> struct is_cv_ref_compatible<T, U &> : mpl::false_ {}; template<typename T, typename U> struct is_cv_ref_compatible<T &, U &> : mpl::bool_<is_const<T>::value == is_const<U>::value> {}; #if BOOST_WORKAROUND(BOOST_MSVC, == 1310) // MSVC-7.1 has lots of problems with array types that have been // deduced. Partially specializing terminal_matches<> on array types // doesn't seem to work. template< typename T , typename U , bool B = is_array<BOOST_PROTO_UNCVREF(T)>::value > struct terminal_array_matches : mpl::false_ {}; template<typename T, typename U, std::size_t M> struct terminal_array_matches<T, U(&)[M], true> : is_convertible<T, U(&)[M]> {}; template<typename T, typename U> struct terminal_array_matches<T, U(&)[proto::N], true> : is_convertible<T, U *> {}; template<typename T, typename U> struct terminal_array_matches<T, U *, true> : is_convertible<T, U *> {}; // terminal_matches template<typename T, typename U> struct terminal_matches : mpl::or_< mpl::and_< is_cv_ref_compatible<T, U> , lambda_matches< BOOST_PROTO_UNCVREF(T) , BOOST_PROTO_UNCVREF(U) > > , terminal_array_matches<T, U> > {}; #else // terminal_matches template<typename T, typename U> struct terminal_matches : mpl::and_< is_cv_ref_compatible<T, U> , lambda_matches< BOOST_PROTO_UNCVREF(T) , BOOST_PROTO_UNCVREF(U) > > {}; template<typename T, std::size_t M> struct terminal_matches<T(&)[M], T(&)[proto::N]> : mpl::true_ {}; template<typename T, std::size_t M> struct terminal_matches<T(&)[M], T *> : mpl::true_ {}; // Avoid ambiguity errors on MSVC #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) template<typename T, std::size_t M> struct terminal_matches<T const (&)[M], T const[M]> : mpl::true_ {}; #endif #endif template<typename T> struct terminal_matches<T, T> : mpl::true_ {}; template<typename T> struct terminal_matches<T &, T> : mpl::true_ {}; template<typename T> struct terminal_matches<T const &, T> : mpl::true_ {}; template<typename T> struct terminal_matches<T, proto::_> : mpl::true_ {}; template<typename T> struct terminal_matches<T, exact<T> > : mpl::true_ {}; template<typename T, typename U> struct terminal_matches<T, proto::convertible_to<U> > : is_convertible<T, U> {}; // matches_ template<typename Expr, typename BasicExpr, typename Grammar> struct matches_ : mpl::false_ {}; template<typename Expr, typename BasicExpr> struct matches_< Expr, BasicExpr, proto::_ > : mpl::true_ {}; template<typename Expr, typename Tag, typename Args1, long N1, typename Args2, long N2> struct matches_< Expr, proto::basic_expr<Tag, Args1, N1>, proto::basic_expr<Tag, Args2, N2> > : vararg_matches< Expr, Args1, Args2, typename Args2::back_, (N1+2 > N2), (N2 > N1) > {}; template<typename Expr, typename Tag, typename Args1, long N1, typename Args2, long N2> struct matches_< Expr, proto::basic_expr<Tag, Args1, N1>, proto::basic_expr<proto::_, Args2, N2> > : vararg_matches< Expr, Args1, Args2, typename Args2::back_, (N1+2 > N2), (N2 > N1) > {}; template<typename Expr, typename Tag, typename Args1, typename Args2> struct matches_< Expr, proto::basic_expr<Tag, Args1, 0>, proto::basic_expr<Tag, Args2, 0> > : terminal_matches<typename Args1::child0, typename Args2::child0> {}; template<typename Expr, typename Tag, typename Args1, typename Args2, long N2> struct matches_< Expr, proto::basic_expr<Tag, Args1, 0>, proto::basic_expr<proto::_, Args2, N2> > : mpl::false_ {}; template<typename Expr, typename Tag, typename Args1, typename Args2> struct matches_< Expr, proto::basic_expr<Tag, Args1, 0>, proto::basic_expr<proto::_, Args2, 0> > : terminal_matches<typename Args1::child0, typename Args2::child0> {}; template<typename Expr, typename Tag, typename Args1, typename Args2> struct matches_< Expr, proto::basic_expr<Tag, Args1, 1>, proto::basic_expr<Tag, Args2, 1> > : matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar > {}; template<typename Expr, typename Tag, typename Args1, typename Args2> struct matches_< Expr, proto::basic_expr<Tag, Args1, 1>, proto::basic_expr<proto::_, Args2, 1> > : matches_< typename detail::expr_traits<typename Args1::child0>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar , typename Args2::child0::proto_grammar > {}; #include <boost/proto/detail/and_n.hpp> #include <boost/proto/detail/or_n.hpp> #include <boost/proto/detail/matches_.hpp> #include <boost/proto/detail/vararg_matches_impl.hpp> #include <boost/proto/detail/lambda_matches.hpp> // handle proto::if_ template<typename Expr, typename Tag, typename Args, long Arity, typename If, typename Then, typename Else> struct matches_<Expr, proto::basic_expr<Tag, Args, Arity>, proto::if_<If, Then, Else> > : mpl::eval_if_c< static_cast<bool>( remove_reference< typename when<_, If>::template impl<Expr, int, int>::result_type >::type::value ) , matches_<Expr, proto::basic_expr<Tag, Args, Arity>, typename Then::proto_grammar> , matches_<Expr, proto::basic_expr<Tag, Args, Arity>, typename Else::proto_grammar> >::type { typedef typename mpl::if_c< static_cast<bool>( remove_reference< typename when<_, If>::template impl<Expr, int, int>::result_type >::type::value ) , Then , Else >::type which; }; // handle degenerate cases of proto::or_ template<typename Expr, typename BasicExpr> struct matches_<Expr, BasicExpr, or_<> > : mpl::false_ { typedef not_<_> which; }; template<typename Expr, typename BasicExpr, typename G0> struct matches_<Expr, BasicExpr, or_<G0> > : matches_<Expr, BasicExpr, typename G0::proto_grammar> { typedef G0 which; }; // handle degenerate cases of proto::and_ template<typename Expr, typename BasicExpr> struct matches_<Expr, BasicExpr, and_<> > : mpl::true_ {}; template<typename Expr, typename BasicExpr, typename G0> struct matches_<Expr, BasicExpr, and_<G0> > : matches_<Expr, BasicExpr, typename G0::proto_grammar> {}; // handle proto::not_ template<typename Expr, typename BasicExpr, typename Grammar> struct matches_<Expr, BasicExpr, not_<Grammar> > : mpl::not_<matches_<Expr, BasicExpr, typename Grammar::proto_grammar> > {}; // handle proto::switch_ template<typename Expr, typename Tag, typename Args, long Arity, typename Cases, typename Transform> struct matches_<Expr, proto::basic_expr<Tag, Args, Arity>, switch_<Cases, Transform> > : matches_< Expr , proto::basic_expr<Tag, Args, Arity> , typename Cases::template case_< typename when<_,Transform>::template impl<Expr,int,int>::result_type >::proto_grammar > { typedef typename Cases::template case_< typename when<_, Transform>::template impl<Expr, int, int>::result_type > which; }; // handle proto::switch_ with the default Transform for specially for better compile times template<typename Expr, typename Tag, typename Args, long Arity, typename Cases> struct matches_<Expr, proto::basic_expr<Tag, Args, Arity>, switch_<Cases> > : matches_< Expr , proto::basic_expr<Tag, Args, Arity> , typename Cases::template case_<Tag>::proto_grammar > { typedef typename Cases::template case_<Tag> which; }; } /// \brief A Boolean metafunction that evaluates whether a given /// expression type matches a grammar. /// /// <tt>matches\<Expr,Grammar\></tt> inherits (indirectly) from /// \c mpl::true_ if <tt>Expr::proto_grammar</tt> matches /// <tt>Grammar::proto_grammar</tt>, and from \c mpl::false_ /// otherwise. /// /// Non-terminal expressions are matched against a grammar /// according to the following rules: /// /// \li The wildcard pattern, \c _, matches any expression. /// \li An expression <tt>expr\<AT, listN\<A0,A1,...An\> \></tt> /// matches a grammar <tt>expr\<BT, listN\<B0,B1,...Bn\> \></tt> /// if \c BT is \c _ or \c AT, and if \c Ax matches \c Bx for /// each \c x in <tt>[0,n)</tt>. /// \li An expression <tt>expr\<AT, listN\<A0,...An,U0,...Um\> \></tt> /// matches a grammar <tt>expr\<BT, listM\<B0,...Bn,vararg\<V\> \> \></tt> /// if \c BT is \c _ or \c AT, and if \c Ax matches \c Bx /// for each \c x in <tt>[0,n)</tt> and if \c Ux matches \c V /// for each \c x in <tt>[0,m)</tt>. /// \li An expression \c E matches <tt>or_\<B0,B1,...Bn\></tt> if \c E /// matches some \c Bx for \c x in <tt>[0,n)</tt>. /// \li An expression \c E matches <tt>and_\<B0,B1,...Bn\></tt> if \c E /// matches all \c Bx for \c x in <tt>[0,n)</tt>. /// \li An expression \c E matches <tt>if_\<T,U,V\></tt> if /// <tt>boost::result_of\<when\<_,T\>(E,int,int)\>::type::value</tt> /// is \c true and \c E matches \c U; or, if /// <tt>boost::result_of\<when\<_,T\>(E,int,int)\>::type::value</tt> /// is \c false and \c E matches \c V. (Note: \c U defaults to \c _ /// and \c V defaults to \c not_\<_\>.) /// \li An expression \c E matches <tt>not_\<T\></tt> if \c E does /// not match \c T. /// \li An expression \c E matches <tt>switch_\<C,T\></tt> if /// \c E matches <tt>C::case_\<boost::result_of\<T(E)\>::type\></tt>. /// (Note: T defaults to <tt>tag_of\<_\>()</tt>.) /// /// A terminal expression <tt>expr\<AT,term\<A\> \></tt> matches /// a grammar <tt>expr\<BT,term\<B\> \></tt> if \c BT is \c AT or /// \c proto::_ and if one of the following is true: /// /// \li \c B is the wildcard pattern, \c _ /// \li \c A is \c B /// \li \c A is <tt>B &</tt> /// \li \c A is <tt>B const &</tt> /// \li \c B is <tt>exact\<A\></tt> /// \li \c B is <tt>convertible_to\<X\></tt> and /// <tt>is_convertible\<A,X\>::value</tt> is \c true. /// \li \c A is <tt>X[M]</tt> or <tt>X(&)[M]</tt> and /// \c B is <tt>X[proto::N]</tt>. /// \li \c A is <tt>X(&)[M]</tt> and \c B is <tt>X(&)[proto::N]</tt>. /// \li \c A is <tt>X[M]</tt> or <tt>X(&)[M]</tt> and /// \c B is <tt>X*</tt>. /// \li \c B lambda-matches \c A (see below). /// /// A type \c B lambda-matches \c A if one of the following is true: /// /// \li \c B is \c A /// \li \c B is the wildcard pattern, \c _ /// \li \c B is <tt>T\<B0,B1,...Bn\></tt> and \c A is /// <tt>T\<A0,A1,...An\></tt> and for each \c x in /// <tt>[0,n)</tt>, \c Ax and \c Bx are types /// such that \c Ax lambda-matches \c Bx template<typename Expr, typename Grammar> struct matches : detail::matches_< typename Expr::proto_derived_expr , typename Expr::proto_grammar , typename Grammar::proto_grammar > {}; /// INTERNAL ONLY /// template<typename Expr, typename Grammar> struct matches<Expr &, Grammar> : detail::matches_< typename Expr::proto_derived_expr , typename Expr::proto_grammar , typename Grammar::proto_grammar > {}; /// \brief A wildcard grammar element that matches any expression, /// and a transform that returns the current expression unchanged. /// /// The wildcard type, \c _, is a grammar element such that /// <tt>matches\<E,_\>::value</tt> is \c true for any expression /// type \c E. /// /// The wildcard can also be used as a stand-in for a template /// argument when matching terminals. For instance, the following /// is a grammar that will match any <tt>std::complex\<\></tt> /// terminal: /// /// \code /// BOOST_MPL_ASSERT(( /// matches< /// terminal<std::complex<double> >::type /// , terminal<std::complex< _ > > /// > /// )); /// \endcode /// /// When used as a transform, \c _ returns the current expression /// unchanged. For instance, in the following, \c _ is used with /// the \c fold\<\> transform to fold the children of a node: /// /// \code /// struct CountChildren /// : or_< /// // Terminals have no children /// when<terminal<_>, mpl::int_<0>()> /// // Use fold<> to count the children of non-terminals /// , otherwise< /// fold< /// _ // <-- fold the current expression /// , mpl::int_<0>() /// , mpl::plus<_state, mpl::int_<1> >() /// > /// > /// > /// {}; /// \endcode struct _ : transform<_> { typedef _ proto_grammar; template<typename Expr, typename State, typename Data> struct impl : transform_impl<Expr, State, Data> { typedef Expr result_type; /// \param expr An expression /// \return \c e BOOST_PROTO_RETURN_TYPE_STRICT_LOOSE(result_type, typename impl::expr_param) operator()( typename impl::expr_param e , typename impl::state_param , typename impl::data_param ) const { return e; } }; }; namespace detail { template<typename Expr, typename State, typename Data> struct _and_impl<proto::and_<>, Expr, State, Data> : proto::_::impl<Expr, State, Data> {}; template<typename G0, typename Expr, typename State, typename Data> struct _and_impl<proto::and_<G0>, Expr, State, Data> : proto::when<proto::_, G0>::template impl<Expr, State, Data> {}; } /// \brief Inverts the set of expressions matched by a grammar. When /// used as a transform, \c not_\<\> returns the current expression /// unchanged. /// /// If an expression type \c E does not match a grammar \c G, then /// \c E \e does match <tt>not_\<G\></tt>. For example, /// <tt>not_\<terminal\<_\> \></tt> will match any non-terminal. template<typename Grammar> struct not_ : transform<not_<Grammar> > { typedef not_ proto_grammar; template<typename Expr, typename State, typename Data> struct impl : transform_impl<Expr, State, Data> { typedef Expr result_type; /// \param e An expression /// \pre <tt>matches\<Expr,not_\>::value</tt> is \c true. /// \return \c e BOOST_PROTO_RETURN_TYPE_STRICT_LOOSE(result_type, typename impl::expr_param) operator()( typename impl::expr_param e , typename impl::state_param , typename impl::data_param ) const { return e; } }; }; /// \brief Used to select one grammar or another based on the result /// of a compile-time Boolean. When used as a transform, \c if_\<\> /// selects between two transforms based on a compile-time Boolean. /// /// When <tt>if_\<If,Then,Else\></tt> is used as a grammar, \c If /// must be a Proto transform and \c Then and \c Else must be grammars. /// An expression type \c E matches <tt>if_\<If,Then,Else\></tt> if /// <tt>boost::result_of\<when\<_,If\>(E,int,int)\>::type::value</tt> /// is \c true and \c E matches \c U; or, if /// <tt>boost::result_of\<when\<_,If\>(E,int,int)\>::type::value</tt> /// is \c false and \c E matches \c V. /// /// The template parameter \c Then defaults to \c _ /// and \c Else defaults to \c not\<_\>, so an expression type \c E /// will match <tt>if_\<If\></tt> if and only if /// <tt>boost::result_of\<when\<_,If\>(E,int,int)\>::type::value</tt> /// is \c true. /// /// \code /// // A grammar that only matches integral terminals, /// // using is_integral<> from Boost.Type_traits. /// struct IsIntegral /// : and_< /// terminal<_> /// , if_< is_integral<_value>() > /// > /// {}; /// \endcode /// /// When <tt>if_\<If,Then,Else\></tt> is used as a transform, \c If, /// \c Then and \c Else must be Proto transforms. When applying /// the transform to an expression \c E, state \c S and data \c V, /// if <tt>boost::result_of\<when\<_,If\>(E,S,V)\>::type::value</tt> /// is \c true then the \c Then transform is applied; otherwise /// the \c Else transform is applied. /// /// \code /// // Match a terminal. If the terminal is integral, return /// // mpl::true_; otherwise, return mpl::false_. /// struct IsIntegral2 /// : when< /// terminal<_> /// , if_< /// is_integral<_value>() /// , mpl::true_() /// , mpl::false_() /// > /// > /// {}; /// \endcode template< typename If , typename Then // = _ , typename Else // = not_<_> > struct if_ : transform<if_<If, Then, Else> > { typedef if_ proto_grammar; template<typename Expr, typename State, typename Data> struct impl : transform_impl<Expr, State, Data> { typedef typename when<_, If>::template impl<Expr, State, Data>::result_type condition; typedef typename mpl::if_c< static_cast<bool>(remove_reference<condition>::type::value) , when<_, Then> , when<_, Else> >::type which; typedef typename which::template impl<Expr, State, Data>::result_type result_type; /// \param e An expression /// \param s The current state /// \param d A data of arbitrary type /// \return <tt>which::impl<Expr, State, Data>()(e, s, d)</tt> result_type operator ()( typename impl::expr_param e , typename impl::state_param s , typename impl::data_param d ) const { return typename which::template impl<Expr, State, Data>()(e, s, d); } }; }; /// \brief For matching one of a set of alternate grammars. Alternates /// tried in order to avoid ambiguity. When used as a transform, \c or_\<\> /// applies the transform associated with the first grammar that matches /// the expression. /// /// An expression type \c E matches <tt>or_\<B0,B1,...Bn\></tt> if \c E /// matches any \c Bx for \c x in <tt>[0,n)</tt>. /// /// When applying <tt>or_\<B0,B1,...Bn\></tt> as a transform with an /// expression \c e of type \c E, state \c s and data \c d, it is /// equivalent to <tt>Bx()(e, s, d)</tt>, where \c x is the lowest /// number such that <tt>matches\<E,Bx\>::value</tt> is \c true. template<BOOST_PROTO_LOGICAL_typename_G> struct or_ : transform<or_<BOOST_PROTO_LOGICAL_G> > { typedef or_ proto_grammar; /// \param e An expression /// \param s The current state /// \param d A data of arbitrary type /// \pre <tt>matches\<Expr,or_\>::value</tt> is \c true. /// \return <tt>which()(e, s, d)</tt>, where <tt>which</tt> is the /// sub-grammar that matched <tt>Expr</tt>. template<typename Expr, typename State, typename Data> struct impl : detail::matches_< typename Expr::proto_derived_expr , typename Expr::proto_grammar , or_ >::which::template impl<Expr, State, Data> {}; template<typename Expr, typename State, typename Data> struct impl<Expr &, State, Data> : detail::matches_< typename Expr::proto_derived_expr , typename Expr::proto_grammar , or_ >::which::template impl<Expr &, State, Data> {}; }; /// \brief For matching all of a set of grammars. When used as a /// transform, \c and_\<\> applies the transforms associated with /// the each grammar in the set, and returns the result of the last. /// /// An expression type \c E matches <tt>and_\<B0,B1,...Bn\></tt> if \c E /// matches all \c Bx for \c x in <tt>[0,n)</tt>. /// /// When applying <tt>and_\<B0,B1,...Bn\></tt> as a transform with an /// expression \c e, state \c s and data \c d, it is /// equivalent to <tt>(B0()(e, s, d),B1()(e, s, d),...Bn()(e, s, d))</tt>. template<BOOST_PROTO_LOGICAL_typename_G> struct and_ : transform<and_<BOOST_PROTO_LOGICAL_G> > { typedef and_ proto_grammar; template<typename Expr, typename State, typename Data> struct impl : detail::_and_impl<and_, Expr, State, Data> {}; }; /// \brief For matching one of a set of alternate grammars, which /// are looked up based on some property of an expression. The /// property on which to dispatch is specified by the \c Transform /// template parameter, which defaults to <tt>tag_of\<_\>()</tt>. /// That is, when the \c Trannsform is not specified, the alternate /// grammar is looked up using the tag type of the current expression. /// /// When used as a transform, \c switch_\<\> applies the transform /// associated with the grammar that matches the expression. /// /// \note \c switch_\<\> is functionally identical to \c or_\<\> but /// is often more efficient. It does a fast, O(1) lookup using the /// result of the specified transform to find a sub-grammar that may /// potentially match the expression. /// /// An expression type \c E matches <tt>switch_\<C,T\></tt> if \c E /// matches <tt>C::case_\<boost::result_of\<T(E)\>::type\></tt>. /// /// When applying <tt>switch_\<C,T\></tt> as a transform with an /// expression \c e of type \c E, state \c s of type \S and data /// \c d of type \c D, it is equivalent to /// <tt>C::case_\<boost::result_of\<T(E,S,D)\>::type\>()(e, s, d)</tt>. template<typename Cases, typename Transform> struct switch_ : transform<switch_<Cases, Transform> > { typedef switch_ proto_grammar; template<typename Expr, typename State, typename Data> struct impl : Cases::template case_< typename when<_, Transform>::template impl<Expr, State, Data>::result_type >::template impl<Expr, State, Data> {}; }; /// INTERNAL ONLY (This is merely a compile-time optimization for the common case) /// template<typename Cases> struct switch_<Cases> : transform<switch_<Cases> > { typedef switch_ proto_grammar; template<typename Expr, typename State, typename Data> struct impl : Cases::template case_<typename Expr::proto_tag>::template impl<Expr, State, Data> {}; template<typename Expr, typename State, typename Data> struct impl<Expr &, State, Data> : Cases::template case_<typename Expr::proto_tag>::template impl<Expr &, State, Data> {}; }; /// \brief For forcing exact matches of terminal types. /// /// By default, matching terminals ignores references and /// cv-qualifiers. For instance, a terminal expression of /// type <tt>terminal\<int const &\>::type</tt> will match /// the grammar <tt>terminal\<int\></tt>. If that is not /// desired, you can force an exact match with /// <tt>terminal\<exact\<int\> \></tt>. This will only /// match integer terminals where the terminal is held by /// value. template<typename T> struct exact {}; /// \brief For matching terminals that are convertible to /// a type. /// /// Use \c convertible_to\<\> to match a terminal that is /// convertible to some type. For example, the grammar /// <tt>terminal\<convertible_to\<int\> \></tt> will match /// any terminal whose argument is convertible to an integer. /// /// \note The trait \c is_convertible\<\> from Boost.Type_traits /// is used to determinal convertibility. template<typename T> struct convertible_to {}; /// \brief For matching a Grammar to a variable number of /// sub-expressions. /// /// An expression type <tt>expr\<AT, listN\<A0,...An,U0,...Um\> \></tt> /// matches a grammar <tt>expr\<BT, listM\<B0,...Bn,vararg\<V\> \> \></tt> /// if \c BT is \c _ or \c AT, and if \c Ax matches \c Bx /// for each \c x in <tt>[0,n)</tt> and if \c Ux matches \c V /// for each \c x in <tt>[0,m)</tt>. /// /// For example: /// /// \code /// // Match any function call expression, irregardless /// // of the number of function arguments: /// struct Function /// : function< vararg<_> > /// {}; /// \endcode /// /// When used as a transform, <tt>vararg\<G\></tt> applies /// <tt>G</tt>'s transform. template<typename Grammar> struct vararg : Grammar { /// INTERNAL ONLY typedef void proto_is_vararg_; }; /// INTERNAL ONLY /// template<BOOST_PROTO_LOGICAL_typename_G> struct is_callable<or_<BOOST_PROTO_LOGICAL_G> > : mpl::true_ {}; /// INTERNAL ONLY /// template<BOOST_PROTO_LOGICAL_typename_G> struct is_callable<and_<BOOST_PROTO_LOGICAL_G> > : mpl::true_ {}; /// INTERNAL ONLY /// template<typename Grammar> struct is_callable<not_<Grammar> > : mpl::true_ {}; /// INTERNAL ONLY /// template<typename If, typename Then, typename Else> struct is_callable<if_<If, Then, Else> > : mpl::true_ {}; /// INTERNAL ONLY /// template<typename Grammar> struct is_callable<vararg<Grammar> > : mpl::true_ {}; /// INTERNAL ONLY /// template<typename Cases, typename Transform> struct is_callable<switch_<Cases, Transform> > : mpl::true_ {}; }} #undef BOOST_PROTO_LOGICAL_typename_G #undef BOOST_PROTO_LOGICAL_G #if defined(_MSC_VER) # pragma warning(pop) #endif #endif PK �J�[y���) �) debug.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file debug.hpp /// Utilities for debugging Proto expression trees // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_DEBUG_HPP_EAN_12_31_2006 #define BOOST_PROTO_DEBUG_HPP_EAN_12_31_2006 #include <iostream> #include <boost/preprocessor/stringize.hpp> #include <boost/core/ref.hpp> #include <boost/core/typeinfo.hpp> #include <boost/mpl/assert.hpp> #include <boost/proto/proto_fwd.hpp> #include <boost/proto/traits.hpp> #include <boost/proto/matches.hpp> #include <boost/proto/fusion.hpp> #include <boost/fusion/algorithm/iteration/for_each.hpp> namespace boost { namespace proto { namespace tagns_ { namespace tag { #define BOOST_PROTO_DEFINE_TAG_INSERTION(Tag) \ /** \brief INTERNAL ONLY */ \ inline std::ostream &operator <<(std::ostream &sout, Tag const &) \ { \ return sout << BOOST_PP_STRINGIZE(Tag); \ } \ /**/ BOOST_PROTO_DEFINE_TAG_INSERTION(terminal) BOOST_PROTO_DEFINE_TAG_INSERTION(unary_plus) BOOST_PROTO_DEFINE_TAG_INSERTION(negate) BOOST_PROTO_DEFINE_TAG_INSERTION(dereference) BOOST_PROTO_DEFINE_TAG_INSERTION(complement) BOOST_PROTO_DEFINE_TAG_INSERTION(address_of) BOOST_PROTO_DEFINE_TAG_INSERTION(logical_not) BOOST_PROTO_DEFINE_TAG_INSERTION(pre_inc) BOOST_PROTO_DEFINE_TAG_INSERTION(pre_dec) BOOST_PROTO_DEFINE_TAG_INSERTION(post_inc) BOOST_PROTO_DEFINE_TAG_INSERTION(post_dec) BOOST_PROTO_DEFINE_TAG_INSERTION(shift_left) BOOST_PROTO_DEFINE_TAG_INSERTION(shift_right) BOOST_PROTO_DEFINE_TAG_INSERTION(multiplies) BOOST_PROTO_DEFINE_TAG_INSERTION(divides) BOOST_PROTO_DEFINE_TAG_INSERTION(modulus) BOOST_PROTO_DEFINE_TAG_INSERTION(plus) BOOST_PROTO_DEFINE_TAG_INSERTION(minus) BOOST_PROTO_DEFINE_TAG_INSERTION(less) BOOST_PROTO_DEFINE_TAG_INSERTION(greater) BOOST_PROTO_DEFINE_TAG_INSERTION(less_equal) BOOST_PROTO_DEFINE_TAG_INSERTION(greater_equal) BOOST_PROTO_DEFINE_TAG_INSERTION(equal_to) BOOST_PROTO_DEFINE_TAG_INSERTION(not_equal_to) BOOST_PROTO_DEFINE_TAG_INSERTION(logical_or) BOOST_PROTO_DEFINE_TAG_INSERTION(logical_and) BOOST_PROTO_DEFINE_TAG_INSERTION(bitwise_and) BOOST_PROTO_DEFINE_TAG_INSERTION(bitwise_or) BOOST_PROTO_DEFINE_TAG_INSERTION(bitwise_xor) BOOST_PROTO_DEFINE_TAG_INSERTION(comma) BOOST_PROTO_DEFINE_TAG_INSERTION(mem_ptr) BOOST_PROTO_DEFINE_TAG_INSERTION(assign) BOOST_PROTO_DEFINE_TAG_INSERTION(shift_left_assign) BOOST_PROTO_DEFINE_TAG_INSERTION(shift_right_assign) BOOST_PROTO_DEFINE_TAG_INSERTION(multiplies_assign) BOOST_PROTO_DEFINE_TAG_INSERTION(divides_assign) BOOST_PROTO_DEFINE_TAG_INSERTION(modulus_assign) BOOST_PROTO_DEFINE_TAG_INSERTION(plus_assign) BOOST_PROTO_DEFINE_TAG_INSERTION(minus_assign) BOOST_PROTO_DEFINE_TAG_INSERTION(bitwise_and_assign) BOOST_PROTO_DEFINE_TAG_INSERTION(bitwise_or_assign) BOOST_PROTO_DEFINE_TAG_INSERTION(bitwise_xor_assign) BOOST_PROTO_DEFINE_TAG_INSERTION(subscript) BOOST_PROTO_DEFINE_TAG_INSERTION(member) BOOST_PROTO_DEFINE_TAG_INSERTION(if_else_) BOOST_PROTO_DEFINE_TAG_INSERTION(function) #undef BOOST_PROTO_DEFINE_TAG_INSERTION }} namespace hidden_detail_ { struct ostream_wrapper { ostream_wrapper(std::ostream &sout) : sout_(sout) {} std::ostream &sout_; BOOST_DELETED_FUNCTION(ostream_wrapper &operator =(ostream_wrapper const &)) }; struct named_any { template<typename T> named_any(T const &) : name_(BOOST_CORE_TYPEID(T).name()) {} char const *name_; }; inline std::ostream &operator <<(ostream_wrapper sout_wrap, named_any t) { return sout_wrap.sout_ << t.name_; } } namespace detail { // copyable functor to pass by value to fusion::foreach struct display_expr_impl; struct display_expr_impl_functor { display_expr_impl_functor(display_expr_impl const& impl): impl_(impl) {} template<typename Expr> void operator()(Expr const &expr) const { this->impl_(expr); } private: display_expr_impl const& impl_; }; struct display_expr_impl { explicit display_expr_impl(std::ostream &sout, int depth = 0) : depth_(depth) , first_(true) , sout_(sout) {} template<typename Expr> void operator()(Expr const &expr) const { this->impl(expr, mpl::long_<arity_of<Expr>::value>()); } BOOST_DELETED_FUNCTION(display_expr_impl(display_expr_impl const &)) BOOST_DELETED_FUNCTION(display_expr_impl &operator =(display_expr_impl const &)) private: template<typename Expr> void impl(Expr const &expr, mpl::long_<0>) const { using namespace hidden_detail_; typedef typename tag_of<Expr>::type tag; this->sout_.width(this->depth_); this->sout_ << (this->first_? "" : ", "); this->sout_ << tag() << "(" << proto::value(expr) << ")\n"; this->first_ = false; } template<typename Expr, typename Arity> void impl(Expr const &expr, Arity) const { using namespace hidden_detail_; typedef typename tag_of<Expr>::type tag; this->sout_.width(this->depth_); this->sout_ << (this->first_? "" : ", "); this->sout_ << tag() << "(\n"; display_expr_impl display(this->sout_, this->depth_ + 4); fusion::for_each(expr, display_expr_impl_functor(display)); this->sout_.width(this->depth_); this->sout_ << "" << ")\n"; this->first_ = false; } int depth_; mutable bool first_; std::ostream &sout_; }; } namespace functional { /// \brief Pretty-print a Proto expression tree. /// /// A PolymorphicFunctionObject which accepts a Proto expression /// tree and pretty-prints it to an \c ostream for debugging /// purposes. struct display_expr { BOOST_PROTO_CALLABLE() typedef void result_type; /// \param sout The \c ostream to which the expression tree /// will be written. /// \param depth The starting indentation depth for this node. /// Children nodes will be displayed at a starting /// depth of <tt>depth+4</tt>. explicit display_expr(std::ostream &sout = std::cout, int depth = 0) : depth_(depth) , sout_(sout) {} /// \brief Pretty-print the current node in a Proto expression /// tree. template<typename Expr> void operator()(Expr const &expr) const { detail::display_expr_impl(this->sout_, this->depth_)(expr); } private: int depth_; reference_wrapper<std::ostream> sout_; }; } /// \brief Pretty-print a Proto expression tree. /// /// \note Equivalent to <tt>functional::display_expr(0, sout)(expr)</tt> /// \param expr The Proto expression tree to pretty-print /// \param sout The \c ostream to which the output should be /// written. If not specified, defaults to /// <tt>std::cout</tt>. template<typename Expr> void display_expr(Expr const &expr, std::ostream &sout) { functional::display_expr(sout, 0)(expr); } /// \overload /// template<typename Expr> void display_expr(Expr const &expr) { functional::display_expr()(expr); } /// \brief Assert at compile time that a particular expression /// matches the specified grammar. /// /// \note Equivalent to <tt>BOOST_MPL_ASSERT((proto::matches\<Expr, Grammar\>))</tt> /// \param expr The Proto expression to check againts <tt>Grammar</tt> template<typename Grammar, typename Expr> void assert_matches(Expr const & /*expr*/) { BOOST_MPL_ASSERT((proto::matches<Expr, Grammar>)); } /// \brief Assert at compile time that a particular expression /// does not match the specified grammar. /// /// \note Equivalent to <tt>BOOST_MPL_ASSERT_NOT((proto::matches\<Expr, Grammar\>))</tt> /// \param expr The Proto expression to check againts <tt>Grammar</tt> template<typename Grammar, typename Expr> void assert_matches_not(Expr const & /*expr*/) { BOOST_MPL_ASSERT_NOT((proto::matches<Expr, Grammar>)); } /// \brief Assert at compile time that a particular expression /// matches the specified grammar. /// /// \note Equivalent to <tt>proto::assert_matches\<Grammar\>(Expr)</tt> /// \param Expr The Proto expression to check againts <tt>Grammar</tt> /// \param Grammar The grammar used to validate Expr. #define BOOST_PROTO_ASSERT_MATCHES(Expr, Grammar) \ (true ? (void)0 : boost::proto::assert_matches<Grammar>(Expr)) /// \brief Assert at compile time that a particular expression /// does not match the specified grammar. /// /// \note Equivalent to <tt>proto::assert_matches_not\<Grammar\>(Expr)</tt> /// \param Expr The Proto expression to check againts <tt>Grammar</tt> /// \param Grammar The grammar used to validate Expr. #define BOOST_PROTO_ASSERT_MATCHES_NOT(Expr, Grammar) \ (true ? (void)0 : boost::proto::assert_matches_not<Grammar>(Expr)) }} #endif PK �J�[�/I deep_copy.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file deep_copy.hpp /// Replace all nodes stored by reference by nodes stored by value. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_DEEP_COPY_HPP_EAN_11_21_2006 #define BOOST_PROTO_DEEP_COPY_HPP_EAN_11_21_2006 #include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/repetition/enum.hpp> #include <boost/preprocessor/iteration/iterate.hpp> #include <boost/mpl/if.hpp> #include <boost/type_traits/remove_reference.hpp> #include <boost/proto/proto_fwd.hpp> #include <boost/proto/args.hpp> #include <boost/proto/expr.hpp> namespace boost { namespace proto { namespace detail { template<typename Expr, long Arity = Expr::proto_arity_c> struct deep_copy_impl; template<typename Expr> struct deep_copy_impl<Expr, 0> { typedef typename base_expr< typename Expr::proto_domain , tag::terminal , term<typename term_traits<typename Expr::proto_child0>::value_type> >::type expr_type; typedef typename Expr::proto_generator proto_generator; typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type; template<typename Expr2, typename S, typename D> result_type operator()(Expr2 const &e, S const &, D const &) const { return proto_generator()(expr_type::make(e.proto_base().child0)); } }; } namespace result_of { /// \brief A metafunction for calculating the return type /// of \c proto::deep_copy(). /// /// A metafunction for calculating the return type /// of \c proto::deep_copy(). The type parameter \c Expr /// should be the type of a Proto expression tree. /// It should not be a reference type, nor should it /// be cv-qualified. template<typename Expr> struct deep_copy { typedef typename detail::deep_copy_impl< BOOST_PROTO_UNCVREF(Expr) >::result_type type; }; } namespace functional { /// \brief A PolymorphicFunctionObject type for deep-copying /// Proto expression trees. /// /// A PolymorphicFunctionObject type for deep-copying /// Proto expression trees. When a tree is deep-copied, /// all internal nodes and most terminals held by reference /// are instead held by value. /// /// \attention Terminals of reference-to-function type are /// left unchanged. Terminals of reference-to-array type are /// stored by value, which can cause a large amount of data /// to be passed by value and stored on the stack. struct deep_copy { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Expr> struct result<This(Expr)> { typedef typename detail::deep_copy_impl< BOOST_PROTO_UNCVREF(Expr) >::result_type type; }; /// \brief Deep-copies a Proto expression tree, turning all /// nodes and terminals held by reference into ones held by /// value. template<typename Expr> typename result_of::deep_copy<Expr>::type operator()(Expr const &e) const { return proto::detail::deep_copy_impl<Expr>()(e, 0, 0); } }; } /// \brief A function for deep-copying /// Proto expression trees. /// /// A function for deep-copying /// Proto expression trees. When a tree is deep-copied, /// all internal nodes and most terminals held by reference /// are instead held by value. /// /// \attention Terminals of reference-to-function type are /// left unchanged. /// /// \sa proto::functional::deep_copy. template<typename Expr> typename proto::result_of::deep_copy<Expr>::type deep_copy(Expr const &e) { return proto::detail::deep_copy_impl<Expr>()(e, 0, 0); } /// \brief A PrimitiveTransform for deep-copying /// Proto expression trees. /// /// A PrimitiveTransform for deep-copying /// Proto expression trees. When a tree is deep-copied, /// all internal nodes and most terminals held by reference /// are instead held by value. /// /// \attention Terminals of reference-to-function type are /// left unchanged. /// /// \sa proto::functional::deep_copy. struct _deep_copy : proto::transform<_deep_copy> { template<typename E, typename S, typename D> struct impl : detail::deep_copy_impl<BOOST_PROTO_UNCVREF(E)> {}; }; namespace detail { // include the definition of deep_copy_impl #include <boost/proto/detail/deep_copy.hpp> } }} #endif // BOOST_PROTO_COMPILER_DEEP_COPY_HPP_EAN_11_21_2006 PK �J�[ٜ��Q �Q fusion.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file fusion.hpp /// Make any Proto expression a valid Fusion sequence // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_FUSION_HPP_EAN_11_04_2006 #define BOOST_PROTO_FUSION_HPP_EAN_11_04_2006 #include <boost/config.hpp> #include <boost/mpl/if.hpp> #include <boost/mpl/bool.hpp> #include <boost/mpl/long.hpp> #include <boost/mpl/sequence_tag_fwd.hpp> #include <boost/utility/enable_if.hpp> #include <boost/fusion/include/is_view.hpp> #include <boost/fusion/include/tag_of_fwd.hpp> #include <boost/fusion/include/category_of.hpp> #include <boost/fusion/include/iterator_base.hpp> #include <boost/fusion/include/intrinsic.hpp> #include <boost/fusion/include/single_view.hpp> #include <boost/fusion/include/transform.hpp> #include <boost/fusion/include/as_list.hpp> #include <boost/fusion/include/is_segmented.hpp> #include <boost/fusion/sequence/comparison/enable_comparison.hpp> #include <boost/proto/proto_fwd.hpp> #include <boost/proto/traits.hpp> #include <boost/proto/eval.hpp> #include <boost/proto/make_expr.hpp> #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable : 4510) // default constructor could not be generated #pragma warning(disable : 4512) // assignment operator could not be generated #pragma warning(disable : 4610) // can never be instantiated - user defined constructor required #endif namespace boost { namespace proto { namespace detail { template<typename Expr, long Pos> struct expr_iterator : fusion::iterator_base<expr_iterator<Expr, Pos> > { typedef Expr expr_type; static const long index = Pos; typedef fusion::random_access_traversal_tag category; typedef tag::proto_expr_iterator< typename Expr::proto_tag , typename Expr::proto_domain > fusion_tag; explicit expr_iterator(Expr &e) : expr(e) {} Expr &expr; }; template<typename Tag> struct as_element { template<typename Sig> struct result; template<typename This, typename Expr> struct result<This(Expr)> : result<This(Expr const &)> {}; template<typename This, typename Expr> struct result<This(Expr &)> : mpl::if_c< is_same<Tag, typename Expr::proto_tag>::value , flat_view<Expr> , fusion::single_view<Expr &> > {}; template<typename Expr> typename result<as_element(Expr &)>::type const operator ()(Expr &e) const { return typename result<as_element(Expr &)>::type(e); } template<typename Expr> typename result<as_element(Expr const &)>::type const operator ()(Expr const &e) const { return typename result<as_element(Expr const &)>::type(e); } }; template<typename Expr> struct flat_view : fusion::sequence_base<flat_view<Expr> > { typedef fusion::forward_traversal_tag category; typedef tag::proto_flat_view< typename Expr::proto_tag , typename Expr::proto_domain > fusion_tag; typedef typename fusion::result_of::as_list< typename fusion::result_of::transform< Expr , as_element<typename Expr::proto_tag> >::type >::type segments_type; explicit flat_view(Expr &e) : segs_(fusion::as_list(fusion::transform(e, as_element<typename Expr::proto_tag>()))) {} segments_type segs_; }; } namespace result_of { template<typename Expr> struct flatten : flatten<Expr const &> {}; template<typename Expr> struct flatten<Expr &> { typedef detail::flat_view<Expr> type; }; } namespace functional { /// \brief A PolymorphicFunctionObject type that returns a "flattened" /// view of a Proto expression tree. /// /// A PolymorphicFunctionObject type that returns a "flattened" /// view of a Proto expression tree. For a tree with a top-most node /// tag of type \c T, the elements of the flattened sequence are /// determined by recursing into each child node with the same /// tag type and returning those nodes of different type. So for /// instance, the Proto expression tree corresponding to the /// expression <tt>a | b | c</tt> has a flattened view with elements /// [a, b, c], even though the tree is grouped as /// <tt>((a | b) | c)</tt>. struct flatten { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Expr> struct result<This(Expr)> : result<This(Expr const &)> {}; template<typename This, typename Expr> struct result<This(Expr &)> { typedef proto::detail::flat_view<Expr> type; }; template<typename Expr> proto::detail::flat_view<Expr> const operator ()(Expr &e) const { return proto::detail::flat_view<Expr>(e); } template<typename Expr> proto::detail::flat_view<Expr const> const operator ()(Expr const &e) const { return proto::detail::flat_view<Expr const>(e); } }; } /// \brief A function that returns a "flattened" /// view of a Proto expression tree. /// /// For a tree with a top-most node /// tag of type \c T, the elements of the flattened sequence are /// determined by recursing into each child node with the same /// tag type and returning those nodes of different type. So for /// instance, the Proto expression tree corresponding to the /// expression <tt>a | b | c</tt> has a flattened view with elements /// [a, b, c], even though the tree is grouped as /// <tt>((a | b) | c)</tt>. template<typename Expr> proto::detail::flat_view<Expr> const flatten(Expr &e) { return proto::detail::flat_view<Expr>(e); } /// \overload /// template<typename Expr> proto::detail::flat_view<Expr const> const flatten(Expr const &e) { return proto::detail::flat_view<Expr const>(e); } /// INTERNAL ONLY /// template<typename Context> struct eval_fun : proto::callable { explicit eval_fun(Context &ctx) : ctx_(ctx) {} template<typename Sig> struct result; template<typename This, typename Expr> struct result<This(Expr)> : result<This(Expr const &)> {}; template<typename This, typename Expr> struct result<This(Expr &)> : proto::result_of::eval<Expr, Context> {}; template<typename Expr> typename proto::result_of::eval<Expr, Context>::type operator ()(Expr &e) const { return proto::eval(e, this->ctx_); } template<typename Expr> typename proto::result_of::eval<Expr const, Context>::type operator ()(Expr const &e) const { return proto::eval(e, this->ctx_); } private: Context &ctx_; }; /// INTERNAL ONLY /// template<typename Context> struct is_callable<eval_fun<Context> > : mpl::true_ {}; }} namespace boost { namespace fusion { namespace extension { template<typename Tag> struct is_sequence_impl; template<typename Tag, typename Domain> struct is_sequence_impl<proto::tag::proto_flat_view<Tag, Domain> > { template<typename Sequence> struct apply : mpl::true_ {}; }; template<typename Tag, typename Domain> struct is_sequence_impl<proto::tag::proto_expr<Tag, Domain> > { template<typename Sequence> struct apply : mpl::true_ {}; }; template<typename Tag> struct is_view_impl; template<typename Tag, typename Domain> struct is_view_impl<proto::tag::proto_flat_view<Tag, Domain> > { template<typename Sequence> struct apply : mpl::true_ {}; }; template<typename Tag, typename Domain> struct is_view_impl<proto::tag::proto_expr<Tag, Domain> > { template<typename Sequence> struct apply : mpl::false_ {}; }; template<typename Tag> struct value_of_impl; template<typename Tag, typename Domain> struct value_of_impl<proto::tag::proto_expr_iterator<Tag, Domain> > { template< typename Iterator , long Arity = proto::arity_of<typename Iterator::expr_type>::value > struct apply { typedef typename proto::result_of::child_c< typename Iterator::expr_type , Iterator::index >::value_type type; }; template<typename Iterator> struct apply<Iterator, 0> { typedef typename proto::result_of::value< typename Iterator::expr_type >::value_type type; }; }; template<typename Tag> struct deref_impl; template<typename Tag, typename Domain> struct deref_impl<proto::tag::proto_expr_iterator<Tag, Domain> > { template< typename Iterator , long Arity = proto::arity_of<typename Iterator::expr_type>::value > struct apply { typedef typename proto::result_of::child_c< typename Iterator::expr_type & , Iterator::index >::type type; static type call(Iterator const &iter) { return proto::child_c<Iterator::index>(iter.expr); } }; template<typename Iterator> struct apply<Iterator, 0> { typedef typename proto::result_of::value< typename Iterator::expr_type & >::type type; static type call(Iterator const &iter) { return proto::value(iter.expr); } }; }; template<typename Tag> struct advance_impl; template<typename Tag, typename Domain> struct advance_impl<proto::tag::proto_expr_iterator<Tag, Domain> > { template<typename Iterator, typename N> struct apply { typedef proto::detail::expr_iterator< typename Iterator::expr_type , Iterator::index + N::value > type; static type call(Iterator const &iter) { return type(iter.expr); } }; }; template<typename Tag> struct distance_impl; template<typename Tag, typename Domain> struct distance_impl<proto::tag::proto_expr_iterator<Tag, Domain> > { template<typename IteratorFrom, typename IteratorTo> struct apply : mpl::long_<IteratorTo::index - IteratorFrom::index> {}; }; template<typename Tag> struct next_impl; template<typename Tag, typename Domain> struct next_impl<proto::tag::proto_expr_iterator<Tag, Domain> > { template<typename Iterator> struct apply : advance_impl<proto::tag::proto_expr_iterator<Tag, Domain> >::template apply<Iterator, mpl::long_<1> > {}; }; template<typename Tag> struct prior_impl; template<typename Tag, typename Domain> struct prior_impl<proto::tag::proto_expr_iterator<Tag, Domain> > { template<typename Iterator> struct apply : advance_impl<proto::tag::proto_expr_iterator<Tag, Domain> >::template apply<Iterator, mpl::long_<-1> > {}; }; template<typename Tag> struct category_of_impl; template<typename Tag, typename Domain> struct category_of_impl<proto::tag::proto_expr<Tag, Domain> > { template<typename Sequence> struct apply { typedef random_access_traversal_tag type; }; }; template<typename Tag> struct size_impl; template<typename Tag, typename Domain> struct size_impl<proto::tag::proto_expr<Tag, Domain> > { template<typename Sequence> struct apply : mpl::long_<0 == Sequence::proto_arity_c ? 1 : Sequence::proto_arity_c> {}; }; template<typename Tag> struct begin_impl; template<typename Tag, typename Domain> struct begin_impl<proto::tag::proto_expr<Tag, Domain> > { template<typename Sequence> struct apply { typedef proto::detail::expr_iterator<Sequence, 0> type; static type call(Sequence &seq) { return type(seq); } }; }; template<typename Tag> struct end_impl; template<typename Tag, typename Domain> struct end_impl<proto::tag::proto_expr<Tag, Domain> > { template<typename Sequence> struct apply { typedef proto::detail::expr_iterator< Sequence , 0 == Sequence::proto_arity_c ? 1 : Sequence::proto_arity_c > type; static type call(Sequence &seq) { return type(seq); } }; }; template<typename Tag> struct value_at_impl; template<typename Tag, typename Domain> struct value_at_impl<proto::tag::proto_expr<Tag, Domain> > { template< typename Sequence , typename Index , long Arity = proto::arity_of<Sequence>::value > struct apply { typedef typename proto::result_of::child_c< Sequence , Index::value >::value_type type; }; template<typename Sequence, typename Index> struct apply<Sequence, Index, 0> { typedef typename proto::result_of::value< Sequence >::value_type type; }; }; template<typename Tag> struct at_impl; template<typename Tag, typename Domain> struct at_impl<proto::tag::proto_expr<Tag, Domain> > { template< typename Sequence , typename Index , long Arity = proto::arity_of<Sequence>::value > struct apply { typedef typename proto::result_of::child_c< Sequence & , Index::value >::type type; static type call(Sequence &seq) { return proto::child_c<Index::value>(seq); } }; template<typename Sequence, typename Index> struct apply<Sequence, Index, 0> { typedef typename proto::result_of::value< Sequence & >::type type; static type call(Sequence &seq) { return proto::value(seq); } }; }; template<typename Tag> struct convert_impl; template<typename Tag, typename Domain> struct convert_impl<proto::tag::proto_expr<Tag, Domain> > { template<typename Sequence> struct apply { typedef typename proto::result_of::unpack_expr< Tag , Domain , Sequence >::type type; static type call(Sequence& seq) { return proto::unpack_expr<Tag, Domain>(seq); } }; }; template<typename Tag, typename Domain> struct convert_impl<proto::tag::proto_flat_view<Tag, Domain> > { template<typename Sequence> struct apply { typedef typename proto::result_of::unpack_expr< Tag , Domain , Sequence >::type type; static type call(Sequence& seq) { return proto::unpack_expr<Tag, Domain>(seq); } }; }; template<typename Tag> struct is_segmented_impl; template<typename Tag, typename Domain> struct is_segmented_impl<proto::tag::proto_flat_view<Tag, Domain> > { template<typename Iterator> struct apply : mpl::true_ {}; }; template<typename Tag> struct segments_impl; template<typename Tag, typename Domain> struct segments_impl<proto::tag::proto_flat_view<Tag, Domain> > { template<typename Sequence> struct apply { typedef typename Sequence::segments_type const &type; static type call(Sequence &sequence) { return sequence.segs_; } }; }; template<typename Tag, typename Domain> struct category_of_impl<proto::tag::proto_flat_view<Tag, Domain> > { template<typename Sequence> struct apply { typedef forward_traversal_tag type; }; }; } namespace traits { template<typename Seq1, typename Seq2> struct enable_equality< Seq1 , Seq2 , typename enable_if_c< mpl::or_< proto::is_expr<Seq1> , proto::is_expr<Seq2> >::value >::type > : mpl::false_ {}; template<typename Seq1, typename Seq2> struct enable_comparison< Seq1 , Seq2 , typename enable_if_c< mpl::or_< proto::is_expr<Seq1> , proto::is_expr<Seq2> >::value >::type > : mpl::false_ {}; } }} namespace boost { namespace mpl { template<typename Tag, typename Args, long Arity> struct sequence_tag< proto::expr<Tag, Args, Arity> > { typedef fusion::fusion_sequence_tag type; }; template<typename Tag, typename Args, long Arity> struct sequence_tag< proto::basic_expr<Tag, Args, Arity> > { typedef fusion::fusion_sequence_tag type; }; }} #ifdef BOOST_MSVC #pragma warning(pop) #endif #endif PK �J�[�[��L �L context/default.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file default.hpp /// Definintion of default_context, a default evaluation context for /// proto::eval() that uses Boost.Typeof to deduce return types /// of the built-in operators. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_CONTEXT_DEFAULT_HPP_EAN_01_08_2007 #define BOOST_PROTO_CONTEXT_DEFAULT_HPP_EAN_01_08_2007 #include <boost/config.hpp> #include <boost/preprocessor/arithmetic/add.hpp> #include <boost/preprocessor/arithmetic/sub.hpp> #include <boost/preprocessor/iteration/iterate.hpp> #include <boost/preprocessor/repetition/enum.hpp> #include <boost/preprocessor/repetition/enum_shifted.hpp> #include <boost/utility/result_of.hpp> #include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_function.hpp> #include <boost/type_traits/remove_reference.hpp> #include <boost/type_traits/is_member_pointer.hpp> #include <boost/type_traits/is_member_object_pointer.hpp> #include <boost/type_traits/is_member_function_pointer.hpp> #include <boost/proto/proto_fwd.hpp> #include <boost/proto/tags.hpp> #include <boost/proto/eval.hpp> #include <boost/proto/traits.hpp> // for proto::child_c() #include <boost/proto/detail/decltype.hpp> namespace boost { namespace proto { /// INTERNAL ONLY /// #define UNREF(x) typename boost::remove_reference<x>::type namespace context { template< typename Expr , typename Context , typename Tag // = typename Expr::proto_tag , long Arity // = Expr::proto_arity_c > struct default_eval {}; template<typename Expr, typename Context> struct default_eval<Expr, Context, tag::terminal, 0> { typedef typename proto::result_of::value<Expr &>::type result_type; result_type operator ()(Expr &expr, Context &) const { return proto::value(expr); } }; /// INTERNAL ONLY /// #define BOOST_PROTO_UNARY_DEFAULT_EVAL(OP, TAG, MAKE) \ template<typename Expr, typename Context> \ struct default_eval<Expr, Context, TAG, 1> \ { \ private: \ typedef typename proto::result_of::child_c<Expr, 0>::type e0; \ typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0; \ public: \ BOOST_PROTO_DECLTYPE_(OP proto::detail::MAKE<r0>(), result_type) \ result_type operator ()(Expr &expr, Context &ctx) const \ { \ return OP proto::eval(proto::child_c<0>(expr), ctx); \ } \ }; \ /**/ /// INTERNAL ONLY /// #define BOOST_PROTO_BINARY_DEFAULT_EVAL(OP, TAG, LMAKE, RMAKE) \ template<typename Expr, typename Context> \ struct default_eval<Expr, Context, TAG, 2> \ { \ private: \ typedef typename proto::result_of::child_c<Expr, 0>::type e0; \ typedef typename proto::result_of::child_c<Expr, 1>::type e1; \ typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0; \ typedef typename proto::result_of::eval<UNREF(e1), Context>::type r1; \ public: \ BOOST_PROTO_DECLTYPE_( \ proto::detail::LMAKE<r0>() OP proto::detail::RMAKE<r1>() \ , result_type \ ) \ result_type operator ()(Expr &expr, Context &ctx) const \ { \ return proto::eval( \ proto::child_c<0>(expr), ctx) OP proto::eval(proto::child_c<1>(expr) \ , ctx \ ); \ } \ }; \ /**/ BOOST_PROTO_UNARY_DEFAULT_EVAL(+, proto::tag::unary_plus, make) BOOST_PROTO_UNARY_DEFAULT_EVAL(-, proto::tag::negate, make) BOOST_PROTO_UNARY_DEFAULT_EVAL(*, proto::tag::dereference, make) BOOST_PROTO_UNARY_DEFAULT_EVAL(~, proto::tag::complement, make) BOOST_PROTO_UNARY_DEFAULT_EVAL(&, proto::tag::address_of, make) BOOST_PROTO_UNARY_DEFAULT_EVAL(!, proto::tag::logical_not, make) BOOST_PROTO_UNARY_DEFAULT_EVAL(++, proto::tag::pre_inc, make_mutable) BOOST_PROTO_UNARY_DEFAULT_EVAL(--, proto::tag::pre_dec, make_mutable) BOOST_PROTO_BINARY_DEFAULT_EVAL(<<, proto::tag::shift_left, make_mutable, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(>>, proto::tag::shift_right, make_mutable, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(*, proto::tag::multiplies, make, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(/, proto::tag::divides, make, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(%, proto::tag::modulus, make, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(+, proto::tag::plus, make, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(-, proto::tag::minus, make, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(<, proto::tag::less, make, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(>, proto::tag::greater, make, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(<=, proto::tag::less_equal, make, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(>=, proto::tag::greater_equal, make, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(==, proto::tag::equal_to, make, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(!=, proto::tag::not_equal_to, make, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(||, proto::tag::logical_or, make, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(&&, proto::tag::logical_and, make, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(&, proto::tag::bitwise_and, make, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(|, proto::tag::bitwise_or, make, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(^, proto::tag::bitwise_xor, make, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(=, proto::tag::assign, make_mutable, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(<<=, proto::tag::shift_left_assign, make_mutable, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(>>=, proto::tag::shift_right_assign, make_mutable, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(*=, proto::tag::multiplies_assign, make_mutable, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(/=, proto::tag::divides_assign, make_mutable, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(%=, proto::tag::modulus_assign, make_mutable, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(+=, proto::tag::plus_assign, make_mutable, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(-=, proto::tag::minus_assign, make_mutable, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(&=, proto::tag::bitwise_and_assign, make_mutable, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(|=, proto::tag::bitwise_or_assign, make_mutable, make) BOOST_PROTO_BINARY_DEFAULT_EVAL(^=, proto::tag::bitwise_xor_assign, make_mutable, make) #undef BOOST_PROTO_UNARY_DEFAULT_EVAL #undef BOOST_PROTO_BINARY_DEFAULT_EVAL /// INTERNAL ONLY template<typename Expr, typename Context> struct is_member_function_eval : is_member_function_pointer< typename detail::uncvref< typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c<Expr, 1>::type >::type , Context >::type >::type > {}; /// INTERNAL ONLY template<typename Expr, typename Context, bool IsMemFunCall> struct memfun_eval { private: typedef typename result_of::child_c<Expr, 0>::type e0; typedef typename result_of::child_c<Expr, 1>::type e1; typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0; typedef typename proto::result_of::eval<UNREF(e1), Context>::type r1; public: typedef typename detail::mem_ptr_fun<r0, r1>::result_type result_type; result_type operator ()(Expr &expr, Context &ctx) const { return detail::mem_ptr_fun<r0, r1>()( proto::eval(proto::child_c<0>(expr), ctx) , proto::eval(proto::child_c<1>(expr), ctx) ); } }; /// INTERNAL ONLY template<typename Expr, typename Context> struct memfun_eval<Expr, Context, true> { private: typedef typename result_of::child_c<Expr, 0>::type e0; typedef typename result_of::child_c<Expr, 1>::type e1; typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0; typedef typename proto::result_of::eval<UNREF(e1), Context>::type r1; public: typedef detail::memfun<r0, r1> result_type; result_type const operator ()(Expr &expr, Context &ctx) const { return detail::memfun<r0, r1>( proto::eval(proto::child_c<0>(expr), ctx) , proto::eval(proto::child_c<1>(expr), ctx) ); } }; template<typename Expr, typename Context> struct default_eval<Expr, Context, tag::mem_ptr, 2> : memfun_eval<Expr, Context, is_member_function_eval<Expr, Context>::value> {}; // Handle post-increment specially. template<typename Expr, typename Context> struct default_eval<Expr, Context, proto::tag::post_inc, 1> { private: typedef typename proto::result_of::child_c<Expr, 0>::type e0; typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0; public: BOOST_PROTO_DECLTYPE_(proto::detail::make_mutable<r0>() ++, result_type) result_type operator ()(Expr &expr, Context &ctx) const { return proto::eval(proto::child_c<0>(expr), ctx) ++; } }; // Handle post-decrement specially. template<typename Expr, typename Context> struct default_eval<Expr, Context, proto::tag::post_dec, 1> { private: typedef typename proto::result_of::child_c<Expr, 0>::type e0; typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0; public: BOOST_PROTO_DECLTYPE_(proto::detail::make_mutable<r0>() --, result_type) result_type operator ()(Expr &expr, Context &ctx) const { return proto::eval(proto::child_c<0>(expr), ctx) --; } }; // Handle subscript specially. template<typename Expr, typename Context> struct default_eval<Expr, Context, proto::tag::subscript, 2> { private: typedef typename proto::result_of::child_c<Expr, 0>::type e0; typedef typename proto::result_of::child_c<Expr, 1>::type e1; typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0; typedef typename proto::result_of::eval<UNREF(e1), Context>::type r1; public: BOOST_PROTO_DECLTYPE_(proto::detail::make_subscriptable<r0>()[proto::detail::make<r1>()], result_type) result_type operator ()(Expr &expr, Context &ctx) const { return proto::eval(proto::child_c<0>(expr), ctx)[proto::eval(proto::child_c<1>(expr), ctx)]; } }; // Handle if_else_ specially. template<typename Expr, typename Context> struct default_eval<Expr, Context, proto::tag::if_else_, 3> { private: typedef typename proto::result_of::child_c<Expr, 0>::type e0; typedef typename proto::result_of::child_c<Expr, 1>::type e1; typedef typename proto::result_of::child_c<Expr, 2>::type e2; typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0; typedef typename proto::result_of::eval<UNREF(e1), Context>::type r1; typedef typename proto::result_of::eval<UNREF(e2), Context>::type r2; public: BOOST_PROTO_DECLTYPE_( proto::detail::make<r0>() ? proto::detail::make<r1>() : proto::detail::make<r2>() , result_type ) result_type operator ()(Expr &expr, Context &ctx) const { return proto::eval(proto::child_c<0>(expr), ctx) ? proto::eval(proto::child_c<1>(expr), ctx) : proto::eval(proto::child_c<2>(expr), ctx); } }; // Handle comma specially. template<typename Expr, typename Context> struct default_eval<Expr, Context, proto::tag::comma, 2> { private: typedef typename proto::result_of::child_c<Expr, 0>::type e0; typedef typename proto::result_of::child_c<Expr, 1>::type e1; typedef typename proto::result_of::eval<UNREF(e0), Context>::type r0; typedef typename proto::result_of::eval<UNREF(e1), Context>::type r1; public: typedef typename proto::detail::comma_result<r0, r1>::type result_type; result_type operator ()(Expr &expr, Context &ctx) const { return proto::eval(proto::child_c<0>(expr), ctx), proto::eval(proto::child_c<1>(expr), ctx); } }; // Handle function specially #define BOOST_PROTO_DEFAULT_EVAL_TYPE(Z, N, DATA) \ typename proto::result_of::eval< \ typename remove_reference< \ typename proto::result_of::child_c<DATA, N>::type \ >::type \ , Context \ >::type \ /**/ #define BOOST_PROTO_DEFAULT_EVAL(Z, N, DATA) \ proto::eval(proto::child_c<N>(DATA), context) \ /**/ template<typename Expr, typename Context> struct default_eval<Expr, Context, proto::tag::function, 1> { typedef typename proto::detail::result_of_fixup< BOOST_PROTO_DEFAULT_EVAL_TYPE(~, 0, Expr) >::type function_type; typedef typename BOOST_PROTO_RESULT_OF<function_type()>::type result_type; result_type operator ()(Expr &expr, Context &context) const { return BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)(); } }; template<typename Expr, typename Context> struct default_eval<Expr, Context, proto::tag::function, 2> { typedef typename proto::detail::result_of_fixup< BOOST_PROTO_DEFAULT_EVAL_TYPE(~, 0, Expr) >::type function_type; typedef typename detail::result_of_< function_type(BOOST_PROTO_DEFAULT_EVAL_TYPE(~, 1, Expr)) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return this->invoke( expr , context , is_member_function_pointer<function_type>() , is_member_object_pointer<function_type>() ); } private: result_type invoke(Expr &expr, Context &context, mpl::false_, mpl::false_) const { return BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)(BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)); } result_type invoke(Expr &expr, Context &context, mpl::true_, mpl::false_) const { BOOST_PROTO_USE_GET_POINTER(); typedef typename detail::class_member_traits<function_type>::class_type class_type; return ( BOOST_PROTO_GET_POINTER(class_type, (BOOST_PROTO_DEFAULT_EVAL(~, 1, expr))) ->* BOOST_PROTO_DEFAULT_EVAL(~, 0, expr) )(); } result_type invoke(Expr &expr, Context &context, mpl::false_, mpl::true_) const { BOOST_PROTO_USE_GET_POINTER(); typedef typename detail::class_member_traits<function_type>::class_type class_type; return ( BOOST_PROTO_GET_POINTER(class_type, (BOOST_PROTO_DEFAULT_EVAL(~, 1, expr))) ->* BOOST_PROTO_DEFAULT_EVAL(~, 0, expr) ); } }; // Additional specialization are generated by the preprocessor #include <boost/proto/context/detail/default_eval.hpp> #undef BOOST_PROTO_DEFAULT_EVAL_TYPE #undef BOOST_PROTO_DEFAULT_EVAL /// default_context /// struct default_context { /// default_context::eval /// template<typename Expr, typename ThisContext = default_context const> struct eval : default_eval<Expr, ThisContext> {}; }; } // namespace context }} // namespace boost::proto #undef UNREF #endif PK �J�[G �(+ + context/null.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file null.hpp /// Definintion of null_context\<\>, an evaluation context for /// proto::eval() that simply evaluates each child expression, doesn't /// combine the results at all, and returns void. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_CONTEXT_NULL_HPP_EAN_06_24_2007 #define BOOST_PROTO_CONTEXT_NULL_HPP_EAN_06_24_2007 #include <boost/preprocessor/iteration/iterate.hpp> #include <boost/preprocessor/repetition/repeat.hpp> #include <boost/proto/proto_fwd.hpp> #include <boost/proto/eval.hpp> #include <boost/proto/traits.hpp> namespace boost { namespace proto { namespace context { template< typename Expr , typename Context , long Arity // = Expr::proto_arity_c > struct null_eval {}; template<typename Expr, typename Context> struct null_eval<Expr, Context, 0> { typedef void result_type; void operator()(Expr &, Context &) const {} }; // Additional specializations generated by the preprocessor #include <boost/proto/context/detail/null_eval.hpp> /// null_context /// struct null_context { /// null_context::eval /// template<typename Expr, typename ThisContext = null_context const> struct eval : null_eval<Expr, ThisContext> {}; }; }}} #endif PK �J�[��`3�W �W - context/detail/preprocessed/callable_eval.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file callable_eval.hpp /// Contains specializations of the callable_eval\<\> class template. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) namespace detail { template<typename Expr, typename Context> struct is_expr_handled<Expr, Context, 1> { static callable_context_wrapper<Context> &sctx_; static Expr &sexpr_; static typename Expr::proto_tag &stag_; static const bool value = sizeof(yes_type) == sizeof( detail::check_is_expr_handled( (sctx_( stag_ , proto::child_c< 0>( sexpr_) ), 0) ) ); typedef mpl::bool_<value> type; }; } namespace context { template<typename Expr, typename Context> struct callable_eval<Expr, Context, 1> { typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename BOOST_PROTO_RESULT_OF< Context( typename Expr::proto_tag , child0 ) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return context( typename Expr::proto_tag() , proto::child_c< 0>( expr) ); } }; } namespace detail { template<typename Expr, typename Context> struct is_expr_handled<Expr, Context, 2> { static callable_context_wrapper<Context> &sctx_; static Expr &sexpr_; static typename Expr::proto_tag &stag_; static const bool value = sizeof(yes_type) == sizeof( detail::check_is_expr_handled( (sctx_( stag_ , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) ), 0) ) ); typedef mpl::bool_<value> type; }; } namespace context { template<typename Expr, typename Context> struct callable_eval<Expr, Context, 2> { typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename BOOST_PROTO_RESULT_OF< Context( typename Expr::proto_tag , child0 , child1 ) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return context( typename Expr::proto_tag() , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) ); } }; } namespace detail { template<typename Expr, typename Context> struct is_expr_handled<Expr, Context, 3> { static callable_context_wrapper<Context> &sctx_; static Expr &sexpr_; static typename Expr::proto_tag &stag_; static const bool value = sizeof(yes_type) == sizeof( detail::check_is_expr_handled( (sctx_( stag_ , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) ), 0) ) ); typedef mpl::bool_<value> type; }; } namespace context { template<typename Expr, typename Context> struct callable_eval<Expr, Context, 3> { typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename BOOST_PROTO_RESULT_OF< Context( typename Expr::proto_tag , child0 , child1 , child2 ) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return context( typename Expr::proto_tag() , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) ); } }; } namespace detail { template<typename Expr, typename Context> struct is_expr_handled<Expr, Context, 4> { static callable_context_wrapper<Context> &sctx_; static Expr &sexpr_; static typename Expr::proto_tag &stag_; static const bool value = sizeof(yes_type) == sizeof( detail::check_is_expr_handled( (sctx_( stag_ , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) ), 0) ) ); typedef mpl::bool_<value> type; }; } namespace context { template<typename Expr, typename Context> struct callable_eval<Expr, Context, 4> { typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename BOOST_PROTO_RESULT_OF< Context( typename Expr::proto_tag , child0 , child1 , child2 , child3 ) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return context( typename Expr::proto_tag() , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) ); } }; } namespace detail { template<typename Expr, typename Context> struct is_expr_handled<Expr, Context, 5> { static callable_context_wrapper<Context> &sctx_; static Expr &sexpr_; static typename Expr::proto_tag &stag_; static const bool value = sizeof(yes_type) == sizeof( detail::check_is_expr_handled( (sctx_( stag_ , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) , proto::child_c< 4>( sexpr_) ), 0) ) ); typedef mpl::bool_<value> type; }; } namespace context { template<typename Expr, typename Context> struct callable_eval<Expr, Context, 5> { typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename proto::result_of::child_c< Expr const &, 4>::type child4; typedef typename BOOST_PROTO_RESULT_OF< Context( typename Expr::proto_tag , child0 , child1 , child2 , child3 , child4 ) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return context( typename Expr::proto_tag() , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) , proto::child_c< 4>( expr) ); } }; } namespace detail { template<typename Expr, typename Context> struct is_expr_handled<Expr, Context, 6> { static callable_context_wrapper<Context> &sctx_; static Expr &sexpr_; static typename Expr::proto_tag &stag_; static const bool value = sizeof(yes_type) == sizeof( detail::check_is_expr_handled( (sctx_( stag_ , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) , proto::child_c< 4>( sexpr_) , proto::child_c< 5>( sexpr_) ), 0) ) ); typedef mpl::bool_<value> type; }; } namespace context { template<typename Expr, typename Context> struct callable_eval<Expr, Context, 6> { typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename proto::result_of::child_c< Expr const &, 4>::type child4; typedef typename proto::result_of::child_c< Expr const &, 5>::type child5; typedef typename BOOST_PROTO_RESULT_OF< Context( typename Expr::proto_tag , child0 , child1 , child2 , child3 , child4 , child5 ) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return context( typename Expr::proto_tag() , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) , proto::child_c< 4>( expr) , proto::child_c< 5>( expr) ); } }; } namespace detail { template<typename Expr, typename Context> struct is_expr_handled<Expr, Context, 7> { static callable_context_wrapper<Context> &sctx_; static Expr &sexpr_; static typename Expr::proto_tag &stag_; static const bool value = sizeof(yes_type) == sizeof( detail::check_is_expr_handled( (sctx_( stag_ , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) , proto::child_c< 4>( sexpr_) , proto::child_c< 5>( sexpr_) , proto::child_c< 6>( sexpr_) ), 0) ) ); typedef mpl::bool_<value> type; }; } namespace context { template<typename Expr, typename Context> struct callable_eval<Expr, Context, 7> { typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename proto::result_of::child_c< Expr const &, 4>::type child4; typedef typename proto::result_of::child_c< Expr const &, 5>::type child5; typedef typename proto::result_of::child_c< Expr const &, 6>::type child6; typedef typename BOOST_PROTO_RESULT_OF< Context( typename Expr::proto_tag , child0 , child1 , child2 , child3 , child4 , child5 , child6 ) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return context( typename Expr::proto_tag() , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) , proto::child_c< 4>( expr) , proto::child_c< 5>( expr) , proto::child_c< 6>( expr) ); } }; } namespace detail { template<typename Expr, typename Context> struct is_expr_handled<Expr, Context, 8> { static callable_context_wrapper<Context> &sctx_; static Expr &sexpr_; static typename Expr::proto_tag &stag_; static const bool value = sizeof(yes_type) == sizeof( detail::check_is_expr_handled( (sctx_( stag_ , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) , proto::child_c< 4>( sexpr_) , proto::child_c< 5>( sexpr_) , proto::child_c< 6>( sexpr_) , proto::child_c< 7>( sexpr_) ), 0) ) ); typedef mpl::bool_<value> type; }; } namespace context { template<typename Expr, typename Context> struct callable_eval<Expr, Context, 8> { typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename proto::result_of::child_c< Expr const &, 4>::type child4; typedef typename proto::result_of::child_c< Expr const &, 5>::type child5; typedef typename proto::result_of::child_c< Expr const &, 6>::type child6; typedef typename proto::result_of::child_c< Expr const &, 7>::type child7; typedef typename BOOST_PROTO_RESULT_OF< Context( typename Expr::proto_tag , child0 , child1 , child2 , child3 , child4 , child5 , child6 , child7 ) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return context( typename Expr::proto_tag() , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) , proto::child_c< 4>( expr) , proto::child_c< 5>( expr) , proto::child_c< 6>( expr) , proto::child_c< 7>( expr) ); } }; } namespace detail { template<typename Expr, typename Context> struct is_expr_handled<Expr, Context, 9> { static callable_context_wrapper<Context> &sctx_; static Expr &sexpr_; static typename Expr::proto_tag &stag_; static const bool value = sizeof(yes_type) == sizeof( detail::check_is_expr_handled( (sctx_( stag_ , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) , proto::child_c< 4>( sexpr_) , proto::child_c< 5>( sexpr_) , proto::child_c< 6>( sexpr_) , proto::child_c< 7>( sexpr_) , proto::child_c< 8>( sexpr_) ), 0) ) ); typedef mpl::bool_<value> type; }; } namespace context { template<typename Expr, typename Context> struct callable_eval<Expr, Context, 9> { typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename proto::result_of::child_c< Expr const &, 4>::type child4; typedef typename proto::result_of::child_c< Expr const &, 5>::type child5; typedef typename proto::result_of::child_c< Expr const &, 6>::type child6; typedef typename proto::result_of::child_c< Expr const &, 7>::type child7; typedef typename proto::result_of::child_c< Expr const &, 8>::type child8; typedef typename BOOST_PROTO_RESULT_OF< Context( typename Expr::proto_tag , child0 , child1 , child2 , child3 , child4 , child5 , child6 , child7 , child8 ) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return context( typename Expr::proto_tag() , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) , proto::child_c< 4>( expr) , proto::child_c< 5>( expr) , proto::child_c< 6>( expr) , proto::child_c< 7>( expr) , proto::child_c< 8>( expr) ); } }; } namespace detail { template<typename Expr, typename Context> struct is_expr_handled<Expr, Context, 10> { static callable_context_wrapper<Context> &sctx_; static Expr &sexpr_; static typename Expr::proto_tag &stag_; static const bool value = sizeof(yes_type) == sizeof( detail::check_is_expr_handled( (sctx_( stag_ , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) , proto::child_c< 4>( sexpr_) , proto::child_c< 5>( sexpr_) , proto::child_c< 6>( sexpr_) , proto::child_c< 7>( sexpr_) , proto::child_c< 8>( sexpr_) , proto::child_c< 9>( sexpr_) ), 0) ) ); typedef mpl::bool_<value> type; }; } namespace context { template<typename Expr, typename Context> struct callable_eval<Expr, Context, 10> { typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename proto::result_of::child_c< Expr const &, 4>::type child4; typedef typename proto::result_of::child_c< Expr const &, 5>::type child5; typedef typename proto::result_of::child_c< Expr const &, 6>::type child6; typedef typename proto::result_of::child_c< Expr const &, 7>::type child7; typedef typename proto::result_of::child_c< Expr const &, 8>::type child8; typedef typename proto::result_of::child_c< Expr const &, 9>::type child9; typedef typename BOOST_PROTO_RESULT_OF< Context( typename Expr::proto_tag , child0 , child1 , child2 , child3 , child4 , child5 , child6 , child7 , child8 , child9 ) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return context( typename Expr::proto_tag() , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) , proto::child_c< 4>( expr) , proto::child_c< 5>( expr) , proto::child_c< 6>( expr) , proto::child_c< 7>( expr) , proto::child_c< 8>( expr) , proto::child_c< 9>( expr) ); } }; } PK �J�[_yf�S S , context/detail/preprocessed/default_eval.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file default_eval.hpp /// Contains specializations of the default_eval\<\> class template. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) template<typename Expr, typename Context> struct default_eval<Expr, Context, proto::tag::function, 3> { typedef typename proto::detail::result_of_fixup< typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 0>::type >::type , Context >::type >::type function_type; typedef typename BOOST_PROTO_RESULT_OF< function_type(typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 1>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 2>::type >::type , Context >::type) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return this->invoke(expr, context, is_member_function_pointer<function_type>()); } private: result_type invoke(Expr &expr, Context &context, mpl::false_) const { return proto::eval(proto::child_c< 0>( expr), context)( proto::eval(proto::child_c< 1>( expr), context) , proto::eval(proto::child_c< 2>( expr), context) ); } result_type invoke(Expr &expr, Context &context, mpl::true_) const { BOOST_PROTO_USE_GET_POINTER(); typedef typename detail::class_member_traits<function_type>::class_type class_type; return ( BOOST_PROTO_GET_POINTER(class_type, (proto::eval(proto::child_c< 1>( expr), context))) ->* proto::eval(proto::child_c< 0>( expr), context) )(proto::eval(proto::child_c< 2>( expr), context)); } }; template<typename Expr, typename Context> struct default_eval<Expr, Context, proto::tag::function, 4> { typedef typename proto::detail::result_of_fixup< typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 0>::type >::type , Context >::type >::type function_type; typedef typename BOOST_PROTO_RESULT_OF< function_type(typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 1>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 2>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 3>::type >::type , Context >::type) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return this->invoke(expr, context, is_member_function_pointer<function_type>()); } private: result_type invoke(Expr &expr, Context &context, mpl::false_) const { return proto::eval(proto::child_c< 0>( expr), context)( proto::eval(proto::child_c< 1>( expr), context) , proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) ); } result_type invoke(Expr &expr, Context &context, mpl::true_) const { BOOST_PROTO_USE_GET_POINTER(); typedef typename detail::class_member_traits<function_type>::class_type class_type; return ( BOOST_PROTO_GET_POINTER(class_type, (proto::eval(proto::child_c< 1>( expr), context))) ->* proto::eval(proto::child_c< 0>( expr), context) )(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context)); } }; template<typename Expr, typename Context> struct default_eval<Expr, Context, proto::tag::function, 5> { typedef typename proto::detail::result_of_fixup< typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 0>::type >::type , Context >::type >::type function_type; typedef typename BOOST_PROTO_RESULT_OF< function_type(typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 1>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 2>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 3>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 4>::type >::type , Context >::type) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return this->invoke(expr, context, is_member_function_pointer<function_type>()); } private: result_type invoke(Expr &expr, Context &context, mpl::false_) const { return proto::eval(proto::child_c< 0>( expr), context)( proto::eval(proto::child_c< 1>( expr), context) , proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) ); } result_type invoke(Expr &expr, Context &context, mpl::true_) const { BOOST_PROTO_USE_GET_POINTER(); typedef typename detail::class_member_traits<function_type>::class_type class_type; return ( BOOST_PROTO_GET_POINTER(class_type, (proto::eval(proto::child_c< 1>( expr), context))) ->* proto::eval(proto::child_c< 0>( expr), context) )(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context)); } }; template<typename Expr, typename Context> struct default_eval<Expr, Context, proto::tag::function, 6> { typedef typename proto::detail::result_of_fixup< typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 0>::type >::type , Context >::type >::type function_type; typedef typename BOOST_PROTO_RESULT_OF< function_type(typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 1>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 2>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 3>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 4>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 5>::type >::type , Context >::type) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return this->invoke(expr, context, is_member_function_pointer<function_type>()); } private: result_type invoke(Expr &expr, Context &context, mpl::false_) const { return proto::eval(proto::child_c< 0>( expr), context)( proto::eval(proto::child_c< 1>( expr), context) , proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) ); } result_type invoke(Expr &expr, Context &context, mpl::true_) const { BOOST_PROTO_USE_GET_POINTER(); typedef typename detail::class_member_traits<function_type>::class_type class_type; return ( BOOST_PROTO_GET_POINTER(class_type, (proto::eval(proto::child_c< 1>( expr), context))) ->* proto::eval(proto::child_c< 0>( expr), context) )(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context)); } }; template<typename Expr, typename Context> struct default_eval<Expr, Context, proto::tag::function, 7> { typedef typename proto::detail::result_of_fixup< typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 0>::type >::type , Context >::type >::type function_type; typedef typename BOOST_PROTO_RESULT_OF< function_type(typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 1>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 2>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 3>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 4>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 5>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 6>::type >::type , Context >::type) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return this->invoke(expr, context, is_member_function_pointer<function_type>()); } private: result_type invoke(Expr &expr, Context &context, mpl::false_) const { return proto::eval(proto::child_c< 0>( expr), context)( proto::eval(proto::child_c< 1>( expr), context) , proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context) ); } result_type invoke(Expr &expr, Context &context, mpl::true_) const { BOOST_PROTO_USE_GET_POINTER(); typedef typename detail::class_member_traits<function_type>::class_type class_type; return ( BOOST_PROTO_GET_POINTER(class_type, (proto::eval(proto::child_c< 1>( expr), context))) ->* proto::eval(proto::child_c< 0>( expr), context) )(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context)); } }; template<typename Expr, typename Context> struct default_eval<Expr, Context, proto::tag::function, 8> { typedef typename proto::detail::result_of_fixup< typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 0>::type >::type , Context >::type >::type function_type; typedef typename BOOST_PROTO_RESULT_OF< function_type(typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 1>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 2>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 3>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 4>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 5>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 6>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 7>::type >::type , Context >::type) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return this->invoke(expr, context, is_member_function_pointer<function_type>()); } private: result_type invoke(Expr &expr, Context &context, mpl::false_) const { return proto::eval(proto::child_c< 0>( expr), context)( proto::eval(proto::child_c< 1>( expr), context) , proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context) , proto::eval(proto::child_c< 7>( expr), context) ); } result_type invoke(Expr &expr, Context &context, mpl::true_) const { BOOST_PROTO_USE_GET_POINTER(); typedef typename detail::class_member_traits<function_type>::class_type class_type; return ( BOOST_PROTO_GET_POINTER(class_type, (proto::eval(proto::child_c< 1>( expr), context))) ->* proto::eval(proto::child_c< 0>( expr), context) )(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context) , proto::eval(proto::child_c< 7>( expr), context)); } }; template<typename Expr, typename Context> struct default_eval<Expr, Context, proto::tag::function, 9> { typedef typename proto::detail::result_of_fixup< typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 0>::type >::type , Context >::type >::type function_type; typedef typename BOOST_PROTO_RESULT_OF< function_type(typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 1>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 2>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 3>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 4>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 5>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 6>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 7>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 8>::type >::type , Context >::type) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return this->invoke(expr, context, is_member_function_pointer<function_type>()); } private: result_type invoke(Expr &expr, Context &context, mpl::false_) const { return proto::eval(proto::child_c< 0>( expr), context)( proto::eval(proto::child_c< 1>( expr), context) , proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context) , proto::eval(proto::child_c< 7>( expr), context) , proto::eval(proto::child_c< 8>( expr), context) ); } result_type invoke(Expr &expr, Context &context, mpl::true_) const { BOOST_PROTO_USE_GET_POINTER(); typedef typename detail::class_member_traits<function_type>::class_type class_type; return ( BOOST_PROTO_GET_POINTER(class_type, (proto::eval(proto::child_c< 1>( expr), context))) ->* proto::eval(proto::child_c< 0>( expr), context) )(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context) , proto::eval(proto::child_c< 7>( expr), context) , proto::eval(proto::child_c< 8>( expr), context)); } }; template<typename Expr, typename Context> struct default_eval<Expr, Context, proto::tag::function, 10> { typedef typename proto::detail::result_of_fixup< typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 0>::type >::type , Context >::type >::type function_type; typedef typename BOOST_PROTO_RESULT_OF< function_type(typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 1>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 2>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 3>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 4>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 5>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 6>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 7>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 8>::type >::type , Context >::type , typename proto::result_of::eval< typename remove_reference< typename proto::result_of::child_c< Expr, 9>::type >::type , Context >::type) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return this->invoke(expr, context, is_member_function_pointer<function_type>()); } private: result_type invoke(Expr &expr, Context &context, mpl::false_) const { return proto::eval(proto::child_c< 0>( expr), context)( proto::eval(proto::child_c< 1>( expr), context) , proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context) , proto::eval(proto::child_c< 7>( expr), context) , proto::eval(proto::child_c< 8>( expr), context) , proto::eval(proto::child_c< 9>( expr), context) ); } result_type invoke(Expr &expr, Context &context, mpl::true_) const { BOOST_PROTO_USE_GET_POINTER(); typedef typename detail::class_member_traits<function_type>::class_type class_type; return ( BOOST_PROTO_GET_POINTER(class_type, (proto::eval(proto::child_c< 1>( expr), context))) ->* proto::eval(proto::child_c< 0>( expr), context) )(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context) , proto::eval(proto::child_c< 7>( expr), context) , proto::eval(proto::child_c< 8>( expr), context) , proto::eval(proto::child_c< 9>( expr), context)); } }; PK �J�[�!�� � ) context/detail/preprocessed/null_eval.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file null_eval.hpp /// Contains specializations of the null_eval\<\> class template. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) template<typename Expr, typename Context> struct null_eval<Expr, Context, 1> { typedef void result_type; void operator ()(Expr &expr, Context &ctx) const { proto::eval(proto::child_c< 0>(expr), ctx); } }; template<typename Expr, typename Context> struct null_eval<Expr, Context, 2> { typedef void result_type; void operator ()(Expr &expr, Context &ctx) const { proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); } }; template<typename Expr, typename Context> struct null_eval<Expr, Context, 3> { typedef void result_type; void operator ()(Expr &expr, Context &ctx) const { proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); } }; template<typename Expr, typename Context> struct null_eval<Expr, Context, 4> { typedef void result_type; void operator ()(Expr &expr, Context &ctx) const { proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); } }; template<typename Expr, typename Context> struct null_eval<Expr, Context, 5> { typedef void result_type; void operator ()(Expr &expr, Context &ctx) const { proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); proto::eval(proto::child_c< 4>(expr), ctx); } }; template<typename Expr, typename Context> struct null_eval<Expr, Context, 6> { typedef void result_type; void operator ()(Expr &expr, Context &ctx) const { proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); proto::eval(proto::child_c< 4>(expr), ctx); proto::eval(proto::child_c< 5>(expr), ctx); } }; template<typename Expr, typename Context> struct null_eval<Expr, Context, 7> { typedef void result_type; void operator ()(Expr &expr, Context &ctx) const { proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); proto::eval(proto::child_c< 4>(expr), ctx); proto::eval(proto::child_c< 5>(expr), ctx); proto::eval(proto::child_c< 6>(expr), ctx); } }; template<typename Expr, typename Context> struct null_eval<Expr, Context, 8> { typedef void result_type; void operator ()(Expr &expr, Context &ctx) const { proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); proto::eval(proto::child_c< 4>(expr), ctx); proto::eval(proto::child_c< 5>(expr), ctx); proto::eval(proto::child_c< 6>(expr), ctx); proto::eval(proto::child_c< 7>(expr), ctx); } }; template<typename Expr, typename Context> struct null_eval<Expr, Context, 9> { typedef void result_type; void operator ()(Expr &expr, Context &ctx) const { proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); proto::eval(proto::child_c< 4>(expr), ctx); proto::eval(proto::child_c< 5>(expr), ctx); proto::eval(proto::child_c< 6>(expr), ctx); proto::eval(proto::child_c< 7>(expr), ctx); proto::eval(proto::child_c< 8>(expr), ctx); } }; template<typename Expr, typename Context> struct null_eval<Expr, Context, 10> { typedef void result_type; void operator ()(Expr &expr, Context &ctx) const { proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); proto::eval(proto::child_c< 4>(expr), ctx); proto::eval(proto::child_c< 5>(expr), ctx); proto::eval(proto::child_c< 6>(expr), ctx); proto::eval(proto::child_c< 7>(expr), ctx); proto::eval(proto::child_c< 8>(expr), ctx); proto::eval(proto::child_c< 9>(expr), ctx); } }; PK �J�[Lk��� � context/detail/callable_eval.hppnu �[��� #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES) #include <boost/proto/context/detail/preprocessed/callable_eval.hpp> #elif !defined(BOOST_PP_IS_ITERATING) #define BOOST_PROTO_CHILD_N_TYPE(Z, N, Expr) \ typedef typename proto::result_of::child_c<Expr const &, N>::type BOOST_PP_CAT(child, N); \ /**/ #define BOOST_PROTO_CHILD_N(Z, N, expr) \ proto::child_c<N>(expr) \ /**/ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 2, line: 0, output: "preprocessed/callable_eval.hpp") #endif /////////////////////////////////////////////////////////////////////////////// /// \file callable_eval.hpp /// Contains specializations of the callable_eval\<\> class template. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 1) #endif #define BOOST_PP_ITERATION_PARAMS_1 \ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/context/detail/callable_eval.hpp>)) #include BOOST_PP_ITERATE() #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(output: null) #endif #undef BOOST_PROTO_CHILD_N_TYPE #undef BOOST_PROTO_CHILD_N #else #define N BOOST_PP_ITERATION() namespace detail { template<typename Expr, typename Context> struct is_expr_handled<Expr, Context, N> { static callable_context_wrapper<Context> &sctx_; static Expr &sexpr_; static typename Expr::proto_tag &stag_; static const bool value = sizeof(yes_type) == sizeof( detail::check_is_expr_handled( (sctx_( stag_ BOOST_PP_ENUM_TRAILING(N, BOOST_PROTO_CHILD_N, sexpr_) ), 0) ) ); typedef mpl::bool_<value> type; }; } namespace context { /// \brief A BinaryFunction that accepts a Proto expression and a /// callable context and calls the context with the expression tag /// and children as arguments, effectively fanning the expression /// out. /// /// <tt>callable_eval\<\></tt> requires that \c Context is a /// PolymorphicFunctionObject that can be invoked with \c Expr's /// tag and children as expressions, as follows: /// /// \code /// context(Expr::proto_tag(), child_c\<0\>(expr), child_c\<1\>(expr), ...) /// \endcode template<typename Expr, typename Context> struct callable_eval<Expr, Context, N> { BOOST_PP_REPEAT(N, BOOST_PROTO_CHILD_N_TYPE, Expr) typedef typename BOOST_PROTO_RESULT_OF< Context( typename Expr::proto_tag BOOST_PP_ENUM_TRAILING_PARAMS(N, child) ) >::type result_type; /// \param expr The current expression /// \param context The callable evaluation context /// \return <tt>context(Expr::proto_tag(), child_c\<0\>(expr), child_c\<1\>(expr), ...)</tt> result_type operator ()(Expr &expr, Context &context) const { return context( typename Expr::proto_tag() BOOST_PP_ENUM_TRAILING(N, BOOST_PROTO_CHILD_N, expr) ); } }; } #undef N #endif PK �J�[�A`}� � context/detail/default_eval.hppnu �[��� #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES) #include <boost/proto/context/detail/preprocessed/default_eval.hpp> #elif !defined(BOOST_PP_IS_ITERATING) #define BOOST_PROTO_DEFAULT_EVAL_SHIFTED(Z, M, DATA) \ BOOST_PROTO_DEFAULT_EVAL(Z, BOOST_PP_ADD(M, 2), DATA) \ /**/ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 2, line: 0, output: "preprocessed/default_eval.hpp") #endif /////////////////////////////////////////////////////////////////////////////// /// \file default_eval.hpp /// Contains specializations of the default_eval\<\> class template. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 1) #endif #define BOOST_PP_ITERATION_PARAMS_1 \ (3, (3, BOOST_PROTO_MAX_ARITY, <boost/proto/context/detail/default_eval.hpp>)) #include BOOST_PP_ITERATE() #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(output: null) #endif #undef BOOST_PROTO_DEFAULT_EVAL_SHIFTED #else #define N BOOST_PP_ITERATION() template<typename Expr, typename Context> struct default_eval<Expr, Context, proto::tag::function, N> { typedef typename proto::detail::result_of_fixup< BOOST_PROTO_DEFAULT_EVAL_TYPE(~, 0, Expr) >::type function_type; typedef typename BOOST_PROTO_RESULT_OF< function_type(BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFAULT_EVAL_TYPE, Expr)) >::type result_type; result_type operator ()(Expr &expr, Context &context) const { return this->invoke(expr, context, is_member_function_pointer<function_type>()); } private: result_type invoke(Expr &expr, Context &context, mpl::false_) const { return BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)( BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFAULT_EVAL, expr) ); } result_type invoke(Expr &expr, Context &context, mpl::true_) const { BOOST_PROTO_USE_GET_POINTER(); typedef typename detail::class_member_traits<function_type>::class_type class_type; return ( BOOST_PROTO_GET_POINTER(class_type, (BOOST_PROTO_DEFAULT_EVAL(~, 1, expr))) ->* BOOST_PROTO_DEFAULT_EVAL(~, 0, expr) )(BOOST_PP_ENUM(BOOST_PP_SUB(N, 2), BOOST_PROTO_DEFAULT_EVAL_SHIFTED, expr)); } }; #undef N #endif PK �J�[-� � context/detail/null_eval.hppnu �[��� #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES) #include <boost/proto/context/detail/preprocessed/null_eval.hpp> #elif !defined(BOOST_PP_IS_ITERATING) #define BOOST_PROTO_EVAL_N(Z, N, DATA) \ proto::eval(proto::child_c<N>(expr), ctx); \ /**/ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 2, line: 0, output: "preprocessed/null_eval.hpp") #endif /////////////////////////////////////////////////////////////////////////////// /// \file null_eval.hpp /// Contains specializations of the null_eval\<\> class template. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 1) #endif #define BOOST_PP_ITERATION_PARAMS_1 \ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/context/detail/null_eval.hpp>)) #include BOOST_PP_ITERATE() #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(output: null) #endif #undef BOOST_PROTO_EVAL_N #else #define N BOOST_PP_ITERATION() template<typename Expr, typename Context> struct null_eval<Expr, Context, N> { typedef void result_type; void operator ()(Expr &expr, Context &ctx) const { BOOST_PP_REPEAT(N, BOOST_PROTO_EVAL_N, ~) } }; #undef N #endif PK �J�[8%��.# .# context/callable.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file callable.hpp /// Definintion of callable_context\<\>, an evaluation context for /// proto::eval() that explodes each node and calls the derived context /// type with the expressions constituents. If the derived context doesn't /// have an overload that handles this node, fall back to some other /// context. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_CONTEXT_CALLABLE_HPP_EAN_06_23_2007 #define BOOST_PROTO_CONTEXT_CALLABLE_HPP_EAN_06_23_2007 #include <boost/config.hpp> #include <boost/detail/workaround.hpp> #include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/iteration/iterate.hpp> #include <boost/preprocessor/facilities/intercept.hpp> #include <boost/preprocessor/repetition/repeat.hpp> #include <boost/preprocessor/repetition/enum_params.hpp> #include <boost/preprocessor/repetition/enum_trailing.hpp> #include <boost/preprocessor/repetition/enum_trailing_params.hpp> #include <boost/preprocessor/arithmetic/inc.hpp> #include <boost/preprocessor/selection/max.hpp> #include <boost/mpl/if.hpp> #include <boost/mpl/bool.hpp> #include <boost/utility/result_of.hpp> #include <boost/type_traits/remove_cv.hpp> #include <boost/proto/proto_fwd.hpp> #include <boost/proto/traits.hpp> // for child_c namespace boost { namespace proto { namespace detail { template<typename Context> struct callable_context_wrapper : remove_cv<Context>::type { callable_context_wrapper(); typedef private_type_ fun_type(...); operator fun_type *() const; BOOST_DELETED_FUNCTION(callable_context_wrapper &operator =(callable_context_wrapper const &)) }; template<typename T> yes_type check_is_expr_handled(T const &); no_type check_is_expr_handled(private_type_ const &); template<typename Expr, typename Context, long Arity = Expr::proto_arity_c> struct is_expr_handled; template<typename Expr, typename Context> struct is_expr_handled<Expr, Context, 0> { static callable_context_wrapper<Context> &sctx_; static Expr &sexpr_; static typename Expr::proto_tag &stag_; static const bool value = sizeof(yes_type) == sizeof( detail::check_is_expr_handled( (sctx_(stag_, proto::value(sexpr_)), 0) ) ); typedef mpl::bool_<value> type; }; } namespace context { /// \brief A BinaryFunction that accepts a Proto expression and a /// callable context and calls the context with the expression tag /// and children as arguments, effectively fanning the expression /// out. /// /// <tt>callable_eval\<\></tt> requires that \c Context is a /// PolymorphicFunctionObject that can be invoked with \c Expr's /// tag and children as expressions, as follows: /// /// \code /// context(Expr::proto_tag(), child_c<0>(expr), child_c<1>(expr), ...) /// \endcode template< typename Expr , typename Context , long Arity // = Expr::proto_arity_c > struct callable_eval {}; /// \brief A BinaryFunction that accepts a Proto expression and a /// callable context and calls the context with the expression tag /// and children as arguments, effectively fanning the expression /// out. /// /// <tt>callable_eval\<\></tt> requires that \c Context is a /// PolymorphicFunctionObject that can be invoked with \c Expr's /// tag and children as expressions, as follows: /// /// \code /// context(Expr::proto_tag(), value(expr)) /// \endcode template<typename Expr, typename Context> struct callable_eval<Expr, Context, 0> { typedef typename proto::result_of::value<Expr const &>::type value_type; typedef typename BOOST_PROTO_RESULT_OF< Context(typename Expr::proto_tag, value_type) >::type result_type; /// \param expr The current expression /// \param context The callable evaluation context /// \return <tt>context(Expr::proto_tag(), value(expr))</tt> result_type operator ()(Expr &expr, Context &context) const { return context(typename Expr::proto_tag(), proto::value(expr)); } }; /// \brief An evaluation context adaptor that makes authoring a /// context a simple matter of writing function overloads, rather /// then writing template specializations. /// /// <tt>callable_context\<\></tt> is a base class that implements /// the context protocol by passing fanned-out expression nodes to /// the derived context, making it easy to customize the handling /// of expression types by writing function overloads. Only those /// expression types needing special handling require explicit /// handling. All others are dispatched to a user-specified /// default context, \c DefaultCtx. /// /// <tt>callable_context\<\></tt> is defined simply as: /// /// \code /// template<typename Context, typename DefaultCtx = default_context> /// struct callable_context /// { /// template<typename Expr, typename ThisContext = Context> /// struct eval /// : mpl::if_< /// is_expr_handled_<Expr, Context> // For exposition /// , callable_eval<Expr, ThisContext> /// , typename DefaultCtx::template eval<Expr, Context> /// >::type /// {}; /// }; /// \endcode /// /// The Boolean metafunction <tt>is_expr_handled_\<\></tt> uses /// metaprogramming tricks to determine whether \c Context has /// an overloaded function call operator that accepts the /// fanned-out constituents of an expression of type \c Expr. /// If so, the handling of the expression is dispatched to /// <tt>callable_eval\<\></tt>. If not, it is dispatched to /// the user-specified \c DefaultCtx. /// /// Below is an example of how to use <tt>callable_context\<\></tt>: /// /// \code /// // An evaluation context that increments all /// // integer terminals in-place. /// struct increment_ints /// : callable_context< /// increment_ints const // derived context /// , null_context const // fall-back context /// > /// { /// typedef void result_type; /// /// // Handle int terminals here: /// void operator()(proto::tag::terminal, int &i) const /// { /// ++i; /// } /// }; /// \endcode /// /// With \c increment_ints, we can do the following: /// /// \code /// literal<int> i = 0, j = 10; /// proto::eval( i - j * 3.14, increment_ints() ); /// /// assert( i.get() == 1 && j.get() == 11 ); /// \endcode template< typename Context , typename DefaultCtx // = default_context > struct callable_context { /// A BinaryFunction that accepts an \c Expr and a /// \c Context, and either fans out the expression and passes /// it to the context, or else hands off the expression to /// \c DefaultCtx. /// /// If \c Context is a PolymorphicFunctionObject such that /// it can be invoked with the tag and children of \c Expr, /// as <tt>ctx(Expr::proto_tag(), child_c\<0\>(expr), child_c\<1\>(expr)...)</tt>, /// then <tt>eval\<Expr, ThisContext\></tt> inherits from /// <tt>callable_eval\<Expr, ThisContext\></tt>. Otherwise, /// <tt>eval\<Expr, ThisContext\></tt> inherits from /// <tt>DefaultCtx::eval\<Expr, Context\></tt>. template<typename Expr, typename ThisContext = Context> struct eval : mpl::if_c< detail::is_expr_handled<Expr, Context>::value , callable_eval<Expr, ThisContext> , typename DefaultCtx::template eval<Expr, Context> >::type {}; }; } #include <boost/proto/context/detail/callable_eval.hpp> }} #endif PK �J�[yg �d �d operators.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file operators.hpp /// Contains all the overloaded operators that make it possible to build /// Proto expression trees. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_OPERATORS_HPP_EAN_04_01_2005 #define BOOST_PROTO_OPERATORS_HPP_EAN_04_01_2005 #include <boost/config.hpp> #include <boost/preprocessor/punctuation/comma.hpp> #include <boost/mpl/logical.hpp> #include <boost/utility/enable_if.hpp> #include <boost/proto/proto_fwd.hpp> #include <boost/proto/tags.hpp> #include <boost/proto/domain.hpp> #include <boost/proto/matches.hpp> #include <boost/proto/generate.hpp> #include <boost/proto/make_expr.hpp> #if defined(_MSC_VER) # pragma warning(push) # pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined #endif namespace boost { namespace proto { namespace detail { template<typename MakeExpr, typename Grammar> struct lazy_matches : proto::matches<typename MakeExpr::type, Grammar> {}; template<typename Domain, typename Grammar, typename Trait, typename Tag, typename Arg> struct enable_unary : boost::lazy_enable_if_c< boost::mpl::and_< Trait , lazy_matches<result_of::make_expr<Tag, basic_default_domain, Arg>, Grammar> >::value , result_of::make_expr<Tag, Domain, Arg> > {}; template<typename Domain, typename Trait, typename Tag, typename Arg> struct enable_unary<Domain, proto::_, Trait, Tag, Arg &> : boost::lazy_enable_if_c< Trait::value , result_of::make_expr<Tag, Domain, Arg &> > {}; template<typename Trait, typename Tag, typename Arg> struct enable_unary<deduce_domain, not_a_grammar, Trait, Tag, Arg &> : enable_unary< typename domain_of<Arg>::type , typename domain_of<Arg>::type::proto_grammar , Trait , Tag , Arg & > {}; template<typename Domain, typename Grammar, typename Trait, typename Tag, typename Left, typename Right> struct enable_binary : boost::lazy_enable_if_c< boost::mpl::and_< Trait , lazy_matches<result_of::make_expr<Tag, basic_default_domain, Left, Right>, Grammar> >::value , result_of::make_expr<Tag, Domain, Left, Right> > {}; template<typename Domain, typename Trait, typename Tag, typename Left, typename Right> struct enable_binary<Domain, proto::_, Trait, Tag, Left &, Right &> : boost::lazy_enable_if_c< Trait::value , result_of::make_expr<Tag, Domain, Left &, Right &> > {}; template<typename Trait, typename Tag, typename Left, typename Right> struct enable_binary<deduce_domain, not_a_grammar, Trait, Tag, Left &, Right &> : enable_binary< typename deduce_domain2<Left, Right>::type , typename deduce_domain2<Left, Right>::type::proto_grammar , Trait , Tag , Left & , Right & > {}; } // detail #define BOOST_PROTO_UNARY_OP_IS_POSTFIX_0 #define BOOST_PROTO_UNARY_OP_IS_POSTFIX_1 , int #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_PROTO_DEFINE_UNARY_OPERATOR(OP, TAG, TRAIT, DOMAIN, POST) \ BOOST_PROTO_PUSH_WARNINGS \ \ template<typename Arg> \ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \ typename boost::proto::detail::enable_unary< \ DOMAIN \ , DOMAIN::proto_grammar \ , BOOST_PROTO_APPLY_UNARY_(TRAIT, Arg) \ , TAG \ , Arg & \ >::type const \ operator OP(Arg &arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \ { \ return boost::proto::detail::make_expr_<TAG, DOMAIN, Arg &>()(arg); \ } \ \ template<typename Arg> \ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \ typename boost::proto::detail::enable_unary< \ DOMAIN \ , DOMAIN::proto_grammar \ , BOOST_PROTO_APPLY_UNARY_(TRAIT, Arg) \ , TAG \ , Arg const & \ >::type const \ operator OP(Arg const &arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \ { \ return boost::proto::detail::make_expr_<TAG, DOMAIN, Arg const &>()(arg); \ } \ \ BOOST_PROTO_POP_WARNINGS \ /**/ #define BOOST_PROTO_DEFINE_BINARY_OPERATOR(OP, TAG, TRAIT, DOMAIN) \ BOOST_PROTO_PUSH_WARNINGS \ \ template<typename Left, typename Right> \ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \ typename boost::proto::detail::enable_binary< \ DOMAIN \ , DOMAIN::proto_grammar \ , BOOST_PROTO_APPLY_BINARY_(TRAIT, Left, Right) \ , TAG \ , Left & \ , Right & \ >::type const \ operator OP(Left &left, Right &right) \ { \ return boost::proto::detail::make_expr_<TAG, DOMAIN, Left &, Right &>()(left, right); \ } \ \ template<typename Left, typename Right> \ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \ typename boost::proto::detail::enable_binary< \ DOMAIN \ , DOMAIN::proto_grammar \ , BOOST_PROTO_APPLY_BINARY_(TRAIT, Left, Right) \ , TAG \ , Left & \ , Right const & \ >::type const \ operator OP(Left &left, Right const &right) \ { \ return boost::proto::detail::make_expr_<TAG, DOMAIN, Left &, Right const &>()(left, right); \ } \ \ template<typename Left, typename Right> \ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \ typename boost::proto::detail::enable_binary< \ DOMAIN \ , DOMAIN::proto_grammar \ , BOOST_PROTO_APPLY_BINARY_(TRAIT, Left, Right) \ , TAG \ , Left const & \ , Right & \ >::type const \ operator OP(Left const &left, Right &right) \ { \ return boost::proto::detail::make_expr_<TAG, DOMAIN, Left const &, Right &>()(left, right); \ } \ \ template<typename Left, typename Right> \ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \ typename boost::proto::detail::enable_binary< \ DOMAIN \ , DOMAIN::proto_grammar \ , BOOST_PROTO_APPLY_BINARY_(TRAIT, Left, Right) \ , TAG \ , Left const & \ , Right const & \ >::type const \ operator OP(Left const &left, Right const &right) \ { \ return boost::proto::detail::make_expr_<TAG, DOMAIN, Left const &, Right const &>()(left, right);\ } \ \ BOOST_PROTO_POP_WARNINGS \ /**/ #else #define BOOST_PROTO_DEFINE_UNARY_OPERATOR(OP, TAG, TRAIT, DOMAIN, POST) \ template<typename Arg> \ BOOST_PROTO_PUSH_WARNINGS \ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \ typename boost::proto::detail::enable_unary< \ DOMAIN \ , DOMAIN::proto_grammar \ , BOOST_PROTO_APPLY_UNARY_(TRAIT, Arg) \ , TAG \ , Arg const & \ >::type const \ operator OP(Arg &&arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \ { \ return boost::proto::detail::make_expr_<TAG, DOMAIN, Arg const &>()(arg); \ } \ BOOST_PROTO_POP_WARNINGS \ /**/ #define BOOST_PROTO_DEFINE_BINARY_OPERATOR(OP, TAG, TRAIT, DOMAIN) \ template<typename Left, typename Right> \ BOOST_PROTO_PUSH_WARNINGS \ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \ typename boost::proto::detail::enable_binary< \ DOMAIN \ , DOMAIN::proto_grammar \ , BOOST_PROTO_APPLY_BINARY_(TRAIT, Left, Right) \ , TAG \ , Left const & \ , Right const & \ >::type const \ operator OP(Left &&left, Right &&right) \ { \ return boost::proto::detail::make_expr_<TAG, DOMAIN, Left const &, Right const &>()(left, right);\ } \ BOOST_PROTO_POP_WARNINGS \ /**/ #endif #define BOOST_PROTO_DEFINE_OPERATORS(TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_UNARY_OPERATOR(+, boost::proto::tag::unary_plus, TRAIT, DOMAIN, 0) \ BOOST_PROTO_DEFINE_UNARY_OPERATOR(-, boost::proto::tag::negate, TRAIT, DOMAIN, 0) \ BOOST_PROTO_DEFINE_UNARY_OPERATOR(*, boost::proto::tag::dereference, TRAIT, DOMAIN, 0) \ BOOST_PROTO_DEFINE_UNARY_OPERATOR(~, boost::proto::tag::complement, TRAIT, DOMAIN, 0) \ BOOST_PROTO_DEFINE_UNARY_OPERATOR(&, boost::proto::tag::address_of, TRAIT, DOMAIN, 0) \ BOOST_PROTO_DEFINE_UNARY_OPERATOR(!, boost::proto::tag::logical_not, TRAIT, DOMAIN, 0) \ BOOST_PROTO_DEFINE_UNARY_OPERATOR(++, boost::proto::tag::pre_inc, TRAIT, DOMAIN, 0) \ BOOST_PROTO_DEFINE_UNARY_OPERATOR(--, boost::proto::tag::pre_dec, TRAIT, DOMAIN, 0) \ BOOST_PROTO_DEFINE_UNARY_OPERATOR(++, boost::proto::tag::post_inc, TRAIT, DOMAIN, 1) \ BOOST_PROTO_DEFINE_UNARY_OPERATOR(--, boost::proto::tag::post_dec, TRAIT, DOMAIN, 1) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(<<, boost::proto::tag::shift_left, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(>>, boost::proto::tag::shift_right, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(*, boost::proto::tag::multiplies, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(/, boost::proto::tag::divides, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(%, boost::proto::tag::modulus, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(+, boost::proto::tag::plus, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(-, boost::proto::tag::minus, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(<, boost::proto::tag::less, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(>, boost::proto::tag::greater, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(<=, boost::proto::tag::less_equal, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(>=, boost::proto::tag::greater_equal, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(==, boost::proto::tag::equal_to, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(!=, boost::proto::tag::not_equal_to, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(||, boost::proto::tag::logical_or, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(&&, boost::proto::tag::logical_and, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(&, boost::proto::tag::bitwise_and, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(|, boost::proto::tag::bitwise_or, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(^, boost::proto::tag::bitwise_xor, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(BOOST_PP_COMMA(), boost::proto::tag::comma, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(->*, boost::proto::tag::mem_ptr, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(<<=, boost::proto::tag::shift_left_assign, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(>>=, boost::proto::tag::shift_right_assign, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(*=, boost::proto::tag::multiplies_assign, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(/=, boost::proto::tag::divides_assign, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(%=, boost::proto::tag::modulus_assign, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(+=, boost::proto::tag::plus_assign, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(-=, boost::proto::tag::minus_assign, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(&=, boost::proto::tag::bitwise_and_assign, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(|=, boost::proto::tag::bitwise_or_assign, TRAIT, DOMAIN) \ BOOST_PROTO_DEFINE_BINARY_OPERATOR(^=, boost::proto::tag::bitwise_xor_assign, TRAIT, DOMAIN) \ /**/ // Extensions are a superset of Proto expressions template<typename T> struct is_extension : is_expr<T> {}; template<typename T> struct is_extension<T &> : is_expr<T> {}; #define BOOST_PROTO_APPLY_UNARY_(TRAIT, ARG) TRAIT<ARG> #define BOOST_PROTO_APPLY_BINARY_(TRAIT, LEFT, RIGHT) boost::mpl::or_<TRAIT<LEFT>, TRAIT<RIGHT> > namespace exprns_ { // This defines all of Proto's built-in free operator overloads BOOST_PROTO_DEFINE_OPERATORS(is_extension, deduce_domain) // if_else, for the non-overloadable ternary conditional operator ?: template<typename A0, typename A1, typename A2> BOOST_FORCEINLINE typename result_of::make_expr< tag::if_else_ , deduce_domain , A0 const & , A1 const & , A2 const & >::type const if_else(A0 const &a0, A1 const &a1, A2 const &a2) { return proto::detail::make_expr_< tag::if_else_ , deduce_domain , A0 const & , A1 const & , A2 const & >()(a0, a1, a2); } } using exprns_::if_else; #undef BOOST_PROTO_APPLY_UNARY_ #undef BOOST_PROTO_APPLY_BINARY_ // Redefine BOOST_PROTO_APPLY_UNARY_ and BOOST_PROTO_APPLY_BINARY_ so that end users // can use BOOST_PROTO_DEFINE_OPERATORS to define Proto operator overloads that work // with their own terminal types. #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_PROTO_APPLY_UNARY_(TRAIT, ARG) \ boost::mpl::and_< \ TRAIT<ARG> \ , boost::mpl::not_<boost::proto::is_extension<ARG> > \ > \ /**/ #define BOOST_PROTO_APPLY_BINARY_(TRAIT, LEFT, RIGHT) \ boost::mpl::and_< \ boost::mpl::or_<TRAIT<LEFT>, TRAIT<RIGHT> > \ , boost::mpl::not_< \ boost::mpl::or_< \ boost::proto::is_extension<LEFT> \ , boost::proto::is_extension<RIGHT> \ > \ > \ > \ /**/ #else #define BOOST_PROTO_APPLY_UNARY_(TRAIT, ARG) \ boost::mpl::and_< \ TRAIT<BOOST_PROTO_UNCVREF(ARG) > \ , boost::mpl::not_<boost::proto::is_extension<ARG> > \ > \ /**/ #define BOOST_PROTO_APPLY_BINARY_(TRAIT, LEFT, RIGHT) \ boost::mpl::and_< \ boost::mpl::or_<TRAIT<BOOST_PROTO_UNCVREF(LEFT) >, TRAIT<BOOST_PROTO_UNCVREF(RIGHT) > > \ , boost::mpl::not_< \ boost::mpl::or_< \ boost::proto::is_extension<LEFT> \ , boost::proto::is_extension<RIGHT> \ > \ > \ > \ /**/ #endif }} #if defined(_MSC_VER) # pragma warning(pop) #endif #endif PK �J�[��P P context.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file context.hpp /// Includes all the context classes in the context/ sub-directory. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_CONTEXT_HPP_EAN_06_23_2007 #define BOOST_PROTO_CONTEXT_HPP_EAN_06_23_2007 #include <boost/proto/context/null.hpp> #include <boost/proto/context/default.hpp> #include <boost/proto/context/callable.hpp> #endif PK �J�[f��6V V detail/and_n.hppnu �[��� #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES) #include <boost/proto/detail/preprocessed/and_n.hpp> #elif !defined(BOOST_PP_IS_ITERATING) #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 2, line: 0, output: "preprocessed/and_n.hpp") #endif /////////////////////////////////////////////////////////////////////////////// /// \file and_n.hpp /// Definitions of and_N, and_impl // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 1) #endif #define BOOST_PP_ITERATION_PARAMS_1 \ (3, (2, BOOST_PP_MAX(BOOST_PROTO_MAX_ARITY, BOOST_PROTO_MAX_LOGICAL_ARITY), <boost/proto/detail/and_n.hpp>)) #include BOOST_PP_ITERATE() #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(output: null) #endif #else // BOOST_PP_IS_ITERATING #define N BOOST_PP_ITERATION() // Assymetry here between the handling of and_N and or_N because // and_N is used by lambda_matches up to BOOST_PROTO_MAX_ARITY, // regardless of how low BOOST_PROTO_MAX_LOGICAL_ARITY is. template<bool B, BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(N), typename P)> struct BOOST_PP_CAT(and_, N) #if 2 == N : mpl::bool_<P0::value> {}; #else : BOOST_PP_CAT(and_, BOOST_PP_DEC(N))< P0::value BOOST_PP_COMMA_IF(BOOST_PP_SUB(N,2)) BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_DEC(N), P) > {}; #endif template<BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(N), typename P)> struct BOOST_PP_CAT(and_, N)<false, BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(N), P)> : mpl::false_ {}; #if N <= BOOST_PROTO_MAX_LOGICAL_ARITY template<BOOST_PP_ENUM_PARAMS(N, typename G), typename Expr, typename State, typename Data> struct _and_impl<proto::and_<BOOST_PP_ENUM_PARAMS(N, G)>, Expr, State, Data> : proto::transform_impl<Expr, State, Data> { #define M0(Z, N, DATA) \ typedef \ typename proto::when<proto::_, BOOST_PP_CAT(G, N)> \ ::template impl<Expr, State, Data> \ BOOST_PP_CAT(Gimpl, N); \ /**/ BOOST_PP_REPEAT(N, M0, ~) #undef M0 typedef typename BOOST_PP_CAT(Gimpl, BOOST_PP_DEC(N))::result_type result_type; result_type operator()( typename _and_impl::expr_param e , typename _and_impl::state_param s , typename _and_impl::data_param d ) const { // Fix: jfalcou - 12/29/2010 // Avoid the use of comma operator here so as not to find Proto's // by accident. // expands to G0()(e,s,d); G1()(e,s,d); ... G{N-1}()(e,s,d); #define M0(Z,N,DATA) BOOST_PP_CAT(Gimpl,N)()(e,s,d); BOOST_PP_REPEAT(BOOST_PP_DEC(N),M0,~) return BOOST_PP_CAT(Gimpl,BOOST_PP_DEC(N))()(e,s,d); #undef M0 } }; #endif #undef N #endif PK �J�[�V= = detail/make_expr_funop.hppnu �[��� #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES) #include <boost/proto/detail/preprocessed/make_expr_funop.hpp> #elif !defined(BOOST_PP_IS_ITERATING) #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 2, line: 0, output: "preprocessed/make_expr_funop.hpp") #endif /////////////////////////////////////////////////////////////////////////////// /// \file make_expr_funop.hpp /// Contains definition of make_expr\<\>::operator() member functions. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 1) #endif #define BOOST_PP_ITERATION_PARAMS_1 \ (3, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/make_expr_funop.hpp>)) #include BOOST_PP_ITERATE() #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(output: null) #endif #else // BOOST_PP_IS_ITERATING #define N BOOST_PP_ITERATION() template<typename This BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)> struct result<This(BOOST_PP_ENUM_PARAMS(N, A))> { typedef typename result_of::make_expr< Tag , Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, A) >::type type; }; /// \overload /// template<BOOST_PP_ENUM_PARAMS(N, typename A)> BOOST_FORCEINLINE typename result_of::make_expr< Tag , Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A) >::type const operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, const A, &a)) const { return proto::detail::make_expr_< Tag , Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A) >()(BOOST_PP_ENUM_PARAMS(N, a)); } #undef N #endif PK �J�[W�� � detail/vararg_matches_impl.hppnu �[��� #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES) #include <boost/proto/detail/preprocessed/vararg_matches_impl.hpp> #elif !defined(BOOST_PP_IS_ITERATING) #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 2, line: 0, output: "preprocessed/vararg_matches_impl.hpp") #endif /////////////////////////////////////////////////////////////////////////////// /// \file vararg_matches_impl.hpp /// Specializations of the vararg_matches_impl template // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 1) #endif #define BOOST_PP_ITERATION_PARAMS_1 \ (3, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/vararg_matches_impl.hpp>)) #include BOOST_PP_ITERATE() #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(output: null) #endif #else // BOOST_PP_IS_ITERATING #define N BOOST_PP_ITERATION() template<typename Args, typename Back, long To> struct vararg_matches_impl<Args, Back, N, To> : and_2< matches_< typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_grammar , Back >::value , vararg_matches_impl<Args, Back, N + 1, To> > {}; template<typename Args, typename Back> struct vararg_matches_impl<Args, Back, N, N> : matches_< typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_derived_expr , typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_grammar , Back > {}; #undef N #endif PK �J�[�)'� detail/class_member_traits.hppnu �[��� #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES) #include <boost/proto/detail/preprocessed/class_member_traits.hpp> #elif !defined(BOOST_PP_IS_ITERATING) #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 2, line: 0, output: "preprocessed/class_member_traits.hpp") #endif /////////////////////////////////////////////////////////////////////////////// // class_member_traits.hpp // Contains specializations of the class_member_traits\<\> class template. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 1) #endif #define BOOST_PP_ITERATION_PARAMS_1 \ (3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/class_member_traits.hpp>)) #include BOOST_PP_ITERATE() #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(output: null) #endif #else #define N BOOST_PP_ITERATION() template<typename T, typename U BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)> struct class_member_traits<T (U::*)(BOOST_PP_ENUM_PARAMS(N, A))> { typedef U class_type; typedef T result_type; }; template<typename T, typename U BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)> struct class_member_traits<T (U::*)(BOOST_PP_ENUM_PARAMS(N, A)) const> { typedef U class_type; typedef T result_type; }; #undef N #endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES PK �J�[2Ù�/= /= detail/preprocessed/and_n.hppnu �[��� /////////////////////////////////////////////////////////////////////////////// /// \file and_n.hpp /// Definitions of and_N, and_impl // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) template<bool B, typename P0> struct and_2 : mpl::bool_<P0::value> {}; template<typename P0> struct and_2<false, P0> : mpl::false_ {}; template<typename G0 , typename G1, typename Expr, typename State, typename Data> struct _and_impl<proto::and_<G0 , G1>, Expr, State, Data> : proto::transform_impl<Expr, State, Data> { typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename Gimpl1::result_type result_type; result_type operator()( typename _and_impl::expr_param e , typename _and_impl::state_param s , typename _and_impl::data_param d ) const { Gimpl0()(e,s,d); return Gimpl1()(e,s,d); } }; template<bool B, typename P0 , typename P1> struct and_3 : and_2< P0::value , P1 > {}; template<typename P0 , typename P1> struct and_3<false, P0 , P1> : mpl::false_ {}; template<typename G0 , typename G1 , typename G2, typename Expr, typename State, typename Data> struct _and_impl<proto::and_<G0 , G1 , G2>, Expr, State, Data> : proto::transform_impl<Expr, State, Data> { typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename Gimpl2::result_type result_type; result_type operator()( typename _and_impl::expr_param e , typename _and_impl::state_param s , typename _and_impl::data_param d ) const { Gimpl0()(e,s,d); Gimpl1()(e,s,d); return Gimpl2()(e,s,d); } }; template<bool B, typename P0 , typename P1 , typename P2> struct and_4 : and_3< P0::value , P1 , P2 > {}; template<typename P0 , typename P1 , typename P2> struct and_4<false, P0 , P1 , P2> : mpl::false_ {}; template<typename G0 , typename G1 , typename G2 , typename G3, typename Expr, typename State, typename Data> struct _and_impl<proto::and_<G0 , G1 , G2 , G3>, Expr, State, Data> : proto::transform_impl<Expr, State, Data> { typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename Gimpl3::result_type result_type; result_type operator()( typename _and_impl::expr_param e , typename _and_impl::state_param s , typename _and_impl::data_param d ) const { Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); return Gimpl3()(e,s,d); } }; template<bool B, typename P0 , typename P1 , typename P2 , typename P3> struct and_5 : and_4< P0::value , P1 , P2 , P3 > {}; template<typename P0 , typename P1 , typename P2 , typename P3> struct and_5<false, P0 , P1 , P2 , P3> : mpl::false_ {}; template<typename G0 , typename G1 , typename G2 , typename G3 , typename G4, typename Expr, typename State, typename Data> struct _and_impl<proto::and_<G0 , G1 , G2 , G3 , G4>, Expr, State, Data> : proto::transform_impl<Expr, State, Data> { typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename proto::when<proto::_, G4> ::template impl<Expr, State, Data> Gimpl4; typedef typename Gimpl4::result_type result_type; result_type operator()( typename _and_impl::expr_param e , typename _and_impl::state_param s , typename _and_impl::data_param d ) const { Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); Gimpl3()(e,s,d); return Gimpl4()(e,s,d); } }; template<bool B, typename P0 , typename P1 , typename P2 , typename P3 , typename P4> struct and_6 : and_5< P0::value , P1 , P2 , P3 , P4 > {}; template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4> struct and_6<false, P0 , P1 , P2 , P3 , P4> : mpl::false_ {}; template<typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5, typename Expr, typename State, typename Data> struct _and_impl<proto::and_<G0 , G1 , G2 , G3 , G4 , G5>, Expr, State, Data> : proto::transform_impl<Expr, State, Data> { typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename proto::when<proto::_, G4> ::template impl<Expr, State, Data> Gimpl4; typedef typename proto::when<proto::_, G5> ::template impl<Expr, State, Data> Gimpl5; typedef typename Gimpl5::result_type result_type; result_type operator()( typename _and_impl::expr_param e , typename _and_impl::state_param s , typename _and_impl::data_param d ) const { Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); Gimpl3()(e,s,d); Gimpl4()(e,s,d); return Gimpl5()(e,s,d); } }; template<bool B, typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5> struct and_7 : and_6< P0::value , P1 , P2 , P3 , P4 , P5 > {}; template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5> struct and_7<false, P0 , P1 , P2 , P3 , P4 , P5> : mpl::false_ {}; template<typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6, typename Expr, typename State, typename Data> struct _and_impl<proto::and_<G0 , G1 , G2 , G3 , G4 , G5 , G6>, Expr, State, Data> : proto::transform_impl<Expr, State, Data> { typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename proto::when<proto::_, G4> ::template impl<Expr, State, Data> Gimpl4; typedef typename proto::when<proto::_, G5> ::template impl<Expr, State, Data> Gimpl5; typedef typename proto::when<proto::_, G6> ::template impl<Expr, State, Data> Gimpl6; typedef typename Gimpl6::result_type result_type; result_type operator()( typename _and_impl::expr_param e , typename _and_impl::state_param s , typename _and_impl::data_param d ) const { Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); Gimpl3()(e,s,d); Gimpl4()(e,s,d); Gimpl5()(e,s,d); return Gimpl6()(e,s,d); } }; template<bool B, typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6> struct and_8 : and_7< P0::value , P1 , P2 , P3 , P4 , P5 , P6 > {}; template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6> struct and_8<false, P0 , P1 , P2 , P3 , P4 , P5 , P6> : mpl::false_ {}; template<typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7, typename Expr, typename State, typename Data> struct _and_impl<proto::and_<G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7>, Expr, State, Data> : proto::transform_impl<Expr, State, Data> { typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename proto::when<proto::_, G4> ::template impl<Expr, State, Data> Gimpl4; typedef typename proto::when<proto::_, G5> ::template impl<Expr, State, Data> Gimpl5; typedef typename proto::when<proto::_, G6> ::template impl<Expr, State, Data> Gimpl6; typedef typename proto::when<proto::_, G7> ::template impl<Expr, State, Data> Gimpl7; typedef typename Gimpl7::result_type result_type; result_type operator()( typename _and_impl::expr_param e , typename _and_impl::state_param s , typename _and_impl::data_param d ) const { Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); Gimpl3()(e,s,d); Gimpl4()(e,s,d); Gimpl5()(e,s,d); Gimpl6()(e,s,d); return Gimpl7()(e,s,d); } }; template<bool B, typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7> struct and_9 : and_8< P0::value , P1 , P2 , P3 , P4 , P5 , P6 , P7 > {}; template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7> struct and_9<false, P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7> : mpl::false_ {}; template<typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7 , typename G8, typename Expr, typename State, typename Data> struct _and_impl<proto::and_<G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7 , G8>, Expr, State, Data> : proto::transform_impl<Expr, State, Data> { typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename proto::when<proto::_, G4> ::template impl<Expr, State, Data> Gimpl4; typedef typename proto::when<proto::_, G5> ::template impl<Expr, State, Data> Gimpl5; typedef typename proto::when<proto::_, G6> ::template impl<Expr, State, Data> Gimpl6; typedef typename proto::when<proto::_, G7> ::template impl<Expr, State, Data> Gimpl7; typedef typename proto::when<proto::_, G8> ::template impl<Expr, State, Data> Gimpl8; typedef typename Gimpl8::result_type result_type; result_type operator()( typename _and_impl::expr_param e , typename _and_impl::state_param s , typename _and_impl::data_param d ) const { Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); Gimpl3()(e,s,d); Gimpl4()(e,s,d); Gimpl5()(e,s,d); Gimpl6()(e,s,d); Gimpl7()(e,s,d); return Gimpl8()(e,s,d); } }; template<bool B, typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8> struct and_10 : and_9< P0::value , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 > {}; template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8> struct and_10<false, P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8> : mpl::false_ {}; template<typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7 , typename G8 , typename G9, typename Expr, typename State, typename Data> struct _and_impl<proto::and_<G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7 , G8 , G9>, Expr, State, Data> : proto::transform_impl<Expr, State, Data> { typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename proto::when<proto::_, G4> ::template impl<Expr, State, Data> Gimpl4; typedef typename proto::when<proto::_, G5> ::template impl<Expr, State, Data> Gimpl5; typedef typename proto::when<proto::_, G6> ::template impl<Expr, State, Data> Gimpl6; typedef typename proto::when<proto::_, G7> ::template impl<Expr, State, Data> Gimpl7; typedef typename proto::when<proto::_, G8> ::template impl<Expr, State, Data> Gimpl8; typedef typename proto::when<proto::_, G9> ::template impl<Expr, State, Data> Gimpl9; typedef typename Gimpl9::result_type result_type; result_type operator()( typename _and_impl::expr_param e , typename _and_impl::state_param s , typename _and_impl::data_param d ) const { Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); Gimpl3()(e,s,d); Gimpl4()(e,s,d); Gimpl5()(e,s,d); Gimpl6()(e,s,d); Gimpl7()(e,s,d); Gimpl8()(e,s,d); return Gimpl9()(e,s,d); } }; PK �J�[IzGb# b# '