Skip to content

Commit

Permalink
[ADT] fix postfix filter_iterator_impl::operator++
Browse files Browse the repository at this point in the history
  • Loading branch information
abrachet committed Jul 7, 2023
1 parent 5e9ab9c commit 1882a4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/include/llvm/ADT/STLExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,9 @@ class filter_iterator_impl<WrappedIteratorT, PredicateT,
}

filter_iterator_impl &operator++(int) {
filter_iterator_impl &old = *this;
BaseT::operator++();
return *this;
return old;

This comment has been minimized.

Copy link
@s-barannikov

s-barannikov Jul 7, 2023

Contributor

This returns the new value because old is a reference.
It would be better if this series of changes was properly reviewed or at least had decent commit message...

}

filter_iterator_impl &operator--() {
Expand Down

0 comments on commit 1882a4e

Please sign in to comment.