Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2007-12-20 16:07:36


Author: eric_niebler
Date: 2007-12-20 16:07:35 EST (Thu, 20 Dec 2007)
New Revision: 42214
URL: http://svn.boost.org/trac/boost/changeset/42214

Log:
constify all return types, port eval() to C++03
Text files modified:
   branches/proto/v3/boost/xpressive/proto/deep_copy.hpp | 2 +-
   branches/proto/v3/boost/xpressive/proto/detail/fun_call_ex.hpp | 8 ++++----
   branches/proto/v3/boost/xpressive/proto/detail/make_expr_ex.hpp | 8 ++++----
   branches/proto/v3/boost/xpressive/proto/eval.hpp | 23 ++++++++++++++++++++---
   branches/proto/v3/boost/xpressive/proto/expr.hpp | 32 ++++++++++++++++----------------
   branches/proto/v3/boost/xpressive/proto/extends.hpp | 22 +++++++++++-----------
   branches/proto/v3/boost/xpressive/proto/literal.hpp | 4 ++--
   branches/proto/v3/boost/xpressive/proto/make_expr.hpp | 16 ++++++++--------
   branches/proto/v3/boost/xpressive/proto/operators.hpp | 26 +++++++++++++-------------
   branches/proto/v3/boost/xpressive/proto/traits.hpp | 24 ++++++++++++------------
   10 files changed, 91 insertions(+), 74 deletions(-)

Modified: branches/proto/v3/boost/xpressive/proto/deep_copy.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/deep_copy.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/deep_copy.hpp 2007-12-20 16:07:35 EST (Thu, 20 Dec 2007)
@@ -50,7 +50,7 @@
             {};
 
             template<typename Expr>
