|
1 | 1 | <?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
2 |
| -<!DOCTYPE issue SYSTEM "lwg-issue.dtd" [ |
3 |
| - <!ENTITY hellip "…"> |
4 |
| - <!ENTITY mdash "—"> |
5 |
| -] > |
| 2 | +<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> |
6 | 3 |
|
7 | 4 | <issue num="2510" status="Open">
|
8 | 5 | <title>Tag types should not be <tt>DefaultConstructible</tt></title>
|
@@ -63,9 +60,16 @@ Move to Tentatively Ready.
|
63 | 60 | <p>VV: The guideline is that anything that does not mention the type name explicitly should not invoke an explicit constructor.</p>
|
64 | 61 | <p>Ville will provide wording.</p>
|
65 | 62 | <p>Discussion about pair/tuple's default constructor - should they now be explicit?</p>
|
66 |
| -</discussion> |
67 | 63 |
|
68 |
| -<resolution> |
| 64 | +<note>2016-01-31</note> |
| 65 | +<p> |
| 66 | +Ville provides revised wording. |
| 67 | +</p> |
| 68 | + |
| 69 | +<p> |
| 70 | +<strong>Previous resolution [SUPERSEDED]:</strong> |
| 71 | +</p> |
| 72 | +<blockquote class="note"> |
69 | 73 | <p>
|
70 | 74 | This wording is relative to N4527.
|
71 | 75 | </p>
|
@@ -200,6 +204,104 @@ argument of literal type.</ins>
|
200 | 204 | </blockquote>
|
201 | 205 |
|
202 | 206 | </li>
|
| 207 | +</ol> |
| 208 | +</blockquote> |
| 209 | +</discussion> |
| 210 | + |
| 211 | +<resolution> |
| 212 | +<p> |
| 213 | +This wording is relative to N4567. |
| 214 | +</p> |
| 215 | + |
| 216 | +<ol> |
| 217 | +<li><p>In <sref ref="[support.dynamic]"/>/1, change the header <tt><new></tt> synopsis:</p> |
| 218 | + |
| 219 | +<blockquote><pre> |
| 220 | +[…] |
| 221 | +struct nothrow_t { <ins>explicit nothrow_t() = default;</ins> }; |
| 222 | +extern const nothrow_t nothrow; |
| 223 | +[…] |
| 224 | +</pre></blockquote> |
| 225 | +</li> |
| 226 | + |
| 227 | +<li><p>In <sref ref="[utility]"/>/2, change the header <tt><utility></tt> synopsis:</p> |
| 228 | + |
| 229 | +<blockquote><pre> |
| 230 | +[…] |
| 231 | +// <i>20.3.5, pair piecewise construction</i> |
| 232 | +struct piecewise_construct_t { <ins>explicit piecewise_construct_t() = default;</ins> }; |
| 233 | +constexpr piecewise_construct_t piecewise_construct{ <ins><i>unspecified</i></ins> }; |
| 234 | +[…] |
| 235 | +</pre></blockquote> |
| 236 | +</li> |
| 237 | + |
| 238 | +<li><p>In <sref ref="[pair.piecewise]"/>, apply the following edits:</p> |
| 239 | + |
| 240 | +<blockquote><pre> |
| 241 | +struct piecewise_construct_t { <ins>explicit piecewise_construct_t() = default;</ins> }; |
| 242 | +constexpr piecewise_construct_t piecewise_construct{ <ins><i>unspecified</i></ins> }; |
| 243 | +</pre></blockquote> |
| 244 | +</li> |
| 245 | + |
| 246 | +<li><p>In <sref ref="[memory.syn]"/>/1, change the header <tt><memory></tt> synopsis:</p> |
| 247 | + |
| 248 | +<blockquote><pre> |
| 249 | +[…] |
| 250 | +// <i>20.7.6, allocator argument tag</i> |
| 251 | +struct allocator_arg_t { <ins>explicit allocator_arg_t() = default;</ins> }; |
| 252 | +constexpr allocator_arg_t allocator_arg{ <ins><i>unspecified</i></ins> }; |
| 253 | +[…] |
| 254 | +</pre></blockquote> |
| 255 | +</li> |
| 256 | + |
| 257 | +<li><p>In <sref ref="[allocator.tag]"/>, apply the following edits:</p> |
| 258 | + |
| 259 | +<blockquote><pre> |
| 260 | +namespace std { |
| 261 | + struct allocator_arg_t { <ins>explicit allocator_arg_t() = default;</ins> }; |
| 262 | + constexpr allocator_arg_t allocator_arg{ <ins><i>unspecified</i></ins> }; |
| 263 | +} |
| 264 | +</pre></blockquote> |
| 265 | +<blockquote class="note"> |
| 266 | +<p> |
| 267 | +Editorial drive-by: <tt>piecewise_construct_t</tt> is written, in <sref ref="[pair.piecewise]"/> like |
| 268 | +</p> |
| 269 | +<blockquote><pre> |
| 270 | +struct piecewise_construct_t { }; |
| 271 | +constexpr piecewise_construct_t piecewise_construct{}; |
| 272 | +</pre></blockquote> |
| 273 | +<p> |
| 274 | +whereas other tag types such as <tt>allocator_construct_t</tt> are, in e.g. |
| 275 | +<sref ref="[allocator.tag]"/>, written like |
| 276 | +</p> |
| 277 | +<blockquote><pre> |
| 278 | +namespace std { |
| 279 | + struct allocator_arg_t { }; |
| 280 | + constexpr allocator_arg_t allocator_arg{}; |
| 281 | +} |
| 282 | +</pre></blockquote> |
| 283 | +<p> |
| 284 | +We should decide whether or not to write out the <tt>std</tt> namespace in such |
| 285 | +paragraphs. I would suggest not to write it out. |
| 286 | +</p> |
| 287 | +</blockquote> |
| 288 | + |
| 289 | +</li> |
| 290 | +<li><p>In <sref ref="[thread.mutex]"/>/1, change the header <tt><mutex></tt> synopsis:</p> |
| 291 | + |
| 292 | +<blockquote><pre> |
| 293 | +[…] |
| 294 | +struct defer_lock_t { <ins>explicit defer_lock_t() = default;</ins> }; |
| 295 | +struct try_to_lock_t { <ins>explicit try_to_lock_t() = default;</ins> }; |
| 296 | +struct adopt_lock_t { <ins>explicit adopt_lock_t() = default;</ins> }; |
| 297 | + |
| 298 | +constexpr defer_lock_t defer_lock { <ins><i>unspecified </i></ins> }; |
| 299 | +constexpr try_to_lock_t try_to_lock { <ins><i>unspecified </i></ins> }; |
| 300 | +constexpr adopt_lock_t adopt_lock { <ins><i>unspecified </i></ins> }; |
| 301 | +[…] |
| 302 | +</pre></blockquote> |
| 303 | +</li> |
| 304 | + |
203 | 305 | </ol>
|
204 | 306 | </resolution>
|
205 | 307 |
|
|
0 commit comments