Would making 'this' a reference rather than a pointer be better in retrospect?
本问题已经有最佳答案,请猛点这里访问。
Possible Duplicate:
Why ‘this’ is a pointer and not a reference?
在C++中,EDCOX1的0个原因是不是一个指针,而不是历史语言决定的一个引用?考虑到复制构造函数或赋值运算符都接受对"
[老实说,我找不到这个问题,尽管它看起来可能是重复的]
从Bjarne Stroustrup的《C++的设计与演化》看,Addison Wesley,1994,PP 39-40:
Sometimes, people ask why
this is a pointer rather than a reference and why it is calledthis rather thanself . Whenthis was introduced into C with Classes, the language didn't have references, and C++ borrows its terminology from Simula rather than Smalltalk.
创建