1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258 |
- #ifndef BOOST_PROTO_ARG_TRAITS_HPP_EAN_04_01_2005
- #define BOOST_PROTO_ARG_TRAITS_HPP_EAN_04_01_2005
- #include <boost/config.hpp>
- #include <boost/detail/workaround.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/repetition/enum.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
- #include <boost/preprocessor/repetition/repeat.hpp>
- #include <boost/preprocessor/repetition/repeat_from_to.hpp>
- #include <boost/preprocessor/facilities/intercept.hpp>
- #include <boost/preprocessor/arithmetic/sub.hpp>
- #include <boost/static_assert.hpp>
- #include <boost/mpl/bool.hpp>
- #include <boost/proto/detail/template_arity.hpp>
- #include <boost/type_traits/is_pod.hpp>
- #include <boost/type_traits/is_same.hpp>
- #include <boost/type_traits/add_const.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/args.hpp>
- #include <boost/proto/domain.hpp>
- #include <boost/proto/transform/pass_through.hpp>
- #if defined(_MSC_VER)
- # pragma warning(push)
- # if BOOST_WORKAROUND( BOOST_MSVC, >= 1400 )
- # pragma warning(disable: 4180)
- # endif
- # pragma warning(disable : 4714)
- #endif
- namespace boost { namespace proto
- {
- namespace detail
- {
- template<typename T, typename Void = void>
- struct if_vararg
- {};
- template<typename T>
- struct if_vararg<T, typename T::proto_is_vararg_>
- : T
- {};
- template<typename T, typename Void = void>
- struct is_callable2_
- : mpl::false_
- {};
- template<typename T>
- struct is_callable2_<T, typename T::proto_is_callable_>
- : mpl::true_
- {};
- template<typename T BOOST_PROTO_TEMPLATE_ARITY_PARAM(long Arity = boost::proto::detail::template_arity<T>::value)>
- struct is_callable_
- : is_callable2_<T>
- {};
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- template<typename T>
- struct is_callable
- : proto::detail::is_callable_<T>
- {};
-
-
- template<>
- struct is_callable<proto::_>
- : mpl::true_
- {};
-
-
- template<>
- struct is_callable<proto::callable>
- : mpl::false_
- {};
-
-
- template<typename PrimitiveTransform, typename X>
- struct is_callable<proto::transform<PrimitiveTransform, X> >
- : mpl::false_
- {};
- #if BOOST_WORKAROUND(__GNUC__, == 3) || (BOOST_WORKAROUND(__GNUC__, == 4) && __GNUC_MINOR__ == 0)
-
- template<typename Tag, typename Args, long N>
- struct is_callable<proto::expr<Tag, Args, N> >
- : mpl::false_
- {};
-
- template<typename Tag, typename Args, long N>
- struct is_callable<proto::basic_expr<Tag, Args, N> >
- : mpl::false_
- {};
- #endif
- namespace detail
- {
- template<typename T, typename Void >
- struct is_transform_
- : mpl::false_
- {};
- template<typename T>
- struct is_transform_<T, typename T::proto_is_transform_>
- : mpl::true_
- {};
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- template<typename T>
- struct is_transform
- : proto::detail::is_transform_<T>
- {};
- namespace detail
- {
- template<typename T, typename Void >
- struct is_aggregate_
- : is_pod<T>
- {};
- template<typename Tag, typename Args, long N>
- struct is_aggregate_<proto::expr<Tag, Args, N>, void>
- : mpl::true_
- {};
- template<typename Tag, typename Args, long N>
- struct is_aggregate_<proto::basic_expr<Tag, Args, N>, void>
- : mpl::true_
- {};
- template<typename T>
- struct is_aggregate_<T, typename T::proto_is_aggregate_>
- : mpl::true_
- {};
- }
-
-
-
-
-
-
-
-
-
- template<typename T>
- struct is_aggregate
- : proto::detail::is_aggregate_<T>
- {};
-
-
-
-
-
-
-
-
-
- template<typename T, typename Void >
- struct is_expr
- : mpl::false_
- {};
-
-
-
-
-
-
-
-
-
- template<typename T>
- struct is_expr<T, typename T::proto_is_expr_>
- : mpl::true_
- {};
-
- template<typename T>
- struct is_expr<T &, void>
- : is_expr<T>
- {};
-
-
- template<typename Expr>
- struct tag_of
- {
- typedef typename Expr::proto_tag type;
- };
- template<typename Expr>
- struct tag_of<Expr &>
- {
- typedef typename Expr::proto_tag type;
- };
-
-
- template<typename Expr>
- struct arity_of
- : Expr::proto_arity
- {};
- template<typename Expr>
- struct arity_of<Expr &>
- : Expr::proto_arity
- {};
- namespace result_of
- {
-
-
- template<typename T, typename Domain >
- struct as_expr
- {
- typedef typename Domain::template as_expr<T>::result_type type;
- };
-
-
- template<typename T, typename Domain >
- struct as_child
- {
- typedef typename Domain::template as_child<T>::result_type type;
- };
-
-
-
-
-
- template<typename Expr, typename N >
- struct child
- : child_c<Expr, N::value>
- {};
-
-
-
- template<typename Expr>
- struct value
- {
-
- BOOST_STATIC_ASSERT(0 == Expr::proto_arity_c);
-
-
- typedef typename Expr::proto_child0 value_type;
-
-
-
-
-
-
-
-
-
- typedef typename detail::term_traits<typename Expr::proto_child0>::value_type type;
- };
- template<typename Expr>
- struct value<Expr &>
- {
-
- BOOST_STATIC_ASSERT(0 == Expr::proto_arity_c);
-
-
- typedef typename Expr::proto_child0 value_type;
-
-
-
-
-
-
-
-
-
- typedef typename detail::term_traits<typename Expr::proto_child0>::reference type;
- };
- template<typename Expr>
- struct value<Expr const &>
- {
-
- BOOST_STATIC_ASSERT(0 == Expr::proto_arity_c);
-
-
- typedef typename Expr::proto_child0 value_type;
-
-
-
-
-
-
-
-
-
- typedef typename detail::term_traits<typename Expr::proto_child0>::const_reference type;
- };
-
-
-
-
-
- template<typename Expr>
- struct left
- : child_c<Expr, 0>
- {};
-
-
-
-
-
- template<typename Expr>
- struct right
- : child_c<Expr, 1>
- {};
- }
-
-
-
- template<typename T>
- struct terminal
- : proto::transform<terminal<T>, int>
- {
- typedef proto::expr<proto::tag::terminal, term<T>, 0> type;
- typedef proto::basic_expr<proto::tag::terminal, term<T>, 0> proto_grammar;
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
- typedef Expr result_type;
-
-
-
-
- BOOST_FORCEINLINE
- 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;
- }
- };
-
- typedef proto::tag::terminal proto_tag;
-
- typedef T proto_child0;
- };
-
-
-
-
- template<typename T, typename U, typename V>
- struct if_else_
- : proto::transform<if_else_<T, U, V>, int>
- {
- typedef proto::expr<proto::tag::if_else_, list3<T, U, V>, 3> type;
- typedef proto::basic_expr<proto::tag::if_else_, list3<T, U, V>, 3> proto_grammar;
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::pass_through_impl<if_else_, deduce_domain, Expr, State, Data>
- {};
-
- typedef proto::tag::if_else_ proto_tag;
-
- typedef T proto_child0;
-
- typedef U proto_child1;
-
- typedef V proto_child2;
- };
-
-
-
-
-
-
-
- template<typename Tag, typename T>
- struct nullary_expr
- : proto::transform<nullary_expr<Tag, T>, int>
- {
- typedef proto::expr<Tag, term<T>, 0> type;
- typedef proto::basic_expr<Tag, term<T>, 0> proto_grammar;
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
- typedef Expr result_type;
-
-
-
-
- BOOST_FORCEINLINE
- 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;
- }
- };
-
- typedef Tag proto_tag;
-
- typedef T proto_child0;
- };
-
-
-
-
-
-
-
-
- template<typename Tag, typename T>
- struct unary_expr
- : proto::transform<unary_expr<Tag, T>, int>
- {
- typedef proto::expr<Tag, list1<T>, 1> type;
- typedef proto::basic_expr<Tag, list1<T>, 1> proto_grammar;
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::pass_through_impl<unary_expr, deduce_domain, Expr, State, Data>
- {};
-
- typedef Tag proto_tag;
-
- typedef T proto_child0;
- };
-
-
-
-
-
-
-
-
- template<typename Tag, typename T, typename U>
- struct binary_expr
- : proto::transform<binary_expr<Tag, T, U>, int>
- {
- typedef proto::expr<Tag, list2<T, U>, 2> type;
- typedef proto::basic_expr<Tag, list2<T, U>, 2> proto_grammar;
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::pass_through_impl<binary_expr, deduce_domain, Expr, State, Data>
- {};
-
- typedef Tag proto_tag;
-
- typedef T proto_child0;
-
- typedef U proto_child1;
- };
- #define BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(Op) \
- template<typename T> \
- struct Op \
- : proto::transform<Op<T>, int> \
- { \
- typedef proto::expr<proto::tag::Op, list1<T>, 1> type; \
- typedef proto::basic_expr<proto::tag::Op, list1<T>, 1> proto_grammar; \
- \
- template<typename Expr, typename State, typename Data> \
- struct impl \
- : detail::pass_through_impl<Op, deduce_domain, Expr, State, Data> \
- {}; \
- \
- typedef proto::tag::Op proto_tag; \
- typedef T proto_child0; \
- }; \
-
- #define BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(Op) \
- template<typename T, typename U> \
- struct Op \
- : proto::transform<Op<T, U>, int> \
- { \
- typedef proto::expr<proto::tag::Op, list2<T, U>, 2> type; \
- typedef proto::basic_expr<proto::tag::Op, list2<T, U>, 2> proto_grammar; \
- \
- template<typename Expr, typename State, typename Data> \
- struct impl \
- : detail::pass_through_impl<Op, deduce_domain, Expr, State, Data> \
- {}; \
- \
- typedef proto::tag::Op proto_tag; \
- typedef T proto_child0; \
- typedef U proto_child1; \
- }; \
-
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(unary_plus)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(negate)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(dereference)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(complement)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(address_of)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(logical_not)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(pre_inc)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(pre_dec)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(post_inc)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(post_dec)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_left)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_right)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(multiplies)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(divides)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(modulus)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(plus)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(minus)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(less)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(greater)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(less_equal)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(greater_equal)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(equal_to)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(not_equal_to)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(logical_or)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(logical_and)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_or)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_and)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_xor)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(comma)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(mem_ptr)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_left_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_right_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(multiplies_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(divides_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(modulus_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(plus_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(minus_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_or_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_and_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_xor_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(subscript)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(member)
- #undef BOOST_PROTO_DEFINE_UNARY_METAFUNCTION
- #undef BOOST_PROTO_DEFINE_BINARY_METAFUNCTION
- #include <boost/proto/detail/traits.hpp>
- namespace functional
- {
-
-
- template<typename Domain >
- struct as_expr
- {
- BOOST_PROTO_CALLABLE()
- template<typename Sig>
- struct result;
- template<typename This, typename T>
- struct result<This(T)>
- {
- typedef typename Domain::template as_expr<T>::result_type type;
- };
- template<typename This, typename T>
- struct result<This(T &)>
- {
- typedef typename Domain::template as_expr<T>::result_type type;
- };
-
-
-
-
- template<typename T>
- BOOST_FORCEINLINE
- typename add_const<typename result<as_expr(T &)>::type>::type
- operator ()(T &t) const
- {
- return typename Domain::template as_expr<T>()(t);
- }
-
-
- template<typename T>
- BOOST_FORCEINLINE
- typename add_const<typename result<as_expr(T const &)>::type>::type
- operator ()(T const &t) const
- {
- return typename Domain::template as_expr<T const>()(t);
- }
- #if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
- template<typename T, std::size_t N_>
- BOOST_FORCEINLINE
- typename add_const<typename result<as_expr(T (&)[N_])>::type>::type
- operator ()(T (&t)[N_]) const
- {
- return typename Domain::template as_expr<T[N_]>()(t);
- }
- template<typename T, std::size_t N_>
- BOOST_FORCEINLINE
- typename add_const<typename result<as_expr(T const (&)[N_])>::type>::type
- operator ()(T const (&t)[N_]) const
- {
- return typename Domain::template as_expr<T const[N_]>()(t);
- }
- #endif
- };
-
-
- template<typename Domain >
- struct as_child
- {
- BOOST_PROTO_CALLABLE()
- template<typename Sig>
- struct result;
- template<typename This, typename T>
- struct result<This(T)>
- {
- typedef typename Domain::template as_child<T>::result_type type;
- };
- template<typename This, typename T>
- struct result<This(T &)>
- {
- typedef typename Domain::template as_child<T>::result_type type;
- };
-
-
-
-
- template<typename T>
- BOOST_FORCEINLINE
- typename add_const<typename result<as_child(T &)>::type>::type
- operator ()(T &t) const
- {
- return typename Domain::template as_child<T>()(t);
- }
-
-
- template<typename T>
- BOOST_FORCEINLINE
- typename add_const<typename result<as_child(T const &)>::type>::type
- operator ()(T const &t) const
- {
- return typename Domain::template as_child<T const>()(t);
- }
- };
-
-
- template<long N>
- struct child_c
- {
- BOOST_PROTO_CALLABLE()
- template<typename Sig>
- struct result;
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef typename result_of::child_c<Expr, N>::type type;
- };
-
-
-
-
-
-
- template<typename Expr>
- BOOST_FORCEINLINE
- typename result_of::child_c<Expr &, N>::type
- operator ()(Expr &e) const
- {
- return result_of::child_c<Expr &, N>::call(e);
- }
-
-
- template<typename Expr>
- BOOST_FORCEINLINE
- typename result_of::child_c<Expr const &, N>::type
- operator ()(Expr const &e) const
- {
- return result_of::child_c<Expr const &, N>::call(e);
- }
- };
-
-
-
-
-
-
- template<typename N >
- struct child
- {
- BOOST_PROTO_CALLABLE()
- template<typename Sig>
- struct result;
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef typename result_of::child<Expr, N>::type type;
- };
-
-
-
-
-
-
- template<typename Expr>
- BOOST_FORCEINLINE
- typename result_of::child<Expr &, N>::type
- operator ()(Expr &e) const
- {
- return result_of::child<Expr &, N>::call(e);
- }
-
-
- template<typename Expr>
- BOOST_FORCEINLINE
- typename result_of::child<Expr const &, N>::type
- operator ()(Expr const &e) const
- {
- return result_of::child<Expr const &, N>::call(e);
- }
- };
-
-
- struct value
- {
- BOOST_PROTO_CALLABLE()
- template<typename Sig>
- struct result;
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef typename result_of::value<Expr>::type type;
- };
-
-
-
-
-
-
- template<typename Expr>
- BOOST_FORCEINLINE
- typename result_of::value<Expr &>::type
- operator ()(Expr &e) const
- {
- return e.proto_base().child0;
- }
-
-
- template<typename Expr>
- BOOST_FORCEINLINE
- typename result_of::value<Expr const &>::type
- operator ()(Expr const &e) const
- {
- return e.proto_base().child0;
- }
- };
-
-
- struct left
- {
- BOOST_PROTO_CALLABLE()
- template<typename Sig>
- struct result;
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef typename result_of::left<Expr>::type type;
- };
-
-
-
-
-
-
- template<typename Expr>
- BOOST_FORCEINLINE
- typename result_of::left<Expr &>::type
- operator ()(Expr &e) const
- {
- return e.proto_base().child0;
- }
-
-
- template<typename Expr>
- BOOST_FORCEINLINE
- typename result_of::left<Expr const &>::type
- operator ()(Expr const &e) const
- {
- return e.proto_base().child0;
- }
- };
-
-
- struct right
- {
- BOOST_PROTO_CALLABLE()
- template<typename Sig>
- struct result;
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef typename result_of::right<Expr>::type type;
- };
-
-
-
-
-
-
- template<typename Expr>
- BOOST_FORCEINLINE
- typename result_of::right<Expr &>::type
- operator ()(Expr &e) const
- {
- return e.proto_base().child1;
- }
- template<typename Expr>
- BOOST_FORCEINLINE
- typename result_of::right<Expr const &>::type
- operator ()(Expr const &e) const
- {
- return e.proto_base().child1;
- }
- };
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- template<typename T>
- BOOST_FORCEINLINE
- typename add_const<typename result_of::as_expr<T, default_domain>::type>::type
- as_expr(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T))
- {
- return default_domain::as_expr<T>()(t);
- }
-
-
- template<typename T>
- BOOST_FORCEINLINE
- typename add_const<typename result_of::as_expr<T const, default_domain>::type>::type
- as_expr(T const &t)
- {
- return default_domain::as_expr<T const>()(t);
- }
-
-
- template<typename Domain, typename T>
- BOOST_FORCEINLINE
- typename add_const<typename result_of::as_expr<T, Domain>::type>::type
- as_expr(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T))
- {
- return typename Domain::template as_expr<T>()(t);
- }
-
-
- template<typename Domain, typename T>
- BOOST_FORCEINLINE
- typename add_const<typename result_of::as_expr<T const, Domain>::type>::type
- as_expr(T const &t)
- {
- return typename Domain::template as_expr<T const>()(t);
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- template<typename T>
- BOOST_FORCEINLINE
- typename add_const<typename result_of::as_child<T, default_domain>::type>::type
- as_child(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T))
- {
- return default_domain::as_child<T>()(t);
- }
-
-
- template<typename T>
- BOOST_FORCEINLINE
- typename add_const<typename result_of::as_child<T const, default_domain>::type>::type
- as_child(T const &t)
- {
- return default_domain::as_child<T const>()(t);
- }
-
-
- template<typename Domain, typename T>
- BOOST_FORCEINLINE
- typename add_const<typename result_of::as_child<T, Domain>::type>::type
- as_child(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T))
- {
- return typename Domain::template as_child<T>()(t);
- }
-
-
- template<typename Domain, typename T>
- BOOST_FORCEINLINE
- typename add_const<typename result_of::as_child<T const, Domain>::type>::type
- as_child(T const &t)
- {
- return typename Domain::template as_child<T const>()(t);
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
- template<typename N, typename Expr>
- BOOST_FORCEINLINE
- typename result_of::child<Expr &, N>::type
- child(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr))
- {
- return result_of::child<Expr &, N>::call(e);
- }
-
-
- template<typename N, typename Expr>
- BOOST_FORCEINLINE
- typename result_of::child<Expr const &, N>::type
- child(Expr const &e)
- {
- return result_of::child<Expr const &, N>::call(e);
- }
-
-
- template<typename Expr2>
- BOOST_FORCEINLINE
- typename detail::expr_traits<typename Expr2::proto_base_expr::proto_child0>::reference
- child(Expr2 &expr2 BOOST_PROTO_DISABLE_IF_IS_CONST(Expr2))
- {
- return expr2.proto_base().child0;
- }
-
-
- template<typename Expr2>
- BOOST_FORCEINLINE
- typename detail::expr_traits<typename Expr2::proto_base_expr::proto_child0>::const_reference
- child(Expr2 const &expr2)
- {
- return expr2.proto_base().child0;
- }
-
-
-
-
-
-
-
-
-
-
- template<long N, typename Expr>
- BOOST_FORCEINLINE
- typename result_of::child_c<Expr &, N>::type
- child_c(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr))
- {
- return result_of::child_c<Expr &, N>::call(e);
- }
-
-
- template<long N, typename Expr>
- BOOST_FORCEINLINE
- typename result_of::child_c<Expr const &, N>::type
- child_c(Expr const &e)
- {
- return result_of::child_c<Expr const &, N>::call(e);
- }
-
-
-
-
-
-
-
-
-
-
-
- template<typename Expr>
- BOOST_FORCEINLINE
- typename result_of::value<Expr &>::type
- value(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr))
- {
- return e.proto_base().child0;
- }
-
-
- template<typename Expr>
- BOOST_FORCEINLINE
- typename result_of::value<Expr const &>::type
- value(Expr const &e)
- {
- return e.proto_base().child0;
- }
-
-
-
-
-
-
-
-
-
-
-
- template<typename Expr>
- BOOST_FORCEINLINE
- typename result_of::left<Expr &>::type
- left(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr))
- {
- return e.proto_base().child0;
- }
-
-
- template<typename Expr>
- BOOST_FORCEINLINE
- typename result_of::left<Expr const &>::type
- left(Expr const &e)
- {
- return e.proto_base().child0;
- }
-
-
-
-
-
-
-
-
-
-
-
- template<typename Expr>
- BOOST_FORCEINLINE
- typename result_of::right<Expr &>::type
- right(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr))
- {
- return e.proto_base().child1;
- }
-
-
- template<typename Expr>
- BOOST_FORCEINLINE
- typename result_of::right<Expr const &>::type
- right(Expr const &e)
- {
- return e.proto_base().child1;
- }
-
-
- template<typename Domain>
- struct is_callable<functional::as_expr<Domain> >
- : mpl::true_
- {};
-
-
- template<typename Domain>
- struct is_callable<functional::as_child<Domain> >
- : mpl::true_
- {};
-
-
- template<long N>
- struct is_callable<functional::child_c<N> >
- : mpl::true_
- {};
-
-
- template<typename N>
- struct is_callable<functional::child<N> >
- : mpl::true_
- {};
- }}
- #if defined(_MSC_VER)
- # pragma warning(pop)
- #endif
- #endif
|