Skip to content

[2026-03 LWG Motion 16] P3948R1 constant_wrapper is the only tool needed#8878

Open
eisenwave wants to merge 1 commit intocplusplus:mainfrom
eisenwave:motions-2026-03-lwg-16
Open

[2026-03 LWG Motion 16] P3948R1 constant_wrapper is the only tool needed#8878
eisenwave wants to merge 1 commit intocplusplus:mainfrom
eisenwave:motions-2026-03-lwg-16

Conversation

@eisenwave
Copy link
Copy Markdown
Member

Fixes #8850
Fixes NB FR-019-210 and FR-021-218 (C++26 CD).

Also fixes https://github.com/cplusplus/nbballot/issues/779
Also fixes https://github.com/cplusplus/nbballot/issues/788

… expressions via function arguments

Fixes NB FR-019-210 and FR-021-218 (C++26 CD).
@eisenwave
Copy link
Copy Markdown
Member Author

eisenwave commented Mar 28, 2026

@jwakely @mattkretz we have goofed HARD. The paper deletes constant_arg_t but not the deduction guides that function_ref has for it.

https://eel.is/c++draft/func.wrap.ref.deduct

(will deal with overfull hboxes once home btw)

\item
If \tcode{is_pointer_v<F> || is_member_pointer_v<F>} is \tcode{true},
then \tcode{f != nullptr} is \tcode{true}.
then \tcode{f != nullptr} is \tcode{true}, and
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
then \tcode{f != nullptr} is \tcode{true}, and
then \tcode{f.value != nullptr} is \tcode{true}, and

@jwakely
Copy link
Copy Markdown
Member

jwakely commented Mar 28, 2026

@jwakely @mattkretz we have goofed HARD. The paper deletes constant_arg_t but not the deduction guides that function_ref has for it.

Can we just delete that (which is fine as an editorial change, because the draft is inconsistent if it refers to a type which no longer exists), or does it need to be changed to use constant_wrapper?

@eisenwave
Copy link
Copy Markdown
Member Author

eisenwave commented Mar 28, 2026

I believe the purpose of the deduction guides is to make things possible like

void f();
// CTAD
std::function_ref ref = std::nontype<f>;

Or now equivalently with std::cw<f>. If this no longer works as a result of deleting the deduction guides, that seems like an inadvertent design change.

I suppose the only editorial way to get the draft into a working state is to delete the deduction guides editorially and to reintroduce them by LWG issue. Any LWG resolutions won't be merged into the DIS anyway, right? We need to ship these motions.

@eisenwave eisenwave added this to the post-2026-03 milestone Mar 28, 2026
@zhihaoy
Copy link
Copy Markdown
Contributor

zhihaoy commented Mar 28, 2026

Herb reminded us that accepting motion can also introduce editorial change, so I suggest just finishing the renaming here.

@Mick235711
Copy link
Copy Markdown
Contributor

Personally, I support treating this as an editorial wording defect in the proposal, as the intention is obviously to replace all usage of constant_arg mechanically. In other similar renaming proposals, if the author left over a few instances in the wording, they are also editorially applied without LWG issues as long as the intention is clear when polling the motions.

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 this pull request may close these issues.

[2026-03 LWG Motion 16] P3948R1 constant_wrapper is the only tool needed

4 participants