Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2008-01-29 16:02:53


Author: eric_niebler
Date: 2008-01-29 16:02:52 EST (Tue, 29 Jan 2008)
New Revision: 43016
URL: http://svn.boost.org/trac/boost/changeset/43016

Log:
make_expr and unpack_expr improvements, fix scary transform::arg_c bug
Text files modified:
   trunk/boost/xpressive/proto/make_expr.hpp | 556 +++++++++++++++++++++++++++++++++------
   trunk/boost/xpressive/proto/operators.hpp | 16
   trunk/boost/xpressive/proto/proto_fwd.hpp | 3
   trunk/boost/xpressive/proto/transform/arg.hpp | 2
   trunk/libs/xpressive/proto/doc/protodoc.xml | 52 ++-
   trunk/libs/xpressive/proto/example/mixed.cpp | 8
   trunk/libs/xpressive/proto/test/make_expr.cpp | 4
   7 files changed, 512 insertions(+), 129 deletions(-)

Modified: trunk/boost/xpressive/proto/make_expr.hpp
==============================================================================
--- trunk/boost/xpressive/proto/make_expr.hpp (original)
+++ trunk/boost/xpressive/proto/make_expr.hpp 2008-01-29 16:02:52 EST (Tue, 29 Jan 2008)
@@ -34,6 +34,7 @@
     #include <boost/preprocessor/repetition/enum_binary_params.hpp>
     #include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
     #include <boost/preprocessor/repetition/enum_shifted_params.hpp>
+ #include <boost/preprocessor/repetition/enum_shifted_binary_params.hpp>
     #include <boost/preprocessor/repetition/repeat.hpp>
     #include <boost/preprocessor/repetition/repeat_from_to.hpp>
     #include <boost/preprocessor/seq/size.hpp>
@@ -209,14 +210,14 @@
     #define BOOST_PROTO_VARARG_AS_EXPR_(R, DATA, I, ELEM) \
         BOOST_PP_EXPR_IF( \
             BOOST_PP_GREATER(I, 1) \
- , (( \
+ , ((boost::proto::utility::static_< \
                 BOOST_PP_SEQ_HEAD(ELEM) \
                 BOOST_PP_IF( \
                     BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ELEM)) \
                   , BOOST_PROTO_TEMPLATE_PARAMS_YES_ \
                   , BOOST_PROTO_TEMPLATE_PARAMS_NO_ \
- )(R, DATA, I, ELEM)() \
- )) \
+ )(R, DATA, I, ELEM) \
+ >::value)) \
         ) \
         /**/
 
@@ -267,11 +268,15 @@
                   , BOOST_PP_TUPLE_ELEM(4, 1, DATA) \
                 ) \
             ) \
- BOOST_PP_ENUM_TRAILING_PARAMS(N, const A) \
+ BOOST_PP_ENUM_TRAILING_BINARY_PARAMS( \
+ N \
+ , typename boost::proto::utility::remref<const A \
+ , >::type BOOST_PP_INTERCEPT \
+ ) \
>::type const \
         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< \
+ return boost::proto::detail::make_expr_< \
                 BOOST_PP_SEQ_FOR_EACH_I( \
                     BOOST_PROTO_VARARG_TYPE_, ~ \
                   , BOOST_PP_SEQ_PUSH_FRONT( \
@@ -282,7 +287,11 @@
                       , BOOST_PP_TUPLE_ELEM(4, 1, DATA) \
                     ) \
                 ) \
- BOOST_PP_ENUM_TRAILING_PARAMS(N, const A) \
+ BOOST_PP_ENUM_TRAILING_BINARY_PARAMS( \
+ N \
+ , typename boost::proto::utility::remref<const A \
+ , >::type BOOST_PP_INTERCEPT \
+ ) \
>::call( \
                 BOOST_PP_SEQ_ENUM( \
                     BOOST_PP_SEQ_FOR_EACH_I( \
@@ -335,6 +344,50 @@
         ) \
         /**/
 
+ namespace utility
+ {
+ template<typename T>
+ struct addref
+ {
+ typedef
+ typename boost::unwrap_reference<T>::type &
+ type;
+ };
+
+ template<typename T>
+ struct addref<T &>
+ {
+ typedef
+ typename boost::unwrap_reference<T>::type &
+ type;
+ };
+
+ template<typename T>
+ struct remref
+ {
+ typedef
+ typename boost::unwrap_reference<T>::type
+ type;
+ };
+
+ template<typename T>
+ struct remref<T &>
+ {
+ typedef
+ typename boost::unwrap_reference<T>::type
+ type;
+ };
+
+ template<typename T>
+ struct static_
+ {
+ static T const value;
+ };
+
+ template<typename T>
+ T const static_<T>::value = T();
+ }
+
         namespace detail
         {
             template<
@@ -419,7 +472,7 @@
             struct make_expr_<tag::terminal, Domain, A
                 BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, void BOOST_PP_INTERCEPT)>
             {
- typedef typename add_reference<A>::type reference;
+ typedef typename utility::addref<A>::type reference;
                 typedef proto::expr<tag::terminal, args0<reference> > expr_type;
                 typedef typename Domain::template apply<expr_type>::type type;
 
@@ -430,6 +483,12 @@
                 }
             };
 
+ template<typename A>
+ struct make_expr_<tag::terminal, deduce_domain, A
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, void BOOST_PP_INTERCEPT)>
+ : make_expr_<tag::terminal, default_domain, A>
+ {};
+
         #define BOOST_PP_ITERATION_PARAMS_1 \
             (4, (1, BOOST_PROTO_MAX_ARITY, <boost/xpressive/proto/make_expr.hpp>, 1)) \
             /**/
@@ -439,39 +498,48 @@
 
         namespace result_of
         {
- template<typename Tag, typename Sequence, typename, typename>
+ template<typename Tag, typename Sequence, typename EnableIf1, typename EnableIf2>
             struct unpack_expr
- : detail::unpack_expr_<
- Tag
- , deduce_domain
- , Sequence
- , fusion::BOOST_PROTO_FUSION_RESULT_OF::size<Sequence>::type::value
- >
- {};
+ {
+ typedef
+ typename detail::unpack_expr_<
+ Tag
+ , deduce_domain
+ , Sequence
+ , fusion::BOOST_PROTO_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_>
- : detail::unpack_expr_<
- Tag
- , Domain
- , Sequence
- , fusion::BOOST_PROTO_FUSION_RESULT_OF::size<Sequence>::type::value
- >
- {};
+ {
+ typedef
+ typename detail::unpack_expr_<
+ Tag
+ , Domain
+ , Sequence
+ , fusion::BOOST_PROTO_FUSION_RESULT_OF::size<Sequence>::type::value
+ >::type
+ type;
+ };
 
             template<
                 typename Tag
                 BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, typename A)
- , typename
- , typename
+ , typename EnableIf1
+ , typename EnableIf2
>
             struct make_expr
- : make_expr<
- Tag
- , deduce_domain
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
- >
- {};
+ {
+ typedef
+ typename detail::make_expr_<
+ Tag
+ , deduce_domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
+ >::type
+ type;
+ };
 
             template<
                 typename Tag
@@ -484,32 +552,15 @@
                 BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
               , typename Domain::proto_is_domain_
>
- : detail::make_expr_<
- Tag
- , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
- >
- {};
-
- template<
- typename Tag
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, typename A)
- >
- struct make_expr<
- Tag
- , deduce_domain
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
- , void
- >
- : detail::make_expr_<
- Tag
- , typename detail::deduce_domain_<
- typename domain_of<A0>::type
- , BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PROTO_MAX_ARITY, A)
+ {
+ typedef
+ typename detail::make_expr_<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
>::type
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
- >
- {};
+ type;
+ };
         }
 
         namespace functional
