Does using __declspec(novtable) on abstract base classes affect RTTI in any way?
问题 Or, are there any other known negative affects of employing __declspec(novtable)? I can't seem to find references to any issues. 回答1: MSCV uses one vptr per object and one vtbl per class to implement OO mechanism such as RTTI and virtual functions. So RTTI and virtual functions will work fine if and only if the vptr has been set correctly. struct __declspec(novtable) B { virtual void f() = 0; }; struct D1 : B { D1() { } // after the construction of D1, vptr will be set to vtbl of D1. }; D1 d1