????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
????????饗code 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++?????????????????“?????”?????????????????????????С?????????????