Given string foo
, when I call:
auto bar = foo.begin();
There are 2 overloads of string::begin
. One returns an string::iterator
and the other returns a string::const_iterator
. How can I know the type of bar
? Is this just based on whether foo
is const
or not?