Quick Q: C++11 auto declaration with and without pointer declarator
Quick A: they are the same
Recently on SO:
Quick Q: C++11 auto declaration with and without pointer declarator
The declarations are exactly equivalent.
auto
works (almost) the same as template type deduction. Putting the star explicitly makes the code a bit easier to read, and makes the programmer aware thatbar2
is a pointer.