@@ -520,21 +571,87 @@
                 BOOST_PROTO_CALLABLE()
 
                 template<typename Sig>
- struct result
- {};
+ struct result {};
 
- template<typename A>
- typename result_of::make_expr<Tag, Domain, A>::type const
- operator ()(A &a BOOST_PROTO_DISABLE_IF_IS_CONST(A)) const
+ /// Construct an expression node with tag type \c Tag
+ /// and in the domain \c Domain.
+ template<typename A0>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , typename utility::remref<A0>::type
+ >::type const
+ operator ()(A0 &a0 BOOST_PROTO_DISABLE_IF_IS_CONST(A0)) const
                 {
- return result_of::make_expr<Tag, Domain, A>::call(a);
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , typename utility::remref<A0>::type
+ >::call(a0);
                 }
 
- #define BOOST_PP_ITERATION_PARAMS_1 \
- (4, (1, BOOST_PROTO_MAX_ARITY, <boost/xpressive/proto/make_expr.hpp>, 2)) \
- /**/
+ /// \overload
+ ///
+ template<typename A0, typename A1>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , typename utility::remref<A0>::type
+ , typename utility::remref<A1>::type
+ >::type const
+ operator ()(A0 &a0, A1 &a1 BOOST_PROTO_DISABLE_IF_IS_CONST(A0) BOOST_PROTO_DISABLE_IF_IS_CONST(A1)) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , typename utility::remref<A0>::type
+ , typename utility::remref<A1>::type
+ >::call(a0, a1);
+ }
 
- #include BOOST_PP_ITERATE()
+ /// \overload
+ ///
+ template<typename A0, typename A1>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , typename utility::remref<A0>::type
+ , typename utility::remref<A1 const>::type
+ >::type const
+ operator ()(A0 &a0, A1 const &a1 BOOST_PROTO_DISABLE_IF_IS_CONST(A0)) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , typename utility::remref<A0>::type
+ , typename utility::remref<A1 const>::type
+ >::call(a0, a1);
+ }
+
+ /// \overload
+ ///
+ template<typename A0, typename A1>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , typename utility::remref<A0 const>::type
+ , typename utility::remref<A1>::type
+ >::type const
+ operator ()(A0 const &a0, A1 &a1 BOOST_PROTO_DISABLE_IF_IS_CONST(A1)) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , typename utility::remref<A0 const>::type
+ , typename utility::remref<A1>::type
+ >::call(a0, a1);
+ }
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (4, (1, BOOST_PROTO_MAX_ARITY, <boost/xpressive/proto/make_expr.hpp>, 2)) \
+ /**/
+
+ #include BOOST_PP_ITERATE()
             };
 
             template<typename Domain>
@@ -549,21 +666,43 @@
                 template<typename This, typename A>
                 struct result<This(A)>
                 {
- typedef typename result_of::make_expr<tag::terminal, Domain, A>::type type;
+ typedef
+ typename result_of::make_expr<
+ tag::terminal
+ , Domain
+ , typename utility::remref<A>::type
+ >::type
+ type;
                 };
 
                 template<typename A>
- typename result_of::make_expr<tag::terminal, Domain, A>::type const
+ typename result_of::make_expr<
+ tag::terminal
+ , Domain
+ , typename utility::remref<A>::type
+ >::type const
                 operator ()(A &a BOOST_PROTO_DISABLE_IF_IS_CONST(A)) const
                 {
- return result_of::make_expr<tag::terminal, Domain, A>::call(a);
+ return proto::detail::make_expr_<
+ tag::terminal
+ , Domain
+ , typename utility::remref<A>::type
+ >::call(a);
                 }
 
                 template<typename A>
- typename result_of::make_expr<tag::terminal, Domain, A const>::type const
+ typename result_of::make_expr<
+ tag::terminal
+ , Domain
+ , typename utility::remref<A const>::type
+ >::type const
                 operator ()(A const &a) const
                 {
- return result_of::make_expr<tag::terminal, Domain, A const>::call(a);
+ return proto::detail::make_expr_<
+ tag::terminal
+ , Domain
+ , typename utility::remref<A const>::type
+ >::call(a);
                 }
             };
 
@@ -592,14 +731,24 @@
                 typename result_of::unpack_expr<Tag, Domain, Sequence>::type const
                 operator ()(Sequence &sequence BOOST_PROTO_DISABLE_IF_IS_CONST(Sequence)) const
                 {
- return result_of::unpack_expr<Tag, Domain, Sequence>::call(sequence);
+ return proto::detail::unpack_expr_<
+ Tag
+ , Domain
+ , Sequence
+ , fusion::BOOST_PROTO_FUSION_RESULT_OF::size<Sequence>::type::value
+ >::call(sequence);
                 }
 
                 template<typename Sequence>
                 typename result_of::unpack_expr<Tag, Domain, Sequence const>::type const
                 operator ()(Sequence const &sequence) const
                 {
- return result_of::unpack_expr<Tag, Domain, Sequence const>::call(sequence);
+ return proto::detail::unpack_expr_<
+ Tag
+ , Domain
+ , Sequence const
+ , fusion::BOOST_PROTO_FUSION_RESULT_OF::size<Sequence>::type::value
+ >::call(sequence);
                 }
             };
 
