Yeah, still getting used to those being in the language.
Type: Posts; User: King Mir
Yeah, still getting used to those being in the language.
A temporary binds to a const reference, never a non-const reference. And a function that returns an iterator creates a temporary. It's also possible to create a temporary with a constructor call or...
In addition to Elysia's example, any time an iterator is created as the return value of a function, that iterator is const, because it's a temporary, and must use the const version of the operator.