问题描述
有一个g ++等价于Visual Studio的 __ declspec(novtable)
参数?
Is there a g++ equivalent to Visual Studio's __declspec(novtable)
argument?
基本上,在一个纯虚拟基类中, __ declspec(novtable)
参数可以用来抑制一个用于基类的vtable以及在构造函数/析构函数中的vtable初始化/反初始化代码。例如,
Basically, in a pure virtual base class the __declspec(novtable)
argument can be used to suppress the creation of a vtable for the base class as well as vtable initialization/deinitialization code in the contstructor/destructor respectively. E.g.,
class __declspec(novtable) PureVirtualBaseClass
{
public:
PureVirtualBaseClass(){}
virtual ~PureVirtualBaseClass() = 0;
};
查看了解更多信息。另请参阅我的相关。 GCC使用类型属性为类型添加额外的注释(如对齐和填充),但没有类型属性等效于 __ declspc(novtable)
。
I don't think there is one -- if there was, it would be listed under the type attributes page of the GCC manual. GCC uses type attributes to add extra annotations to types (such as alignment and padding), but there is no type attribute equivalent to __declspc(novtable)
listed there.
我在。
这篇关于有一个g ++等价于Visual Studio的__declspec(novtable)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!