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

P0792 function_ref: a non-owning reference to a Callable #256

Closed
jensmaurer opened this issue Jan 28, 2019 · 27 comments · Fixed by cplusplus/draft#6357
Closed

P0792 function_ref: a non-owning reference to a Callable #256

jensmaurer opened this issue Jan 28, 2019 · 27 comments · Fixed by cplusplus/draft#6357
Labels
C++26 Targeted at C++26 IS Ship vehicle: IS plenary-approved Papers approved for inclusion in their target vehicle by plenary vote.
Milestone

Comments

@jensmaurer
Copy link
Member

jensmaurer commented Jan 28, 2019

P0792R3 function_ref: a non-owning reference to a Callable (Vittorio Romeo)

https://issues.isocpp.org/show_bug.cgi?id=340

Titus Winters 2018-03-17 11:19:18 UTC
Discussed in http://wiki.edg.com/bin/view/Wg21jacksonville2018/P0792

Forward paper as-is to LWG for C++20?
SF F N A SA
3 9 3 0 0

@jensmaurer jensmaurer added this to the 2019-02 milestone Jan 28, 2019
@jensmaurer jensmaurer added the LWG Library label Jan 28, 2019
@mclow
Copy link

mclow commented Feb 4, 2019

Rostistlav Khlebnikov will present it to LWG.
Jason Liu is also interested in attending and participating to the discussion.

@jensmaurer jensmaurer added this to Thursday in LWG in Kona 2019 Feb 5, 2019
@mclow mclow added the needs-revision Paper needs changes before it can proceed label Feb 22, 2019
@jensmaurer jensmaurer removed this from the 2019-02 milestone Mar 21, 2019
@wg21bot
Copy link
Collaborator

wg21bot commented Jun 23, 2019

P0792R4 function_ref: a non-owning reference to a Callable (Vittorio Romeo)

@wg21bot wg21bot added this to the 2019-07 milestone Jun 23, 2019
@jensmaurer jensmaurer removed the needs-revision Paper needs changes before it can proceed label Jun 27, 2019
@mclow mclow added the C++20 Targeted at C++20 label Jul 8, 2019
@jensmaurer jensmaurer modified the milestones: 2019-07, 2019-11 Aug 23, 2019
@wg21bot
Copy link
Collaborator

wg21bot commented Oct 15, 2019

P0792R5 function_ref: a non-owning reference to a Callable (Vittorio Romeo)

@mclow mclow removed the C++20 Targeted at C++20 label Nov 3, 2019
@mclow
Copy link

mclow commented Nov 3, 2019

This was not adopted for C++20. Removing the "C++20" label.

@jensmaurer jensmaurer modified the milestones: 2019-11, 2020-06 Feb 18, 2020
@JeffGarland JeffGarland self-assigned this Mar 25, 2020
@ben-craig ben-craig added B3 - addition Bucket 3 as described by P0592: material that is not mentioned in P0592 size - medium paper size estimate labels Oct 17, 2020
@JeffGarland JeffGarland added the lwg-fullreview Paper is ready for lwg full group review label Oct 30, 2020
@JeffGarland
Copy link
Member

LWG started this review in July (catching up on the notes).

https://wiki.edg.com/bin/view/Wg21summer2020/P0792R5-20200731

Will continue review when author is available.

@brycelelbach brycelelbach added LEWG Library Evolution ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll LWG Library and removed LWG Library ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll LEWG Library Evolution labels Dec 8, 2020
@brycelelbach
Copy link

P2265R0: Renaming any_invocable

P0288R7: any_invocable

P0792R5: function_ref

2020-12-08 Library Evolution Telecon Minutes

Chair: Bryce Adelstein Lelbach

Champion: Kevlin Henney

Minute Taker: Ben Craig

Start: 2020-12-08 10:09 Pacific

Kevlin's ordered preferences for the facility in P0288 (any_invocable):
0. move_only_function.

  1. move_function.
  2. movable_function.

Note that the order Kevlin wrote in P2265 is incorrect; the above is the right version.

Other options for the facility in P0288 (any_invocable):

  • any_invocable (status quo).
  • unique_function.
  • any_function.

What type-erased facilities use the any naming pattern?

  • any.
  • any_invocable (proposed).
  • any_executor (proposed).

We also have the option of adding aliases to make function consistent with whatever we choose.

We should at least have consensus that function, function_ref, and any_invocable should be consistently named.

Should we name this for what it is or what it contains?

If we decide to not call the move-only function wrapper in P0288 any_invocable, that will have implications for everything else that is currently following the any pattern.

POLL: The facilities introduced in P0288 and P0792 should have function in their names.

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
11 8 7 5 2

Attendance: 38

Outcome: Weak consensus in favor.

Existing precedent and policy for the any-prefix naming pattern.

POLL: Type-erasing wrappers for concepts should follow the any_${CONCEPTNAME} naming pattern.

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
8 8 7 8 2

Attendance: 36

Outcome: That has no consensus.

POLL: Type-erasing wrappers should have an any prefix.

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
2 6 12 7 3

Attendance: 36

Outcome: That has no consensus.

Somebody from the against camp should write a paper about this (ideally proposing an alternative guideline).

POLL: The facility in P0792 should be named:

Name Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against Outcome
function_ref 12 13 4 1 2 Consensus in favor.
invocable_ref 4 7 8 6 4 No consensus.
any_function_ref 0 1 7 8 13 Consensus against.
any_invocable_ref 2 3 2 9 13 Consensus against.

Attendance: 35

Outcome: We agree that the facility in P0792 should be called function_ref.

That probably means we feel type erasure does not imply any (although any may imply type erasure).

POLL: The facility in P0288 should be named:

Name Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against Outcome
move_only_function 4 8 8 4 4 No consensus.
move_function 1 5 4 5 12 Consensus against.
movable_function 2 8 5 5 8 No consensus.
any_invocable 4 2 1 10 10 Consensus against.
unique_function 2 8 4 5 8 No consensus.
any_function 4 13 1 7 4 No consensus.

Attendance: 34

Outcome: We need to make a decision for the name of P0288 (any_invocable) facility and there's no clear favorite. We'll conduct an electronic poll in the next voting cycle on the name for the P0288 facility in which participants will vote once on their preferred option. If anyone would like to suggest a new name for consideration for said poll, they should write a paper similar to P2265.

End: 11:46

Summary

We had a lively discussion with excellent turnout on naming, focused on the facilities in P0288 (any_invocable) and P0792 (function_ref), but covering broader topics and policy, including:

  • Should we name facilities for what they hold or what they are?
  • How should we name type-erased wrappers in general?
  • How should we name type-erased wrappers that hold a concept?

It is not clear whether we have consensus on the answers to any of these questions.

One of the underlying challenges is this discussion is different views regarding what kind and degree of consistency do we desire for the names of these facilities and future facilities like them. Some wish for these facilities to be named and thought of as wrappers for the concepts they hold. Others wish for names that reflect pre-concept existing practice and precedent, such as function.

Some expressed concerns about possible confusion caused by the name any_invocable. For example, the distinction between any_invocable (a type-erasing wrapper which takes a function signature as a template parameter) and invocable (which takes the potentially-invocable type followed by a set of argument types as a parameter). Additionally, there were questions about whether users would understand the distinction between any_invocable and function given the names.

We also briefly discussed the possibility of introducing type aliases for function that would be consistent with proposed new naming schemes.

Outcome

Most of us seem to believe that, at the very least, the facilities in P0288 (any_invocable) and the P0792 (function_ref) should be consistently named with respect to each other. We had consensus that the name for the facility in P0792 (function_ref) should be function_ref and that the for the facility in P0288 (any_invocable) should have function in the name. None of the names for the P0288 facility achieved consensus, but the one name considered that did not have function in it (any_invocable) had the greatest opposition. This suggests that a possible route to consensus would be a name for the P0288 facility that contains function but was not considered during this discussion.

We need to make a decision for the name of P0288 (any_invocable) facility and there's no clear favorite. We'll conduct an electronic poll in the next voting cycle on the name for the P0288 facility in which participants will vote once on their preferred option. If anyone would like to suggest a new name for consideration for said poll, they should write a paper similar to P2265.

Other type-erased facilities using any as a prefix should take note of the lack of consensus demonstrated in today's discussion.

@jensmaurer jensmaurer removed this from the 2020-telecon milestone Dec 28, 2020
@JeffGarland JeffGarland added C++26 Targeted at C++26 and removed C++23 Targeted at C++23 labels Nov 10, 2022
@brycelelbach brycelelbach removed LEWG Library Evolution ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review labels Nov 10, 2022
@JeffGarland
Copy link
Member

LWG reviewed this in Kona 2022 and requested changes.

https://wiki.edg.com/bin/view/Wg21kona2022/LWG20221111-LM

@JeffGarland JeffGarland added needs-revision Paper needs changes before it can proceed lwg-fullreview Paper is ready for lwg full group review and removed lwg-pending LWG Chair needs to disposition labels Dec 9, 2022
@jwakely
Copy link
Member

jwakely commented Dec 14, 2022

LWG reviewed P0792R13 today.

Poll: Forward P0792R13 for C++26, at some future plenary.

F N A
8 0 1

@jwakely jwakely removed needs-revision Paper needs changes before it can proceed lwg-fullreview Paper is ready for lwg full group review labels Dec 14, 2022
@JeffGarland JeffGarland removed their assignment Dec 14, 2022
@JeffGarland JeffGarland added lwg-future-plenary ready to go to plenary but working draft isn't open so we are waiting and removed B3 - addition Bucket 3 as described by P0592: material that is not mentioned in P0592 size - medium paper size estimate labels Dec 14, 2022
@wg21bot
Copy link
Collaborator

wg21bot commented Jan 16, 2023

P0792R12 function_ref: a non-owning reference to a Callable (Vittorio Romeo, Zhihao Yuan, Jarrad Waterloo)

@wg21bot
Copy link
Collaborator

wg21bot commented Feb 20, 2023

P0792R13 function_ref: a non-owning reference to a Callable (Vittorio Romeo, Zhihao Yuan, Jarrad Waterloo)

@wg21bot
Copy link
Collaborator

wg21bot commented Feb 20, 2023

P0792R14 function_ref: a non-owning reference to a Callable (Vittorio Romeo, Zhihao Yuan, Jarrad Waterloo)

@JeffGarland JeffGarland added the tentatively-ready-for-plenary Reviewed between meetings; ready for a vote. label May 23, 2023
@JeffGarland JeffGarland removed the lwg-future-plenary ready to go to plenary but working draft isn't open so we are waiting label Jun 11, 2023
@cor3ntin cor3ntin added plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. and removed tentatively-ready-for-plenary Reviewed between meetings; ready for a vote. labels Jun 17, 2023
@ben-craig ben-craig removed the LWG Library label Mar 5, 2024
@jwakely
Copy link
Member

jwakely commented Mar 5, 2024

Approved in Varna 2023 and applied to the draft (cplusplus/draft#6304)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++26 Targeted at C++26 IS Ship vehicle: IS plenary-approved Papers approved for inclusion in their target vehicle by plenary vote.
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

10 participants