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.
1.4m articles
1.4m replys
5 comments
57.0k users