- typename result_of::deep_copy<Expr>::type
+ typename result_of::deep_copy<Expr>::type const
             operator()(Expr const &expr) const
             {
                 return result_of::deep_copy<Expr>::call(expr);

Modified: branches/proto/v3/boost/xpressive/proto/detail/fun_call_ex.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/detail/fun_call_ex.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/detail/fun_call_ex.hpp 2007-12-20 16:07:35 EST (Thu, 20 Dec 2007)
@@ -13,7 +13,7 @@
 
     #define M3(R, SIZE, PRODUCT) \
         template<BOOST_PP_ENUM_PARAMS(SIZE, typename A)> \
- expr<tag::function, args<expr &, BOOST_PP_SEQ_FOR_EACH_I_R(R, M5, ~, PRODUCT)> > \
+ expr<tag::function, args<expr &, BOOST_PP_SEQ_FOR_EACH_I_R(R, M5, ~, PRODUCT)> > const \
         operator()(BOOST_PP_SEQ_FOR_EACH_I_R(R, M4, ~, PRODUCT)) \
         { \
             typedef args<expr &, BOOST_PP_SEQ_FOR_EACH_I_R(R, M5, ~, PRODUCT)> args_type; \
@@ -27,7 +27,7 @@
         } \
                                                                                                     \
         template<BOOST_PP_ENUM_PARAMS(SIZE, typename A)> \
- expr<tag::function, args<expr const &, BOOST_PP_SEQ_FOR_EACH_I_R(R, M5, ~, PRODUCT)> > \
+ expr<tag::function, args<expr const &, BOOST_PP_SEQ_FOR_EACH_I_R(R, M5, ~, PRODUCT)> > const\
         operator()(BOOST_PP_SEQ_FOR_EACH_I_R(R, M4, ~, PRODUCT)) const \
         { \
             typedef args<expr const &, BOOST_PP_SEQ_FOR_EACH_I_R(R, M5, ~, PRODUCT)> args_type; \
@@ -48,12 +48,12 @@
 
         #define M5(R, _, I, ELEM) \
         BOOST_PP_COMMA_IF(I) \
- typename result_of::as_expr_ref<BOOST_PP_CAT(A, I) BOOST_PP_CAT(C, ELEM)&>::type \
+ typename result_of::as_expr_ref<BOOST_PP_CAT(A, I) BOOST_PP_CAT(C, ELEM)&>::type \
         /**/
 
         #define M6(R, _, I, ELEM) \
         BOOST_PP_COMMA_IF(I) \
- result_of::as_expr_ref<BOOST_PP_CAT(A, I) BOOST_PP_CAT(C, ELEM)&>::call(BOOST_PP_CAT(a, I)) \
+ result_of::as_expr_ref<BOOST_PP_CAT(A, I) BOOST_PP_CAT(C, ELEM)&>::call(BOOST_PP_CAT(a, I)) \
         /**/
 
         #define C0

Modified: branches/proto/v3/boost/xpressive/proto/detail/make_expr_ex.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/detail/make_expr_ex.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/detail/make_expr_ex.hpp 2007-12-20 16:07:35 EST (Thu, 20 Dec 2007)
@@ -16,7 +16,7 @@
         typename lazy_disable_if< \
             is_domain<A0> \
           , result_of::make_expr_ref<Tag, BOOST_PP_SEQ_FOR_EACH_I_R(R, M5, ~, PRODUCT)> \
- >::type \
+ >::type const \
         make_expr_ref(BOOST_PP_SEQ_FOR_EACH_I_R(R, M4, ~, PRODUCT)) \
         { \
             return result_of::make_expr_ref<Tag, BOOST_PP_SEQ_FOR_EACH_I_R(R, M5, ~, PRODUCT)> \
@@ -24,7 +24,7 @@
         } \
                                                                                                     \
         template<typename Tag, typename Domain, BOOST_PP_ENUM_PARAMS(SIZE, typename A)> \
- typename result_of::make_expr_ref<Tag, Domain, BOOST_PP_SEQ_FOR_EACH_I_R(R, M5, ~, PRODUCT)>::type\
+ typename result_of::make_expr_ref<Tag, Domain, BOOST_PP_SEQ_FOR_EACH_I_R(R, M5, ~, PRODUCT)>::type const\
         make_expr_ref(BOOST_PP_SEQ_FOR_EACH_I_R(R, M4, ~, PRODUCT)) \
         { \
             return result_of::make_expr_ref<Tag, Domain, BOOST_PP_SEQ_FOR_EACH_I_R(R, M5, ~, PRODUCT)>\
@@ -35,7 +35,7 @@
         typename lazy_disable_if< \
             is_domain<A0> \
           , result_of::make_expr<Tag, BOOST_PP_SEQ_FOR_EACH_I_R(R, M5, ~, PRODUCT)> \
- >::type \
+ >::type const \
         make_expr(BOOST_PP_SEQ_FOR_EACH_I_R(R, M4, ~, PRODUCT)) \
         { \
             return result_of::make_expr<Tag, BOOST_PP_SEQ_FOR_EACH_I_R(R, M5, ~, PRODUCT)> \
@@ -43,7 +43,7 @@
         } \
                                                                                                     \
         template<typename Tag, typename Domain, BOOST_PP_ENUM_PARAMS(SIZE, typename A)> \
- typename result_of::make_expr<Tag, Domain, BOOST_PP_SEQ_FOR_EACH_I_R(R, M5, ~, PRODUCT)>::type\
+ typename result_of::make_expr<Tag, Domain, BOOST_PP_SEQ_FOR_EACH_I_R(R, M5, ~, PRODUCT)>::type const\
         make_expr(BOOST_PP_SEQ_FOR_EACH_I_R(R, M4, ~, PRODUCT)) \
         { \
             return result_of::make_expr<Tag, Domain, BOOST_PP_SEQ_FOR_EACH_I_R(R, M5, ~, PRODUCT)> \

Modified: branches/proto/v3/boost/xpressive/proto/eval.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/eval.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/eval.hpp 2007-12-20 16:07:35 EST (Thu, 20 Dec 2007)
@@ -10,6 +10,7 @@
 #define BOOST_PROTO_EVAL_HPP_EAN_03_29_2007
 
 #include <boost/type_traits.hpp>
+#include <boost/xpressive/proto/proto_fwd.hpp>
 #include <boost/xpressive/proto/detail/define.hpp>
 
 namespace boost { namespace proto
@@ -36,12 +37,28 @@
               : proto::result_of::eval<UNREF(Expr), UNREF(Context)>
             {};
 
+ #ifdef BOOST_HAS_RVALUE_REFS
             template<typename Expr, typename Context>
- typename proto::result_of::eval<UNREF(Expr), UNREF(Context)>::type
- operator ()(Expr &&expr, Context &&context) const
+ typename proto::result_of::eval<Expr, UNREF(Context)>::type
+ operator ()(Expr &expr, Context &&context) const
             {
- return UNREF(Context)::template eval<UNREF(Expr)>()(expr, context);
+ return UNREF(Context)::template eval<Expr>()(expr, context);
             }
+ #else
+ template<typename Expr, typename Context>
+ typename proto::result_of::eval<Expr, Context>::type
+ operator ()(Expr &expr, Context &context) const
+ {
+ return Context::template eval<Expr>()(expr, context);
+ }
+
+ template<typename Expr, typename Context>
+ typename proto::result_of::eval<Expr, Context>::type
+ operator ()(Expr &expr, Context const &context) const
+ {
+ return Context::template eval<Expr>()(expr, context);
+ }
+ #endif
         };
     }
 

Modified: branches/proto/v3/boost/xpressive/proto/expr.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/expr.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/expr.hpp 2007-12-20 16:07:35 EST (Thu, 20 Dec 2007)
@@ -75,7 +75,7 @@
         #if defined(BOOST_HAS_VARIADIC_TMPL) && defined(BOOST_HAS_RVALUE_REFS)
 
             template<typename A>
- expr<tag::assign, args<expr &, typename result_of::as_expr_ref<A>::type> >
+ expr<tag::assign, args<expr &, typename result_of::as_expr_ref<A>::type> > const
             operator=(A &&a)
             {
                 expr<tag::assign, args<expr &, typename result_of::as_expr_ref<A>::type> > that =
@@ -84,7 +84,7 @@
             }
 
             template<typename A>
- expr<tag::assign, args<expr const &, typename result_of::as_expr_ref<A>::type> >
+ expr<tag::assign, args<expr const &, typename result_of::as_expr_ref<A>::type> > const
             operator=(A &&a) const
             {
                 expr<tag::assign, args<expr const &, typename result_of::as_expr_ref<A>::type> > that =
@@ -93,7 +93,7 @@
             }
 
             template<typename A>
- expr<tag::subscript, args<expr &, typename result_of::as_expr_ref<A>::type> >
+ expr<tag::subscript, args<expr &, typename result_of::as_expr_ref<A>::type> > const
             operator[](A &&a)
             {
                 expr<tag::subscript, args<expr &, typename result_of::as_expr_ref<A>::type> > that =
@@ -102,7 +102,7 @@
             }
 
             template<typename A>
- expr<tag::subscript, args<expr const &, typename result_of::as_expr_ref<A>::type> >
+ expr<tag::subscript, args<expr const &, typename result_of::as_expr_ref<A>::type> > const
             operator[](A &&a) const
             {
                 expr<tag::subscript, args<expr const &, typename result_of::as_expr_ref<A>::type> > that =
@@ -111,7 +111,7 @@
             }
 
             template<typename... A>
- expr<tag::function, args<expr &, typename result_of::as_expr_ref<A>::type...> >
+ expr<tag::function, args<expr &, typename result_of::as_expr_ref<A>::type...> > const
             operator()(A &&... a)
             {
                 typedef args<expr &, typename result_of::as_expr_ref<A>::type...> args_type;
@@ -121,7 +121,7 @@
             }
 
             template<typename... A>
- expr<tag::function, args<expr const &, typename result_of::as_expr_ref<A>::type...> >
+ expr<tag::function, args<expr const &, typename result_of::as_expr_ref<A>::type...> > const
             operator()(A &&... a) const
             {
                 typedef args<expr const &, typename result_of::as_expr_ref<A>::type...> args_type;
@@ -133,7 +133,7 @@
         #else
 
             template<typename A>
- expr<tag::assign, args<expr &, typename result_of::as_expr_ref<A &>::type> >
+ expr<tag::assign, args<expr &, typename result_of::as_expr_ref<A &>::type> > const
             operator=(A &a)
             {
                 expr<tag::assign, args<expr &, typename result_of::as_expr_ref<A &>::type> > that =
@@ -142,7 +142,7 @@
             }
 
             template<typename A>
- expr<tag::assign, args<expr const &, typename result_of::as_expr_ref<A &>::type> >
+ expr<tag::assign, args<expr const &, typename result_of::as_expr_ref<A &>::type> > const
             operator=(A &a) const
             {
                 expr<tag::assign, args<expr const &, typename result_of::as_expr_ref<A &>::type> > that =
@@ -151,7 +151,7 @@
             }
 
             template<typename A>
- expr<tag::assign, args<expr &, typename result_of::as_expr_ref<A const &>::type> >
+ expr<tag::assign, args<expr &, typename result_of::as_expr_ref<A const &>::type> > const
             operator=(A const &a)
             {
                 expr<tag::assign, args<expr &, typename result_of::as_expr_ref<A const &>::type> > that =
@@ -160,7 +160,7 @@
             }
 
             template<typename A>
- expr<tag::assign, args<expr const &, typename result_of::as_expr_ref<A const &>::type> >
+ expr<tag::assign, args<expr const &, typename result_of::as_expr_ref<A const &>::type> > const
             operator=(A const &a) const
             {
                 expr<tag::assign, args<expr const &, typename result_of::as_expr_ref<A const &>::type> > that =
@@ -169,7 +169,7 @@
             }
 
             template<typename A>
- expr<tag::subscript, args<expr &, typename result_of::as_expr_ref<A &>::type> >
+ expr<tag::subscript, args<expr &, typename result_of::as_expr_ref<A &>::type> > const
             operator[](A &a)
             {
                 expr<tag::subscript, args<expr &, typename result_of::as_expr_ref<A &>::type> > that =
@@ -178,7 +178,7 @@
             }
 
             template<typename A>
- expr<tag::subscript, args<expr const &, typename result_of::as_expr_ref<A &>::type> >
+ expr<tag::subscript, args<expr const &, typename result_of::as_expr_ref<A &>::type> > const
             operator[](A &a) const
             {
                 expr<tag::subscript, args<expr const &, typename result_of::as_expr_ref<A &>::type> > that =
@@ -187,7 +187,7 @@
             }
 
             template<typename A>
- expr<tag::subscript, args<expr &, typename result_of::as_expr_ref<A const &>::type> >
+ expr<tag::subscript, args<expr &, typename result_of::as_expr_ref<A const &>::type> > const
             operator[](A const &a)
             {
                 expr<tag::subscript, args<expr &, typename result_of::as_expr_ref<A const &>::type> > that =
@@ -196,7 +196,7 @@
             }
 
             template<typename A>
- expr<tag::subscript, args<expr const &, typename result_of::as_expr_ref<A const &>::type> >
+ expr<tag::subscript, args<expr const &, typename result_of::as_expr_ref<A const &>::type> > const
             operator[](A const &a) const
             {
                 expr<tag::subscript, args<expr const &, typename result_of::as_expr_ref<A const &>::type> > that =
@@ -204,14 +204,14 @@
                 return that;
             }
 
- expr<tag::function, args<expr &> >
+ expr<tag::function, args<expr &> > const
             operator()()
             {
                 expr<tag::function, args<expr &> > that = {{*this}};
                 return that;
             }
 
- expr<tag::function, args<expr const &> >
+ expr<tag::function, args<expr const &> > const
             operator()() const
             {
                 expr<tag::function, args<expr const &> > that = {{*this}};

Modified: branches/proto/v3/boost/xpressive/proto/extends.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/extends.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/extends.hpp 2007-12-20 16:07:35 EST (Thu, 20 Dec 2007)
@@ -66,10 +66,10 @@
                 boost::proto::tag::assign \
               , boost::proto::args< \
                     Derived BOOST_PROTO_CONST ## Const & \
- , typename boost::proto::result_of::as_expr_ref<A, Domain>::type \
+ , typename boost::proto::result_of::as_expr_ref<A, Domain>::type \
> \
> \
- >::type \
+ >::type const \
         operator =(A &&a) BOOST_PROTO_CONST ## Const \
         { \
             typedef \
@@ -77,7 +77,7 @@
                     boost::proto::tag::assign \
                   , boost::proto::args< \
                         Derived BOOST_PROTO_CONST ## Const & \
- , typename boost::proto::result_of::as_expr_ref<A, Domain>::type \
+ , typename boost::proto::result_of::as_expr_ref<A, Domain>::type \
> \
> \
             that_type; \
@@ -110,10 +110,10 @@
                 boost::proto::tag::subscript \
               , boost::proto::args< \
                     Derived BOOST_PROTO_CONST ## Const & \
- , typename boost::proto::result_of::as_expr_ref<A, Domain>::type \
+ , typename boost::proto::result_of::as_expr_ref<A, Domain>::type \
> \
> \
- >::type \
+ >::type const \
         operator [](A &&a) BOOST_PROTO_CONST ## Const \
         { \
             typedef \
@@ -121,13 +121,13 @@
                     boost::proto::tag::subscript \
                   , boost::proto::args< \
                         Derived BOOST_PROTO_CONST ## Const & \
- , typename boost::proto::result_of::as_expr_ref<A, Domain>::type \
+ , typename boost::proto::result_of::as_expr_ref<A, Domain>::type \
> \
> \
             that_type; \
             that_type that = { \
                 {*static_cast<Derived BOOST_PROTO_CONST ## Const *>(this) \
- , {boost::proto::result_of::as_expr_ref<A, Domain>::call(a)}} \
+ , {boost::proto::result_of::as_expr_ref<A, Domain>::call(a)}} \
             }; \
             return Domain::make(that); \
         } \
@@ -154,16 +154,16 @@
                 boost::proto::tag::function \
               , boost::proto::args< \
                     Derived BOOST_PROTO_CONST ## Const & \
- , typename boost::proto::result_of::as_expr_ref<A, Domain>::type... \
+ , typename boost::proto::result_of::as_expr_ref<A, Domain>::type... \
> \
> \
- >::type \
+ >::type const \
         operator ()(A &&... a) BOOST_PROTO_CONST ## Const \
         { \
            typedef \
                 boost::proto::args< \
                     Derived BOOST_PROTO_CONST ## Const & \
- , typename boost::proto::result_of::as_expr_ref<A, Domain>::type... \
+ , typename boost::proto::result_of::as_expr_ref<A, Domain>::type... \
> \
             args_type; \
             typedef \
@@ -175,7 +175,7 @@
             that_type that = { \
                 boost::proto::argsns_::make_cons_<typename args_type::cons_type>( \
                     *static_cast<Derived BOOST_PROTO_CONST ## Const *>(this) \
- , boost::proto::result_of::as_expr_ref<A, Domain>::call(a)... \
+ , boost::proto::result_of::as_expr_ref<A, Domain>::call(a)... \
                 ) \
             }; \
             return Domain::make(that); \

Modified: branches/proto/v3/boost/xpressive/proto/literal.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/literal.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/literal.hpp 2007-12-20 16:07:35 EST (Thu, 20 Dec 2007)
@@ -48,7 +48,7 @@
     /// lit
     ///
     template<typename T>
- inline literal<T &> lit(T &t)
+ inline literal<T &> const lit(T &t)
     {
         return literal<T &>(t);
     }
@@ -56,7 +56,7 @@
     /// \overload
     ///
     template<typename T>
- inline literal<T const &> lit(T const &t)
+ inline literal<T const &> const lit(T const &t)
     {
         #ifdef _MSC_VER
         #pragma warning(push)

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-20 16:07:35 EST (Thu, 20 Dec 2007)
@@ -754,7 +754,7 @@
     typename lazy_disable_if<
         is_domain<Sequence>
       , result_of::unpack_expr_ref<Tag, Sequence>
- >::type
+ >::type const
     unpack_expr_ref(Sequence const &sequence)
     {
         return result_of::unpack_expr_ref<Tag, Sequence>::call(sequence);
@@ -763,7 +763,7 @@
     /// \overload
     ///
     template<typename Tag, typename Domain, typename Sequence2>
- typename result_of::unpack_expr_ref<Tag, Domain, Sequence2>::type
+ typename result_of::unpack_expr_ref<Tag, Domain, Sequence2>::type const
     unpack_expr_ref(Sequence2 const &sequence2)
     {
         return result_of::unpack_expr_ref<Tag, Domain, Sequence2>::call(sequence2);
@@ -775,7 +775,7 @@
     typename lazy_disable_if<
         is_domain<Sequence>
       , result_of::unpack_expr<Tag, Sequence>
- >::type
+ >::type const
     unpack_expr(Sequence const &sequence)
     {
         return result_of::unpack_expr<Tag, Sequence>::call(sequence);
@@ -784,7 +784,7 @@
     /// \overload
     ///
     template<typename Tag, typename Domain, typename Sequence2>
- typename result_of::unpack_expr<Tag, Domain, Sequence2>::type
+ typename result_of::unpack_expr<Tag, Domain, Sequence2>::type const
     unpack_expr(Sequence2 const &sequence2)
     {
         return result_of::unpack_expr<Tag, Domain, Sequence2>::call(sequence2);
@@ -797,7 +797,7 @@
     typename lazy_disable_if<
         is_domain<Head>
       , result_of::make_expr_ref<Tag, Head, Tail...>
- >::type
+ >::type const
     make_expr_ref(Head &&head, Tail &&... tail)
     {
         return result_of::make_expr_ref<Tag, Head, Tail...>::call(head, tail...);
@@ -806,7 +806,7 @@
     /// \overload
     ///
     template<typename Tag, typename Domain, typename Head, typename... Tail>
- typename result_of::make_expr_ref<Tag, Domain, Head, Tail...>::type
+ typename result_of::make_expr_ref<Tag, Domain, Head, Tail...>::type const
     make_expr_ref(Head &&head, Tail &&... tail)
     {
         return result_of::make_expr_ref<Tag, Domain, Head, Tail...>::call(head, tail...);
@@ -818,7 +818,7 @@
     typename lazy_disable_if<
         is_domain<Head>
       , result_of::make_expr<Tag, Head, Tail...>
- >::type
+ >::type const
     make_expr(Head &&head, Tail &&... tail)
     {
         return result_of::make_expr<Tag, Head, Tail...>::call(head, tail...);
@@ -827,7 +827,7 @@
     /// \overload
     ///
     template<typename Tag, typename Domain, typename Head, typename... Tail>
- typename result_of::make_expr<Tag, Domain, Head, Tail...>::type
+ typename result_of::make_expr<Tag, Domain, Head, Tail...>::type const
     make_expr(Head &&head, Tail &&... tail)
     {
         return result_of::make_expr<Tag, Domain, Head, Tail...>::call(head, tail...);

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-20 16:07:35 EST (Thu, 20 Dec 2007)
@@ -157,15 +157,15 @@
             true \
           , UNREF(A)::proto_domain \
           , expr<TAG, args< \
- typename result_of::as_expr_ref<A, UNREF(A)::proto_domain>::type \
+ typename result_of::as_expr_ref<A, UNREF(A)::proto_domain>::type \
> > \
- >::type \
+ >::type const \
         operator OP(A &&a BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \
         { \
             typedef UNREF(A)::proto_domain D; \
             expr<TAG, args< \
- typename result_of::as_expr_ref<A, D>::type \
- > > that = {{result_of::as_expr_ref<A, D>::call(a)}}; \
+ typename result_of::as_expr_ref<A, D>::type \
+ > > that = {{result_of::as_expr_ref<A, D>::call(a)}}; \
             return D::make(that); \
         } \
         /**/
@@ -176,19 +176,19 @@
             result_of::is_expr<A>::value || result_of::is_expr<B>::value \
           , typename detail::unify_domain<A, B>::type \
           , expr<TAG, args< \
- typename result_of::as_expr_ref<A, typename detail::unify_domain<A, B>::type>::type \
- , typename result_of::as_expr_ref<B, typename detail::unify_domain<A, B>::type>::type \
+ typename result_of::as_expr_ref<A, typename detail::unify_domain<A, B>::type>::type \
+ , typename result_of::as_expr_ref<B, typename detail::unify_domain<A, B>::type>::type \
> > \
- >::type \
+ >::type const \
         operator OP(A &&a, B &&b) \
         { \
             typedef typename detail::unify_domain<A, B>::type D; \
             expr<TAG, args< \
- typename result_of::as_expr_ref<A, D>::type \
- , typename result_of::as_expr_ref<B, D>::type \
+ typename result_of::as_expr_ref<A, D>::type \
+ , typename result_of::as_expr_ref<B, D>::type \
> > that = { \
- {result_of::as_expr_ref<A, D>::call(a) \
- , {result_of::as_expr_ref<B, D>::call(b)}} \
+ {result_of::as_expr_ref<A, D>::call(a) \
+ , {result_of::as_expr_ref<B, D>::call(b)}} \
             }; \
             return D::make(that); \
         } \
@@ -241,7 +241,7 @@
     #undef BOOST_PROTO_DEFINE_BINARY_OPERATOR
 
         template<typename A, typename B, typename C>
- typename result_of::make_expr_ref<tag::if_else_, A, B, C>::type
+ typename result_of::make_expr_ref<tag::if_else_, A, B, C>::type const
         if_else(A &&a, B &&b, C &&c)
         {
             return result_of::make_expr_ref<tag::if_else_, A, B, C>::call(a, b, c);
@@ -256,7 +256,7 @@
         DOMAIN \
       , TRAIT<BOOST_PROTO_UNCVREF(Arg)>, Arg \
       , typename boost::proto::result_of::make_expr_ref<TAG, DOMAIN, Arg>::type \
- >::type \
+ >::type const \
     operator OP(Arg &&arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \
     { \
         return boost::proto::result_of::make_expr_ref<TAG, DOMAIN, Arg>::call(arg); \

Modified: branches/proto/v3/boost/xpressive/proto/traits.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/traits.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/traits.hpp 2007-12-20 16:07:35 EST (Thu, 20 Dec 2007)
@@ -453,73 +453,73 @@
 
 #ifdef BOOST_HAS_RVALUE_REFS
     template<typename T>
- typename result_of::as_expr<T>::type as_expr(T &&t)
+ typename result_of::as_expr<T>::type const as_expr(T &&t)
     {
         return result_of::as_expr<T>::call(t);
     }
 
     template<typename Domain, typename T>
- typename result_of::as_expr<T, Domain>::type as_expr(T &&t)
+ typename result_of::as_expr<T, Domain>::type const as_expr(T &&t)
     {
         return result_of::as_expr<T, Domain>::call(t);
     }
 
     template<typename T>
- typename result_of::as_expr_ref<T>::type as_expr_ref(T &&t)
+ typename result_of::as_expr_ref<T>::type const as_expr_ref(T &&t)
     {
         return result_of::as_expr_ref<T>::call(t);
     }
 
     template<typename Domain, typename T>
- typename result_of::as_expr_ref<T, Domain>::type as_expr_ref(T &&t)
+ typename result_of::as_expr_ref<T, Domain>::type const as_expr_ref(T &&t)
     {
         return result_of::as_expr_ref<T, Domain>::call(t);
     }
 #else
     template<typename T>
- typename result_of::as_expr<T &>::type as_expr(T &t)
+ typename result_of::as_expr<T &>::type const as_expr(T &t)
     {
         return result_of::as_expr<T &>::call(t);
     }
 
     template<typename Domain, typename T>
- typename result_of::as_expr<T &, Domain>::type as_expr(T &t)
+ typename result_of::as_expr<T &, Domain>::type const as_expr(T &t)
     {
         return result_of::as_expr<T &, Domain>::call(t);
     }
 
     template<typename T>
- typename result_of::as_expr<T const &>::type as_expr(T const &t)
+ typename result_of::as_expr<T const &>::type const as_expr(T const &t)
     {
         return result_of::as_expr<T const &>::call(t);
     }
 
     template<typename Domain, typename T>
- typename result_of::as_expr<T const &, Domain>::type as_expr(T const &t)
+ typename result_of::as_expr<T const &, Domain>::type const as_expr(T const &t)
     {
         return result_of::as_expr<T const &, Domain>::call(t);
     }
 
     template<typename T>
- typename result_of::as_expr_ref<T &>::type as_expr_ref(T &t)
+ typename result_of::as_expr_ref<T &>::type const as_expr_ref(T &t)
     {
         return result_of::as_expr_ref<T &>::call(t);
     }
 
     template<typename Domain, typename T>
- typename result_of::as_expr_ref<T &, Domain>::type as_expr_ref(T &t)
+ typename result_of::as_expr_ref<T &, Domain>::type const as_expr_ref(T &t)
     {
         return result_of::as_expr_ref<T &, Domain>::call(t);
     }
 
     template<typename T>
- typename result_of::as_expr_ref<T const &>::type as_expr_ref(T const &t)
+ typename result_of::as_expr_ref<T const &>::type const as_expr_ref(T const &t)
     {
         return result_of::as_expr_ref<T const &>::call(t);
     }
 
     template<typename Domain, typename T>
- typename result_of::as_expr_ref<T const &, Domain>::type as_expr_ref(T const &t)
+ typename result_of::as_expr_ref<T const &, Domain>::type const as_expr_ref(T const &t)
     {
         return result_of::as_expr_ref<T const &, Domain>::call(t);
     }


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