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

[func.wrap.ref.class, func.wrap.ref.deduct] Inconsistent parameter #6362

Closed
JohelEGP opened this issue Jun 28, 2023 · 5 comments · Fixed by #6398
Closed

[func.wrap.ref.class, func.wrap.ref.deduct] Inconsistent parameter #6362

JohelEGP opened this issue Jun 28, 2023 · 5 comments · Fixed by #6398

Comments

@JohelEGP
Copy link
Contributor

In the class synopsis:

  template<auto f>
    function_ref(nontype_t<f>, auto) -> function_ref<see below>;

The detailed specifications uses a forwarding parameter.
That's consistent with the actual constructors,
as it doesn't require copy on the caller side when deducing.

    function_ref(nontype_t<f>, auto&&) -> function_ref<@\seebelow@>;

In the deduction guide's detailed specifications:

template<auto f, class T>
  function_ref(nontype_t<f>, T&&) -> function_ref<see below>;

The second parameter in the class synopsis is actually auto.
That requires a copy, as opposed to T&&.
So I can't solve this editorially here,
but it can be done in the class synopsis.

To be consistent with my suggestion on the class synopsis:

template<auto f>
  function_ref(nontype_t<f>, auto&&) -> function_ref<@\seebelow@>;

Originally: #6357 (comment), #6357 (comment).

@frederick-vs-ja
Copy link
Contributor

frederick-vs-ja commented Jun 29, 2023

Presumably the second auto shouldn't be used here, see CWG2697.

@JohelEGP
Copy link
Contributor Author

Thank you.
For now, I suggested #6357 (comment).
If that's not editorially accepted, an LWG issue might be needed.

@tkoeppe
Copy link
Contributor

tkoeppe commented Jul 21, 2023

Could you please make a separate PR for this, after the motions?

@JohelEGP
Copy link
Contributor Author

JohelEGP commented Jul 21, 2023

Yes.
Remaining motions: https://github.com/cplusplus/draft/issues?q=is%3Aissue+is%3Aopen+Motion+in%3Atitle.
Commit to be rebased on main afterwards: 34305cc.

@JohelEGP
Copy link
Contributor Author

Opened #6398.

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

Successfully merging a pull request may close this issue.

3 participants