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

P2273 Making std::unique_ptr constexpr #961

Closed
wg21bot opened this issue Dec 27, 2020 · 11 comments · Fixed by cplusplus/draft#5284
Closed

P2273 Making std::unique_ptr constexpr #961

wg21bot opened this issue Dec 27, 2020 · 11 comments · Fixed by cplusplus/draft#5284
Labels
B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e C++23 Targeted at C++23 constexpr expedited-library-evolution-electronic-poll Papers that were reviewed on the mailing list and then advanced directly to electronic polling. LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote.
Milestone

Comments

@wg21bot
Copy link
Collaborator

wg21bot commented Dec 27, 2020

P2273R0 Making std::unique_ptr constexpr (Andreas Fertig)

@wg21bot wg21bot added the LEWG Library Evolution label Dec 27, 2020
@wg21bot wg21bot added this to the 2021-telecon milestone Dec 27, 2020
@brycelelbach brycelelbach added the ready-for-library-evolution-mailing-list-review This paper needs to be discussed on the Library Evolution mailing list label Jan 25, 2021
@cor3ntin cor3ntin added the scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review label Feb 22, 2021
@cor3ntin
Copy link

cor3ntin commented Mar 29, 2021

Mailing list review 22-02-2021 - 29-03-2021

  • default_delete need to be made constexpr too
  • Why are non member swap/ comparison are not constexpr?
  • The wording should instruct editors to make the declaration constexpr too
  • Consider having a single feature test macro

Low participation: Update the paper for a second round of Mailing review

@cor3ntin cor3ntin added needs-revision Paper needs changes before it can proceed and removed scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review labels Mar 29, 2021
@wg21bot
Copy link
Collaborator Author

wg21bot commented Apr 25, 2021

P2273R1 Making std::unique_ptr constexpr (Andreas Fertig)

@wg21bot wg21bot removed the needs-revision Paper needs changes before it can proceed label Apr 25, 2021
@brycelelbach brycelelbach added 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 B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e C++23 Targeted at C++23 constexpr and removed ready-for-library-evolution-mailing-list-review This paper needs to be discussed on the Library Evolution mailing list labels May 17, 2021
@brycelelbach brycelelbach added needs-revision Paper needs changes before it can proceed and removed scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review labels May 26, 2021
@brycelelbach
Copy link

brycelelbach commented May 26, 2021

2021-05-25 Library Evolution Telecon

P2273R1: constexpr unique_ptr

2021-05-25 Library Evolution Telecon Minutes

Chair: Nevin Liber

Champion: Andreas Fertig

Minute Taker: Ben Craig

Summary

Discussion on whether or not the ordered comparison operators between two unique_ptrs could, and if so, should be made constexpr. Poll results are meh.

Discussion took a tangent on whether or not the standard should mark functions constexpr knowing that they cannot be used as such. It was pointed out that if there are no values which can be used in a constexpr context, the standard already says IFNDR.

Similar discussion on if make_shared_for_overwrite could be made constexpr (as default initialized values are uninitialized for some types). As the paper already proposes this, the author will check to see if it is currently allowed.

Finally, a brief discussion on whether or not we want shared_ptr, make_shared, etc. to be constexpr. There is weak consensus for this, with the dissenters feeling that it isn’t worth our limited time and resources to do so.

Outcome

LEWG is in favor of making unique_ptr constexpr, very neutral on making the ordered comparisons between two unique_ptrs constexpr, and weak consensus for making the shared_ptr family constexpr.

@brycelelbach
Copy link

On 2021-05-25, we reviewed P2273R1, which proposed making std::unique_ptr constexpr.

Library Evolution had the following opinions after the review:

  • We were in favor of making unique_ptr constexpr, which P2273 does.
  • We were neutral on making ordered comparisons between two unique_ptr constexpr. P2273 does NOT make ordered comparisons between unique_ptr constexpr, it only makes comparisons between a unique_ptr and a nullptr constexpr.
  • We were weakly in favor of exploring making shared_ptr constexpr; that's outside of the scope of what P2273 is proposing.

During the review, we asked the author to verify that making make_unique_for_overwrite constexpr is implementable, as P2273
proposes making it constexpr. The author informed me this week that he has looked into this. He believes constexpr
make_unique_for_overwrite is implementable, as we adopted P1331R2 (Permitting trivial default initialization in constexpr contexts). Here is a minimal implementation of it.

