Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82080 - in branches/release: . boost boost/spirit boost/spirit/home boost/spirit/home/qi/stream boost/spirit/home/support libs libs/spirit libs/spirit/test libs/spirit/test/qi
From: hartmut.kaiser_at_[hidden]
Date: 2012-12-18 08:58:39


Author: hkaiser
Date: 2012-12-18 08:58:38 EST (Tue, 18 Dec 2012)
New Revision: 82080
URL: http://svn.boost.org/trac/boost/changeset/82080

Log:
Spirit: Merging from trunk
Added:
   branches/release/libs/spirit/test/qi/regression_stream_eof.cpp
      - copied unchanged from r82078, /trunk/libs/spirit/test/qi/regression_stream_eof.cpp
Properties modified:
   branches/release/ (props changed)
   branches/release/boost/ (props changed)
   branches/release/boost/spirit/ (props changed)
   branches/release/boost/spirit/home/ (props changed)
   branches/release/boost/spirit/home/support/attributes.hpp (contents, props changed)
   branches/release/libs/ (props changed)
   branches/release/libs/spirit/ (props changed)
   branches/release/libs/spirit/test/ (props changed)
Text files modified:
   branches/release/boost/spirit/home/qi/stream/stream.hpp | 9 +++++----
   branches/release/boost/spirit/home/support/attributes.hpp | 16 ++++------------
   branches/release/libs/spirit/test/Jamfile | 1 +
   3 files changed, 10 insertions(+), 16 deletions(-)

Modified: branches/release/boost/spirit/home/qi/stream/stream.hpp
==============================================================================
--- branches/release/boost/spirit/home/qi/stream/stream.hpp (original)
+++ branches/release/boost/spirit/home/qi/stream/stream.hpp 2012-12-18 08:58:38 EST (Tue, 18 Dec 2012)
@@ -65,16 +65,17 @@
 
             qi::skip_over(first, last, skipper);
 
- instream in(first, last); // copies 'first'
- in >> attr; // use existing operator>>()
+ instream in(first, last); // copies 'first'
+ in >> attr_; // use existing operator>>()
 
             // advance the iterator if everything is ok
- if (in.good()) {
+ if (in) {
                 std::streamsize pos = in.tellg();
                 std::advance(first, pos);
+ return true;
             }
 
- return in.good() || in.eof();
+ return false;
         }
 
         template <typename Context>

Modified: branches/release/boost/spirit/home/support/attributes.hpp
==============================================================================
--- branches/release/boost/spirit/home/support/attributes.hpp (original)
+++ branches/release/boost/spirit/home/support/attributes.hpp 2012-12-18 08:58:38 EST (Tue, 18 Dec 2012)
@@ -522,19 +522,13 @@
 
     namespace detail
     {
- struct attribute_size_visitor : static_visitor<>
+ struct attribute_size_visitor : static_visitor<std::size_t>
         {
- attribute_size_visitor(std::size_t& size)
- :size_(size)
- {}
-
             template <typename T>
- void operator()(T const& val) const
+ std::size_t operator()(T const& val) const
             {
- size_ = spirit::traits::size(val);
+ return spirit::traits::size(val);
             }
-
- std::size_t& size_;
         };
     }
 
@@ -545,9 +539,7 @@
 
         static type call(variant<BOOST_VARIANT_ENUM_PARAMS(T)> const& val)
         {
- std::size_t size = 0;
- apply_visitor(detail::attribute_size_visitor(size), val);
- return size;
+ return apply_visitor(detail::attribute_size_visitor(), val);
         }
     };
 

Modified: branches/release/libs/spirit/test/Jamfile
==============================================================================
--- branches/release/libs/spirit/test/Jamfile (original)
+++ branches/release/libs/spirit/test/Jamfile 2012-12-18 08:58:38 EST (Tue, 18 Dec 2012)
@@ -162,6 +162,7 @@
      [ run qi/regression_repeat.cpp : : : : qi_regression_repeat ]
      [ run qi/regression_transform_assignment.cpp : : : : qi_regression_transform_assignment ]
      [ run qi/regression_binary_action.cpp : : : : qi_regression_binary_action ]
+ [ run qi/regression_stream_eof.cpp : : : : qi_regression_stream_eof ]
     ;
 
     ###########################################################################


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