-
Notifications
You must be signed in to change notification settings - Fork 148
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
Create a all loaded objects of type iterator/function #2406
Comments
This is pattern that shows up a lot, so it's a neat idea indeed. Agreed the version that passes the ID would be better, for the same reason you've stated. |
I would vote for the forEach visitor pattern, we can also return the object id with iterators, just return std::pair instead of the object only, then you can do |
We use the following in a lot of places:
Where cargo is just any particular type. We should make a helper method to handle this such as:
Now this works perfectly fine and would help but should we maybe make an iterator version so we could do:
One thing with the iterator approach i'm not sure how you could get the index. So maybe it doesn't work in our situation. You can't easily go from object -> id.
The text was updated successfully, but these errors were encountered: