Does every object of virtual class have a pointer to vtable?

后端 未结 9 922
借酒劲吻你
借酒劲吻你 2020-12-14 10:54

Does every object of virtual class have a pointer to vtable?

Or only the object of base class with virtual function has it?

Where did the vtable stored? code

9条回答
  •  我在风中等你
    2020-12-14 11:37

    All virtual classes usually have a vtable, but it is not required by the C++ standard and the storage method is dependent upon the compiler.

提交回复
热议问题