??????C++??Ч??
???????????? ???????[ 2012/10/22 10:22:46 ] ????????
??????????????????????C??????????????????????
mangled_name_of_X_StaticFunc();
//obj.StaticFunc();
mangled_name_of_X_StaticFunc();
// ptr- >StaticFunc();
mangled_name_of_X_StaticFunc();
// X::StaticFunc();
????mangled_name_of_X_StaticFunc???????????????X????StaticFunc???????????????Σ?mangled?????????????C++????????????????????mangled???????????????????в????????C++???????й漲????????????mangled??????????????????????????????????????????????C??????????????????Ч???????ж?????????
?????????????????????????з????
X obj; X* ptr = &obj;
obj.NormalFunc();
ptr->NormalFunc();
???????????????????????μ?C??????????????????????
mangled_name_of_X_NormalFunc(&obj);
//obj.NormalFunc();
mangled_name_of_X_NormalFunc(ptr);
// ptr- >NormalFunc();
????????????????????????????????C??????д??????Ч????????????????????????????д????????壬???????const X* this???????????????????????????
?????麯???????????????Щ????????????(??????????????)????????????????????????????????????????????????vptr?????????麯????vtbl??
?????麯??????????????????????????????????????????μ?????
X obj;
X* ptr = &obj; X& ref = obj;
ptr->VirtualFunc();
ref.VirtualFunc();
????????C++?????????????μ??????
( *ptr->vptr??2?? )(ptr);
( *ptr->vptr??2?? )(&ref);
???????е?2???VirtualFunc?????麯??????2????λ????????????麯??????????????C??????????????Ч?????δ?????
??????????????????????????C++?????????Ч???????????C++??????????????????????????????????????C++??????????????????д??????????????????????????????????????????????????????Щ??????????д??Ч??????????????Щ??в?κ????????????????????а??????????????????XX?е?m_strName?????????????????????????????????????????????XX???????????????????????ж????κ?????????????????乹???????????′???????????????????????
XX::XX()
{
// ???????????????????????
1?????????X??????????
2???趨vptr???XX???麯????
3??????String???????????????m_strName
};
??????
???·???
??????????????????
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