Skip to content

Commit 731180d

Browse files
committed
Set priority for 4304 and add wording
1 parent 3ac563a commit 731180d

File tree

1 file changed

+72
-3
lines changed

1 file changed

+72
-3
lines changed

xml/issue4304.xml

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<section><sref ref="[optional.ref.observe]"/></section>
77
<submitter>Jiang An</submitter>
88
<date>25 Jul 2025</date>
9-
<priority>99</priority>
9+
<priority>1</priority>
1010

1111
<discussion>
1212
<p>
@@ -17,9 +17,18 @@ is still ill-formed, because the return type of its `value_or` member function i
1717
However, we don't exclude such <tt>T&amp;</tt> from valid contained types. Given only `value_or` is
1818
problematic here, perhaps we can avoid providing it if `T` is not returnable.
1919
</p>
20-
</discussion>
2120

22-
<resolution>
21+
<note>2025-10-16; Reflector poll</note>
22+
<p>
23+
Set priority to 1 after reflector poll.
24+
</p>
25+
<p>
26+
Why not just add <i>Constraints</i>: and use <code>decay_t&lt;T&gt;</code>
27+
for the return type, instead of "not always present" which is currently
28+
only used for member types, not member functions.
29+
</p>
30+
31+
<superseded>
2332
<p>
2433
This wording is relative to <paper num="N5014"/>.
2534
</p>
@@ -68,6 +77,66 @@ return has_value() ? *<i>val</i> : static_cast&lt;X&gt;(std::forward&lt;U&gt;(u)
6877
</blockquote>
6978
</li>
7079
</ol>
80+
</superseded>
81+
82+
<note>2025-10-16; Jonathan provides new wording</note>
83+
84+
</discussion>
85+
86+
<resolution>
87+
88+
<p>
89+
This wording is relative to <paper num="N5014"/>.
90+
</p>
91+
92+
<ol>
93+
94+
<li><p>Modify <sref ref="[optional.optional.ref.general]"/>, header <tt>&lt;iterator&gt;</tt> synopsis, as indicated:</p>
95+
96+
<blockquote>
97+
<pre>
98+
namespace std {
99+
template&lt;class T&gt;
100+
class optional&lt;T&amp;&gt; {
101+
[&hellip;]
102+
constexpr T&amp; value() const; // freestanding-deleted
103+
template&lt;class U = remove_cv_t&lt;T&gt;&gt;
104+
constexpr <ins>decay_t</ins><del>remove_cv_t</del>&lt;T&gt; value_or(U&amp;&amp; u) const;
105+
[&hellip;]
106+
};
107+
}
108+
</pre>
109+
</blockquote>
110+
</li>
111+
112+
<li><p>Modify <sref ref="[optional.ref.observe]"/> as indicated:</p>
113+
114+
<blockquote>
115+
<pre>
116+
template&lt;class U = remove_cv_t&lt;T&gt;&gt; constexpr <ins>decay_t</ins><del>remove_cv_t</del>&lt;T&gt; value_or(U&amp;&amp; u) const;
117+
</pre>
118+
<blockquote>
119+
<p>
120+
<ins>
121+
-?- <i>Constraints</i>:
122+
`T` is a non-array object type.
123+
</ins>
124+
</p>
125+
<p>
126+
-8- Let `X` be <tt>remove_cv_t&lt;T&gt;</tt>.
127+
<p/>
128+
-9- <i>Mandates</i>: <tt>is_constructible_v&lt;X, T&amp;&gt; &amp;&amp; is_convertible_v&lt;U, X&gt;</tt> is `true`.
129+
<p/>
130+
-10- <i>Effects</i>: Equivalent to:
131+
</p>
132+
<blockquote><pre>
133+
return has_value() ? *<i>val</i> : static_cast&lt;X&gt;(std::forward&lt;U&gt;(u));
134+
</pre></blockquote>
135+
</blockquote>
136+
</blockquote>
137+
</li>
138+
</ol>
139+
71140
</resolution>
72141

73142
</issue>

0 commit comments

Comments
 (0)