Using ++ as a prefix to a statement of access through class member not causing an error
True, postfix increment (a++
) and member access (.
) have the same precedence.
But you're using prefix increment (++a
).
Consult cppreference's precedence chart.
Indeed, test++.at(i)
would error for the reasons you give, though as readers of the code we would not be in any way surprised in that case.