auto a = 10;
When compiler knows a is int, at compile time or at run-time? If it deduce type at run-time, will it not affect performance?
a
int
Thanks
Compile time. In C++, runtime type information is stripped during compilation(without RTTI or virtual inheritance). It is not possible, in fact, to inspect the primitive type at runtime.
2.1m questions
2.1m answers
60 comments
57.0k users