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
Codechange: Replace FOR_ALL_XXX with range-based for loops #7864
Conversation
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.
👍
* @param from index of the first Titem to consider | ||
* @return an iterable ensemble of all valid Titem | ||
*/ | ||
static Pool::IterateWrapper<Titem> Iterate(size_t from = 0) { return Pool::IterateWrapper<Titem>(from); } |
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.
perhaps a specific const variant could be useful as well?
typedef T* pointer; | ||
typedef T& reference; | ||
typedef size_t difference_type; | ||
typedef std::forward_iterator_tag iterator_category; |
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 all seem to be unused? Or are they necessary for the iterator "type" ?
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.
They are necessary if we want to use the iterator in std algorithms like std::distance() or std::count_if().
But they are not needed for range-based for loops.
No description provided.