__declspec(novtable)
Go Up to Keywords, Alphabetical Listing Index
Category
Modifiers (C++), Keyword Extensions, Storage Class Specifiers (C++)
Syntax
__declspec( novtable ) declarator
This form of _declspec can be applied to any class declaration, but should only be applied to pure interface classes, that is classes that will never be instantiated on their own. _declspec stops the compiler from generating code to initialize the vfptr in the constructor(s) and destructor of the class. In many cases, this removes the only references to the vtable that are associated with the class and, thus, the linker will remove it. Using this form of _declspec can result in a significant reduction in code size.