when I try to assign a pointer to this pointer, My IDE(clion) said Expression is not assignable. So, Is this pointer assignable in c++ ? Is it a rvalue?
when I try to assign a pointer to this pointer, My IDE(clion) said Expression is not assignable. So, Is this pointer assignable in c++ ? Is it a rvalue?
Yes, this is an rvalue. Specifically, it's a prvalue:
The keyword
thisis a prvalue expression whose value is the address of the implicit object parameter (object on which the non-static member function is being called).
(From https://en.cppreference.com/w/cpp/language/this)
Hence, this is not assignable.