C++ 11 auto compile time or runtime?

后端 未结 4 849
暖寄归人
暖寄归人 2020-12-02 18:48
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 aff

4条回答
  •  猫巷女王i
    2020-12-02 19:32

    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.

提交回复
热议问题