Skip to content
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

Invocable requirement for CPOs is incorrect #546

Closed
CaseyCarter opened this issue Feb 10, 2018 · 3 comments
Closed

Invocable requirement for CPOs is incorrect #546

CaseyCarter opened this issue Feb 10, 2018 · 3 comments

Comments

@CaseyCarter
Copy link
Collaborator

[customization.point.object]/4 states:

The type of a customization point object T shall satisfy Invocable<const T, Args...> (7.6.2) when the
types of Args... meet the requirements specified in that customization point object’s definition. Otherwise, T shall not have a function call operator that participates in overload resolution.

This requires const rvalue T to have such a function call operator, instead of const lvalue T as intended. The wording should require the call operator for lvalue T, ideally without forbidding the presence of equivalent call operators for rvalue (or non-const, or volatile, or ...) T`.

Proposed Resolution

Modify [customization.point.object]/4 as follows:

 The type of a customization point object T shall satisfy
-Invocable<const T, Args...>
+Invocable<const T&, Args...>
 (22.6.2) when the types of Args... meet the requirements specified in that customization point
 object’s definition.
-Otherwise,
+When the types of Args... do not meet the customization point object’s requirements,
 T shall not have a function call operator that participates in overload resolution.
@CaseyCarter
Copy link
Collaborator Author

Note that this PR has already been applied to the CPO wording in D0898R0.

@timsong-cpp
Copy link
Contributor

There seems to be another problem here: the type of an object includes its cv-qualification, if any, but for something like the Semiregular requirement (and this Invocable) presumably we want to remove the cv-qualification.

@ericniebler
Copy link
Owner

I've moved the issue with the Semiregular-ness of CPOs to #621. Closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants