我的一个friend今天早些时候向我发送了以下挑战:Giventhefollowingcode,proposeanimplementationofOBJECT_HAS_VTABLEsotheprogramprintsAnObjecthasavtable=0,AnObjectWithVTablehasavtable=1.classAnObject{intm_a;voidDoSomething(){}public:AnObject(){m_a=0;}};classAnObjectWithVTable{intm_b;virtualvoidDoStuff(){}public:AnObjectW