????C++ ??????????????????????????“???”????????????????????κλ???VMA????-??????????????????????????????????????????????????C??????????????
????????????????????C++??????C++?????????????????????????????????е?????????????C++?????????????????????????????????????????????????Haskell??????????????? ??????????????????????????????????????????
??????????????????????????????????C++?????????????????????????????“reference"??????????????????????????
??????????????????“ http://blog.csdn.net/ly8838/article/details/38638491”????????reference????????????????????????????????reference???Щ????
???????????reference????????ò????????????? - ??????direct object?????.
????C++?У?????????“???????”??normal variable???? ????“?????”??value semantics??????rvalue ???? ?????????reference??????????????“???????”??????????????????о?????
????long x;
????MyClass m;  // MyClass is a user defined class
????????x??m????“??????”????????????е??????????????????????????????????????????????????????????????????????????????????????object?У????????????????????Щ????????????????????????????????????????????????????????????“???????????primitive type variable??”???????÷?????????????C++??λ??????????????
??????????????C#??JavaScript?? ???????????????????????“??????”??????ж?????????????????????????“??????heap??”?У??????????“???”???????????“??????”???????"????????“???”??“reference”. ??????????????????????????????????????“???”??“reference”??
???????reference??????????????????????????http://en.wikipedia.org/wiki/Reference_(C%2B%2B)???????????????????????????“????”?????????????????“???”??“?????”?????????????
??????????????????“reference ???????alias (?????????)”??????????
????????????????????????alias??ν???“????”??????
????int x = int(10);           // line1
????int & r = x;                // line2: r is an alias of x
????r++;                         // line3: x is now 11
????r = 3;                       // line4: x is now 3
????assert (&r == &x);     // line5: r points to x
??????????????????????????r ?? x ??????κ?????????????????棬?????????????C++?????????reference?????????????????“???”???????÷???
??????????????????????????????÷???????????“????????Σ???”????????????x ?? r ?????????????????
?????????x ??“??????”????r???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????object reference ?? direct object ????????????????д??????????????
???????????????line2 ???????? r = &x (?x???????????????????? reference ???????? ????line5???????????????“??????”?????????????????д?????????
????class X {…}
????void myXFunction(X x) {…}
????void myXFunction2(const X & x) {…}
??????????X& ?? X ??“alias”???????÷?????? ????????????myXFunction2??????????????X&???????X * ??????????????myXFunction2???????????myXFunction?????????X???????????“???”???myXFunction2????copy ????????copy??? ????????????????- shallow copy???? ??myXFunction???????????copy ??argument?????У??????????????- deep copy????
???????????????????????const X &x ???÷???????????????????????????ù????