The thispointer [ class.this ] で、C++ 標準は次のように述べています。
thisクラスのメンバ関数のの型Xは ですX*。
すなわちthisありませんconst。しかし、なぜそれはそれである
struct M {
M() { this = new M; }
};
与える
error: invalid lvalue in assignment <-- gcc
'=' : left operand must be l-value <-- VC++
'=' : left operand must be l-value <-- clang++
'=' : left operand must be l-value <-- ICC
(source: some online compiler frontends)
言い換えれば、そうでthisはありませんconstが、実際にはそうです!