Why is the “this” pointer in C++ a pointer and not a reference?
为什么C++中的EDOCX1 0指针是指针而不是引用?
是否有我遗漏的用例使"this"作为指针比引用更有用?
如果没有,将它作为指针是否涉及到语言设计的含义/考虑?
从Bjarne Stroustrup的C++风格和技巧谈起:
Why is"this" not a reference?
Because"this" was introduced into C++ (really into C with Classes) before references were added. Also, I chose"this" to follow Simula usage, rather than the (later) Smalltalk use of"self".