(probably not a complete answer) There is always the situation when an object needs to delete itself with the "dangerous"
delete this;
So it probably have to be a pointer.
M.
Max
2010-02-11 18:30:20
(probably not a complete answer) There is always the situation when an object needs to delete itself with the "dangerous"
delete this;
So it probably have to be a pointer.
M.
Because references weren't added to C++ until later. By then it was too late to change it.
See Stroustrup's 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".