Boost logo

Boost Users :

Subject: Re: [Boost-users] [Filesystem] Reverse traversal of boost::filesystem::path::const_iterator?
From: Sebastian Messerschmidt (sebastian.messerschmidt_at_[hidden])
Date: 2012-11-02 08:43:02


Hello Nat,

Bidirectional Iterators and rbegin/rend are not necessarily the same thing.
The bidirectional property only guarantees that the operator-- is
supported [1] additionally to the ++ operator.

[1] http://www.sgi.com/tech/stl/BidirectionalIterator.html

cheers
Sebastian
> On Thu, Nov 1, 2012 at 11:55 AM, Joshua Boyce
> <raptorfactor_at_[hidden]> wrote:
>
>> On Thu, Nov 1, 2012 at 4:07 AM, Nat Linden <nat_at_[hidden]> wrote:
>>> Am I correct? Given the way some containers implement end(), I always
>>> feel nervous about decrementing end(). I'm happy to see that
>>> Boost.Filesystem's own tests guarantee that usage; but is there
>>> anything in the documentation that would have assured me of that?
>> http://www.boost.org/doc/libs/1_49_0/libs/filesystem/v3/doc/reference.html#path-iterators
>>
>> "A path::iterator is a constant iterator satisfying all the requirements
>> of a bidirectional iterator (C++ Std, 24.1.4 Bidirectional iterators
>> [lib.bidirectional.iterators])."
> Until I can dig up a copy of the standard -- pardon me, but this feels
> slightly divergent from the question I'm asking. Does the standard's
> description of "bidirectional iterators" guarantee the operations
> legal on the value returned by a container's end() method?
>
> The only operation I feel confident assuming on a value returned by a
> container's end() method is [in]equality comparison with another
> iterator value.
>
> (Of course, this discussion would be moot if boost::filesystem::path
> supported rbegin() and rend() methods... hint, hint...)
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net