Skip to content

P2781R9 std::constant_wrapper #8018

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

Merged
merged 1 commit into from
Jul 16, 2025

Conversation

AlisdairM
Copy link
Contributor

Fixes #7969
Fixes cplusplus/papers#1458

Allowed paragraphs to number themselves correctly.
For consistency, did not use code font for constexpr in the phrase "constexpr function".

Copy link
Member

@mattkretz mattkretz left a comment

Choose a reason for hiding this comment

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

I'm not an authority on indexing.

Did you forget the changes to [span.syn] and [version.syn] or did I overlook something?

struct @\exposid{cw-operators}@ { // \expos
// unary operators
template<@\exposid{constexpr-param}@ T>
friend constexpr auto operator+(T) noexcept -> constant_wrapper<(+T::value)>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
friend constexpr auto operator+(T) noexcept -> constant_wrapper<(+T::value)>
friend constexpr auto @\libmember{operator+}{constant_wrapper}@(T) noexcept -> constant_wrapper<(+T::value)>

Same for all the other operators. Though, constant_wrapper isn't 100% correct, I believe it's what is most helpful even to implementers.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, this would seem to require a bunch of new escaping. Let's do that later.

@tkoeppe tkoeppe force-pushed the p2781_constant_wrapper branch 3 times, most recently from 5910b2a to 54ca64f Compare July 16, 2025 20:08
@tkoeppe tkoeppe force-pushed the p2781_constant_wrapper branch from 54ca64f to 1c503b2 Compare July 16, 2025 23:34
@tkoeppe tkoeppe merged commit 5fd338c into cplusplus:main Jul 16, 2025
2 checks passed
@AlisdairM AlisdairM deleted the p2781_constant_wrapper branch July 17, 2025 01:55
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.

[2025-06 LWG Motion 32] P2781R9 std::constant_wrapper P2781 R8 std::constexpr_wrapper
4 participants