-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace boost::filter_iterator
with explicit iterator implementation
#2312
Replace boost::filter_iterator
with explicit iterator implementation
#2312
Conversation
daa8cb8
to
2d2e524
Compare
Filed as internal issue #USD-8056 |
2d2e524
to
465d5db
Compare
465d5db
to
1997562
Compare
const _Owner* _owner; | ||
void filter() | ||
{ | ||
while (_underlyingIterator != _end && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure you have this inverted. According to the boost filter_iterator documentation, the iterator retains the element if the predicate returns true and skips the element if the predicate is false. Here, you're skipping when the predicate is true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was it. All tests are now passing.
|
||
bool operator()(const value_type& x) const | ||
private: | ||
// Skip any iterators that don't satisfy the predicate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These shouldFilter
and filter
functions aren't here for API conformance right? If I'm right, they should follow our coding conventions for private methods, i.e. capitalized and starting with an underscore
using pointer = typename _InnerIterator::pointer; | ||
using difference_type = typename _InnerIterator::difference_type; | ||
|
||
_FilterIterator() = default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The body of all three of these should be on a new line like you did for all the rest of the functions.
1997562
to
bce13c5
Compare
Description of Change(s)
Converts the
_Predicate
private class into an explicit_FilterIterator
bidirectional iterator implementation.Fixes Issue(s)
boost::filter_iterator
usage with fully specified iterator class #2311