[Boost-bugs] [Boost C++ Libraries] #3815: Clearing an iterator range

Subject: [Boost-bugs] [Boost C++ Libraries] #3815: Clearing an iterator range
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-01-04 08:49:43


#3815: Clearing an iterator range
--------------------------+-------------------------------------------------
 Reporter: danieljames | Owner: djowel
     Type: Bugs | Status: new
Milestone: Boost 1.42.0 | Component: spirit
  Version: Boost 1.41.0 | Severity: Problem
 Keywords: |
--------------------------+-------------------------------------------------
 The attached test fails to compile with this error:
 {{{
 ../quickbook-1.5/boost/spirit/home/support/attributes.hpp:710: error:
 'class boost::iterator_range<const char*>' has no member named 'clear'
 }}}
 The problem is that `iterator_range` looks enough like a container so that
 `is_container` returns true, but it doesn't have a `clear` method. The
 attached patch attempts to fix this by adding a special case to clear
 iterator ranges.

 I used a slightly odd method to clear the range, because for some reason
 `begin` is called for the cleared range (this may be a bug) and that's not
 allowed for default constructed ranges (since default constructed
 iterators can be singular).

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3815>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:02 UTC