News for hackers. Stuff that matters.
Re:Swift 3.0 Release Process by jayrhynas on Saturday May 07, 2016 @08:02AM (#11649261)
FYI, a third option is

    mutating func next() -> Element? {
        //...
        defer { pos += 1 }
        return pos
    }
Whether it's better is a matter of opinion
Re:Swift 3.0 Release Process by stevetrewick on Saturday May 07, 2016 @08:14AM (#11649281)
Nice. That's a beautifully idiomatic implementation of the original intent of post increment, if nothing else.
Re:Swift 3.0 Release Process by jayrhynas on Saturday May 07, 2016 @10:56AM (#11649813)
I just realized there's a small typo in the above, it should be

    return data[pos]