Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2007-12-10 21:51:51


Author: eric_niebler
Date: 2007-12-10 21:51:50 EST (Mon, 10 Dec 2007)
New Revision: 41963
URL: http://svn.boost.org/trac/boost/changeset/41963

Log:
add make_arg and unpack_arg, etc.
Text files modified:
   branches/proto/v3/boost/xpressive/detail/static/modifier.hpp | 6
   branches/proto/v3/boost/xpressive/proto/make_expr.hpp | 332 ++++++++++++++++++++++++++++++---------
   branches/proto/v3/boost/xpressive/proto/operators.hpp | 12
   branches/proto/v3/boost/xpressive/proto/proto_fwd.hpp | 125 ++++++++++++++
   branches/proto/v3/boost/xpressive/regex_actions.hpp | 24 +-
   branches/proto/v3/boost/xpressive/regex_primitives.hpp | 16
   branches/proto/v3/libs/xpressive/proto/example/mixed.cpp | 4
   branches/proto/v3/libs/xpressive/proto/example/vec3.cpp | 4
   branches/proto/v3/libs/xpressive/proto/test/make_expr.cpp | 4
   9 files changed, 411 insertions(+), 116 deletions(-)

Modified: branches/proto/v3/boost/xpressive/detail/static/modifier.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/detail/static/modifier.hpp (original)
+++ branches/proto/v3/boost/xpressive/detail/static/modifier.hpp 2007-12-10 21:51:50 EST (Mon, 10 Dec 2007)
@@ -32,14 +32,14 @@
 
         template<typename Expr>
         struct apply
- : proto::result_of::make_expr<modifier_tag, Modifier, Expr const>
+ : proto::result_of::make_arg<modifier_tag, Modifier, Expr const>
         {};
 
         template<typename Expr>
- typename proto::result_of::make_expr<modifier_tag, Modifier, Expr const>::type
+ typename proto::result_of::make_arg<modifier_tag, Modifier, Expr const>::type
         operator ()(Expr const &expr) const
         {
- return proto::make_expr<modifier_tag>(this->mod_, expr);
+ return proto::make_arg<modifier_tag>(this->mod_, expr);
         }
 
         operator opt_type() const

Modified: branches/proto/v3/boost/xpressive/proto/make_expr.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/make_expr.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/make_expr.hpp 2007-12-10 21:51:50 EST (Mon, 10 Dec 2007)
@@ -25,6 +25,7 @@
 #include <boost/fusion/include/value_at.hpp>
 #include <boost/fusion/include/size.hpp>
 #include <boost/fusion/include/fold.hpp>
+#include <boost/fusion/include/front.hpp>
 #include <boost/fusion/include/transform_view.hpp>
 #include <boost/fusion/include/invoke_function_object.hpp>
 
@@ -186,7 +187,7 @@
             ) \
         ) \
         BOOST_PP_ENUM_TRAILING_PARAMS(N, const A) \
- >::type const \
+ >::type \
     BOOST_PP_TUPLE_ELEM(4, 0, DATA)(BOOST_PP_ENUM_BINARY_PARAMS_Z(Z, N, const A, &a)) \
     { \
         return boost::proto::result_of::make_expr< \
@@ -315,28 +316,28 @@
             };
         };
 
- template<typename Tag, typename Domain, typename Sequence, std::size_t Size>
- struct unpack_expr_
+ template<
+ typename Tag
+ , typename Domain
+ , template<typename> class AsExpr
+ , typename Sequence
+ , std::size_t Size
+ >
+ struct unpack_
         {
             typedef expr<
                 Tag
               , typename fusion::result_of::invoke_function_object<
                     make_args_fun
- , fusion::transform_view<
- Sequence const
- , functional::/*as_arg*/ as_expr<Domain>
- >
+ , fusion::transform_view<Sequence const, AsExpr<Domain> >
>::type
> expr_type;
 
             typedef typename Domain::template apply<expr_type>::type type;
 
- static type const call(Sequence const &sequence)
+ static type call(CVREF(Sequence) sequence)
             {
- fusion::transform_view<
- Sequence const
- , functional::/*as_arg*/ as_expr<Domain>
- > seq(sequence, functional::/*as_arg*/ as_expr<Domain>());
+ fusion::transform_view<Sequence const, AsExpr<Domain> > seq(sequence, AsExpr<Domain>());
 
                 expr_type that = {
                     fusion::invoke_function_object(argsns_::make_cons_fun(), seq)
@@ -346,76 +347,82 @@
             }
         };
 
- template<typename Tag, typename Sequence, std::size_t N>
- struct unpack_expr_<Tag, deduce_domain, Sequence, N>
- : unpack_expr_<
+ template<
+ typename Domain
+ , template<typename> class AsExpr
+ , typename Sequence
+ >
+ struct unpack_<tag::terminal, Domain, AsExpr, Sequence, 1u>
+ {
+ typedef
+ typename fusion::result_of::value_of<
+ typename fusion::result_of::begin<Sequence>::type
+ >::type
+ value_type;
+
+ typedef typename boost::result_of<AsExpr<Domain>(value_type)>::type type;
+
+ static type call(CVREF(Sequence) sequence)
+ {
+ return AsExpr<Domain>()(fusion::front(sequence));
+ }
+ };
+
+ template<
+ typename Tag
+ , template<typename> class AsExpr
+ , typename Sequence
+ , std::size_t N
+ >
+ struct unpack_<Tag, deduce_domain, AsExpr, Sequence, N>
+ : unpack_<
                 Tag
               , typename fusion::result_of::fold<
                     fusion::transform_view<Sequence, proto::detail::domain_of_>
                   , default_domain
                   , proto::detail::fold_domain_
>::type
+ , AsExpr
               , Sequence
               , N
>
         {};
 
- template<typename Domain, typename Sequence>
- struct unpack_expr_<tag::terminal, Domain, Sequence, 1u>
- {
- typedef expr<
- tag::terminal
- , term<typename fusion::result_of::value_at_c<Sequence, 0>::type>
- > expr_type;
-
- typedef typename Domain::template apply<expr_type>::type type;
-
- static type const call(Sequence const &sequence)
- {
- expr_type that = {fusion::at_c<0>(sequence)};
- return Domain::make(that);
- }
- };
-
- template<typename Sequence>
- struct unpack_expr_<tag::terminal, deduce_domain, Sequence, 1u>
- : unpack_expr_<tag::terminal, default_domain, Sequence, 1u>
+ template<
+ template<typename> class AsExpr
+ , typename Sequence
+ >
+ struct unpack_<tag::terminal, deduce_domain, AsExpr, Sequence, 1u>
+ : unpack_<tag::terminal, default_domain, AsExpr, Sequence, 1u>
         {};
 
- template<typename Tag, typename Domain, typename... Args>
- struct make_expr_
+
+ template<typename Tag, typename Domain, template<typename> class AsExpr, typename... Args>
+ struct make_
         {
- typedef expr<Tag, args<typename proto::result_of::/*as_arg*/ as_expr<Args, Domain>::type...> > expr_type;
+ typedef
+ expr<
+ Tag
+ , args<typename boost::result_of<AsExpr<Domain>(Args)>::type...>
+ >
+ expr_type;
+
             typedef typename Domain::template apply<expr_type>::type type;
 
- static type call(Args &... args)
+ static type call(CVREF(Args)... args)
             {
- expr_type that = {
- argsns_::make_cons(proto::result_of::/*as_arg*/ as_expr<Args, Domain>::call(args)...)
- };
- return Domain::make(that);
+ return Domain::make(expr_type::make(AsExpr<Domain>()(args)...));
             }
         };
 
- template<typename Domain, typename A>
- struct make_expr_<tag::terminal, Domain, A>
+ template<typename Domain, template<typename> class AsExpr, typename A>
+ struct make_<tag::terminal, Domain, AsExpr, A>
         {
- //typedef typename add_reference<A>::type reference;
- //typedef expr<tag::terminal, term<reference> > expr_type;
- //typedef typename Domain::template apply<expr_type>::type type;
-
- //static type const call(reference a)
- //{
- // expr_type that = {{a}};
- // return Domain::make(that);
- //}
-
- typedef expr<tag::terminal, term<UNCVREF(A)> > expr_type;
- typedef typename Domain::template apply<expr_type>::type type;
+ typedef typename boost::result_of<AsExpr<Domain>(A)>::type type;
 
- static type call(A const &a)
+ static type call(CVREF(A) a)
             {
- return Domain::make(expr_type::make(a));
+ return AsExpr<Domain>()(a);
             }
         };
 
@@ -424,10 +431,56 @@
     namespace result_of
     {
         template<typename Tag, typename Sequence, typename, typename>
+ struct unpack_arg
+ : proto::detail::unpack_<
+ Tag
+ , deduce_domain
+ , functional::as_arg
+ , Sequence
+ , fusion::result_of::size<Sequence>::type::value
+ >
+ {};
+
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_arg<Tag, Domain, Sequence, typename Domain::proto_is_domain_>
+ : proto::detail::unpack_<
+ Tag
+ , Domain
+ , functional::as_arg
+ , Sequence
+ , fusion::result_of::size<Sequence>::type::value
+ >
+ {};
+
+ template<typename Tag, typename Head, typename... Tail>
+ struct make_arg<Tag, Head, Tail...>
+ : mpl::if_<
+ is_domain<Head>
+ , proto::detail::make_<Tag, Head, functional::as_arg, Tail...>
+ , make_arg<Tag, deduce_domain, Head, Tail...>
+ >::type
+ {};
+
+ template<typename Tag, typename Head, typename... Tail>
+ struct make_arg<Tag, deduce_domain, Head, Tail...>
+ : proto::detail::make_<
+ Tag
+ , typename proto::detail::deduce_domain_<
+ typename domain_of<Head>::type
+ , Tail...
+ >::type
+ , functional::as_arg
+ , Head
+ , Tail...
+ >
+ {};
+
+ template<typename Tag, typename Sequence, typename, typename>
         struct unpack_expr
- : proto::detail::unpack_expr_<
+ : proto::detail::unpack_<
                 Tag
               , deduce_domain
+ , functional::as_expr
               , Sequence
               , fusion::result_of::size<Sequence>::type::value
>
@@ -435,9 +488,10 @@
 
         template<typename Tag, typename Domain, typename Sequence>
         struct unpack_expr<Tag, Domain, Sequence, typename Domain::proto_is_domain_>
- : proto::detail::unpack_expr_<
+ : proto::detail::unpack_<
                 Tag
               , Domain
+ , functional::as_expr
               , Sequence
               , fusion::result_of::size<Sequence>::type::value
>
@@ -447,19 +501,20 @@
         struct make_expr<Tag, Head, Tail...>
           : mpl::if_<
                 is_domain<Head>
- , proto::detail::make_expr_<Tag, Head, Tail...>
+ , proto::detail::make_<Tag, Head, functional::as_expr, Tail...>
               , make_expr<Tag, deduce_domain, Head, Tail...>
>::type
         {};
 
         template<typename Tag, typename Head, typename... Tail>
         struct make_expr<Tag, deduce_domain, Head, Tail...>
- : proto::detail::make_expr_<
+ : proto::detail::make_<
                 Tag
               , typename proto::detail::deduce_domain_<
                     typename domain_of<Head>::type
                   , Tail...
>::type
+ , functional::as_expr
               , Head
               , Tail...
>
@@ -469,8 +524,79 @@
     namespace functional
     {
         template<typename Tag, typename Domain>
+ struct make_arg
+ {
+ BOOST_PROTO_CALLABLE()
+
+ template<typename Sig>
+ struct result
+ {};
+
+ template<typename This, typename... A>
+ struct result<This(A...)>
+ : result_of::make_arg<Tag, Domain, A...>
+ {};
+
+ template<typename... A>
+ typename result_of::make_arg<Tag, Domain, A...>::type
+ operator ()(A &&...a) const
+ {
+ return result_of::make_arg<Tag, Domain, A...>::call(a...);
+ }
+ };
+
+ template<typename Tag, typename Domain>
+ struct unpack_arg
+ {
+ BOOST_PROTO_CALLABLE()
+
+ template<typename Sig>
+ struct result
+ {};
+
+ template<typename This, typename Sequence>
+ struct result<This(Sequence)>
+ : result_of::unpack_arg<Tag, Domain, UNCVREF(Sequence)>
+ {};
+
+ template<typename Sequence>
+ typename result_of::unpack_arg<Tag, Domain, Sequence>::type
+ operator ()(Sequence const &sequence) const
+ {
+ return result_of::unpack_arg<Tag, Domain, Sequence>::call(sequence);
+ }
+ };
+
+ template<typename Tag, typename Domain>
+ struct unfused_arg_fun
+ {
+ BOOST_PROTO_CALLABLE()
+
+ template<typename Sequence>
+ struct result
+ : result_of::unpack_arg<Tag, Domain, Sequence>
+ {};
+
+ template<typename Sequence>
+ typename proto::result_of::unpack_arg<Tag, Domain, Sequence>::type
+ operator ()(Sequence const &sequence) const
+ {
+ return result_of::unpack_arg<Tag, Domain, Sequence>::call(sequence);
+ }
+ };
+
+ template<typename Tag, typename Domain>
+ struct unfused_arg
+ : fusion::unfused_generic<unfused_arg_fun<Tag, Domain> >
+ {
+ BOOST_PROTO_CALLABLE()
+ };
+
+ template<typename Tag, typename Domain>
         struct make_expr
         {
+ BOOST_PROTO_CALLABLE()
+
             template<typename Sig>
             struct result
             {};
@@ -491,6 +617,8 @@
         template<typename Tag, typename Domain>
         struct unpack_expr
         {
+ BOOST_PROTO_CALLABLE()
+
             template<typename Sig>
             struct result
             {};
@@ -511,6 +639,8 @@
         template<typename Tag, typename Domain>
         struct unfused_expr_fun
         {
+ BOOST_PROTO_CALLABLE()
+
             template<typename Sequence>
             struct result
               : result_of::unpack_expr<Tag, Domain, Sequence>
@@ -527,7 +657,51 @@
         template<typename Tag, typename Domain>
         struct unfused_expr
           : fusion::unfused_generic<unfused_expr_fun<Tag, Domain> >
- {};
+ {
+ BOOST_PROTO_CALLABLE()
+ };
+ }
+
+ /// unpack_arg
+ ///
+ template<typename Tag, typename Sequence>
+ typename lazy_disable_if<
+ is_domain<Sequence>
+ , result_of::unpack_arg<Tag, Sequence>
+ >::type
+ unpack_arg(Sequence const &sequence)
+ {
+ return result_of::unpack_arg<Tag, Sequence>::call(sequence);
+ }
+
+ /// \overload
+ ///
+ template<typename Tag, typename Domain, typename Sequence2>
+ typename result_of::unpack_arg<Tag, Domain, Sequence2>::type
+ unpack_arg(Sequence2 const &sequence2)
+ {
+ return result_of::unpack_arg<Tag, Domain, Sequence2>::call(sequence2);
+ }
+
+ /// make_arg
+ ///
+ template<typename Tag, typename Head, typename... Tail>
+ typename lazy_disable_if<
+ is_domain<Head>
+ , result_of::make_arg<Tag, Head, Tail...>
+ >::type
+ make_arg(Head &&head, Tail &&... tail)
+ {
+ return result_of::make_arg<Tag, Head, Tail...>::call(head, tail...);
+ }
+
+ /// \overload
+ ///
+ template<typename Tag, typename Domain, typename Head, typename... Tail>
+ typename result_of::make_arg<Tag, Domain, Head, Tail...>::type
+ make_arg(Head &&head, Tail &&... tail)
+ {
+ return result_of::make_arg<Tag, Domain, Head, Tail...>::call(head, tail...);
     }
 
     /// unpack_expr
@@ -536,7 +710,7 @@
     typename lazy_disable_if<
         is_domain<Sequence>
       , result_of::unpack_expr<Tag, Sequence>
- >::type const
+ >::type
     unpack_expr(Sequence const &sequence)
     {
         return result_of::unpack_expr<Tag, Sequence>::call(sequence);
@@ -545,7 +719,7 @@
     /// \overload
     ///
     template<typename Tag, typename Domain, typename Sequence2>
- typename result_of::unpack_expr<Tag, Domain, Sequence2>::type const
+ typename result_of::unpack_expr<Tag, Domain, Sequence2>::type
     unpack_expr(Sequence2 const &sequence2)
     {
         return result_of::unpack_expr<Tag, Domain, Sequence2>::call(sequence2);
@@ -574,30 +748,34 @@
 
 
     template<typename Tag, typename Domain>
- struct is_callable<functional::make_expr<Tag, Domain> >
+ struct is_callable<functional::make_arg<Tag, Domain> >
       : mpl::true_
     {};
 
     template<typename Tag, typename Domain>
- struct is_callable<functional::unpack_expr<Tag, Domain> >
+ struct is_callable<functional::unpack_arg<Tag, Domain> >
       : mpl::true_
     {};
 
     template<typename Tag, typename Domain>
- struct is_callable<functional::unfused_expr<Tag, Domain> >
+ struct is_callable<functional::unfused_arg<Tag, Domain> >
       : mpl::true_
     {};
 
+ 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_
+ {};
 
- // TODO make_expr uses as_expr, not as_arg. Is that right?
- typedef functional::make_expr<tag::assign> _make_assign;
- typedef functional::make_expr<tag::negate> _make_negate;
- typedef functional::make_expr<tag::terminal> _make_terminal;
- typedef functional::make_expr<tag::subscript> _make_subscript;
- typedef functional::make_expr<tag::complement> _make_complement;
- typedef functional::make_expr<tag::logical_not> _make_logical_not;
- typedef functional::make_expr<tag::shift_right> _make_shift_right;
+ template<typename Tag, typename Domain>
+ struct is_callable<functional::unfused_expr<Tag, Domain> >
+ : mpl::true_
+ {};
 
 
 }}

Modified: branches/proto/v3/boost/xpressive/proto/operators.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/operators.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/operators.hpp 2007-12-10 21:51:50 EST (Mon, 10 Dec 2007)
@@ -242,10 +242,10 @@
     #undef BOOST_PROTO_DEFINE_BINARY_OPERATOR
 
         template<typename A, typename B, typename C>
- typename result_of::make_expr<tag::if_else_, A, B, C>::type
+ typename result_of::make_arg<tag::if_else_, A, B, C>::type
         if_else(A &&a, B &&b, C &&c)
         {
- return result_of::make_expr<tag::if_else_, A, B, C>::call(a, b, c);
+ return result_of::make_arg<tag::if_else_, A, B, C>::call(a, b, c);
         }
     }
 
@@ -256,11 +256,11 @@
     typename boost::proto::exprns_::detail::enable_unary< \
         DOMAIN \
       , TRAIT<BOOST_PROTO_UNCVREF(Arg)>, Arg \
- , typename boost::proto::result_of::make_expr<TAG, DOMAIN, Arg>::type \
+ , typename boost::proto::result_of::make_arg<TAG, DOMAIN, Arg>::type \
>::type \
     operator OP(Arg &&arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \
     { \
- return boost::proto::result_of::make_expr<TAG, DOMAIN, Arg>::call(arg); \
+ return boost::proto::result_of::make_arg<TAG, DOMAIN, Arg>::call(arg); \
     } \
     /**/
 
@@ -270,11 +270,11 @@
         DOMAIN \
       , TRAIT<BOOST_PROTO_UNCVREF(Left)>, Left \
       , TRAIT<BOOST_PROTO_UNCVREF(Right)>, Right \
- , typename boost::proto::result_of::make_expr<TAG, DOMAIN, Left, Right>::type \
+ , typename boost::proto::result_of::make_arg<TAG, DOMAIN, Left, Right>::type \
>::type const \
     operator OP(Left &&left, Right &&right) \
     { \
- return boost::proto::result_of::make_expr<TAG, DOMAIN, Left, Right> \
+ return boost::proto::result_of::make_arg<TAG, DOMAIN, Left, Right> \
             ::call(left, right); \
     } \
     /**/

Modified: branches/proto/v3/boost/xpressive/proto/proto_fwd.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/proto_fwd.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/proto_fwd.hpp 2007-12-10 21:51:50 EST (Mon, 10 Dec 2007)
@@ -12,6 +12,7 @@
 #include <climits> // for INT_MAX
 #include <boost/type_traits.hpp>
 #include <boost/mpl/bool.hpp>
+#include <boost/mpl/long.hpp>
 #include <boost/mpl/aux_/template_arity.hpp>
 #include <boost/mpl/aux_/lambda_arity_param.hpp>
 
@@ -200,6 +201,12 @@
         struct domain_of;
 
         template<typename Tag, typename... Args>
+ struct make_arg;
+
+ template<typename Tag, typename DomainOrSequence, typename SequenceOrVoid = void, typename _ = void>
+ struct unpack_arg;
+
+ template<typename Tag, typename... Args>
         struct make_expr;
 
         template<typename Tag, typename DomainOrSequence, typename SequenceOrVoid = void, typename _ = void>
@@ -331,9 +338,11 @@
 
     namespace transform
     {
+ #define BOOST_PROTO_CALLABLE() typedef void proto_is_callable_;
+
         struct callable
         {
- typedef void proto_is_callable_;
+ BOOST_PROTO_CALLABLE()
         };
 
         template<typename Grammar, typename Fun = Grammar>
@@ -461,13 +470,25 @@
         template<typename Domain = default_domain>
         struct as_arg;
 
- //template<typename N = mpl::long_<0> >
- //struct arg;
+ template<typename N = mpl::long_<0> >
+ struct arg;
 
         template<long N>
         struct arg_c;
 
         template<typename Tag, typename Domain = deduce_domain>
+ struct make_arg;
+
+ template<typename Tag, typename Domain = deduce_domain>
+ struct unpack_arg;
+
+ template<typename Tag, typename Domain = deduce_domain>
+ struct unfused_arg_fun;
+
+ template<typename Tag, typename Domain = deduce_domain>
+ struct unfused_arg;
+
+ template<typename Tag, typename Domain = deduce_domain>
         struct make_expr;
 
         template<typename Tag, typename Domain = deduce_domain>
@@ -479,14 +500,106 @@
         template<typename Tag, typename Domain = deduce_domain>
         struct unfused_expr;
 
+ typedef make_expr<tag::terminal> make_terminal;
+ typedef make_expr<tag::posit> make_posit;
+ typedef make_expr<tag::negate> make_negate;
+ typedef make_expr<tag::dereference> make_dereference;
+ typedef make_expr<tag::complement> make_complement;
+ typedef make_expr<tag::address_of> make_address_of;
+ typedef make_expr<tag::logical_not> make_logical_not;
+ typedef make_expr<tag::pre_inc> make_pre_inc;
+ typedef make_expr<tag::pre_dec> make_pre_dec;
+ typedef make_expr<tag::post_inc> make_post_inc;
+ typedef make_expr<tag::post_dec> make_post_dec;
+ typedef make_expr<tag::shift_left> make_shift_left;
+ typedef make_expr<tag::shift_right> make_shift_right;
+ typedef make_expr<tag::multiplies> make_multiplies;
+ typedef make_expr<tag::divides> make_divides;
+ typedef make_expr<tag::modulus> make_modulus;
+ typedef make_expr<tag::plus> make_plus;
+ typedef make_expr<tag::minus> make_minus;
+ typedef make_expr<tag::less> make_less;
+ typedef make_expr<tag::greater> make_greater;
+ typedef make_expr<tag::less_equal> make_less_equal;
+ typedef make_expr<tag::greater_equal> make_greater_equal;
+ typedef make_expr<tag::equal_to> make_equal_to;
+ typedef make_expr<tag::not_equal_to> make_not_equal_to;
+ typedef make_expr<tag::logical_or> make_logical_or;
+ typedef make_expr<tag::logical_and> make_logical_and;
+ typedef make_expr<tag::bitwise_and> make_bitwise_and;
+ typedef make_expr<tag::bitwise_or> make_bitwise_or;
+ typedef make_expr<tag::bitwise_xor> make_bitwise_xor;
+ typedef make_expr<tag::comma> make_comma;
+ typedef make_expr<tag::mem_ptr> make_mem_ptr;
+ typedef make_expr<tag::assign> make_assign;
+ typedef make_expr<tag::shift_left_assign> make_shift_left_assign;
+ typedef make_expr<tag::shift_right_assign> make_shift_right_assign;
+ typedef make_expr<tag::multiplies_assign> make_multiplies_assign;
+ typedef make_expr<tag::divides_assign> make_divides_assign;
+ typedef make_expr<tag::modulus_assign> make_modulus_assign;
+ typedef make_expr<tag::plus_assign> make_plus_assign;
+ typedef make_expr<tag::minus_assign> make_minus_assign;
+ typedef make_expr<tag::bitwise_and_assign> make_bitwise_and_assign;
+ typedef make_expr<tag::bitwise_or_assign> make_bitwise_or_assign;
+ typedef make_expr<tag::bitwise_xor_assign> make_bitwise_xor_assign;
+ typedef make_expr<tag::subscript> make_subscript;
+ typedef make_expr<tag::if_else_> make_if_else;
+ typedef make_expr<tag::function> make_function;
+
         struct flatten;
         struct pop_front;
         struct reverse;
     }
 
- typedef functional::flatten _flatten;
- typedef functional::pop_front _pop_front;
- typedef functional::pop_front _reverse;
+ typedef functional::make_terminal _make_terminal;
+ typedef functional::make_posit _make_posit;
+ typedef functional::make_negate _make_negate;
+ typedef functional::make_dereference _make_dereference;
+ typedef functional::make_complement _make_complement;
+ typedef functional::make_address_of _make_address_of;
+ typedef functional::make_logical_not _make_logical_not;
+ typedef functional::make_pre_inc _make_pre_inc;
+ typedef functional::make_pre_dec _make_pre_dec;
+ typedef functional::make_post_inc _make_post_inc;
+ typedef functional::make_post_dec _make_post_dec;
+ typedef functional::make_shift_left _make_shift_left;
+ typedef functional::make_shift_right _make_shift_right;
+ typedef functional::make_multiplies _make_multiplies;
+ typedef functional::make_divides _make_divides;
+ typedef functional::make_modulus _make_modulus;
+ typedef functional::make_plus _make_plus;
+ typedef functional::make_minus _make_minus;
+ typedef functional::make_less _make_less;
+ typedef functional::make_greater _make_greater;
+ typedef functional::make_less_equal _make_less_equal;
+ typedef functional::make_greater_equal _make_greater_equal;
+ typedef functional::make_equal_to _make_equal_to;
+ typedef functional::make_not_equal_to _make_not_equal_to;
+ typedef functional::make_logical_or _make_logical_or;
+ typedef functional::make_logical_and _make_logical_and;
+ typedef functional::make_bitwise_and _make_bitwise_and;
+ typedef functional::make_bitwise_or _make_bitwise_or;
+ typedef functional::make_bitwise_xor _make_bitwise_xor;
+ typedef functional::make_comma _make_comma;
+ typedef functional::make_mem_ptr _make_mem_ptr;
+ typedef functional::make_assign _make_assign;
+ typedef functional::make_shift_left_assign _make_shift_left_assign;
+ typedef functional::make_shift_right_assign _make_shift_right_assign;
+ typedef functional::make_multiplies_assign _make_multiplies_assign;
+ typedef functional::make_divides_assign _make_divides_assign;
+ typedef functional::make_modulus_assign _make_modulus_assign;
+ typedef functional::make_plus_assign _make_plus_assign;
+ typedef functional::make_minus_assign _make_minus_assign;
+ typedef functional::make_bitwise_and_assign _make_bitwise_and_assign;
+ typedef functional::make_bitwise_or_assign _make_bitwise_or_assign;
+ typedef functional::make_bitwise_xor_assign _make_bitwise_xor_assign;
+ typedef functional::make_subscript _make_subscript;
+ typedef functional::make_if_else _make_if_else;
+ typedef functional::make_function _make_function;
+
+ typedef functional::flatten _flatten;
+ typedef functional::pop_front _pop_front;
+ typedef functional::pop_front _reverse;
 
     template<typename T>
     struct is_extension;

Modified: branches/proto/v3/boost/xpressive/regex_actions.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/regex_actions.hpp (original)
+++ branches/proto/v3/boost/xpressive/regex_actions.hpp 2007-12-10 21:51:50 EST (Mon, 10 Dec 2007)
@@ -689,14 +689,14 @@
     /// as (a.k.a., lexical_cast)
     ///
     template<typename T, typename A>
- typename proto::result_of::make_expr<
+ typename proto::result_of::make_arg<
         proto::tag::function
       , proto::default_domain
       , op::as<T> const
       , A
>::type as(A &&a)
     {
- return proto::result_of::make_expr<
+ return proto::result_of::make_arg<
             proto::tag::function
           , proto::default_domain
           , op::as<T> const
@@ -707,14 +707,14 @@
     /// static_cast_
     ///
     template<typename T, typename A>
- typename proto::result_of::make_expr<
+ typename proto::result_of::make_arg<
         proto::tag::function
       , proto::default_domain
       , op::static_cast_<T> const
       , A
>::type static_cast_(A &&a)
     {
- return proto::result_of::make_expr<
+ return proto::result_of::make_arg<
             proto::tag::function
           , proto::default_domain
           , op::static_cast_<T> const
@@ -725,14 +725,14 @@
     /// dynamimc_cast_
     ///
     template<typename T, typename A>
- typename proto::result_of::make_expr<
+ typename proto::result_of::make_arg<
         proto::tag::function
       , proto::default_domain
       , op::dynamic_cast_<T> const
       , A
>::type dynamic_cast_(A &&a)
     {
- return proto::result_of::make_expr<
+ return proto::result_of::make_arg<
             proto::tag::function
           , proto::default_domain
           , op::dynamic_cast_<T> const
@@ -743,14 +743,14 @@
     /// const_cast_
     ///
     template<typename T, typename A>
- typename proto::result_of::make_expr<
+ typename proto::result_of::make_arg<
         proto::tag::function
       , proto::default_domain
       , op::const_cast_<T> const
       , A
>::type const_cast_(A &&a)
     {
- return proto::result_of::make_expr<
+ return proto::result_of::make_arg<
             proto::tag::function
           , proto::default_domain
           , op::const_cast_<T> const
@@ -808,14 +808,14 @@
     /// Usage: construct\<Type\>(arg1, arg2)
     ///
     template<typename T, typename... A>
- typename proto::result_of::make_expr<
+ typename proto::result_of::make_arg<
         proto::tag::function
       , proto::default_domain
       , op::construct<T> const
       , A...
>::type construct(A &&... a)
     {
- return proto::result_of::make_expr<
+ return proto::result_of::make_arg<
             proto::tag::function
           , proto::default_domain
           , op::construct<T> const
@@ -826,14 +826,14 @@
     /// Usage: throw_\<Exception\>(arg1, arg2)
     ///
     template<typename T, typename... A>
- typename proto::result_of::make_expr<
+ typename proto::result_of::make_arg<
         proto::tag::function
       , proto::default_domain
       , op::throw_<T> const
       , A...
>::type throw_(A &&... a)
     {
- return proto::result_of::make_expr<
+ return proto::result_of::make_arg<
             proto::tag::function
           , proto::default_domain
           , op::throw_<T> const

Modified: branches/proto/v3/boost/xpressive/regex_primitives.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/regex_primitives.hpp (original)
+++ branches/proto/v3/boost/xpressive/regex_primitives.hpp 2007-12-10 21:51:50 EST (Mon, 10 Dec 2007)
@@ -496,7 +496,7 @@
 #ifdef BOOST_XPRESSIVE_DOXYGEN_INVOKED
 template<typename Expr> detail::unspecified optional(Expr const &expr) { return 0; }
 #else
-proto::functional::make_expr<proto::tag::logical_not, proto::default_domain> const optional = {};
+proto::functional::make_arg<proto::tag::logical_not, proto::default_domain> const optional = {};
 #endif
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -511,19 +511,19 @@
 ///
 /// \param expr The sub-expression to repeat.
 template<unsigned int Min, unsigned int Max, typename Expr>
-typename proto::result_of::make_expr<detail::generic_quant_tag<Min, Max>, proto::default_domain, Expr const>::type const
+typename proto::result_of::make_arg<detail::generic_quant_tag<Min, Max>, proto::default_domain, Expr const>::type const
 repeat(Expr const &expr)
 {
- return proto::make_expr<detail::generic_quant_tag<Min, Max>, proto::default_domain>(expr);
+ return proto::make_arg<detail::generic_quant_tag<Min, Max>, proto::default_domain>(expr);
 }
 
 /// \overload
 ///
 template<unsigned int Count, typename Expr2>
-typename proto::result_of::make_expr<detail::generic_quant_tag<Count, Count>, proto::default_domain, Expr2 const>::type const
+typename proto::result_of::make_arg<detail::generic_quant_tag<Count, Count>, proto::default_domain, Expr2 const>::type const
 repeat(Expr2 const &expr2)
 {
- return proto::make_expr<detail::generic_quant_tag<Count, Count>, proto::default_domain>(expr2);
+ return proto::make_arg<detail::generic_quant_tag<Count, Count>, proto::default_domain>(expr2);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -539,7 +539,7 @@
 #ifdef BOOST_XPRESSIVE_DOXYGEN_INVOKED
 template<typename Expr> detail::unspecified keep(Expr const &expr) { return 0; }
 #else
-proto::functional::make_expr<detail::keeper_tag, proto::default_domain> const keep = {};
+proto::functional::make_arg<detail::keeper_tag, proto::default_domain> const keep = {};
 #endif
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -558,7 +558,7 @@
 #ifdef BOOST_XPRESSIVE_DOXYGEN_INVOKED
 template<typename Expr> detail::unspecified before(Expr const &expr) { return 0; }
 #else
-proto::functional::make_expr<detail::lookahead_tag, proto::default_domain> const before = {};
+proto::functional::make_arg<detail::lookahead_tag, proto::default_domain> const before = {};
 #endif
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -579,7 +579,7 @@
 #ifdef BOOST_XPRESSIVE_DOXYGEN_INVOKED
 template<typename Expr> detail::unspecified after(Expr const &expr) { return 0; }
 #else
-proto::functional::make_expr<detail::lookbehind_tag, proto::default_domain> const after = {};
+proto::functional::make_arg<detail::lookbehind_tag, proto::default_domain> const after = {};
 #endif
 
 ///////////////////////////////////////////////////////////////////////////////

Modified: branches/proto/v3/libs/xpressive/proto/example/mixed.cpp
==============================================================================
--- branches/proto/v3/libs/xpressive/proto/example/mixed.cpp (original)
+++ branches/proto/v3/libs/xpressive/proto/example/mixed.cpp 2007-12-10 21:51:50 EST (Mon, 10 Dec 2007)
@@ -248,14 +248,14 @@
     };
 
     template<typename A>
- typename proto::result_of::make_expr<
+ typename proto::result_of::make_arg<
         proto::tag::function
       , MixedDomain
       , sin_ const
       , A
>::type sin(A &&a)
     {
- return proto::result_of::make_expr<
+ return proto::result_of::make_arg<
             proto::tag::function
           , MixedDomain
           , sin_ const

Modified: branches/proto/v3/libs/xpressive/proto/example/vec3.cpp
==============================================================================
--- branches/proto/v3/libs/xpressive/proto/example/vec3.cpp (original)
+++ branches/proto/v3/libs/xpressive/proto/example/vec3.cpp 2007-12-10 21:51:50 EST (Mon, 10 Dec 2007)
@@ -68,7 +68,7 @@
 // It demonstrates the use of the std::plus<> function object
 // with the fold transform. With minor modifications, this
 // transform could be used to calculate the leaf count at compile
-// time, rather at runtime.
+// time, rather than at runtime.
 struct CountLeaves
   : or_<
         // match a Vec3 terminal, return 1
@@ -77,7 +77,7 @@
       , when<terminal<_>, int() >
         // fold everything else, using std::plus<> to add
         // the leaf count of each child to the accumulated state.
- , when< nary_expr<_, vararg<_> >, fold<_, int(), iplus(CountLeaves, _state) > >
+ , otherwise< fold<_, int(), iplus(CountLeaves, _state) > >
>
 {};
 

Modified: branches/proto/v3/libs/xpressive/proto/test/make_expr.cpp
==============================================================================
--- branches/proto/v3/libs/xpressive/proto/test/make_expr.cpp (original)
+++ branches/proto/v3/libs/xpressive/proto/test/make_expr.cpp 2007-12-10 21:51:50 EST (Mon, 10 Dec 2007)
@@ -30,6 +30,8 @@
 void test_make_expr()
 {
     int i = 42;
+ terminal<int>::type t1 = make_expr<tag::terminal>(1);
+ terminal<int>::type t2 = make_expr<tag::terminal>(i);
     posit<terminal<int>::type>::type p1 = make_expr<tag::posit>(1);
     posit<terminal<int>::type>::type p2 = make_expr<tag::posit>(i);
     BOOST_CHECK_EQUAL(arg(arg(p2)), 42);
@@ -49,6 +51,8 @@
     int i = 42;
     fusion::vector<int> v1(1);
     fusion::vector<int&> v2(i);
+ terminal<int>::type t1 = unpack_expr<tag::terminal>(v1);
+ terminal<int>::type t2 = unpack_expr<tag::terminal>(v2);
     posit<terminal<int>::type>::type p1 = unpack_expr<tag::posit>(v1);
     posit<terminal<int>::type>::type p2 = unpack_expr<tag::posit>(v2);
     BOOST_CHECK_EQUAL(arg(arg(p2)), 42);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk