标准C ++,没有vtable [英] standard C++ and no vtable
问题描述
是否有一个标准的C ++机制,可以有效地呈现
is there a standard C++ mechanism that effectively renders
__declspec(novtable)
已过时?
https://dbj.org
obsolete?
https://dbj.org
推荐答案
感谢您在此处发布。
>>标准C ++且无vtable
请提供有关您的问题的更多信息。你是什么意思 过时了?它仍然可以在vs2017中使用。
Please provide more information about your question. What do you mean obsolete? It still could be using in vs2017.
有关novtable的更多信息,您可以参考下面的这个文档。
For more information about novtable, you could refer to this document below.
https://msdn.microsoft.com/en-us/library/k13k85ky.aspx?f= 255& MSPPError = -2147217396
据我所知,ATL有一个名为ATL_NO_VTABLE的符号,它阻止vtable指针在类的构造函数和析构函数中初始化。 如果阻止在类的构造函数
和析构函数中初始化vtable指针,则链接器可以消除vtable及其指向的所有函数。扩展为__declspec(novtable)。
As far as I know, ATL has a symbol called ATL_NO_VTABLE which prevents the vtable pointer from being initialized in the class's constructor and destructor. If the vtable pointer is prevented from being initialized in the class's constructor and destructor, the linker can eliminate the vtable and all of the functions to which it points. Expands to __declspec(novtable).
希望这可以帮到你。
最好的问候,
Baron Bi
这篇关于标准C ++,没有vtable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!