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
The candidate conversion functions of directly binding reference #4443
Comments
Yes, because that's not direct reference binding. (A temporary will be materialized.) |
Doesn't temporary materialization conversion apply to when the conversion function's return type is As said in: If the converted initializer is a prvalue, its type T4 is adjusted to type “cv1 T4” ([conv.qual]) and the temporary materialization conversion is applied. In any case, the reference is bound to the resulting glvalue (or to an appropriate base class subobject). Or, Is that just the intent of the standard to avoid to view the binding |
It looks like we consider initializing an rvalue-ref from a prvalue a "direct reference binding", for better or worse. In any case, I'm not seeing anything that could be fixed editorially here (i.e. if we change something, it will have effects on the meaning of the standard). |
Consider the candidate conversion function that required in section [dcl.init.ref], the candidate set is defined as:
over.match.ref#1.1.2
The wording in the parenthesis of the second bullet looks like we don't consider these conversion functions of return type “cv2 T2” and “rvalue reference to cv2 T2” as candidate functions when the reference be initialized is an lvalue reference to a const-qualified object type.
Isn't
#1
not a candidate function for initializingrf
? I think the wording should be reworded.And forming the conversion function candidate sets should be separated into two phases. The intent of dcl.init.ref#5.1.2 is considering all conversion functions whose return type are lvalue reference.
Instead, the intent of dcl.init.ref#5.3.2 is considering all conversion functions whose return type are “cv2 T2” and “rvalue reference to cv2 T2” when the initialized reference is rvalue reference or lvalue reference to const-qualified type.
The text was updated successfully, but these errors were encountered: