How replace position++ code to make it Swift 3 compatible?
<p>I have following class, which has method <code>getNextToken</code> to iterate array items:</p>

<pre><code>class Parser {
    let tokens: [Token]
    var position = 0

    init(tokens: [Token]) {
        self.tokens = tokens
    }

    func getNextToken() -&gt; Token? {
        guard position &lt; tokens.count else {
            return nil
        }
    return tokens[position++]
    }
}
</code></pre>

<p>but i have a warning message from compiler that ++ will be deprecated in Swift 3</p>

<p>How should i rewrite my code to let method return array item at current position and increment position after that?</p>

<p>Standard recommendations to add one more line <code>position +=1</code> doesn't fit here because i am exiting from the scope exactly when i am evaluating <code>tokens[position++]</code></p>