Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56302 - in trunk/boost: proto xpressive xpressive/detail/static/transforms
From: eric_at_[hidden]
Date: 2009-09-18 16:22:48


Author: eric_niebler
Date: 2009-09-18 16:22:47 EDT (Fri, 18 Sep 2009)
New Revision: 56302
URL: http://svn.boost.org/trac/boost/changeset/56302

Log:
xpressive passes its tests on gcc under c++0x mode
Text files modified:
   trunk/boost/proto/deep_copy.hpp | 51 +++++++++++++++++++++++++++++----------
   trunk/boost/proto/proto_fwd.hpp | 2
   trunk/boost/xpressive/detail/static/transforms/as_action.hpp | 2
   trunk/boost/xpressive/regex_actions.hpp | 5 +--
   4 files changed, 42 insertions(+), 18 deletions(-)

Modified: trunk/boost/proto/deep_copy.hpp
==============================================================================
--- trunk/boost/proto/deep_copy.hpp (original)
+++ trunk/boost/proto/deep_copy.hpp 2009-09-18 16:22:47 EDT (Fri, 18 Sep 2009)
@@ -32,6 +32,7 @@
             struct deep_copy_impl<Expr, 0>
             {
                 typedef BOOST_PROTO_UNCVREF(typename Expr::proto_child0) raw_terminal_type;
+
                 // can't store a function type in a terminal.
                 typedef
                     typename mpl::if_c<
@@ -40,12 +41,13 @@
                       , raw_terminal_type
>::type
                 actual_terminal_type;
+
                 typedef typename terminal<actual_terminal_type>::type expr_type;
                 typedef typename Expr::proto_domain proto_domain;
- typedef typename proto_domain::template result<proto_domain(expr_type)>::type type;
+ typedef typename proto_domain::template result<proto_domain(expr_type)>::type result_type;
 
- template<typename Expr2>
- static type call(Expr2 const &e)
+ template<typename Expr2, typename S, typename D>
+ result_type operator()(Expr2 const &e, S const &, D const &) const
                 {
                     return typename Expr::proto_domain()(expr_type::make(e.proto_base().child0));
                 }
@@ -68,7 +70,7 @@
                 typedef
                     typename detail::deep_copy_impl<
                         BOOST_PROTO_UNCVREF(Expr)
- >::type
+ >::result_type
                 type;
             };
         }
@@ -98,7 +100,9 @@
                 struct result<This(Expr)>
                 {
                     typedef
- typename result_of::deep_copy<Expr>::type
+ typename detail::deep_copy_impl<
+ BOOST_PROTO_UNCVREF(Expr)
+ >::result_type
                     type;
                 };
 
@@ -109,7 +113,7 @@
                 typename result_of::deep_copy<Expr>::type
                 operator()(Expr const &e) const
                 {
- return proto::detail::deep_copy_impl<Expr>::call(e);
+ return proto::detail::deep_copy_impl<Expr>()(e, 0, 0);
                 }
             };
         }
@@ -122,17 +126,38 @@
         /// all internal nodes and most terminals held by reference
         /// are instead held by value.
         ///
- /// \attention Terminals of reference-to-array type and of
- /// reference-to-function type are left unchanged.
+ /// \attention Terminals of reference-to-function type are
+ /// left unchanged.
         ///
         /// \sa proto::functional::deep_copy.
         template<typename Expr>
         typename proto::result_of::deep_copy<Expr>::type
         deep_copy(Expr const &e)
         {
- return proto::detail::deep_copy_impl<Expr>::call(e);
+ return proto::detail::deep_copy_impl<Expr>()(e, 0, 0);
         }
 
+ /// \brief A PrimitiveTransform for deep-copying
+ /// Proto expression trees.
+ ///
+ /// A PrimitiveTransform for deep-copying
+ /// Proto expression trees. When a tree is deep-copied,
+ /// all internal nodes and most terminals held by reference
+ /// are instead held by value.
+ ///
+ /// \attention Terminals of reference-to-function type are
+ /// left unchanged.
+ ///
+ /// \sa proto::functional::deep_copy.
+ struct _deep_copy
+ : proto::transform<_deep_copy>
+ {
+ template<typename E, typename S, typename D>
+ struct impl
+ : detail::deep_copy_impl<BOOST_PROTO_UNCVREF(E)>
+ {};
+ };
+
         namespace detail
         {
         #define BOOST_PROTO_DEFINE_DEEP_COPY_TYPE(Z, N, DATA) \
@@ -140,7 +165,7 @@
                 typename remove_reference< \
                   typename Expr::BOOST_PP_CAT(proto_child, N) \
>::type::proto_derived_expr \
- >::type \
+ >::result_type \
             /**/
 
         #define BOOST_PROTO_DEFINE_DEEP_COPY_FUN(Z, N, DATA) \
@@ -176,10 +201,10 @@
                 expr_type;
 
                 typedef typename Expr::proto_domain proto_domain;
- typedef typename proto_domain::template result<proto_domain(expr_type)>::type type;
+ typedef typename proto_domain::template result<proto_domain(expr_type)>::type result_type;
 
- template<typename Expr2>
- static type call(Expr2 const &e)
+ template<typename Expr2, typename S, typename D>
+ result_type operator()(Expr2 const &e, S const &, D const &) const
                 {
                     expr_type that = {
                         BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_DEEP_COPY_FUN, ~)

Modified: trunk/boost/proto/proto_fwd.hpp
==============================================================================
--- trunk/boost/proto/proto_fwd.hpp (original)
+++ trunk/boost/proto/proto_fwd.hpp 2009-09-18 16:22:47 EDT (Fri, 18 Sep 2009)
@@ -640,7 +640,7 @@
     typedef functional::pop_front _pop_front;
     typedef functional::reverse _reverse;
     typedef functional::eval _eval;
- typedef functional::deep_copy _deep_copy;
+ struct _deep_copy;
 
     typedef functional::make_expr<tag::terminal> _make_terminal;
     typedef functional::make_expr<tag::unary_plus> _make_unary_plus;

Modified: trunk/boost/xpressive/detail/static/transforms/as_action.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/transforms/as_action.hpp (original)
+++ trunk/boost/xpressive/detail/static/transforms/as_action.hpp 2009-09-18 16:22:47 EDT (Fri, 18 Sep 2009)
@@ -113,7 +113,7 @@
     struct DeepCopy
       : or_<
             when< terminal<detail::attribute_placeholder<_> >, as_read_attr>
- , when< terminal<_>, proto::_deep_copy(_)>
+ , when< terminal<_>, proto::_deep_copy>
           , otherwise< nary_expr<_, vararg<DeepCopy> > >
>
     {};

Modified: trunk/boost/xpressive/regex_actions.hpp
==============================================================================
--- trunk/boost/xpressive/regex_actions.hpp (original)
+++ trunk/boost/xpressive/regex_actions.hpp 2009-09-18 16:22:47 EDT (Fri, 18 Sep 2009)
@@ -20,6 +20,7 @@
 #include <boost/mpl/if.hpp>
 #include <boost/mpl/or.hpp>
 #include <boost/mpl/int.hpp>
+#include <boost/noncopyable.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/throw_exception.hpp>
 #include <boost/utility/enable_if.hpp>
@@ -80,6 +81,7 @@
 
         template<typename T>
         struct value_wrapper
+ : private noncopyable
         {
             value_wrapper()
               : value()
@@ -743,9 +745,6 @@
         {
             return proto::value(*this);
         }
-
- private:
- local(local const &);
     };
 
     /// as (a.k.a., lexical_cast)


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