|
1 | 1 | <?xml version='1.0' encoding='utf-8' standalone='no'?> |
2 | 2 | <!DOCTYPE issue SYSTEM "lwg-issue.dtd"> |
3 | 3 |
|
4 | | -<issue num="2746" status="New"> |
| 4 | +<issue num="2746" status="Ready"> |
5 | 5 | <title>Inconsistency between requirements for <tt>emplace</tt> between <tt>optional</tt> and <tt>variant</tt></title> |
6 | 6 | <section><sref ref="[optional.assign]"/><sref ref="[variant.mod]"/><sref ref="[any.modifiers]"/></section> |
7 | 7 | <submitter>Richard Smith</submitter> |
@@ -117,9 +117,7 @@ precondition violation, I recommend that its <tt>emplace</tt> functions use the |
117 | 117 | them also in consistency with their corresponding type-based <tt>emplace</tt> forms that are |
118 | 118 | <i>Mandates:</i>-free but delegate to the index-based forms. |
119 | 119 | </p> |
120 | | -</discussion> |
121 | | - |
122 | | -<resolution> |
| 120 | +<superseded> |
123 | 121 | <p>This wording is relative to <a href="https://wg21.link/n4861">N4861</a>.</p> |
124 | 122 |
|
125 | 123 | <ol> |
@@ -205,6 +203,53 @@ template<size_t I, class U, class... Args> |
205 | 203 | </blockquote> |
206 | 204 | </li> |
207 | 205 |
|
208 | | -</ol></resolution> |
| 206 | +</ol> |
| 207 | + |
| 208 | +</superseded> |
| 209 | + |
| 210 | +<note>2025-12-05; Jonathan provides new wording</note> |
| 211 | +<p> |
| 212 | +There's no need to use SFINAE to check if a `variant` with N alternatives |
| 213 | +allows you to emplace the N+1<sup>th</sup> alternative. |
| 214 | +</p> |
| 215 | + |
| 216 | +<note>2025-12-05; LWG telecon. Moved to Ready</note> |
| 217 | + |
| 218 | +</discussion> |
| 219 | + |
| 220 | +<resolution> |
| 221 | + |
| 222 | +<p>This wording is relative to <paper num="N5014"/>.</p> |
| 223 | + |
| 224 | +<ol> |
| 225 | +<li><p>Modify <sref ref="[optional.assign]"/>, as indicated:</p> |
| 226 | + |
| 227 | +<blockquote> |
| 228 | +<pre> |
| 229 | +template<class... Args> T& emplace(Args&&... args); |
| 230 | +</pre> |
| 231 | +<blockquote> |
| 232 | +<p> |
| 233 | +-29- <i><del>Mandates</del><ins>Constraints</ins>:</i> <tt>is_constructible_v<T, Args...></tt> is <tt>true</tt>. |
| 234 | +<p/> |
| 235 | +[…] |
| 236 | +</p> |
| 237 | +</blockquote> |
| 238 | +<pre> |
| 239 | +template<class U, class... Args> T& emplace(initializer_list<U> il, Args&&... args); |
| 240 | +</pre> |
| 241 | +<blockquote> |
| 242 | +<p> |
| 243 | +-35- <i>Constraints:</i> <tt>is_constructible_v<T, initializer_list<U>&, Args...></tt> is <tt>true</tt>. |
| 244 | +<p/> |
| 245 | +[…] |
| 246 | +</p> |
| 247 | +</blockquote> |
| 248 | +</blockquote> |
| 249 | +</li> |
| 250 | + |
| 251 | +</ol> |
| 252 | + |
| 253 | +</resolution> |
209 | 254 |
|
210 | 255 | </issue> |
0 commit comments