[PATCH] D45792: [ADT] Teach reverse() about filter_iterator ranges

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 19 14:18:37 PDT 2018


+1 - I'd rather not have a special case for filter+reverse if we can help
it. If filter can be made bidi so it "just works" without reverse knowing
anything about it, that seems better.

On Thu, Apr 19, 2018 at 2:10 PM Zachary Turner via Phabricator <
reviews at reviews.llvm.org> wrote:

> zturner added a comment.
>
> In https://reviews.llvm.org/D45792#1072601, @timshen wrote:
>
> > My understanding is that, the reason why
> reverse_iterator<filter_iterator<I, F>> doesn't "just work" is because
> filter_iterator<I> is only a forward_iterator, while reverse_iterator
> expects a bidirectional_iterator. Can we make filter_iterator bidirectional
> instead?
>
>
> Yea it seems like `filter_iterator` should be bidirectional if and only if
> the underlying range is bidirectional.
>
>
> https://reviews.llvm.org/D45792
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180419/f9f48523/attachment.html>


More information about the llvm-commits mailing list