123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474 |
- #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
- #ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
- #include <boost/proto/detail/preprocessed/expr_variadic.hpp>
- #else
- #include <boost/proto/detail/preprocessed/expr.hpp>
- #endif
- #elif !defined(BOOST_PP_IS_ITERATING)
-
-
- #define BOOST_PROTO_CHILD(Z, N, DATA) \
- typedef BOOST_PP_CAT(Arg, N) BOOST_PP_CAT(proto_child, N); \
- BOOST_PP_CAT(proto_child, N) BOOST_PP_CAT(child, N); \
-
-
-
- #define BOOST_PROTO_VOID(Z, N, DATA) \
- typedef void BOOST_PP_CAT(proto_child, N); \
-
-
- #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
- #pragma wave option(preserve: 2, line: 0, output: "preprocessed/expr_variadic.hpp")
- #endif
-
-
-
-
-
-
-
- #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
- #pragma wave option(preserve: 1)
- #endif
-
- #define BOOST_PROTO_DEFINE_TERMINAL
- #define BOOST_PP_ITERATION_PARAMS_1 \
- (3, (0, 0, <boost/proto/detail/expr.hpp>))
- #include BOOST_PP_ITERATE()
- #undef BOOST_PROTO_DEFINE_TERMINAL
- #define BOOST_PP_ITERATION_PARAMS_1 \
- (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/expr.hpp>))
- #include BOOST_PP_ITERATE()
-
- #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
- #define BOOST_NO_CXX11_VARIADIC_TEMPLATES
- #pragma wave option(preserve: 2, line: 0, output: "preprocessed/expr.hpp")
-
-
-
-
-
-
-
- #pragma wave option(preserve: 1)
-
- #define BOOST_PROTO_DEFINE_TERMINAL
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, 0, <boost/proto/detail/expr.hpp>))
- #include BOOST_PP_ITERATE()
- #undef BOOST_PROTO_DEFINE_TERMINAL
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/expr.hpp>))
- #include BOOST_PP_ITERATE()
- #pragma wave option(output: null)
- #undef BOOST_NO_CXX11_VARIADIC_TEMPLATES
- #endif
- #undef BOOST_PROTO_CHILD
- #undef BOOST_PROTO_VOID
- #else
- #define ARG_COUNT BOOST_PP_MAX(1, BOOST_PP_ITERATION())
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #ifdef BOOST_PROTO_DEFINE_TERMINAL
- template<typename Tag, typename Arg0>
- struct expr<Tag, term<Arg0>, 0>
- #else
- template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(ARG_COUNT, typename Arg)>
- struct expr<Tag, BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)>, BOOST_PP_ITERATION() >
- #endif
- {
- typedef Tag proto_tag;
- static const long proto_arity_c = BOOST_PP_ITERATION();
- typedef mpl::long_<BOOST_PP_ITERATION() > proto_arity;
- typedef expr proto_base_expr;
- #ifdef BOOST_PROTO_DEFINE_TERMINAL
- typedef term<Arg0> proto_args;
- #else
- typedef BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)> proto_args;
- #endif
- typedef basic_expr<Tag, proto_args, BOOST_PP_ITERATION() > proto_grammar;
- typedef default_domain proto_domain;
- typedef default_generator proto_generator;
- typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
- typedef expr proto_derived_expr;
- typedef void proto_is_expr_;
- BOOST_PP_REPEAT(ARG_COUNT, BOOST_PROTO_CHILD, ~)
- BOOST_PP_REPEAT_FROM_TO(ARG_COUNT, BOOST_PROTO_MAX_ARITY, BOOST_PROTO_VOID, ~)
-
-
- BOOST_FORCEINLINE
- expr const &proto_base() const
- {
- return *this;
- }
-
-
- BOOST_FORCEINLINE
- expr &proto_base()
- {
- return *this;
- }
- #ifdef BOOST_PROTO_DEFINE_TERMINAL
-
-
-
- template<typename A0>
- BOOST_FORCEINLINE
- static expr const make(A0 &a0)
- {
- return detail::make_terminal(a0, static_cast<expr *>(0), static_cast<proto_args *>(0));
- }
-
-
- template<typename A0>
- BOOST_FORCEINLINE
- static expr const make(A0 const &a0)
- {
- return detail::make_terminal(a0, static_cast<expr *>(0), static_cast<proto_args *>(0));
- }
- #else
-
-
-
- template<BOOST_PP_ENUM_PARAMS(ARG_COUNT, typename A)>
- BOOST_FORCEINLINE
- static expr const make(BOOST_PP_ENUM_BINARY_PARAMS(ARG_COUNT, A, const &a))
- {
- expr that = {BOOST_PP_ENUM_PARAMS(ARG_COUNT, a)};
- return that;
- }
- #endif
- #if 1 == BOOST_PP_ITERATION()
-
-
-
- typedef typename detail::address_of_hack<Tag, proto_child0>::type address_of_hack_type_;
-
-
-
-
-
-
-
- BOOST_FORCEINLINE
- operator address_of_hack_type_() const
- {
- return boost::addressof(this->child0);
- }
- #else
-
-
- typedef detail::not_a_valid_type address_of_hack_type_;
- #endif
-
-
-
-
- BOOST_FORCEINLINE
- proto::expr<
- proto::tag::assign
- , list2<expr &, expr const &>
- , 2
- > const
- operator =(expr const &a)
- {
- proto::expr<
- proto::tag::assign
- , list2<expr &, expr const &>
- , 2
- > that = {*this, a};
- return that;
- }
-
-
-
-
- template<typename A>
- BOOST_FORCEINLINE
- proto::expr<
- proto::tag::assign
- , list2<expr const &, typename result_of::as_child<A>::type>
- , 2
- > const
- operator =(A &a) const
- {
- proto::expr<
- proto::tag::assign
- , list2<expr const &, typename result_of::as_child<A>::type>
- , 2
- > that = {*this, proto::as_child(a)};
- return that;
- }
-
-
- template<typename A>
- BOOST_FORCEINLINE
- proto::expr<
- proto::tag::assign
- , list2<expr const &, typename result_of::as_child<A const>::type>
- , 2
- > const
- operator =(A const &a) const
- {
- proto::expr<
- proto::tag::assign
- , list2<expr const &, typename result_of::as_child<A const>::type>
- , 2
- > that = {*this, proto::as_child(a)};
- return that;
- }
- #ifdef BOOST_PROTO_DEFINE_TERMINAL
-
-
- template<typename A>
- BOOST_FORCEINLINE
- proto::expr<
- proto::tag::assign
- , list2<expr &, typename result_of::as_child<A>::type>
- , 2
- > const
- operator =(A &a)
- {
- proto::expr<
- proto::tag::assign
- , list2<expr &, typename result_of::as_child<A>::type>
- , 2
- > that = {*this, proto::as_child(a)};
- return that;
- }
-
-
- template<typename A>
- BOOST_FORCEINLINE
- proto::expr<
- proto::tag::assign
- , list2<expr &, typename result_of::as_child<A const>::type>
- , 2
- > const
- operator =(A const &a)
- {
- proto::expr<
- proto::tag::assign
- , list2<expr &, typename result_of::as_child<A const>::type>
- , 2
- > that = {*this, proto::as_child(a)};
- return that;
- }
- #endif
-
-
-
-
- template<typename A>
- BOOST_FORCEINLINE
- proto::expr<
- proto::tag::subscript
- , list2<expr const &, typename result_of::as_child<A>::type>
- , 2
- > const
- operator [](A &a) const
- {
- proto::expr<
- proto::tag::subscript
- , list2<expr const &, typename result_of::as_child<A>::type>
- , 2
- > that = {*this, proto::as_child(a)};
- return that;
- }
-
-
- template<typename A>
- BOOST_FORCEINLINE
- proto::expr<
- proto::tag::subscript
- , list2<expr const &, typename result_of::as_child<A const>::type>
- , 2
- > const
- operator [](A const &a) const
- {
- proto::expr<
- proto::tag::subscript
- , list2<expr const &, typename result_of::as_child<A const>::type>
- , 2
- > that = {*this, proto::as_child(a)};
- return that;
- }
- #ifdef BOOST_PROTO_DEFINE_TERMINAL
-
-
- template<typename A>
- BOOST_FORCEINLINE
- proto::expr<
- proto::tag::subscript
- , list2<expr &, typename result_of::as_child<A>::type>
- , 2
- > const
- operator [](A &a)
- {
- proto::expr<
- proto::tag::subscript
- , list2<expr &, typename result_of::as_child<A>::type>
- , 2
- > that = {*this, proto::as_child(a)};
- return that;
- }
-
-
- template<typename A>
- BOOST_FORCEINLINE
- proto::expr<
- proto::tag::subscript
- , list2<expr &, typename result_of::as_child<A const>::type>
- , 2
- > const
- operator [](A const &a)
- {
- proto::expr<
- proto::tag::subscript
- , list2<expr &, typename result_of::as_child<A const>::type>
- , 2
- > that = {*this, proto::as_child(a)};
- return that;
- }
- #endif
-
-
- template<typename Sig>
- struct result
- {
- typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
- };
- #ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
-
-
- template<typename ...A>
- BOOST_FORCEINLINE
- typename result_of::funop<
- expr const(A const &...)
- , expr
- , default_domain
- >::type const
- operator ()(A const &... a) const
- {
- return result_of::funop<
- expr const(A const &...)
- , expr
- , default_domain
- >::call(*this, a...);
- }
- #ifdef BOOST_PROTO_DEFINE_TERMINAL
-
-
- template<typename ...A>
- BOOST_FORCEINLINE
- typename result_of::funop<
- expr(A const &...)
- , expr
- , default_domain
- >::type const
- operator ()(A const &... a)
- {
- return result_of::funop<
- expr(A const &...)
- , expr
- , default_domain
- >::call(*this, a...);
- }
- #endif
- #else
-
-
-
- BOOST_FORCEINLINE
- proto::expr<proto::tag::function, list1<expr const &>, 1> const
- operator ()() const
- {
- proto::expr<proto::tag::function, list1<expr const &>, 1> that = {*this};
- return that;
- }
- #ifdef BOOST_PROTO_DEFINE_TERMINAL
-
-
- BOOST_FORCEINLINE
- proto::expr<proto::tag::function, list1<expr &>, 1> const
- operator ()()
- {
- proto::expr<proto::tag::function, list1<expr &>, 1> that = {*this};
- return that;
- }
- #endif
- #define BOOST_PP_ITERATION_PARAMS_2 \
- (3, (1, BOOST_PP_DEC(BOOST_PROTO_MAX_FUNCTION_CALL_ARITY), <boost/proto/detail/expr_funop.hpp>))
- #include BOOST_PP_ITERATE()
- #endif
- };
- #undef ARG_COUNT
- #endif
|