Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-07-13 11:13:51


Doug Gregor <dgregor_at_[hidden]> writes:

> On Jul 13, 2004, at 5:49 AM, David Abrahams wrote:
>> Synge Todo <wistaria_at_[hidden]> writes:
>> It appears that the old input iterator requirements require that *r++
>> returns value_type instead of a proxy. However, *r++ must be a proxy
>> if the iterator is writable. Since there's no way to detect iterator
>> writability reliably, I'm going to have to make *r++ return value_type
>> whenever the specified iterator category is strictly
>> std::input_iterator_tag.
>>
>> I'll let everyone know when it's checked in
>
> FYI, the operations_test.cpp test of the filesystem lib fails unless
> the return type of *r++ is value_type (where r is a
> directory_iterator). The problematic line is, of course:
>
> BOOST_TEST( (*dir_itr++).leaf() == "d2" );
>
> directory_iterator uses single_pass_traversal_tag, not
> std::input_iterator_tag. Granted, there's a big comment in that same
> block of code (near line 100 of boost/filesystem/operations.hpp) that
> indicates how unsure the author was about proxies :)

Yeah, I decided that we'd only make a writable proxy for *r++ if the
facade's CategoryOrTraversal parameter is convertible to
std::output_iterator_tag. It's the best thing I can think of, since
I expect that building output iterators with iterator_facade is rare.

Tests seem to be passing now; I'll check things in shortly.

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk