123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509 |
- #ifndef BOOST_PROTO_MAKE_EXPR_HPP_EAN_04_01_2005
- #define BOOST_PROTO_MAKE_EXPR_HPP_EAN_04_01_2005
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/arithmetic/inc.hpp>
- #include <boost/preprocessor/arithmetic/dec.hpp>
- #include <boost/preprocessor/arithmetic/sub.hpp>
- #include <boost/preprocessor/punctuation/comma_if.hpp>
- #include <boost/preprocessor/iteration/iterate.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/repetition/enum_shifted_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
- #include <boost/preprocessor/repetition/repeat.hpp>
- #include <boost/ref.hpp>
- #include <boost/mpl/if.hpp>
- #include <boost/mpl/assert.hpp>
- #include <boost/mpl/eval_if.hpp>
- #include <boost/utility/enable_if.hpp>
- #include <boost/type_traits/add_const.hpp>
- #include <boost/type_traits/add_reference.hpp>
- #include <boost/type_traits/remove_cv.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/traits.hpp>
- #include <boost/proto/domain.hpp>
- #include <boost/proto/generate.hpp>
- #include <boost/fusion/include/at_c.hpp>
- #include <boost/fusion/include/begin.hpp>
- #include <boost/fusion/include/next.hpp>
- #include <boost/fusion/include/value_of.hpp>
- #include <boost/fusion/include/size.hpp>
- #include <boost/proto/detail/poly_function.hpp>
- #include <boost/proto/detail/deprecated.hpp>
- #if defined(_MSC_VER)
- # pragma warning(push)
- # pragma warning(disable : 4180)
- # pragma warning(disable : 4714)
- #endif
- namespace boost { namespace proto
- {
- #define BOOST_PROTO_AS_CHILD_TYPE(Z, N, DATA) \
- typename boost::proto::detail::protoify< \
- BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 0, DATA), N) \
- , BOOST_PP_TUPLE_ELEM(3, 2, DATA) \
- >::result_type \
-
- #define BOOST_PROTO_AS_CHILD(Z, N, DATA) \
- boost::proto::detail::protoify< \
- BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 0, DATA), N) \
- , BOOST_PP_TUPLE_ELEM(3, 2, DATA) \
- >()(BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 1, DATA), N)) \
-
- namespace detail
- {
- template<typename T, typename Domain>
- struct protoify
- : Domain::template as_expr<T>
- {};
- template<typename T, typename Domain>
- struct protoify<T &, Domain>
- : Domain::template as_child<T>
- {};
- template<typename T, typename Domain>
- struct protoify<boost::reference_wrapper<T>, Domain>
- : Domain::template as_child<T>
- {};
- template<typename T, typename Domain>
- struct protoify<boost::reference_wrapper<T> const, Domain>
- : Domain::template as_child<T>
- {};
-
- #include <boost/proto/detail/unpack_expr_.hpp>
-
- #include <boost/proto/detail/make_expr_.hpp>
- }
- namespace result_of
- {
-
-
-
-
-
-
-
-
-
-
-
- template<
- typename Tag
- , BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, typename A)
- , typename Void1 // = void
- , typename Void2 // = void
- >
- struct make_expr
- {
-
-
-
-
-
-
-
- typedef
- typename detail::make_expr_<
- Tag
- , deduce_domain
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
- >::result_type
- type;
- };
-
-
-
-
-
- template<
- typename Tag
- , typename Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, typename A)
- >
- struct make_expr<
- Tag
- , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
- , typename Domain::proto_is_domain_
- >
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- typedef
- typename detail::make_expr_<
- Tag
- , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
- >::result_type
- type;
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
- template<
- typename Tag
- , typename Sequence
- , typename Void1 // = void
- , typename Void2 // = void
- >
- struct unpack_expr
- {
-
-
-
-
-
-
- typedef
- typename detail::unpack_expr_<
- Tag
- , deduce_domain
- , Sequence
- , fusion::result_of::size<Sequence>::type::value
- >::type
- type;
- };
-
-
-
-
-
- template<typename Tag, typename Domain, typename Sequence>
- struct unpack_expr<Tag, Domain, Sequence, typename Domain::proto_is_domain_>
- {
-
-
-
-
-
-
- typedef
- typename detail::unpack_expr_<
- Tag
- , Domain
- , Sequence
- , fusion::result_of::size<Sequence>::type::value
- >::type
- type;
- };
- }
- namespace functional
- {
-
-
-
-
-
-
-
-
- template<typename Tag, typename Domain /* = deduce_domain*/>
- struct make_expr
- {
- BOOST_PROTO_CALLABLE()
- BOOST_PROTO_POLY_FUNCTION()
- template<typename Sig>
- struct result;
- template<typename This, typename A0>
- struct result<This(A0)>
- {
- typedef
- typename result_of::make_expr<
- Tag
- , Domain
- , A0
- >::type
- type;
- };
-
-
-
-
- template<typename A0>
- BOOST_FORCEINLINE
- typename result_of::make_expr<
- Tag
- , Domain
- , A0 const
- >::type const
- operator ()(A0 const &a0) const
- {
- return proto::detail::make_expr_<
- Tag
- , Domain
- , A0 const
- >()(a0);
- }
-
- #include <boost/proto/detail/make_expr_funop.hpp>
-
-
- template<
- BOOST_PP_ENUM_BINARY_PARAMS(
- BOOST_PROTO_MAX_ARITY
- , typename A
- , = void BOOST_PP_INTERCEPT
- )
- >
- struct impl
- : detail::make_expr_<
- Tag
- , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
- >
- {};
- };
-
-
-
-
-
-
-
-
- template<typename Tag, typename Domain /* = deduce_domain*/>
- struct unpack_expr
- {
- BOOST_PROTO_CALLABLE()
- template<typename Sig>
- struct result;
- template<typename This, typename Sequence>
- struct result<This(Sequence)>
- {
- typedef
- typename result_of::unpack_expr<
- Tag
- , Domain
- , typename remove_reference<Sequence>::type
- >::type
- type;
- };
-
-
-
-
-
- template<typename Sequence>
- BOOST_FORCEINLINE
- typename result_of::unpack_expr<Tag, Domain, Sequence const>::type const
- operator ()(Sequence const &sequence) const
- {
- return proto::detail::unpack_expr_<
- Tag
- , Domain
- , Sequence const
- , fusion::result_of::size<Sequence>::type::value
- >::call(sequence);
- }
- };
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- template<typename Tag, typename A0>
- BOOST_FORCEINLINE
- typename lazy_disable_if<
- is_domain<A0>
- , result_of::make_expr<
- Tag
- , A0 const
- >
- >::type const
- make_expr(A0 const &a0)
- {
- return proto::detail::make_expr_<
- Tag
- , deduce_domain
- , A0 const
- >()(a0);
- }
-
-
- template<typename Tag, typename Domain, typename C0>
- BOOST_FORCEINLINE
- typename result_of::make_expr<
- Tag
- , Domain
- , C0 const
- >::type const
- make_expr(C0 const &c0)
- {
- return proto::detail::make_expr_<
- Tag
- , Domain
- , C0 const
- >()(c0);
- }
-
- #include <boost/proto/detail/make_expr.hpp>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- template<typename Tag, typename Sequence>
- BOOST_FORCEINLINE
- typename lazy_disable_if<
- is_domain<Sequence>
- , result_of::unpack_expr<Tag, Sequence const>
- >::type const
- unpack_expr(Sequence const &sequence)
- {
- return proto::detail::unpack_expr_<
- Tag
- , deduce_domain
- , Sequence const
- , fusion::result_of::size<Sequence>::type::value
- >::call(sequence);
- }
-
-
- template<typename Tag, typename Domain, typename Sequence2>
- BOOST_FORCEINLINE
- typename result_of::unpack_expr<Tag, Domain, Sequence2 const>::type const
- unpack_expr(Sequence2 const &sequence2)
- {
- return proto::detail::unpack_expr_<
- Tag
- , Domain
- , Sequence2 const
- , fusion::result_of::size<Sequence2>::type::value
- >::call(sequence2);
- }
-
-
- template<typename Tag, typename Domain>
- struct is_callable<functional::make_expr<Tag, Domain> >
- : mpl::true_
- {};
-
-
- template<typename Tag, typename Domain>
- struct is_callable<functional::unpack_expr<Tag, Domain> >
- : mpl::true_
- {};
- }}
- #if defined(_MSC_VER)
- # pragma warning(pop)
- #endif
- #endif
|