-
Notifications
You must be signed in to change notification settings - Fork 771
[expr.call] Clarify the value of this #5399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The automatic check fails. Also, I'm not convinced this is a net clarification. |
I've used
Any details? |
as if by an explicit type conversion\iref{expr.cast}. | ||
If the function is an implicit object member function, | ||
the object for which it is invoked\iref{expr.prim.this} | ||
is the object which would be pointed to by the result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why "would"? There is nothing hypothetical here. The member function is invoked for a certain subobject (or possibly the entire object) of the object designated by the object expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why "would"? There is nothing hypothetical here.
We don't do any code transformations or anything else to make this conversion «really exist».
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do convert the object expression to the type of the base class, and the result of that transformation is the value of "this" inside the member function, in my view.
There is no such thing as «
this
parameter of the function», after all