|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-08-22 20:16:11
Beman Dawes <bdawes_at_[hidden]> writes:
> At 05:17 PM 8/22/2004, David Abrahams wrote:
> >Beman Dawes <bdawes_at_[hidden]> writes:
> >
> >> What is weird is that even though the single_pass_traversal_tag is
> >> given, the path_test.cpp regression test uses operator-- in tests,
> >> and they compile fine.
> >>
> >> So it looks like there is also a bug in iterator adaptors too, since
> >> I would think that the use of operator-- on a single pass iterator
> >> should fail.
> >
> >It's not a bug to provide more functionality than the category
> >allows. If you supply a decrement() operation, operator-- will call
> >it.
>
> OK. Thanks for the clarification.
>
> I guess that means the filesystem test needs an additional case that
> would work for a bidirectional iterator but fail for a single pass
> traversal iterator which supplies a decrement() operator. Any
> suggestions?
Try any std:: algorithm that requires forward iterators but is faster
with random access iterators. binary_search comes to mind.
>
> --Beman
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>
-- 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