@@ -627,14 +776,24 @@
                 typename proto::result_of::unpack_expr<Tag, Domain, Sequence>::type
                 operator ()(Sequence &sequence BOOST_PROTO_DISABLE_IF_IS_CONST(Sequence)) const
                 {
- return result_of::unpack_expr<Tag, Domain, Sequence>::call(sequence);
+ return proto::detail::unpack_expr_<
+ Tag
+ , Domain
+ , Sequence
+ , fusion::BOOST_PROTO_FUSION_RESULT_OF::size<Sequence>::type::value
+ >::call(sequence);
                 }
 
                 template<typename Sequence>
                 typename proto::result_of::unpack_expr<Tag, Domain, Sequence const>::type const
                 operator ()(Sequence const &sequence) const
                 {
- return result_of::unpack_expr<Tag, Domain, Sequence const>::call(sequence);
+ return proto::detail::unpack_expr_<
+ Tag
+ , Domain
+ , Sequence const
+ , fusion::BOOST_PROTO_FUSION_RESULT_OF::size<Sequence>::type::value
+ >::call(sequence);
                 }
             };
 
@@ -655,9 +814,16 @@
>::type const
         unpack_expr(Sequence &sequence BOOST_PROTO_DISABLE_IF_IS_CONST(Sequence))
         {
- return result_of::unpack_expr<Tag, Sequence>::call(sequence);
+ return proto::detail::unpack_expr_<
+ Tag
+ , deduce_domain
+ , Sequence
+ , fusion::BOOST_PROTO_FUSION_RESULT_OF::size<Sequence>::type::value
+ >::call(sequence);
         }
 
+ /// \overload
+ ///
         template<typename Tag, typename Sequence>
         typename lazy_disable_if<
             is_domain<Sequence>
@@ -665,7 +831,12 @@
>::type const
         unpack_expr(Sequence const &sequence)
         {
- return result_of::unpack_expr<Tag, Sequence const>::call(sequence);
+ return proto::detail::unpack_expr_<
+ Tag
+ , deduce_domain
+ , Sequence const
+ , fusion::BOOST_PROTO_FUSION_RESULT_OF::size<Sequence>::type::value
+ >::call(sequence);
         }
 
         /// \overload
@@ -674,14 +845,26 @@
         typename result_of::unpack_expr<Tag, Domain, Sequence2>::type const
         unpack_expr(Sequence2 &sequence2 BOOST_PROTO_DISABLE_IF_IS_CONST(Sequence2))
         {
- return result_of::unpack_expr<Tag, Domain, Sequence2>::call(sequence2);
+ return proto::detail::unpack_expr_<
+ Tag
+ , Domain
+ , Sequence2
+ , fusion::BOOST_PROTO_FUSION_RESULT_OF::size<Sequence2>::type::value
+ >::call(sequence2);
         }
 
+ /// \overload
+ ///
         template<typename Tag, typename Domain, typename Sequence2>
         typename result_of::unpack_expr<Tag, Domain, Sequence2 const>::type const
         unpack_expr(Sequence2 const &sequence2)
         {
- return result_of::unpack_expr<Tag, Domain, Sequence2 const>::call(sequence2);
+ return proto::detail::unpack_expr_<
+ Tag
+ , Domain
+ , Sequence2 const
+ , fusion::BOOST_PROTO_FUSION_RESULT_OF::size<Sequence2>::type::value
+ >::call(sequence2);
         }
 
         /// make_expr
@@ -689,20 +872,155 @@
         template<typename Tag, typename A0>
         typename lazy_disable_if<
             is_domain<A0>
- , result_of::make_expr<Tag, A0>
+ , result_of::make_expr<
+ Tag
+ , typename utility::remref<A0>::type
+ >
>::type const
         make_expr(A0 &a0 BOOST_PROTO_DISABLE_IF_IS_CONST(A0))
         {
- return result_of::make_expr<Tag, A0>::call(a0);
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , typename utility::remref<A0>::type
+ >::call(a0);
+ }
+
+ /// \ovoerload
+ ///
+ template<typename Tag, typename A0, typename A1>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ , typename utility::remref<A0>::type
+ , typename utility::remref<A1>::type
+ >
+ >::type const
+ make_expr(A0 &a0, A1 &a1 BOOST_PROTO_DISABLE_IF_IS_CONST(A0) BOOST_PROTO_DISABLE_IF_IS_CONST(A1))
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , typename utility::remref<A0>::type
+ , typename utility::remref<A1>::type
+ >::call(a0, a1);
+ }
+
+ /// \ovoerload
+ ///
+ template<typename Tag, typename A0, typename A1>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ , typename utility::remref<A0>::type
+ , typename utility::remref<A1 const>::type
+ >
+ >::type const
+ make_expr(A0 &a0, A1 const &a1 BOOST_PROTO_DISABLE_IF_IS_CONST(A0))
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , typename utility::remref<A0>::type
+ , typename utility::remref<A1 const>::type
+ >::call(a0, a1);
+ }
+
+ /// \ovoerload
+ ///
+ template<typename Tag, typename A0, typename A1>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ , typename utility::remref<A0 const>::type
+ , typename utility::remref<A1>::type
+ >
+ >::type const
+ make_expr(A0 const &a0, A1 &a1 BOOST_PROTO_DISABLE_IF_IS_CONST(A1))
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , typename utility::remref<A0 const>::type
+ , typename utility::remref<A1>::type
+ >::call(a0, a1);
         }
 
         /// \overload
         ///
         template<typename Tag, typename Domain, typename B0>
- typename result_of::make_expr<Tag, Domain, B0>::type const
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , typename utility::remref<B0>::type
+ >::type const
         make_expr(B0 &b0 BOOST_PROTO_DISABLE_IF_IS_CONST(B0))
         {
- return result_of::make_expr<Tag, Domain, B0>::call(b0);
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , typename utility::remref<B0>::type
+ >::call(b0);
+ }
+
+ /// \overload
+ ///
+ template<typename Tag, typename Domain, typename B0, typename B1>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , typename utility::remref<B0>::type
+ , typename utility::remref<B1>::type
+ >::type const
+ make_expr(B0 &b0, B1 &b1 BOOST_PROTO_DISABLE_IF_IS_CONST(B0) BOOST_PROTO_DISABLE_IF_IS_CONST(B1))
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , typename utility::remref<B0>::type
+ , typename utility::remref<B1>::type
+ >::call(b0, b1);
+ }
+
+ /// \overload
+ ///
+ template<typename Tag, typename Domain, typename B0, typename B1>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , typename utility::remref<B0>::type
+ , typename utility::remref<B1 const>::type
+ >::type const
+ make_expr(B0 &b0, B1 const &b1 BOOST_PROTO_DISABLE_IF_IS_CONST(B0))
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , typename utility::remref<B0>::type
+ , typename utility::remref<B1 const>::type
+ >::call(b0, b1);
+ }
+
+ /// \overload
+ ///
+ template<typename Tag, typename Domain, typename B0, typename B1>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , typename utility::remref<B0 const>::type
+ , typename utility::remref<B1>::type
+ >::type const
+ make_expr(B0 const &b0, B1 &b1 BOOST_PROTO_DISABLE_IF_IS_CONST(B1))
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , typename utility::remref<B0 const>::type
+ , typename utility::remref<B1>::type
+ >::call(b0, b1);
         }
 
     #define BOOST_PP_ITERATION_PARAMS_1 \
