-
Notifications
You must be signed in to change notification settings - Fork 250
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
Please update Collection example in README.md #1
Comments
@janckerchen Thank you for the feedback. Doc has been updated. The Iter class had been deprecated for a while, as I found a new trick to implement a foreach macro. Do check out the foreach macro, it works just as you wanted. It is generally not recommended to do insertion while in iteration. The iterator will be invalidated due to size change. A temporary solution might be:
I know this is verbose but this is currently the only safe way to do what you want. |
I just found a
|
Use public insert of ArrayList. You use insertion position by index, not by element reference. |
If I just wanna find something then break in iteration, |
Normally macros should be upper case, but I want Yes, the foreach macro can not handle exceptional control flow where |
ok, I will open new issue, thanks to your effort. |
The doc looks outdated, I checked the codebase, there is no Iter<T> at all.
I wan to iterate the list and find the target node, and insert a new T before the target node. maybe like this
The text was updated successfully, but these errors were encountered: