2013???????????--???е??????????
???????????? ???????[ 2013/1/18 10:46:21 ] ????????????
??????Derived???????????????е????????????????????????У?
cl Test.cpp /d1reportSingleClassLayoutDerived
?????????????£?
???????????class Derived????????沼??????????????????????????Base???????????????????????????????Derived::$vftable@ ??virtual function table???????а?????Derived???????е??麯????
??????????
?????????С???????????????????????????????????е????????
???????????
class A
{
virtual void a()
{
}
};
class A1
{
virtual void a()
{
}
};
class B : public A ?? virtual public A1
{
};
void main()
{
cout<<"sizeof A: "<<sizeof(A)<<endl;
cout<<"sizeof A1: "<<sizeof(A1)<<endl;
cout<<"sizeof B: "<<sizeof(B)<<endl; //
}
?????????????
??????????????????
cl test.cpp /d1reportSingleClassLayoutB
???????????沼??????????class A??class A1??ClassB???С??????class A???С?????1bytes????漲λ??С?????麯?????4bytes????????麯??????1bytes???λ??????????????A???С??4bytes?????Class A1??????Class B????????class A??class A1?????У???????????B????????????A??A1????????????????????????????A1????vbptr??????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11