File indexing completed on 2025-01-18 09:50:26
0001 #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
0002
0003 #include <boost/proto/detail/preprocessed/basic_expr.hpp>
0004
0005 #elif !defined(BOOST_PP_IS_ITERATING)
0006
0007
0008
0009 #define BOOST_PROTO_CHILD(Z, N, DATA) \
0010 typedef BOOST_PP_CAT(Arg, N) BOOST_PP_CAT(proto_child, N); \
0011 BOOST_PP_CAT(proto_child, N) BOOST_PP_CAT(child, N); \
0012
0013
0014
0015
0016 #define BOOST_PROTO_VOID(Z, N, DATA) \
0017 typedef void BOOST_PP_CAT(proto_child, N); \
0018
0019
0020 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
0021 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/basic_expr.hpp")
0022 #endif
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
0033 #pragma wave option(preserve: 1)
0034 #endif
0035
0036
0037 #define BOOST_PROTO_DEFINE_TERMINAL
0038 #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, 0, <boost/proto/detail/basic_expr.hpp>))
0039 #include BOOST_PP_ITERATE()
0040
0041 #undef BOOST_PROTO_DEFINE_TERMINAL
0042 #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/basic_expr.hpp>))
0043 #include BOOST_PP_ITERATE()
0044
0045 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
0046 #pragma wave option(output: null)
0047 #endif
0048
0049 #undef BOOST_PROTO_CHILD
0050 #undef BOOST_PROTO_VOID
0051
0052 #else
0053
0054 #define ARG_COUNT BOOST_PP_MAX(1, BOOST_PP_ITERATION())
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083 #ifdef BOOST_PROTO_DEFINE_TERMINAL
0084 template<typename Tag, typename Arg0>
0085 struct basic_expr<Tag, term<Arg0>, 0>
0086 #else
0087 template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(ARG_COUNT, typename Arg)>
0088 struct basic_expr<Tag, BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)>, BOOST_PP_ITERATION() >
0089 #endif
0090 {
0091 typedef Tag proto_tag;
0092 static const long proto_arity_c = BOOST_PP_ITERATION();
0093 typedef mpl::long_<BOOST_PP_ITERATION() > proto_arity;
0094 typedef basic_expr proto_base_expr;
0095 #ifdef BOOST_PROTO_DEFINE_TERMINAL
0096 typedef term<Arg0> proto_args;
0097 #else
0098 typedef BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)> proto_args;
0099 #endif
0100 typedef basic_expr proto_grammar;
0101 typedef basic_default_domain proto_domain;
0102 typedef default_generator proto_generator;
0103 typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
0104 typedef basic_expr proto_derived_expr;
0105 typedef void proto_is_expr_;
0106
0107 BOOST_PP_REPEAT(ARG_COUNT, BOOST_PROTO_CHILD, ~)
0108 BOOST_PP_REPEAT_FROM_TO(ARG_COUNT, BOOST_PROTO_MAX_ARITY, BOOST_PROTO_VOID, ~)
0109
0110
0111
0112 BOOST_FORCEINLINE
0113 basic_expr const &proto_base() const
0114 {
0115 return *this;
0116 }
0117
0118
0119
0120 BOOST_FORCEINLINE
0121 basic_expr &proto_base()
0122 {
0123 return *this;
0124 }
0125
0126 #ifdef BOOST_PROTO_DEFINE_TERMINAL
0127
0128
0129
0130 template<typename A0>
0131 BOOST_FORCEINLINE
0132 static basic_expr const make(A0 &a0)
0133 {
0134 return detail::make_terminal(a0, static_cast<basic_expr *>(0), static_cast<proto_args *>(0));
0135 }
0136
0137
0138
0139 template<typename A0>
0140 BOOST_FORCEINLINE
0141 static basic_expr const make(A0 const &a0)
0142 {
0143 return detail::make_terminal(a0, static_cast<basic_expr *>(0), static_cast<proto_args *>(0));
0144 }
0145 #else
0146
0147
0148
0149 template<BOOST_PP_ENUM_PARAMS(ARG_COUNT, typename A)>
0150 BOOST_FORCEINLINE
0151 static basic_expr const make(BOOST_PP_ENUM_BINARY_PARAMS(ARG_COUNT, A, const &a))
0152 {
0153 basic_expr that = {BOOST_PP_ENUM_PARAMS(ARG_COUNT, a)};
0154 return that;
0155 }
0156 #endif
0157
0158 #if 1 == BOOST_PP_ITERATION()
0159
0160
0161
0162 typedef typename detail::address_of_hack<Tag, proto_child0>::type address_of_hack_type_;
0163
0164
0165
0166
0167
0168
0169
0170
0171 BOOST_FORCEINLINE
0172 operator address_of_hack_type_() const
0173 {
0174 return boost::addressof(this->child0);
0175 }
0176 #else
0177
0178
0179 typedef detail::not_a_valid_type address_of_hack_type_;
0180 #endif
0181 };
0182
0183 #undef ARG_COUNT
0184
0185 #endif