I know that the type of this
is a prvalue ("pure" rvalue) pointer, and that it may be made a pointer-to-const and/or pointer-to-volatile (affecting accesses to its instance variables), by appending the keywords const
or volatile
to the end of the function definition to which it belongs.
I also know that this
is sometimes (incorrectly) described as being a const pointer, perhaps as a way of saying "you can't make an assignment to this
". As an rvalue, it is inherently unassignable, and so there is no need for the concept of a const
rvalue.
I also know that in C++11, there are cases where being an rvalue or an lvalue can affect call resolution, but I've tried to work through the possibilities, and I'm not sure whether there's a case where it would actually matter to call resolution that this
is an rvalue pointer rather than a const
lvalue pointer.
Is there a case where this distinction makes a real difference, from a programmer's perspective, such as a context where an rvalue pointer can be used that a const
lvalue pointer cannot be used, where a const
lvalue pointer can be used that an rvalue pointer cannot, or where the difference affects call resolution?