Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3815 closed Bugs (fixed)

Clearing an iterator range

Reported by: Daniel James Owned by: Joel de Guzman
Milestone: Boost 1.42.0 Component: spirit
Version: Boost 1.41.0 Severity: Problem
Keywords: Cc:

Description

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).

Attachments (2)

test.cpp (787 bytes ) - added by Daniel James 13 years ago.
clear.patch (834 bytes ) - added by Daniel James 13 years ago.

Download all attachments as: .zip

Change History (4)

by Daniel James, 13 years ago

Attachment: test.cpp added

by Daniel James, 13 years ago

Attachment: clear.patch added

comment:1 by Hartmut Kaiser, 13 years ago

Resolution: fixed
Status: newclosed

(In [59929]) Spirit: fixed #3815 (Clearing an iterator range)

comment:2 by Hartmut Kaiser, 13 years ago

(In [59930]) Spirit: fixed #3815 (Clearing an iterator range), added test

Note: See TracTickets for help on using tickets.