There is implementation experience for the entire P2273 proposal in a fork of libc++:

The proposal has wording, which is quite straightforward. Basically, it's just adding constexpr in synopses and adding a feature test macro. I've asked two wordsmiths to review it, and they've provided some minor feedback and have not identified any design issues.

Library Evolution did not ask for any changes to P2273 in our last review, and we affirmed that we wanted to pursue it. We asked the author to confirm that something contained in the paper was implementable, which he has done.

As such, I determined that another telecon review of P2273 is probably not the best use of Library Evolution time.

Instead, I presented the above information to Library Evolution via mailing list and asked who would support taking an electronic poll advancing P2273 to LWG for C++23 as a B2 (improvement) item in the next Library Evolution electronic polling period. 8 people explicitly spoke in favor of this on the mailing list; none spoke against it.

Therefore, I have determined that we have consensus to take an electronic poll advancing P2273 to LWG for C++23 as a B2 (improvement) item in the next Library Evolution electronic polling period

@brycelelbach brycelelbach added ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll needs-revision Paper needs changes before it can proceed and removed needs-revision Paper needs changes before it can proceed ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting labels Jul 5, 2021
@wg21bot
Copy link
Collaborator Author

wg21bot commented Jul 30, 2021

P2273R2 Making std::unique_ptr constexpr (Andreas Fertig)

@wg21bot wg21bot removed the needs-revision Paper needs changes before it can proceed label Jul 30, 2021
@brycelelbach
Copy link

The paper is being placed on the Summer 2021 electronic ballot.

@brycelelbach brycelelbach added the scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review label Aug 1, 2021
@brycelelbach
Copy link

2021 Summer Library Evolution Polls

P2435: 2021 Summer Library Evolution Poll Outcomes

POLL 5: Send P2273R2 (Making unique_ptr constexpr) to Library Working Group for C++23, classified as an improvement of an existing feature (P0592R4 bucket 2 item).

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
17 16 0 0 0

Outcome: Unanimous consensus in favor.

@brycelelbach brycelelbach removed LEWG Library Evolution ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll labels Sep 6, 2021
@brycelelbach brycelelbach added lwg-pending LWG Chair needs to disposition LWG Library and removed scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review labels Sep 6, 2021
@JeffGarland
Copy link
Member

JeffGarland commented Nov 7, 2021

This was seen and effectively approved by LWG with a small addition that needs LEWG approval

https://wiki.edg.com/bin/view/Wg21telecons2021/P2273-20211105

poll: add P2273r3 to the C++23 working paper with the changes (reviewed by CC and JW)

F A N
11 0 0

JW: action item for me to send the version to LEWG.

@JeffGarland JeffGarland added lwg-waiting LWG is waiting on another group to address this issue and removed lwg-pending LWG Chair needs to disposition labels Nov 7, 2021
@wg21bot
Copy link
Collaborator Author

wg21bot commented Nov 26, 2021

P2273R3 Making std::unique_ptr constexpr (Andreas Fertig)

@JeffGarland JeffGarland added tentatively-ready-for-plenary Reviewed between meetings; ready for a vote. and removed lwg-waiting LWG is waiting on another group to address this issue labels Dec 6, 2021
@JeffGarland
Copy link
Member

LEWG action resolved - November 8. No objections. Short thread starting with https://lists.isocpp.org/lib-ext/2021/11/21308.php

Ready for plenary.

@jensmaurer jensmaurer modified the milestones: 2021-telecon, 2022-telecon Jan 1, 2022
@cor3ntin cor3ntin added the plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. label Feb 7, 2022
@jensmaurer
Copy link
Member

Approved by WG21 plenary 2022-02-07

@cor3ntin cor3ntin removed the tentatively-ready-for-plenary Reviewed between meetings; ready for a vote. label Feb 21, 2022
@brycelelbach brycelelbach added the expedited-library-evolution-electronic-poll Papers that were reviewed on the mailing list and then advanced directly to electronic polling. label Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e C++23 Targeted at C++23 constexpr expedited-library-evolution-electronic-poll Papers that were reviewed on the mailing list and then advanced directly to electronic polling. LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants