Update of /cvsroot/boost/boost/boost/xpressive/proto
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8078/boost/xpressive/proto
Modified Files:
context.hpp debug.hpp make_expr.hpp operators.hpp
proto_fwd.hpp proto_typeof.hpp tags.hpp traits.hpp
Added Files:
transform.hpp
Log Message:
add ternary if_else operator, break context.hpp up, fix bug in
BOOST_PROTO_DEFINE_FUNCTION_TEMPLATE
--- NEW FILE: transform.hpp ---
///////////////////////////////////////////////////////////////////////////////
/// \file transform.hpp
/// Includes all the transforms in the transform/ sub-directory.
//
// Copyright 2007 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/xpressive/proto/detail/prefix.hpp> // must be first include
#include <boost/xpressive/proto/transform/apply.hpp>
#include <boost/xpressive/proto/transform/arg.hpp>
#include <boost/xpressive/proto/transform/branch.hpp>
#include <boost/xpressive/proto/transform/compose.hpp>
#include <boost/xpressive/proto/transform/construct.hpp>
#include <boost/xpressive/proto/transform/fold.hpp>
#include <boost/xpressive/proto/transform/fold_tree.hpp>
#include <boost/xpressive/proto/transform/function.hpp>
#include <boost/xpressive/proto/transform/list.hpp>
#include <boost/xpressive/proto/transform/pass_through.hpp>
#include <boost/xpressive/proto/detail/suffix.hpp> // must be last include
#endif
Index: context.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/context.hpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- context.hpp 16 Jun 2007 05:46:15 -0000 1.31
+++ context.hpp 23 Jun 2007 21:22:30 -0000 1.32
@@ -1,462 +1,17 @@
-#ifndef BOOST_PP_IS_ITERATING
-
///////////////////////////////////////////////////////////////////////////////
- /// \file context.hpp
- /// Definintion of context\<\>, a default evaluation context for
- /// expr\<\>::eval() that uses Boost.Typeof to deduce return types
- /// of the built-in operators.
- //
- // Copyright 2004 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_01_08_2007
- #define BOOST_PROTO_CONTEXT_HPP_EAN_01_08_2007
-
- #include <boost/xpressive/proto/detail/prefix.hpp> // must be first include
- #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/enum_shifted.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing.hpp>
- #include <boost/preprocessor/arithmetic/inc.hpp>
- #include <boost/preprocessor/tuple/elem.hpp>
- #include <boost/preprocessor/selection/max.hpp>
- #include <boost/mpl/if.hpp>
- #include <boost/typeof/typeof.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_cv.hpp>
- #include <boost/xpressive/proto/proto_fwd.hpp>
- #include <boost/xpressive/proto/tags.hpp>
- #include <boost/xpressive/proto/eval.hpp>
- #include <boost/xpressive/proto/detail/suffix.hpp> // must be last include
-
- // If we're generating doxygen documentation, hide all the nasty
- // Boost.Typeof gunk.
- #ifndef BOOST_PROTO_DOXYGEN_INVOKED
- #define BOOST_PROTO_DECLTYPE_NESTED_TYPEDEF_TPL_(Nested, Expr)\
- BOOST_TYPEOF_NESTED_TYPEDEF_TPL(BOOST_PP_CAT(nested_and_hidden_,
Nested), Expr)\
- struct Nested\
- : mpl::if_c<\
- 1==sizeof(detail::check_reference(Expr))\
- , typename BOOST_PP_CAT(nested_and_hidden_, Nested)::type &\
- , typename BOOST_PP_CAT(nested_and_hidden_, Nested)::type\
- >\
- {};
-
- #define BOOST_PROTO_DECLTYPE_(Expr, Type)\
- BOOST_PROTO_DECLTYPE_NESTED_TYPEDEF_TPL_(BOOST_PP_CAT(nested_,
Type), (Expr))\
- typedef typename BOOST_PP_CAT(nested_, Type)::type Type;
- #else
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_DECLTYPE_NESTED_TYPEDEF_TPL_(Nested, Expr)
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_DECLTYPE_(Expr, Type)\
- typedef detail::unspecified Type;
- #endif
-
- namespace boost { namespace proto
- {
-
- template<typename Expr, typename Context, typename Tag = typename
Expr::proto_tag, long Arity = Expr::proto_arity::value>
- struct default_eval
- {};
-
- template<typename Expr, typename Context, long Arity =
Expr::proto_arity::value>
- struct callable_eval
- {};
-
- namespace detail
- {
- template<typename T> T make();
-
- template<typename T>
- char check_reference(T &);
-
- template<typename T>
- char (&check_reference(T const &))[2];
-
- template<typename A0, typename A1>
- struct comma_result
- {
- BOOST_PROTO_DECLTYPE_((detail::make<A0>(),
detail::make<A1>()), type)
- };
-
- template<typename A0>
- struct comma_result<A0, void>
- {
- typedef void type;
- };
-
- template<typename A1>
- struct comma_result<void, A1>
- {
- typedef A1 type;
- };
-
- template<>
- struct comma_result<void, void>
- {
- typedef void type;
- };
-
- template<typename T, typename U = T>
- struct result_of_fixup
- : mpl::if_<is_function<T>, T *, U>
- {};
-
- template<typename T, typename U>
- struct result_of_fixup<T &, U>
- : result_of_fixup<T, T>
- {};
-
- template<typename T, typename U>
- struct result_of_fixup<T *, U>
- : result_of_fixup<T, U>
- {};
-
- template<typename T, typename U>
- struct result_of_fixup<T const, U>
- : result_of_fixup<T, U>
- {};
-
- //// Tests for result_of_fixup
- //struct bar {};
- //BOOST_MPL_ASSERT((is_same<bar,
result_of_fixup<bar>::type>));
- //BOOST_MPL_ASSERT((is_same<bar const, result_of_fixup<bar
const>::type>));
- //BOOST_MPL_ASSERT((is_same<bar, result_of_fixup<bar
&>::type>));
- //BOOST_MPL_ASSERT((is_same<bar const, result_of_fixup<bar const
&>::type>));
- //BOOST_MPL_ASSERT((is_same<void(*)(),
result_of_fixup<void(*)()>::type>));
- //BOOST_MPL_ASSERT((is_same<void(*)(), result_of_fixup<void(*
const)()>::type>));
- //BOOST_MPL_ASSERT((is_same<void(*)(), result_of_fixup<void(*
const &)()>::type>));
- //BOOST_MPL_ASSERT((is_same<void(*)(),
result_of_fixup<void(&)()>::type>));
-
- struct dont_care
- {
- dont_care(...);
- };
-
- #if BOOST_WORKAROUND(BOOST_MSVC, == 1400)
- template<typename T> T &make_ref_(T &t);
- template<typename T> T const &make_ref_(T const &t);
- #define BOOST_PROTO_REF(x) detail::make_ref_(x)
- #else
- #define BOOST_PROTO_REF(x) x
- #endif
- }
-
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_UNARY_OP_RESULT(Op, Tag)\
- template<typename Expr, typename Context>\
- struct default_eval<Expr, Context, Tag, 1>\
- {\
- private:\
- static Expr &sexpr;\
- static Context &sctx;\
- public:\
- BOOST_PROTO_DECLTYPE_(Op
proto::eval(BOOST_PROTO_REF(proto::arg_c<0>(sexpr)), sctx), result_type)\
- result_type operator()(Expr &expr, Context &ctx) const\
- {\
- return Op proto::eval(proto::arg_c<0>(expr), ctx);\
- }\
- };\
- /**/
-
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_BINARY_OP_RESULT(Op, Tag)\
- template<typename Expr, typename Context>\
- struct default_eval<Expr, Context, Tag, 2>\
- {\
- private:\
- static Expr &sexpr;\
- static Context &sctx;\
- public:\
-
BOOST_PROTO_DECLTYPE_(proto::eval(BOOST_PROTO_REF(proto::arg_c<0>(sexpr)),
sctx) Op proto::eval(BOOST_PROTO_REF(proto::arg_c<1>(sexpr)), sctx),
result_type)\
- result_type operator()(Expr &expr, Context &ctx) const\
- {\
- return proto::eval(proto::arg_c<0>(expr), ctx) Op
proto::eval(proto::arg_c<1>(expr), ctx);\
- }\
- };\
- /**/
-
- BOOST_PROTO_UNARY_OP_RESULT(+, proto::tag::posit)
- BOOST_PROTO_UNARY_OP_RESULT(-, proto::tag::negate)
- BOOST_PROTO_UNARY_OP_RESULT(*, proto::tag::dereference)
- BOOST_PROTO_UNARY_OP_RESULT(~, proto::tag::complement)
- BOOST_PROTO_UNARY_OP_RESULT(&, proto::tag::address_of)
- BOOST_PROTO_UNARY_OP_RESULT(!, proto::tag::logical_not)
- BOOST_PROTO_UNARY_OP_RESULT(++, proto::tag::pre_inc)
- BOOST_PROTO_UNARY_OP_RESULT(--, proto::tag::pre_dec)
-
- BOOST_PROTO_BINARY_OP_RESULT(<<, proto::tag::shift_left)
- BOOST_PROTO_BINARY_OP_RESULT(>>, proto::tag::shift_right)
- BOOST_PROTO_BINARY_OP_RESULT(*, proto::tag::multiplies)
- BOOST_PROTO_BINARY_OP_RESULT(/, proto::tag::divides)
- BOOST_PROTO_BINARY_OP_RESULT(%, proto::tag::modulus)
- BOOST_PROTO_BINARY_OP_RESULT(+, proto::tag::plus)
- BOOST_PROTO_BINARY_OP_RESULT(-, proto::tag::minus)
- BOOST_PROTO_BINARY_OP_RESULT(<, proto::tag::less)
- BOOST_PROTO_BINARY_OP_RESULT(>, proto::tag::greater)
- BOOST_PROTO_BINARY_OP_RESULT(<=, proto::tag::less_equal)
- BOOST_PROTO_BINARY_OP_RESULT(>=, proto::tag::greater_equal)
- BOOST_PROTO_BINARY_OP_RESULT(==, proto::tag::equal_to)
- BOOST_PROTO_BINARY_OP_RESULT(!=, proto::tag::not_equal_to)
- BOOST_PROTO_BINARY_OP_RESULT(||, proto::tag::logical_or)
- BOOST_PROTO_BINARY_OP_RESULT(&&, proto::tag::logical_and)
- BOOST_PROTO_BINARY_OP_RESULT(&, proto::tag::bitwise_and)
- BOOST_PROTO_BINARY_OP_RESULT(|, proto::tag::bitwise_or)
- BOOST_PROTO_BINARY_OP_RESULT(^, proto::tag::bitwise_xor)
- BOOST_PROTO_BINARY_OP_RESULT(->*, proto::tag::mem_ptr)
-
- BOOST_PROTO_BINARY_OP_RESULT(=, proto::tag::assign)
- BOOST_PROTO_BINARY_OP_RESULT(<<=, proto::tag::shift_left_assign)
- BOOST_PROTO_BINARY_OP_RESULT(>>=, proto::tag::shift_right_assign)
- BOOST_PROTO_BINARY_OP_RESULT(*=, proto::tag::multilpies_assign)
- BOOST_PROTO_BINARY_OP_RESULT(/=, proto::tag::divides_assign)
- BOOST_PROTO_BINARY_OP_RESULT(%=, proto::tag::modulus_assign)
- BOOST_PROTO_BINARY_OP_RESULT(+=, proto::tag::plus_assign)
- BOOST_PROTO_BINARY_OP_RESULT(-=, proto::tag::minus_assign)
- BOOST_PROTO_BINARY_OP_RESULT(&=, proto::tag::bitwise_and_assign)
- BOOST_PROTO_BINARY_OP_RESULT(|=, proto::tag::bitwise_or_assign)
- BOOST_PROTO_BINARY_OP_RESULT(^=, proto::tag::bitwise_xor_assign)
-
- template<typename Expr, typename Context>
- struct default_eval<Expr, Context, proto::tag::terminal, 0>
- {
- typedef
- typename mpl::if_<
- is_const<Expr>
- , typename proto::result_of::arg<Expr>::const_reference
- , typename proto::result_of::arg<Expr>::reference
- >::type
- result_type;
-
- result_type operator()(Expr &expr, Context &) const
- {
- return proto::arg(expr);
- }
- };
-
- // Handle post-increment specially.
- template<typename Expr, typename Context>
- struct default_eval<Expr, Context, proto::tag::post_inc, 1>
- {
- private:
- static Expr &sexpr;
- static Context &sctx;
- public:
-
BOOST_PROTO_DECLTYPE_(proto::eval(BOOST_PROTO_REF(proto::arg_c<0>(sexpr)),
sctx) ++, result_type)
- result_type operator()(Expr &expr, Context &ctx) const
- {
- return proto::eval(proto::arg_c<0>(expr), ctx) ++;
- }
- };
-
- // Handle post-decrement specially.
- template<typename Expr, typename Context>
- struct default_eval<Expr, Context, proto::tag::post_dec, 1>
- {
- private:
- static Expr &sexpr;
- static Context &sctx;
- public:
-
BOOST_PROTO_DECLTYPE_(proto::eval(BOOST_PROTO_REF(proto::arg_c<0>(sexpr)),
sctx) --, result_type)
- result_type operator()(Expr &expr, Context &ctx) const
- {
- return proto::eval(proto::arg_c<0>(expr), ctx) --;
- }
- };
-
- // Handle subscript specially.
- template<typename Expr, typename Context>
- struct default_eval<Expr, Context, proto::tag::subscript, 2>
- {
- private:
- static Expr &sexpr;
- static Context &sctx;
- public:
-
BOOST_PROTO_DECLTYPE_(proto::eval(BOOST_PROTO_REF(proto::arg_c<0>(sexpr)),
sctx)[proto::eval(BOOST_PROTO_REF(proto::arg_c<1>(sexpr)), sctx)], result_type)
- result_type operator()(Expr &expr, Context &ctx) const
- {
- return proto::eval(proto::arg_c<0>(expr),
ctx)[proto::eval(proto::arg_c<1>(expr), ctx)];
- }
- };
-
- // Handle comma specially.
- template<typename Expr, typename Context>
- struct default_eval<Expr, Context, proto::tag::comma, 2>
- {
- typedef typename proto::result_of::eval<typename
proto::result_of::arg_c<Expr, 0>::type, Context>::type proto_arg0;
- typedef typename proto::result_of::eval<typename
proto::result_of::arg_c<Expr, 1>::type, Context>::type proto_arg1;
- typedef typename detail::comma_result<proto_arg0,
proto_arg1>::type result_type;
- result_type operator()(Expr &expr, Context &ctx) const
- {
- return proto::eval(proto::arg_c<0>(expr), ctx),
proto::eval(proto::arg_c<1>(expr), ctx);
- }
- };
-
- #define BOOST_PROTO_ARG_N_TYPE(Z, N, Expr)\
- typename proto::result_of::arg_c<Expr, N>::const_reference
-
- #define BOOST_PROTO_ARG_N(Z, N, expr)\
- proto::arg_c<N>(expr)
-
- #define BOOST_PROTO_EVAL_N_TYPE(Z, N, Data)\
- typename proto::result_of::eval<\
- typename proto::result_of::arg_c<BOOST_PP_TUPLE_ELEM(2, 0, Data),
N>::type\
- , BOOST_PP_TUPLE_ELEM(2, 1, Data)\
- >::type
-
- #define BOOST_PROTO_EVAL_N(Z, N, Data)\
- proto::eval(proto::arg_c<N>(BOOST_PP_TUPLE_ELEM(2, 0, Data)),
BOOST_PP_TUPLE_ELEM(2, 1, Data))
-
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PROTO_MAX_ARITY,
<boost/xpressive/proto/context.hpp>))
- #include BOOST_PP_ITERATE()
-
- #undef BOOST_PROTO_ARG_N_TYPE
- #undef BOOST_PROTO_ARG_N
- #undef BOOST_PROTO_EVAL_N_TYPE
- #undef BOOST_PROTO_EVAL_N
-
- /// default_context
- ///
- struct default_context
- {
- /// default_context::eval
- ///
- template<typename Expr>
- struct eval
- : default_eval<Expr, default_context const>
- {};
- };
-
- /// callable_context
- ///
- template<typename Context>
- struct callable_context
- {
- /// callable_context::eval
- ///
- template<typename Expr>
- struct eval
- : callable_eval<Expr, Context>
- {};
- };
-
- }}
-
- #undef BOOST_PROTO_DECLTYPE_NESTED_TYPEDEF_TPL_
- #undef BOOST_PROTO_DECLTYPE_
-
- #endif
-
-#else
-
- #define N BOOST_PP_ITERATION()
- #define ARG_COUNT BOOST_PP_MAX(1, N)
-
- #if N != 0
- // Handle function specially
- template<typename Expr, typename Context>
- struct default_eval<Expr, Context, proto::tag::function, N>
- {
- typedef
- typename detail::result_of_fixup<
- BOOST_PROTO_EVAL_N_TYPE(1, 0, (Expr, Context))
- >::type
- function_type;
-
- typedef
- typename boost::result_of<
- function_type(
- BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_EVAL_N_TYPE,
(Expr, Context))
- )
- >::type
- result_type;
-
- result_type operator ()(Expr &expr, Context &context) const
- {
- return BOOST_PROTO_EVAL_N(1, 0, (expr, context))(
- BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_EVAL_N, (expr,
context))
- );
- }
- };
- #endif
-
- template<typename Expr, typename Context>
- struct callable_eval<Expr, Context, N>
- {
- private:
- /// INTERNAL ONLY
- ///
- typedef typename remove_cv<Context>::type context_type;
- /// INTERNAL ONLY
- ///
- struct inner_context
- : context_type
- {
- inner_context();
- struct private_type_ { private_type_ const &operator,(int)
const; };
- typedef private_type_ const
&(*pointer_to_function)(BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(ARG_COUNT),
detail::dont_care BOOST_PP_INTERCEPT));
- operator pointer_to_function() const;
- };
-
- public:
- typedef
- typename boost::result_of<
- Context(
- typename Expr::proto_tag
- BOOST_PP_ENUM_TRAILING(ARG_COUNT,
BOOST_PROTO_ARG_N_TYPE, Expr)
- )
- >::type
- result_type;
-
- result_type operator ()(Expr &expr, Context &context) const
- {
- BOOST_STATIC_CONSTANT(bool, value =
- (
- sizeof(yes_type) ==
- sizeof(
- callable_eval::check(
- (static_cast<inner_context
&>(const_cast<context_type &>(context))(
- typename Expr::proto_tag()
- BOOST_PP_ENUM_TRAILING(ARG_COUNT,
BOOST_PROTO_ARG_N, expr)
- ), 0)
- )
- )));
- return (*this)(expr, context, mpl::bool_<value>());
- }
-
- private:
-
- typedef char yes_type;
- typedef char (&no_type)[2];
- template<typename T> static yes_type check(T const &);
- static no_type check(typename inner_context::private_type_ const
&);
-
- result_type operator ()(Expr &expr, Context &context, mpl::true_)
const
- {
- return context(
- typename Expr::proto_tag()
- BOOST_PP_ENUM_TRAILING(ARG_COUNT, BOOST_PROTO_ARG_N, expr)
- );
- }
+///////////////////////////////////////////////////////////////////////////////
+/// \file context.hpp
+/// Includes all the context classes in the context/ sub-directory.
+//
+// Copyright 2007 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)
- result_type operator ()(Expr &expr, Context &context, mpl::false_)
const
- {
- return default_eval<Expr, Context>()(expr, context);
- }
- };
+#ifndef BOOST_PROTO_CONTEXT_HPP_EAN_06_23_2007
+#define BOOST_PROTO_CONTEXT_HPP_EAN_06_23_2007
- #undef N
- #undef ARG_COUNT
+#include <boost/xpressive/proto/detail/prefix.hpp> // must be first include
+#include <boost/xpressive/proto/context/default.hpp>
+#include <boost/xpressive/proto/context/callable.hpp>
+#include <boost/xpressive/proto/detail/suffix.hpp> // must be last include
#endif
Index: debug.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/debug.hpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- debug.hpp 16 Jun 2007 05:46:15 -0000 1.10
+++ debug.hpp 23 Jun 2007 21:22:30 -0000 1.11
@@ -83,6 +83,7 @@
BOOST_PROTO_DEFINE_TAG_NAME(bitwise_or_assign)
BOOST_PROTO_DEFINE_TAG_NAME(bitwise_xor_assign)
BOOST_PROTO_DEFINE_TAG_NAME(subscript)
+ BOOST_PROTO_DEFINE_TAG_NAME(if_else_)
BOOST_PROTO_DEFINE_TAG_NAME(function)
#undef BOOST_PROTO_DEFINE_TAG_NAME
Index: make_expr.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/make_expr.hpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- make_expr.hpp 16 Jun 2007 05:46:16 -0000 1.22
+++ make_expr.hpp 23 Jun 2007 21:22:31 -0000 1.23
@@ -224,6 +224,13 @@
BOOST_PP_SEQ_POP_BACK(BOOST_PP_SEQ_PUSH_FRONT(BOOST_PP_SEQ_PUSH_BACK(SEQ,
_dummy_), ELEM)) \
/**/
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_VARARG_AS_PARAM_(Z, N, DATA)
\
+ (BOOST_PP_CAT(DATA, N))
\
+ /**/
+
/// INTERNAL ONLY
///
#define BOOST_PROTO_VARARG_FUN_(Z, N, DATA)
\
@@ -237,8 +244,12 @@
, BOOST_PP_TUPLE_ELEM(4, 1, DATA)
\
)
\
)
\
+ BOOST_PP_REPEAT_ ## Z(
\
+ N
\
+ , BOOST_PROTO_VARARG_AS_PARAM_
\
+ , typename A
\
+ )
\
)
\
- BOOST_PP_ENUM_TRAILING_PARAMS_Z(Z, N, typename A)
\
>
\
typename boost::mpl::apply_wrap1<
\
BOOST_PP_TUPLE_ELEM(4, 3, DATA)
\
Index: operators.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/operators.hpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- operators.hpp 16 Jun 2007 05:46:16 -0000 1.32
+++ operators.hpp 23 Jun 2007 21:22:31 -0000 1.33
@@ -19,6 +19,7 @@
#include <boost/xpressive/proto/tags.hpp>
#include <boost/xpressive/proto/expr.hpp>
#include <boost/xpressive/proto/generate.hpp>
+#include <boost/xpressive/proto/make_expr.hpp>
#include <boost/xpressive/proto/detail/suffix.hpp>
namespace boost { namespace proto
@@ -229,6 +230,16 @@
return Arg::proto_domain::make(that);
}
+ /// if_else
+ ///
+ BOOST_PROTO_DEFINE_FUNCTION_TEMPLATE(
+ 3
+ , if_else
+ , deduce_domain
+ , (tag::if_else_)
+ , BOOST_PP_SEQ_NIL
+ )
+
}}
#endif
Index: proto_fwd.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/proto_fwd.hpp,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- proto_fwd.hpp 23 Jun 2007 07:41:20 -0000 1.77
+++ proto_fwd.hpp 23 Jun 2007 21:22:31 -0000 1.78
@@ -96,7 +96,7 @@
struct bitwise_or_assign;
struct bitwise_xor_assign;
struct subscript;
-
+ struct if_else_;
struct function;
}
@@ -319,6 +319,7 @@
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, typename V> struct if_else_;
template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_ARITY,
typename A, void), typename Dummy = void>
struct function;
Index: proto_typeof.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/proto_typeof.hpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- proto_typeof.hpp 15 Jun 2007 18:27:59 -0000 1.15
+++ proto_typeof.hpp 23 Jun 2007 21:22:31 -0000 1.16
@@ -61,6 +61,7 @@
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::if_else_)
BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::function)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::ref_, (typename))
Index: tags.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/tags.hpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- tags.hpp 21 May 2007 03:21:33 -0000 1.10
+++ tags.hpp 23 Jun 2007 21:22:31 -0000 1.11
@@ -145,6 +145,9 @@
/// Tag type for the binary subscript operator.
struct subscript {};
+ /// Tag type for the ternary ?: conditional operator.
+ struct if_else_ {};
+
/// Tag type for the nary function call operator.
struct function {};
Index: traits.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/traits.hpp,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- traits.hpp 23 Jun 2007 06:26:31 -0000 1.59
+++ traits.hpp 23 Jun 2007 21:22:31 -0000 1.60
@@ -166,7 +166,8 @@
namespace detail
{
template<typename T, typename EnableIf = void>
- struct if_vararg {};
+ struct if_vararg
+ {};
template<typename T>
struct if_vararg<T, typename T::proto_is_vararg_>
@@ -185,6 +186,19 @@
typedef T proto_arg0;
};
+ // if_else
+ template<typename T, typename U, typename V>
+ struct if_else_ : has_pass_through_transform<if_else_<T, U, V> >
+ {
+ if_else_();
+ typedef expr<proto::tag::if_else_, args3<T, U, V> > type;
+ typedef type proto_base_expr;
+ typedef proto::tag::if_else_ proto_tag;
+ typedef T proto_arg0;
+ typedef U proto_arg1;
+ typedef V proto_arg2;
+ };
+
// unary_expr
template<typename Tag, typename T>
struct unary_expr : has_pass_through_transform<unary_expr<Tag, T> >
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs