If you only have a single index, that you continue to increment, you don't need an index at all, you just invoke memcpy.
It is useful to distinguish between consuming an element and only jumping to it. So you would have an ptr[i++] for consuming the current token, but not, when you are switching to another token.
A grouping of index and array modification also provides clarity about the intention. It would read very annoying if that constantly would be split into two steps, and also provides more room for error.
It's obvious that you do prefer the stylistic choices Go made, but that doesn't mean everyone does.
>It is useful to distinguish between consuming an element and only jumping to it. So you would have an ptr[i++] for consuming the current token, but not, when you are switching to another token.
So, it's trivial to do it with a function. Or a macro.
Not to mention, iterators and all that jazz.The point is, you don't need assignment to return a value to have this.
Can you give a non-contrived example where you really need it?
>It's obvious that you do prefer the stylistic choices Go made, but that doesn't mean everyone does.
It's not that I "prefer stylistic choices of Go", it's that I hate to have undefined behavior in language spec which is easy to stumble into - the cost of the "stylistic choice" that C made doesn't make that choice justified.