@@ -760,6 +1078,22 @@
             }
         };
 
+ template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct make_expr_<Tag, deduce_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
+ BOOST_PP_ENUM_TRAILING_PARAMS(M, void BOOST_PP_INTERCEPT), void>
+ : make_expr_<
+ Tag
+ , typename detail::deduce_domain_<
+ typename domain_of<
+ A0
+ >::type
+ BOOST_PP_COMMA_IF(BOOST_PP_DEC(N))
+ BOOST_PP_ENUM_SHIFTED_PARAMS(N, A)
+ >::type
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
+ >
+ {};
+
         template<typename Tag, typename Domain, typename Sequence>
         struct unpack_expr_<Tag, Domain, Sequence, N>
         {
@@ -813,23 +1147,36 @@
                   , Domain
                     BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
                         N
- , typename remove_reference<A
+ , typename utility::remref<A
                       , >::type BOOST_PP_INTERCEPT
                     )
>::type
             type;
         };
 
+ /// \overload
+ ///
         template<BOOST_PP_ENUM_PARAMS(N, typename A)>
         typename result_of::make_expr<
             Tag
           , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
+ BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
+ N
+ , typename utility::remref<const A
+ , >::type BOOST_PP_INTERCEPT
+ )
>::type const
         operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, const A, &a)) const
         {
- return result_of::make_expr<Tag, Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)>
- ::call(BOOST_PP_ENUM_PARAMS(N, a));
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
+ N
+ , typename utility::remref<const A
+ , >::type BOOST_PP_INTERCEPT
+ )
+ >::call(BOOST_PP_ENUM_PARAMS(N, a));
         }
 
     #undef N
@@ -843,12 +1190,26 @@
         template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
         typename lazy_disable_if<
             is_domain<A0>
- , result_of::make_expr<Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)>
+ , result_of::make_expr<
+ Tag
+ BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
+ N
+ , typename utility::remref<const A
+ , >::type BOOST_PP_INTERCEPT
+ )
+ >
>::type const
         make_expr(BOOST_PP_ENUM_BINARY_PARAMS(N, const A, &a))
         {
- return result_of::make_expr<Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)>
- ::call(BOOST_PP_ENUM_PARAMS(N, a));
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
+ N
+ , typename utility::remref<const A
+ , >::type BOOST_PP_INTERCEPT
+ )
+ >::call(BOOST_PP_ENUM_PARAMS(N, a));
         }
 
         /// \overload
@@ -857,12 +1218,23 @@
         typename result_of::make_expr<
             Tag
           , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(N, const B)
+ BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
+ N
+ , typename utility::remref<const B
+ , >::type BOOST_PP_INTERCEPT
+ )
>::type const
         make_expr(BOOST_PP_ENUM_BINARY_PARAMS(N, const B, &b))
         {
- return result_of::make_expr<Tag, Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const B)>
- ::call(BOOST_PP_ENUM_PARAMS(N, b));
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
+ N
+ , typename utility::remref<const B
+ , >::type BOOST_PP_INTERCEPT
+ )
+ >::call(BOOST_PP_ENUM_PARAMS(N, b));
         }
 
     #undef N

Modified: trunk/boost/xpressive/proto/operators.hpp
==============================================================================
--- trunk/boost/xpressive/proto/operators.hpp (original)
+++ trunk/boost/xpressive/proto/operators.hpp 2008-01-29 16:02:52 EST (Tue, 29 Jan 2008)
@@ -295,7 +295,7 @@
>::type const \
     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::make_expr<TAG, DOMAIN>(arg); \
     } \
     template<typename Arg> \
     typename boost::proto::detail::enable_unary<DOMAIN, TRAIT<Arg>, Arg \
@@ -303,7 +303,7 @@
>::type const \
     operator OP(Arg const &arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \
     { \
- return boost::proto::result_of::make_expr<TAG, DOMAIN, Arg const>::call(arg); \
+ return boost::proto::make_expr<TAG, DOMAIN>(arg); \
     } \
     /**/
 
@@ -314,8 +314,7 @@
>::type const \
     operator OP(Left &left, Right &right) \
     { \
- return boost::proto::result_of::make_expr<TAG, DOMAIN, Left, Right> \
- ::call(left, right); \
+ return boost::proto::make_expr<TAG, DOMAIN>(left, right); \
     } \
     template<typename Left, typename Right> \
     typename boost::proto::detail::enable_binary<DOMAIN, TRAIT<Left>, Left, TRAIT<Right>, Right \
@@ -323,8 +322,7 @@
>::type const \
     operator OP(Left &left, Right const &right) \
     { \
- return boost::proto::result_of::make_expr<TAG, DOMAIN, Left, Right const> \
- ::call(left, right); \
+ return boost::proto::make_expr<TAG, DOMAIN>(left, right); \
     } \
     template<typename Left, typename Right> \
     typename boost::proto::detail::enable_binary<DOMAIN, TRAIT<Left>, Left, TRAIT<Right>, Right \
@@ -332,8 +330,7 @@
>::type const \
     operator OP(Left const &left, Right &right) \
     { \
- return boost::proto::result_of::make_expr<TAG, DOMAIN, Left const, Right> \
- ::call(left, right); \
+ return boost::proto::make_expr<TAG, DOMAIN>(left, right); \
     } \
     template<typename Left, typename Right> \
     typename boost::proto::detail::enable_binary<DOMAIN, TRAIT<Left>, Left, TRAIT<Right>, Right \
@@ -341,8 +338,7 @@
>::type const \
     operator OP(Left const &left, Right const &right) \
     { \
- return boost::proto::result_of::make_expr<TAG, DOMAIN, Left const, Right const> \
- ::call(left, right); \
+ return boost::proto::make_expr<TAG, DOMAIN>(left, right); \
     } \
     /**/
 

Modified: trunk/boost/xpressive/proto/proto_fwd.hpp
==============================================================================
--- trunk/boost/xpressive/proto/proto_fwd.hpp (original)
+++ trunk/boost/xpressive/proto/proto_fwd.hpp 2008-01-29 16:02:52 EST (Tue, 29 Jan 2008)
@@ -40,7 +40,7 @@
 # include <boost/utility/enable_if.hpp>
 # include <boost/type_traits/is_const.hpp>
 # define BOOST_PROTO_DISABLE_IF_IS_CONST(T)\
- , typename boost::disable_if<boost::is_const<T> >::type * = 0
+ , typename boost::disable_if<boost::is_const<T>, boost::proto::detail::undefined>::type * = 0
 #else
 # define BOOST_PROTO_DISABLE_IF_IS_CONST(T)
 #endif
@@ -69,6 +69,7 @@
         typedef char (&no_type)[2];
 
         struct dont_care;
+ struct undefined; // leave this undefined
 
         /// INTERNAL ONLY
         ///

Modified: trunk/boost/xpressive/proto/transform/arg.hpp
==============================================================================
--- trunk/boost/xpressive/proto/transform/arg.hpp (original)
+++ trunk/boost/xpressive/proto/transform/arg.hpp 2008-01-29 16:02:52 EST (Tue, 29 Jan 2008)
@@ -86,7 +86,7 @@
             };
 
             template<typename Expr, typename State, typename Visitor>
- typename proto::result_of::arg_c<Expr, I>::type
+ typename proto::result_of::arg_c<Expr, I>::const_reference
             operator ()(Expr const &expr, State const &, Visitor &) const
             {
                 return proto::arg_c<I>(expr);

Modified: trunk/libs/xpressive/proto/doc/protodoc.xml
==============================================================================
--- trunk/libs/xpressive/proto/doc/protodoc.xml (original)
+++ trunk/libs/xpressive/proto/doc/protodoc.xml 2008-01-29 16:02:52 EST (Tue, 29 Jan 2008)
@@ -742,11 +742,11 @@
     </template><specialization><template-arg>This(Expr)</template-arg></specialization><typedef name="type"><type>fusion::result_of::reverse&lt; typename boost::remove_reference&lt; Expr &gt;::type const &gt;::type</type></typedef></struct-specialization><typedef name="proto_is_callable_"><type>void</type></typedef><method-group name="public member functions"><method name="operator()" cv="const"><type>fusion::result_of::reverse&lt; Expr const &gt;::type</type><template>
           <template-type-parameter name="Expr"/>
         </template><parameter name="expr"><paramtype>Expr const &amp;</paramtype></parameter></method></method-group></struct></namespace><data-member name="flatten"><type><classname>functional::flatten</classname> const</type><purpose>A PolymorphicFunctionObject type that returns a "flattened" view of a Proto expression tree. </purpose><description><para><para>boost::proto::functional::flatten </para>
-</para></description></data-member></namespace></namespace></header><header name="boost/xpressive/proto/generate.hpp"><para>Contains definition of generate&lt;&gt; class template, which end users can specialize for generating domain-specific expression wrappers. </para><namespace name="boost"><namespace name="proto"><namespace name="generatorns_"><struct name="default_generator"><purpose>A simple generator that simply passes an expression through unchanged. </purpose><description><para>Generators are intended for use as the first template parameter to the <computeroutput>domain&lt;&gt;</computeroutput> class template and control if and how expressions within that domain are to be customized. The <computeroutput>default_generator</computeroutput> makes no modifications to the expressions passed to it. </para></description><struct name="apply"><template>
+</para></description></data-member></namespace></namespace></header><header name="boost/xpressive/proto/generate.hpp"><para>Contains definition of generate&lt;&gt; class template, which end users can specialize for generating domain-specific expression wrappers. </para><namespace name="boost"><namespace name="proto"><namespace name="generatorns_"><struct name="default_generator"><purpose>A simple generator that passes an expression through unchanged. </purpose><description><para>Generators are intended for use as the first template parameter to the <computeroutput>domain&lt;&gt;</computeroutput> class template and control if and how expressions within that domain are to be customized. The <computeroutput>default_generator</computeroutput> makes no modifications to the expressions passed to it. </para></description><struct name="apply"><template>
       <template-type-parameter name="Expr"/>
     </template><typedef name="type"><type>Expr</type></typedef></struct><method-group name="public static functions"><method name="make" cv=""><type>static Expr const &amp;</type><template>
           <template-type-parameter name="Expr"/>
- </template><parameter name="expr"><paramtype>Expr const &amp;</paramtype><description><para>The expression </para></description></parameter><description><para>
+ </template><parameter name="expr"><paramtype>Expr const &amp;</paramtype><description><para>A Proto expression </para></description></parameter><description><para>
 
 </para></description><returns><para>expr </para></returns></method></method-group></struct><struct name="generator"><template>
       <template-nontype-parameter name="Extends"><type>template&lt; typename &gt; class</type></template-nontype-parameter>
@@ -754,7 +754,7 @@
       <template-type-parameter name="Expr"/>
     </template><typedef name="type"><type>Extends&lt; Expr &gt;</type></typedef></struct><method-group name="public static functions"><method name="make" cv=""><type>static Extends&lt; Expr &gt;</type><template>
           <template-type-parameter name="Expr"/>
- </template><parameter name="expr"><paramtype>Expr const &amp;</paramtype><description><para>The expression to wrap </para></description></parameter><description><para>
+ </template><parameter name="expr"><paramtype>Expr const &amp;</paramtype><description><para>A Proto expression </para></description></parameter><description><para>
 
 </para></description><returns><para>Extends&lt;Expr&gt;(expr) </para></returns></method></method-group></struct><struct name="pod_generator"><template>
       <template-nontype-parameter name="Extends"><type>template&lt; typename &gt; class</type></template-nontype-parameter>
@@ -775,7 +775,7 @@
 </para></description><returns><para>Generator::make(deep_copy(expr)) </para></returns></method></method-group></struct></namespace></namespace></namespace></header><header name="boost/xpressive/proto/literal.hpp"><para>The literal&lt;&gt; terminal wrapper, and the proto::lit() function for creating literal&lt;&gt; wrappers. </para><namespace name="boost"><namespace name="proto"><namespace name="utility"><struct name="literal"><template>
       <template-type-parameter name="T"/>
       <template-type-parameter name="Domain"/>
- </template><typedef name="terminal_type"><type><classname>terminal</classname>&lt; T &gt;::type</type></typedef><typedef name="base_type"><type>extends&lt; terminal_type, <classname>literal</classname>&lt; T, Domain &gt;, Domain &gt;</type></typedef><method-group name="public member functions"/><constructor><template>
+ </template><purpose>A simple wrapper for a terminal, provided for ease of use. </purpose><description><para>A simple wrapper for a terminal, provided for ease of use. In all cases, <computeroutput>literal&lt;X&gt; l(x);</computeroutput> is equivalent to <computeroutput>terminal&lt;X&gt;type l = {x};</computeroutput>.</para><para>The <computeroutput>Domain</computeroutput> template parameter defaults to <computeroutput>proto::default_domain</computeroutput>. </para></description><method-group name="public member functions"/><constructor><template>
           <template-type-parameter name="U"/>
         </template><parameter name="u"><paramtype>U &amp;</paramtype></parameter></constructor><constructor><template>
           <template-type-parameter name="U"/>
@@ -783,9 +783,13 @@
           <template-type-parameter name="U"/>
         </template><parameter name="u"><paramtype><classname>literal</classname>&lt; U, Domain &gt; const &amp;</paramtype></parameter></constructor></struct></namespace><overloaded-function name="lit"><signature><type>literal&lt; T &amp; &gt;</type><template>
           <template-type-parameter name="T"/>
- </template><parameter name="t"><paramtype>T &amp;</paramtype></parameter></signature><signature><type>literal&lt; T const &amp; &gt;</type><template>
+ </template><parameter name="t"><paramtype>T &amp;</paramtype><description><para>The object to wrap. </para></description></parameter></signature><signature><type>literal&lt; T const &amp; &gt;</type><template>
           <template-type-parameter name="T"/>
- </template><parameter name="t"><paramtype>T const &amp;</paramtype></parameter></signature><description><para>lit </para></description></overloaded-function></namespace></namespace></header><header name="boost/xpressive/proto/make_expr.hpp"><para>Definition of the <computeroutput>make_expr()</computeroutput> and <computeroutput>unpack_expr()</computeroutput> utilities for building Proto expression nodes from children nodes or from a Fusion sequence of children nodes, respectively. </para><namespace name="boost"><namespace name="fusion"/><namespace name="proto"><struct-specialization name="is_callable"><template>
+ </template><parameter name="t"><paramtype>T const &amp;</paramtype></parameter></signature><purpose>A helper function for creating a <computeroutput>literal&lt;&gt;</computeroutput> wrapper. </purpose><description><para>
+
+
+
+</para></description><returns><para>literal&lt;T &amp;&gt;(t) </para></returns><throws><simpara>Will not throw.</simpara></throws><notes><para>The returned value holds the argument by reference. </para></notes></overloaded-function></namespace></namespace></header><header name="boost/xpressive/proto/make_expr.hpp"><para>Definition of the <computeroutput>make_expr()</computeroutput> and <computeroutput>unpack_expr()</computeroutput> utilities for building Proto expression nodes from children nodes or from a Fusion sequence of children nodes, respectively. </para><namespace name="boost"><namespace name="fusion"/><namespace name="proto"><struct-specialization name="is_callable"><template>
       <template-type-parameter name="Tag"/>
       <template-type-parameter name="Domain"/>
     </template><specialization><template-arg>functional::make_expr&lt; Tag</template-arg><template-arg>Domain &gt;</template-arg></specialization></struct-specialization><struct-specialization name="is_callable"><template>
@@ -802,29 +806,29 @@
     </template></struct><struct-specialization name="result"><template>
       <template-type-parameter name="This"/>
       <template-type-parameter name="A0"/>
- </template><specialization><template-arg>This(A0)</template-arg></specialization><inherit access="public">boost::proto::result_of::make_expr&lt; Tag, Domain, remove_reference&lt; A0 &gt;::type &gt;</inherit></struct-specialization><struct-specialization name="result"><template>
+ </template><specialization><template-arg>This(A0)</template-arg></specialization><typedef name="type"><type><classname>result_of::make_expr</classname>&lt; Tag, Domain, typename remove_reference&lt; A0 &gt;::type &gt;::type</type></typedef></struct-specialization><struct-specialization name="result"><template>
       <template-type-parameter name="This"/>
       <template-type-parameter name="A0"/>
       <template-type-parameter name="A1"/>
- </template><specialization><template-arg>This(A0</template-arg><template-arg>A1)</template-arg></specialization><inherit access="public">boost::proto::result_of::make_expr&lt; Tag, Domain, remove_reference&lt; A0 &gt;::type, remove_reference&lt; A1 &gt;::type &gt;</inherit></struct-specialization><struct-specialization name="result"><template>
+ </template><specialization><template-arg>This(A0</template-arg><template-arg>A1)</template-arg></specialization><typedef name="type"><type><classname>result_of::make_expr</classname>&lt; Tag, Domain, typename remove_reference&lt; A0 &gt;::type, typename remove_reference&lt; A1 &gt;::type &gt;::type</type></typedef></struct-specialization><struct-specialization name="result"><template>
       <template-type-parameter name="This"/>
       <template-type-parameter name="A0"/>
       <template-type-parameter name="A1"/>
       <template-type-parameter name="A2"/>
- </template><specialization><template-arg>This(A0</template-arg><template-arg>A1</template-arg><template-arg>A2)</template-arg></specialization><inherit access="public">boost::proto::result_of::make_expr&lt; Tag, Domain, remove_reference&lt; A0 &gt;::type, remove_reference&lt; A1 &gt;::type, remove_reference&lt; A2 &gt;::type &gt;</inherit></struct-specialization><struct-specialization name="result"><template>
+ </template><specialization><template-arg>This(A0</template-arg><template-arg>A1</template-arg><template-arg>A2)</template-arg></specialization><typedef name="type"><type><classname>result_of::make_expr</classname>&lt; Tag, Domain, typename remove_reference&lt; A0 &gt;::type, typename remove_reference&lt; A1 &gt;::type, typename remove_reference&lt; A2 &gt;::type &gt;::type</type></typedef></struct-specialization><struct-specialization name="result"><template>
       <template-type-parameter name="This"/>
       <template-type-parameter name="A0"/>
       <template-type-parameter name="A1"/>
       <template-type-parameter name="A2"/>
       <template-type-parameter name="A3"/>
- </template><specialization><template-arg>This(A0</template-arg><template-arg>A1</template-arg><template-arg>A2</template-arg><template-arg>A3)</template-arg></specialization><inherit access="public">boost::proto::result_of::make_expr&lt; Tag, Domain, remove_reference&lt; A0 &gt;::type, remove_reference&lt; A1 &gt;::type, remove_reference&lt; A2 &gt;::type, remove_reference&lt; A3 &gt;::type &gt;</inherit></struct-specialization><struct-specialization name="result"><template>
+ </template><specialization><template-arg>This(A0</template-arg><template-arg>A1</template-arg><template-arg>A2</template-arg><template-arg>A3)</template-arg></specialization><typedef name="type"><type><classname>result_of::make_expr</classname>&lt; Tag, Domain, typename remove_reference&lt; A0 &gt;::type, typename remove_reference&lt; A1 &gt;::type, typename remove_reference&lt; A2 &gt;::type, typename remove_reference&lt; A3 &gt;::type &gt;::type</type></typedef></struct-specialization><struct-specialization name="result"><template>
       <template-type-parameter name="This"/>
       <template-type-parameter name="A0"/>
       <template-type-parameter name="A1"/>
       <template-type-parameter name="A2"/>
       <template-type-parameter name="A3"/>
       <template-type-parameter name="A4"/>
- </template><specialization><template-arg>This(A0</template-arg><template-arg>A1</template-arg><template-arg>A2</template-arg><template-arg>A3</template-arg><template-arg>A4)</template-arg></specialization><inherit access="public">boost::proto::result_of::make_expr&lt; Tag, Domain, remove_reference&lt; A0 &gt;::type, remove_reference&lt; A1 &gt;::type, remove_reference&lt; A2 &gt;::type, remove_reference&lt; A3 &gt;::type, remove_reference&lt; A4 &gt;::type &gt;</inherit></struct-specialization><typedef name="proto_is_callable_"><type>void</type></typedef><method-group name="public member functions"><method name="operator()" cv="const"><type><classname>result_of::make_expr</classname>&lt; Tag, Domain, A &gt;::type const</type><template>
+ </template><specialization><template-arg>This(A0</template-arg><template-arg>A1</template-arg><template-arg>A2</template-arg><template-arg>A3</template-arg><template-arg>A4)</template-arg></specialization><typedef name="type"><type><classname>result_of::make_expr</classname>&lt; Tag, Domain, typename remove_reference&lt; A0 &gt;::type, typename remove_reference&lt; A1 &gt;::type, typename remove_reference&lt; A2 &gt;::type, typename remove_reference&lt; A3 &gt;::type, typename remove_reference&lt; A4 &gt;::type &gt;::type</type></typedef></struct-specialization><typedef name="proto_is_callable_"><type>void</type></typedef><method-group name="public member functions"><method name="operator()" cv="const"><type><classname>result_of::make_expr</classname>&lt; Tag, Domain, A &gt;::type const</type><template>
           <template-type-parameter name="A"/>
         </template><parameter name="a"><paramtype>A &amp;</paramtype></parameter></method><method name="operator()" cv="const"><type><classname>result_of::make_expr</classname>&lt; Tag, Domain, const A0 &gt;::type const</type><template>
           <template-type-parameter name="A0"/>
@@ -854,14 +858,21 @@
     </template></struct><struct-specialization name="result"><template>
       <template-type-parameter name="This"/>
       <template-type-parameter name="Sequence"/>
- </template><specialization><template-arg>This(Sequence)</template-arg></specialization><inherit access="public">boost::proto::result_of::unpack_expr&lt; Tag, Domain, boost::remove_const &lt; boost::remove_reference&lt; Sequence &gt;::type &gt;::type &gt;</inherit></struct-specialization><typedef name="proto_is_callable_"><type>void</type></typedef><method-group name="public member functions"><method name="operator()" cv="const"><type><classname>result_of::unpack_expr</classname>&lt; Tag, Domain, Sequence &gt;::type</type><template>
+ </template><specialization><template-arg>This(Sequence)</template-arg></specialization><typedef name="type"><type><classname>result_of::unpack_expr</classname>&lt; Tag, Domain, typename remove_reference&lt; Sequence &gt;::type &gt;::type</type></typedef></struct-specialization><typedef name="proto_is_callable_"><type>void</type></typedef><method-group name="public member functions"><method name="operator()" cv="const"><type><classname>result_of::unpack_expr</classname>&lt; Tag, Domain, Sequence &gt;::type const</type><template>
+ <template-type-parameter name="Sequence"/>
+ </template><parameter name="sequence"><paramtype>Sequence &amp;</paramtype></parameter></method><method name="operator()" cv="const"><type><classname>result_of::unpack_expr</classname>&lt; Tag, Domain, Sequence const &gt;::type const</type><template>
           <template-type-parameter name="Sequence"/>
         </template><parameter name="sequence"><paramtype>Sequence const &amp;</paramtype></parameter></method></method-group></struct><struct name="unfused_expr_fun"><template>
       <template-type-parameter name="Tag"/>
       <template-type-parameter name="Domain"/>
     </template><struct name="result"><template>
+ <template-type-parameter name="Sig"/>
+ </template></struct><struct-specialization name="result"><template>
+ <template-type-parameter name="This"/>
       <template-type-parameter name="Sequence"/>
- </template><inherit access="public">boost::proto::result_of::unpack_expr&lt; Tag, Domain, Sequence &gt;</inherit></struct><typedef name="proto_is_callable_"><type>void</type></typedef><method-group name="public member functions"><method name="operator()" cv="const"><type><classname>proto::result_of::unpack_expr</classname>&lt; Tag, Domain, Sequence &gt;::type</type><template>
+ </template><specialization><template-arg>This(Sequence)</template-arg></specialization><typedef name="type"><type><classname>result_of::unpack_expr</classname>&lt; Tag, Domain, typename remove_reference&lt; Sequence &gt;::type &gt;::type</type></typedef></struct-specialization><typedef name="proto_is_callable_"><type>void</type></typedef><method-group name="public member functions"><method name="operator()" cv="const"><type><classname>proto::result_of::unpack_expr</classname>&lt; Tag, Domain, Sequence &gt;::type</type><template>
+ <template-type-parameter name="Sequence"/>
+ </template><parameter name="sequence"><paramtype>Sequence &amp;</paramtype></parameter></method><method name="operator()" cv="const"><type><classname>proto::result_of::unpack_expr</classname>&lt; Tag, Domain, Sequence const &gt;::type const</type><template>
           <template-type-parameter name="Sequence"/>
         </template><parameter name="sequence"><paramtype>Sequence const &amp;</paramtype></parameter></method></method-group></struct><struct name="unfused_expr"><template>
       <template-type-parameter name="Tag"/>
@@ -873,9 +884,9 @@
     </template></struct><struct-specialization name="result"><template>
       <template-type-parameter name="This"/>
       <template-type-parameter name="A"/>
- </template><specialization><template-arg>This(A)</template-arg></specialization><inherit access="public">boost::proto::result_of::make_expr&lt; Tag, A0, A1, A2, A3, A4,, &gt;</inherit></struct-specialization><typedef name="proto_is_callable_"><type>void</type></typedef><method-group name="public member functions"><method name="operator()" cv="const"><type><classname>result_of::make_expr</classname>&lt; <classname>tag::terminal</classname>, Domain, A &gt;::type</type><template>
+ </template><specialization><template-arg>This(A)</template-arg></specialization><typedef name="type"><type><classname>result_of::make_expr</classname>&lt; <classname>tag::terminal</classname>, Domain, A &gt;::type</type></typedef></struct-specialization><typedef name="proto_is_callable_"><type>void</type></typedef><method-group name="public member functions"><method name="operator()" cv="const"><type><classname>result_of::make_expr</classname>&lt; <classname>tag::terminal</classname>, Domain, A &gt;::type const</type><template>
           <template-type-parameter name="A"/>
- </template><parameter name="a"><paramtype>A &amp;</paramtype></parameter></method><method name="operator()" cv="const"><type><classname>result_of::make_expr</classname>&lt; <classname>tag::terminal</classname>, Domain, A const &gt;::type</type><template>
+ </template><parameter name="a"><paramtype>A &amp;</paramtype></parameter></method><method name="operator()" cv="const"><type><classname>result_of::make_expr</classname>&lt; <classname>tag::terminal</classname>, Domain, A const &gt;::type const</type><template>
           <template-type-parameter name="A"/>
         </template><parameter name="a"><paramtype>A const &amp;</paramtype></parameter></method></method-group></struct-specialization></namespace><namespace name="result_of"><struct name="unpack_expr"><template>
       <template-type-parameter name="Tag"/>
@@ -910,14 +921,21 @@
       <template-type-parameter name="A2"/>
       <template-type-parameter name="A3"/>
       <template-type-parameter name="A4"/>
- </template><specialization><template-arg>Tag</template-arg><template-arg>Domain</template-arg><template-arg>A0</template-arg><template-arg>A1</template-arg><template-arg>A2</template-arg><template-arg>A3</template-arg><template-arg>A4</template-arg><template-arg>typename Domain::proto_is_domain_</template-arg></specialization></struct-specialization></namespace><overloaded-function name="unpack_expr"><signature><type>lazy_disable_if&lt; is_domain&lt; Sequence &gt;, <classname>result_of::unpack_expr</classname>&lt; Tag, Sequence &gt;&gt;::type const</type><template>
+ </template><specialization><template-arg>Tag</template-arg><template-arg>Domain</template-arg><template-arg>A0</template-arg><template-arg>A1</template-arg><template-arg>A2</template-arg><template-arg>A3</template-arg><template-arg>A4</template-arg><template-arg>typename Domain::proto_is_domain_</template-arg></specialization></struct-specialization></namespace><function name="unpack_expr"><type>lazy_disable_if&lt; is_domain&lt; Sequence &gt;, <classname>result_of::unpack_expr</classname>&lt; Tag, Sequence &gt;&gt;::type const</type><template>
+ <template-type-parameter name="Tag"/>
+ <template-type-parameter name="Sequence"/>
+ </template><parameter name="sequence"><paramtype>Sequence &amp;</paramtype></parameter><description><para>unpack_expr </para></description></function><overloaded-function name="unpack_expr"><signature><type>lazy_disable_if&lt; is_domain&lt; Sequence &gt;, <classname>result_of::unpack_expr</classname>&lt; Tag, Sequence const &gt;&gt;::type const</type><template>
           <template-type-parameter name="Tag"/>
           <template-type-parameter name="Sequence"/>
         </template><parameter name="sequence"><paramtype>Sequence const &amp;</paramtype></parameter></signature><signature><type><classname>result_of::unpack_expr</classname>&lt; Tag, Domain, Sequence2 &gt;::type const</type><template>
           <template-type-parameter name="Tag"/>
           <template-type-parameter name="Domain"/>
           <template-type-parameter name="Sequence2"/>
- </template><parameter name="sequence2"><paramtype>Sequence2 const &amp;</paramtype></parameter></signature><description><para>unpack_expr </para></description></overloaded-function><overloaded-function name="make_expr"><signature><type>lazy_disable_if&lt; is_domain&lt; A0 &gt;, <classname>result_of::make_expr</classname>&lt; Tag, A0 &gt;&gt;::type const</type><template>
+ </template><parameter name="sequence2"><paramtype>Sequence2 &amp;</paramtype></parameter></signature></overloaded-function><function name="unpack_expr"><type><classname>result_of::unpack_expr</classname>&lt; Tag, Domain, Sequence2 const &gt;::type const</type><template>
+ <template-type-parameter name="Tag"/>
+ <template-type-parameter name="Domain"/>
+ <template-type-parameter name="Sequence2"/>
+ </template><parameter name="sequence2"><paramtype>Sequence2 const &amp;</paramtype></parameter></function><overloaded-function name="make_expr"><signature><type>lazy_disable_if&lt; is_domain&lt; A0 &gt;, <classname>result_of::make_expr</classname>&lt; Tag, A0 &gt;&gt;::type const</type><template>
           <template-type-parameter name="Tag"/>
           <template-type-parameter name="A0"/>
         </template><parameter name="a0"><paramtype>A0 &amp;</paramtype></parameter></signature><signature><type><classname>result_of::make_expr</classname>&lt; Tag, Domain, B0 &gt;::type const</type><template>

Modified: trunk/libs/xpressive/proto/example/mixed.cpp
==============================================================================
--- trunk/libs/xpressive/proto/example/mixed.cpp (original)
+++ trunk/libs/xpressive/proto/example/mixed.cpp 2008-01-29 16:02:52 EST (Tue, 29 Jan 2008)
@@ -249,12 +249,8 @@
       , A const
>::type sin(A const &a)
     {
- return proto::result_of::make_expr<
- proto::tag::function
- , MixedDomain
- , sin_ const
- , A const
- >::call(sin_(), a);
+ static sin_ const s = {};
+ return proto::make_expr<proto::tag::function, MixedDomain>(s, a);
     }
 
     template<typename FwdIter, typename Expr, typename Op>

Modified: trunk/libs/xpressive/proto/test/make_expr.cpp
==============================================================================
--- trunk/libs/xpressive/proto/test/make_expr.cpp (original)
+++ trunk/libs/xpressive/proto/test/make_expr.cpp 2008-01-29 16:02:52 EST (Tue, 29 Jan 2008)
@@ -40,7 +40,7 @@
     BOOST_CHECK_EQUAL(proto::arg(proto::arg(p3)), 42);
 
     ewrap<plus<
- proto::ref_<ewrap<posit<ewrap<terminal<int &>::type> >::type> const> // BUGBUG the const is an error here
+ proto::ref_<ewrap<posit<ewrap<terminal<int &>::type> >::type> >
       , ewrap<terminal<int const &>::type>
>::type> p4 = make_expr<tag::plus>(p3, 0);
     BOOST_CHECK_EQUAL(proto::arg(proto::arg(proto::left(p4))), 42);
@@ -59,7 +59,7 @@
     BOOST_CHECK_EQUAL(proto::arg(proto::arg(p3)), 42);
 
     ewrap<plus<
- proto::ref_<ewrap<posit<ewrap<terminal<int &>::type> >::type> const> // BUGBUG the const is an error here
+ proto::ref_<ewrap<posit<ewrap<terminal<int &>::type> >::type> >
       , ewrap<terminal<int const &>::type>
>::type> p4 = functional::make_expr<tag::plus, mydomain>()(p3, 0);
     BOOST_CHECK_EQUAL(proto::arg(proto::arg(proto::left(p4))), 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