Skip to content
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

Add proxy/iterator to iterate groups in order. #459

Closed
wants to merge 1 commit into from

Conversation

rpavlik
Copy link
Contributor

@rpavlik rpavlik commented Aug 20, 2019

Simplifies an idiom seen all over the codebase, of iterating
thru groupOrder then using it to look up a group.

Simplifies an idiom seen all over the codebase, of iterating
thru groupOrder then using it to look up a group.
}
bool operator!=(OrderedGroupsIterator const &other) const { return !((*this) == other); }

private:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really use C++ visibility.

};


class OrderedGroupsProxy {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any way to simplify this? Returning a pair or something. As it is I feel like this patch adds more complexity than it removes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, +70 lines -27 lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish there was - but ranges haven't made it into the standard yet. (Maybe c++20?)

No hard feelings, I can close this. Just had it sitting around here.

@rpavlik rpavlik closed this Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants