C++???????????????Mereology??
???????????? ???????[ 2014/9/30 11:21:20 ] ????????C++ ???? NET
????Stroustrup ?????????????????????? Kierkegaard (?????????????????????????????? Stroustrup ???椋�???????????????????????????????C++??????????C++????????写????????????????????芯????????? ?????? ?????????C++????? Stroustrup ?????
?????谢??????????C++????????????????C++??????????????????卸??????????????????????????????????C++?????????????????????C++?????????????????????????????????????????????????C++?????
?????????????????
????C++?????“未???”????
????C++???????????????????????scope?????????????
?????娲�?????storage class??
????????危?data segment??????
?????????stack?? ????
?????????heap?? ???????????????????
???????梅?围??scope??:
????1?????????? :: namespace??
????2????????? named namespace??
????3?????????anonymous namespace???????????
????4???? ??static class variable or type variable??
????5???????instance class member variable??
????6???????? - ??? ??static variable in a function??
????7??????????????????- ??? ??auto variable or stack variable??
????????????
??????????????????global
????????楗梒ode block??: auto
????New/delete: free
?????????????????????: static in function
?????????
???????????
??????????
???????????
??????????
???????????
??????????Mereology??
???????whole variable??????
???????part variable?? ???????????????
??????????????????????????澹�???????????????????????????
????????“?????”??????????????Mereology?????????????????????????????????????????????????????????
?????????????“????”??“????”?????????????????????????????????????????????????
???????????????????????????????????????
????A?? ????????????????澹�???????魏伪??????????“?????”
????B?? ?????????????????澹�???????????????????“?????”
???????????????????????????????????
????1?? ????娲�????? Heap ????????????????
????A* pA = new A; //line1
????pA???????????????????heap?校??????“???Heap???”??
???????A??????? class A { B b??}?????line1???????????b??娲�??????Heap.
?????????????????Heap?械???????????????????????????????????
????2?? ???????娲�????????????????娲�????
???????? class A { }?? class B { A *pA; }??foo????{B b??}
????b ???????????娲�????????????????????? pA????????小????B *b = new B????? pA ???????? Heap??
????3?????????????????????????????????“??”???????????/写?????????????????械?????????“??”??????????????????????????谩?
????????b.f1?????????b+offsetof(f1)?? f1?????????“??????”??
???????
???????C++????????????????????????C++?????????C++?????????????????“?????”?????????????????????????小?????????????
??????

???路???
??????????????????
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