Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50185 - in trunk/boost/proto: . transform
From: eric_at_[hidden]
Date: 2008-12-07 21:06:59


Author: eric_niebler
Date: 2008-12-07 21:06:58 EST (Sun, 07 Dec 2008)
New Revision: 50185
URL: http://svn.boost.org/trac/boost/changeset/50185

Log:
temporary hack to make proto work with C++0x
Text files modified:
   trunk/boost/proto/expr.hpp | 2 +-
   trunk/boost/proto/extends.hpp | 2 +-
   trunk/boost/proto/generate.hpp | 9 ++++++++-
   trunk/boost/proto/matches.hpp | 15 +++++++++++++--
   trunk/boost/proto/traits.hpp | 7 ++++++-
   trunk/boost/proto/transform/arg.hpp | 29 ++++++++++++++++++++++++++---
   trunk/boost/proto/transform/pass_through.hpp | 7 ++++++-
   7 files changed, 61 insertions(+), 10 deletions(-)

Modified: trunk/boost/proto/expr.hpp
==============================================================================
--- trunk/boost/proto/expr.hpp (original)
+++ trunk/boost/proto/expr.hpp 2008-12-07 21:06:58 EST (Sun, 07 Dec 2008)
@@ -409,7 +409,7 @@
             template<typename Sig>
             struct result
             {
- typedef typename result_of::funop<Sig, expr, default_domain>::type type;
+ typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
             };
 
             /// Function call

Modified: trunk/boost/proto/extends.hpp
==============================================================================
--- trunk/boost/proto/extends.hpp (original)
+++ trunk/boost/proto/extends.hpp 2008-12-07 21:06:58 EST (Sun, 07 Dec 2008)
@@ -344,7 +344,7 @@
                           , proto_domain \
>::type \
                     ) \
- >::type \
+ >::type const \
             type; \
         }; \
         /**/

Modified: trunk/boost/proto/generate.hpp
==============================================================================
--- trunk/boost/proto/generate.hpp (original)
+++ trunk/boost/proto/generate.hpp 2008-12-07 21:06:58 EST (Sun, 07 Dec 2008)
@@ -12,6 +12,8 @@
     #define BOOST_PROTO_GENERATE_HPP_EAN_02_13_2007
 
     #include <boost/proto/detail/prefix.hpp>
+ #include <boost/config.hpp>
+ #include <boost/utility/result_of.hpp>
     #include <boost/preprocessor/cat.hpp>
     #include <boost/preprocessor/iteration/iterate.hpp>
     #include <boost/preprocessor/repetition/enum.hpp>
@@ -98,7 +100,12 @@
             /// \param expr A Proto expression
             /// \return expr
             template<typename Expr>
- Expr const &operator ()(Expr const &expr) const
+ #ifdef BOOST_HAS_DECLTYPE
+ Expr
+ #else
+ Expr const &
+ #endif
+ operator ()(Expr const &expr) const
             {
                 return expr;
             }

Modified: trunk/boost/proto/matches.hpp
==============================================================================
--- trunk/boost/proto/matches.hpp (original)
+++ trunk/boost/proto/matches.hpp 2008-12-07 21:06:58 EST (Sun, 07 Dec 2008)
@@ -12,6 +12,7 @@
     #define BOOST_PROTO_MATCHES_HPP_EAN_11_03_2006
 
     #include <boost/proto/detail/prefix.hpp> // must be first include
+ #include <boost/config.hpp>
     #include <boost/detail/workaround.hpp>
     #include <boost/preprocessor/cat.hpp>
     #include <boost/preprocessor/arithmetic/dec.hpp>
@@ -538,7 +539,12 @@
 
                     /// \param expr An expression
                     /// \return \c e
- typename impl::expr_param operator()(
+ #ifdef BOOST_HAS_DECLTYPE
+ result_type
+ #else
+ typename impl::expr_param
+ #endif
+ operator()(
                         typename impl::expr_param e
                       , typename impl::state_param
                       , typename impl::data_param
@@ -573,7 +579,12 @@
                     /// \param e An expression
                     /// \pre <tt>matches\<Expr,not_\>::::value</tt> is \c true.
                     /// \return \c e
- typename impl::expr_param operator()(
+ #ifdef BOOST_HAS_DECLTYPE
+ result_type
+ #else
+ typename impl::expr_param
+ #endif
+ operator()(
                         typename impl::expr_param e
                       , typename impl::state_param
                       , typename impl::data_param

Modified: trunk/boost/proto/traits.hpp
==============================================================================
--- trunk/boost/proto/traits.hpp (original)
+++ trunk/boost/proto/traits.hpp 2008-12-07 21:06:58 EST (Sun, 07 Dec 2008)
@@ -543,7 +543,12 @@
                     /// \pre <tt>matches\<Expr, terminal\<T\> \>::::value</tt> is \c true.
                     /// \return \c e
                     /// \throw nothrow
- typename impl::expr_param operator ()(
+ #ifdef BOOST_HAS_DECLTYPE
+ result_type
+ #else
+ typename impl::expr_param
+ #endif
+ operator ()(
                         typename impl::expr_param e
                       , typename impl::state_param
                       , typename impl::data_param

Modified: trunk/boost/proto/transform/arg.hpp
==============================================================================
--- trunk/boost/proto/transform/arg.hpp (original)
+++ trunk/boost/proto/transform/arg.hpp 2008-12-07 21:06:58 EST (Sun, 07 Dec 2008)
@@ -39,7 +39,12 @@
             /// \param e The current expression.
             /// \return \c e
             /// \throw nothrow
- typename impl::expr_param operator()(
+ #ifdef BOOST_HAS_DECLTYPE
+ result_type
+ #else
+ typename impl::expr_param
+ #endif
+ operator()(
                 typename impl::expr_param e
               , typename impl::state_param
               , typename impl::data_param
@@ -71,7 +76,12 @@
             /// \param s The current state.
             /// \return \c s
             /// \throw nothrow
- typename impl::state_param operator ()(
+ #ifdef BOOST_HAS_DECLTYPE
+ result_type
+ #else
+ typename impl::state_param
+ #endif
+ operator ()(
                 typename impl::expr_param
               , typename impl::state_param s
               , typename impl::data_param
@@ -104,7 +114,12 @@
             /// \param d The current data.
             /// \return \c d
             /// \throw nothrow
- typename impl::data_param operator ()(
+ #ifdef BOOST_HAS_DECLTYPE
+ result_type
+ #else
+ typename impl::data_param
+ #endif
+ operator ()(
                 typename impl::expr_param
               , typename impl::state_param
               , typename impl::data_param d
@@ -140,7 +155,11 @@
             /// \param e The current expression.
             /// \return <tt>proto::child_c\<N\>(e)</tt>
             /// \throw nothrow
+ #ifdef BOOST_HAS_DECLTYPE
+ result_type
+ #else
             typename result_of::child_c<typename impl::expr_param, N>::type
+ #endif
             operator ()(
                 typename impl::expr_param e
               , typename impl::state_param
@@ -176,7 +195,11 @@
             /// \param e The current expression.
             /// \return <tt>proto::value(e)</tt>
             /// \throw nothrow
+ #ifdef BOOST_HAS_DECLTYPE
+ result_type
+ #else
             typename result_of::value<typename impl::expr_param>::type
+ #endif
             operator ()(
                 typename impl::expr_param e
               , typename impl::state_param

Modified: trunk/boost/proto/transform/pass_through.hpp
==============================================================================
--- trunk/boost/proto/transform/pass_through.hpp (original)
+++ trunk/boost/proto/transform/pass_through.hpp 2008-12-07 21:06:58 EST (Sun, 07 Dec 2008)
@@ -69,7 +69,12 @@
                 /// \param e An expression
                 /// \return \c e
                 /// \throw nothrow
- typename pass_through_impl::expr_param operator()(
+ #ifdef BOOST_HAS_DECLTYPE
+ result_type
+ #else
+ typename pass_through_impl::expr_param
+ #endif
+ operator()(
                     typename pass_through_impl::expr_param e
                   , typename pass_through_impl::state_param
                   , typename pass_through_impl::data_param


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