Why was this deprecated in C++? How is the this pointer in C++ different than this in Java?
Or is Wikipedia just wrong
Early versions of C++ would let the this pointer be changed; by doing
so a programmer could change which object a method was working on.
This feature was eventually deprecated, and now this in C++ is const .
I believe your mistake is in how you interpret that line. They’re not saying “The this feature was deprecated”. Merely the ability to reassign the
thispointer was deprecated.