Skip to content

[2026-03 LWG Motion 17] P3978R3 constant_wrapper should unwrap on call and subscript#8884

Open
mattkretz wants to merge 1 commit intocplusplus:mainfrom
mattkretz:motions-2026-03-lwg-17
Open

[2026-03 LWG Motion 17] P3978R3 constant_wrapper should unwrap on call and subscript#8884
mattkretz wants to merge 1 commit intocplusplus:mainfrom
mattkretz:motions-2026-03-lwg-17

Conversation

@mattkretz
Copy link
Copy Markdown
Member

All applied except the move from <type_traits> to <utility>. I'm not confident to do the latter. Feel free to reuse this commit even if it loses my authorship info.


\pnum
\constraints
\placeholder{call-expr} is a valid expression.
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
\placeholder{call-expr} is a valid expression.
\tcode{\placeholder{call-expr}} is a valid expression.


\pnum
\constraints
\placeholder{subscr-expr} is a valid expression.
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
\placeholder{subscr-expr} is a valid expression.
\tcode{\placeholder{subscr-expr}} is a valid expression.

The exception specification is equivalent to \tcode{noexcept(\placeholder{call-expr})}.
\end{itemdescr}

\begin{itemdecl}
Copy link
Copy Markdown
Member

@eisenwave eisenwave Mar 29, 2026

Choose a reason for hiding this comment

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

Suggested change
\begin{itemdecl}
\indexlibrarymember{operator[]}{constant_wrapper}%
\begin{itemdecl}

Initialize elements of \exposid{data} with corresponding elements of \tcode{arr}.
\end{itemdescr}

\begin{itemdecl}
Copy link
Copy Markdown
Member

@eisenwave eisenwave Mar 29, 2026

Choose a reason for hiding this comment

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

Suggested change
\begin{itemdecl}
\indexlibrarymember{operator()}{constant_wrapper}%
\begin{itemdecl}

\tcode{remove_cvref_t<Args>...} satisfy \exposconcept{constexpr-param} and
\tcode{constant_wrapper<\placeholder{INVOKE}(val\-ue,
remove_cvref_t<Args>::value...)>} is a valid type, otherwise let
\placeholder{call-expr} be \tcode{\placeholder{INVOKE}(value,
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
\placeholder{call-expr} be \tcode{\placeholder{INVOKE}(value,
\tcode{\placeholder{call-expr}} be \tcode{\placeholder{INVOKE}(value,

\tcode{constant_wrapper<value[remove_cvref_t<Args>::value...]>\{\}} if all
types in \tcode{remove_cvref_t<Args>...} satisfy \exposconcept{constexpr-param}
and \tcode{constant_wrapper<value[remove_cv\-ref_t<Args>::value...]>} is a valid
type, otherwise let \placeholder{subscr-expr} be
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
type, otherwise let \placeholder{subscr-expr} be
type, otherwise let \tcode{\placeholder{subscr-expr}} be

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.

2 participants