Skip to content

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

@JohelEGP

Description

@JohelEGP

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions