Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
jayrhynas
on May 7, 2016
|
parent
|
context
|
favorite
| on:
Swift 3.0 Release Process
FYI, a third option is
mutating func next() -> Element? { //... defer { pos += 1 } return pos }
Whether it's better is a matter of opinion
stevetrewick
on May 7, 2016
|
next
[–]
Nice. That's a beautifully idiomatic implementation of the original intent of post increment, if nothing else.
jayrhynas
on May 7, 2016
|
prev
[–]
I just realized there's a small typo in the above, it should be
return data[pos]
Join us for
AI Startup School
this June 16-17 in San Francisco!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: