Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68374 - trunk/boost/spirit/home/phoenix/core
From: joel_at_[hidden]
Date: 2011-01-22 18:08:14


Author: djowel
Date: 2011-01-22 18:08:10 EST (Sat, 22 Jan 2011)
New Revision: 68374
URL: http://svn.boost.org/trac/boost/changeset/68374

Log:
Added default construction of values + assignment operator for actors.
Text files modified:
   trunk/boost/spirit/home/phoenix/core/actor.hpp | 12 ++++++++++++
   trunk/boost/spirit/home/phoenix/core/value.hpp | 13 ++++++++-----
   2 files changed, 20 insertions(+), 5 deletions(-)

Modified: trunk/boost/spirit/home/phoenix/core/actor.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/core/actor.hpp (original)
+++ trunk/boost/spirit/home/phoenix/core/actor.hpp 2011-01-22 18:08:10 EST (Sat, 22 Jan 2011)
@@ -86,6 +86,18 @@
>::type
         nullary_result;
 
+ actor& operator=(actor const& rhs)
+ {
+ Base::operator=(rhs);
+ return *this;
+ }
+
+ actor& operator=(actor& rhs)
+ {
+ Base::operator=(rhs);
+ return *this;
+ }
+
         nullary_result
         operator()() const
         {

Modified: trunk/boost/spirit/home/phoenix/core/value.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/core/value.hpp (original)
+++ trunk/boost/spirit/home/phoenix/core/value.hpp 2011-01-22 18:08:10 EST (Sat, 22 Jan 2011)
@@ -1,7 +1,7 @@
 /*=============================================================================
     Copyright (c) 2001-2007 Joel de Guzman
 
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 ==============================================================================*/
 #ifndef PHOENIX_CORE_VALUE_HPP
@@ -44,7 +44,7 @@
     }
 
     template <typename T>
- struct value
+ struct value
     {
         BOOST_STATIC_ASSERT(
             mpl::not_<is_reference<T> >::value != 0);
@@ -57,6 +57,9 @@
             typedef T type;
         };
 
+ value()
+ : val() {}
+
         value(T const& arg)
             : val(arg) {}
 
@@ -71,14 +74,14 @@
     };
 
     template <typename Actor>
- struct actor_value
+ struct actor_value
     {
         typedef typename Actor::no_nullary no_nullary;
 
         template <typename Env>
         struct result
         {
- typedef typename
+ typedef typename
                 remove_reference<
                     typename eval_result<Actor, Env>::type
>::type
@@ -124,7 +127,7 @@
         }
     };
 
- // Sometimes it is necessary to auto-convert references to
+ // Sometimes it is necessary to auto-convert references to
     // a value<T>. This happens when we are re-currying. This
     // cannot happen through the standard public actor interfaces.
     template <typename 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