@@ -173,6 +173,10 @@ return std::forward<U>(v);</ins>
173173Rebase after LWG <iref ref =" 4015" /> which was approved in Kona.
174174This would also resolve LWG <iref ref =" 4281" />.
175175</p >
176+ <note >2025-11-19; Jonathan provides updated wording</note >
177+ <p >
178+ Incorporate proposed resolution of <iref ref =" 3424" /> as well.
179+ </p >
176180
177181</discussion >
178182
@@ -183,15 +187,35 @@ This wording is relative to <b>the working draft after <paper num="N5014"/></b>.
183187
184188<ol >
185189
190+ <li ><p >Modify <sref ref =" [optional.optional.general]" /> as indicated:</p >
191+
192+ <blockquote >
193+ <pre >
194+ [… ]
195+ template< class U = remove_cv_t< T>> constexpr <ins >remove_cv_t< </ins >T<ins >> </ins > value_or(U&& ) const & ;
196+ template< class U = remove_cv_t< T>> constexpr <ins >remove_cv_t< </ins >T<ins >> </ins > value_or(U&& ) && ;
197+ [… ]
198+ </pre >
199+ </blockquote >
200+ </li >
201+
186202<li ><p >Modify <sref ref =" [optional.observe]" /> as indicated:</p >
187203
188204<blockquote >
189205<pre >
190- template< class U = remove_cv_t< T>> constexpr T value_or(U&& v) const & ;
206+ template< class U = remove_cv_t< T>> constexpr < ins >remove_cv_t < </ ins >T< ins > > </ ins > value_or(U&& v) const & ;
191207</pre >
192208<blockquote >
193209<p >
194- -15- <i >Mandates</i >: <code >is_copy_constructible_v< T> && is_convertible_v< U&& , T> </code >
210+ <ins >-?- Let <code >X</code > be <code >remove_cv_t< T> </code >.</ins >
211+ </p >
212+ <p >
213+ -15- <i >Mandates</i >:
214+ <code >
215+ <del >is_copy_constructible_v< T> </del > <ins >is_convertible_v< const T& , X> </ins >
216+ &&
217+ is_convertible_v< U<del >&& </del >, <del >T</del > <ins >X</ins >>
218+ </code >
195219is `true`.
196220<p />
197221-16- <i >Effects</i >: Equivalent to:
@@ -204,11 +228,19 @@ return std::forward<U>(v);</ins>
204228</pre ></blockquote >
205229</blockquote >
206230<pre >
207- template< class U = remove_cv_t< T>> constexpr T value_or(U&& v) && ;
231+ template< class U = remove_cv_t< T>> constexpr < ins >remove_cv_t < </ ins >T< ins > > </ ins > value_or(U&& v) && ;
208232</pre >
209233<blockquote >
210234<p >
211- -17- <i >Mandates</i >: <code >is_move_constructible_v< T> && is_convertible_v< U&& , T> </code >
235+ <ins >-?- Let <code >X</code > be <code >remove_cv_t< T> </code >.</ins >
236+ </p >
237+ <p >
238+ -17- <i >Mandates</i >:
239+ <code >
240+ <del >is_move_constructible_v< T> </del > <ins >is_convertible_v< T, X> </ins >
241+ &&
242+ is_convertible_v< U<del >&& </del >, <del >T</del > <ins >X</ins >>
243+ </code >
212244is `true`.
213245<p />
214246-18- <i >Effects</i >: Equivalent to:
@@ -247,7 +279,12 @@ template<class U = remove_cv_t<T>> constexpr remove_cv_t<T> va
247279<p >
248280-8- Let <code >X</code > be <code >remove_cv_t< T> </code >.
249281<p />
250- -9- <i >Mandates</i >: <code >is_constructible_v< X, T&> && is_convertible_v< U, X> </code >
282+ -9- <i >Mandates</i >:
283+ <code >
284+ <del >is_constructible_v< T> </del > <ins >is_convertible_v< T& , X> </ins >
285+ &&
286+ is_convertible_v< U, X>
287+ </code >
251288is `true`.
252289<p />
253290-10- <i >Effects</i >: Equivalent to:
@@ -262,16 +299,34 @@ return std::forward<U>(u);</ins>
262299</blockquote >
263300</li >
264301
302+ <li ><p >Modify <sref ref =" [expected.object.general]" /> as indicated:</p >
303+
304+ <blockquote >
305+ <pre >
306+ [… ]
307+ template< class U = remove_cv_t< T>> constexpr <ins >remove_cv_t< </ins >T<ins >> </ins > value_or(U&& ) const & ;
308+ template< class U = remove_cv_t< T>> constexpr <ins >remove_cv_t< </ins >T<ins >> </ins > value_or(U&& ) && ;
309+ [… ]
310+ </pre >
311+ </blockquote >
312+ </li >
313+
265314<li ><p >Modify <sref ref =" [expected.object.obs]" /> as indicated:</p >
266315
267316<blockquote >
268317<pre >
269- template< class U = remove_cv_t< T>> constexpr T value_or(U&& v) const & ;
318+ template< class U = remove_cv_t< T>> constexpr < ins >remove_cv_t < </ ins >T< ins > > </ ins > value_or(U&& v) const & ;
270319</pre >
271320<blockquote >
272321<p >
273- -18- <i >Mandates</i >: <code >is_copy_constructible_v< T> </code > is `true` and
274- <code >is_convertible_v< U, T> </code > is `true`.
322+ <ins >-?- Let <code >X</code > be <code >remove_cv_t< T> </code >.</ins >
323+ </p >
324+ <p >
325+ -18- <i >Mandates</i >:
326+ <del ><code >is_copy_constructible_v< T> </code > is `true` and</del >
327+ <ins ><code >is_convertible_v< const T& , X> && </code ></ins >
328+ <code >is_convertible_v< U, T> </code >
329+ is `true`.
275330<p />
276331<del >-19- <i >Returns</i >: <code >has_value() ? **this : static_cast< T> (std::forward< U> (v))</code >.</del >
277332<p />
@@ -284,12 +339,18 @@ return std::forward<U>(v);</ins>
284339</pre ></blockquote >
285340</blockquote >
286341<pre >
287- template< class U = remove_cv_t< T>> constexpr T value_or(U&& v) && ;
342+ template< class U = remove_cv_t< T>> constexpr < ins >remove_cv_t < </ ins >T< ins > > </ ins > value_or(U&& v) && ;
288343</pre >
289344<blockquote >
290345<p >
291- -20- <i >Mandates</i >: <code >is_move_constructible_v< T> </code > is `true` and
292- <code >is_convertible_v< U, T> </code > is `true`.
346+ <ins >-?- Let <code >X</code > be <code >remove_cv_t< T> </code >.</ins >
347+ </p >
348+ <p >
349+ -20- <i >Mandates</i >:
350+ <del ><code >is_move_constructible_v< T> </code > is `true` and</del >
351+ <ins ><code >is_convertible_v< T, X> && </code ></ins >
352+ <code >is_convertible_v< U, T> </code >
353+ is `true`.
293354<p />
294355<del >-21- <i >Returns</i >: <code >has_value() ? std::move(**this) : static_cast< T> (std::forward< U> (v))</code >.</del >
295356<p />
0 commit comments