I was recently wondering why the keyword auto was chosen in C++11 to mark a variable whose type must be inferred by the compiler, like in
auto x = 1; Since
varseems more common in other programming languages (e.g. C#, Scala, JavaScript), and- AFAIAs far as I understand the new semantics of
autobreaks backward compatibility (it was rarely used but had a different meaning in previous revisions of C++, see e.g. here)
I wanted to ask if there was a special reason for choosing auto (in favour of var or any other keyword). Was there any specific discussion about this issue before the C++11 standard was released?
Also, are there any possible incompatibilities we should watch out for when recompiling legacy C++ code with a C++11 compiler?