Boost C++ Libraries: Ticket #3815: Clearing an iterator range https://svn.boost.org/trac10/ticket/3815 <p> The attached test fails to compile with this error: </p> <pre class="wiki">../quickbook-1.5/boost/spirit/home/support/attributes.hpp:710: error: 'class boost::iterator_range&lt;const char*&gt;' has no member named 'clear' </pre><p> The problem is that <code>iterator_range</code> looks enough like a container so that <code>is_container</code> returns true, but it doesn't have a <code>clear</code> method. The attached patch attempts to fix this by adding a special case to clear iterator ranges. </p> <p> I used a slightly odd method to clear the range, because for some reason <code>begin</code> 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). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3815 Trac 1.4.3 Daniel James Mon, 04 Jan 2010 08:50:28 GMT attachment set https://svn.boost.org/trac10/ticket/3815 https://svn.boost.org/trac10/ticket/3815 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test.cpp</span> </li> </ul> Ticket Daniel James Mon, 04 Jan 2010 08:51:08 GMT attachment set https://svn.boost.org/trac10/ticket/3815 https://svn.boost.org/trac10/ticket/3815 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">clear.patch</span> </li> </ul> Ticket Hartmut Kaiser Fri, 26 Feb 2010 01:12:25 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3815#comment:1 https://svn.boost.org/trac10/ticket/3815#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/59929" title="Spirit: fixed #3815 (Clearing an iterator range) ">[59929]</a>) Spirit: fixed <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3815" title="#3815: Bugs: Clearing an iterator range (closed: fixed)">#3815</a> (Clearing an iterator range) </p> Ticket Hartmut Kaiser Fri, 26 Feb 2010 01:13:30 GMT <link>https://svn.boost.org/trac10/ticket/3815#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3815#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/59930" title="Spirit: fixed #3815 (Clearing an iterator range), added test">[59930]</a>) Spirit: fixed <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3815" title="#3815: Bugs: Clearing an iterator range (closed: fixed)">#3815</a> (Clearing an iterator range), added test </p> </description> <category>Ticket</category> </item> </channel> </rss>