|
| 1 | +# D4764 Editors' Report -- Programming Languages -- C++ |
| 2 | + |
| 3 | +2018-07-06 |
| 4 | +Richard Smith (editor) (Google Inc) |
| 5 | +Thomas Köppe (co-editor) (Google DeepMind) |
| 6 | +Jens Maurer (co-editor) |
| 7 | +Dawn Perchik (co-editor) (Bright Side Computing, LLC) |
| 8 | + |
| 9 | + |
| 10 | +## Acknowledgements |
| 11 | + |
| 12 | +Special thanks to Casey Carter for supplying a pull request to merge |
| 13 | +[P0898R3](http://wg21.link/p0898r3) (LWG motion 28), |
| 14 | +and working with us on editorial cleanups within the |
| 15 | +12 pages of added text. |
| 16 | + |
| 17 | +Thanks to all those who have [submitted editorial |
| 18 | +issues](https://github.com/cplusplus/draft/wiki/How-to-submit-an-editorial-issue) |
| 19 | +and to those who have provided pull requests with fixes. |
| 20 | + |
| 21 | +## New papers |
| 22 | + |
| 23 | + * [N4762](http://wg21.link/n4762) is the current working draft for C++20. It replaces [N4750](http://wg21.link/n4750). |
| 24 | + * N4764 is this Editors' Report. |
| 25 | + |
| 26 | +## Motions incorporated into working draft |
| 27 | + |
| 28 | +### Core working group motions |
| 29 | + |
| 30 | +CWG motion 1: [Core issue resolutions](http://wg21.link/p1113r0) for 6 issues in "ready" status applied: |
| 31 | + |
| 32 | + * [2254](http://wg21.link/cwg2254) Standard-layout classes and bit-fields |
| 33 | + * [2293](http://wg21.link/cwg2293) Requirements for *simple-template-id* used as a *class-name* |
| 34 | + * [2294](http://wg21.link/cwg2294) Dependent `auto` static data members |
| 35 | + * [2321](http://wg21.link/cwg2321) Conditional operator and cv-qualified class prvalues |
| 36 | + * [2322](http://wg21.link/cwg2322) Substitution failure and lexical order |
| 37 | + * [2339](http://wg21.link/cwg2339) Underspecified template arguments in structured bindings |
| 38 | + |
| 39 | +CWG motion 2: [Core issue resolutions](http://wg21.link/p1114r0) for 6 issues in "tentatively ready" status applied: |
| 40 | + |
| 41 | + * [2233](http://wg21.link/cwg2233) Function parameter packs following default arguments |
| 42 | + * [2249](http://wg21.link/cwg2249) *identifier*s and *id-expression*s |
| 43 | + * [2285](http://wg21.link/cwg2285) Issues with structured bindings |
| 44 | + * [2351](http://wg21.link/cwg2351) `void{}` |
| 45 | + * [2356](http://wg21.link/cwg2356) Base class copy and move constructors should not be inherited |
| 46 | + * [2359](http://wg21.link/cwg2359) Unintended copy initialization with designated initializers **(not a DR)** |
| 47 | + |
| 48 | +CWG motion 3: [P0806R2 "Deprecate implicit capture of `this` via `[=]`"](http://wg21.link/p0806r2) |
| 49 | + |
| 50 | +CWG motion 4: [P1042R1 `__VA_OPT__` wording clarifications"](http://wg21.link/p1042r1) |
| 51 | + |
| 52 | +CWG motion 5: [P0929R2 "Checking for abstract class types"](http://wg21.link/p0929r2) applied, resolving 2 core issues: |
| 53 | + |
| 54 | + * [1640](http://wg21.link/cwg1640) Array of abstract instance of class template |
| 55 | + * [1646](http://wg21.link/cwg1646) *decltype-specifier*s, abstract classes, and deduction failure |
| 56 | + |
| 57 | +CWG motion 6: [P0732R2 "Class types in non-type template parameters"](http://wg21.link/p0732r2) |
| 58 | + |
| 59 | +CWG motion 7 was not approved |
| 60 | + |
| 61 | +CWG motion 8: [P1025R1 "Update the reference to the Unicode standard"](http://wg21.link/p1025r1) |
| 62 | + |
| 63 | +CWG motion 9: [P0528R3 "The curious case of padding bits, featuring atomic compare-and-exchange"](http://wg21.link/p0528r3) |
| 64 | + |
| 65 | +CWG motion 10: [P0722R3 "Efficient sized delete for variable sized classes"](http://wg21.link/p0722r3) |
| 66 | + |
| 67 | +CWG motion 11: [P1064R0 "Allowing virtual function calls in constant expressions"](http://wg21.link/p1064r0) |
| 68 | + |
| 69 | +CWG motion 12: [P1008R1 "Prohibit aggregates with user-declared constructors"](http://wg21.link/p1008r1) |
| 70 | + |
| 71 | +CWG motion 13: [P1120R0 "Consistency improvements for `<=>` and other comparison operators"](http://wg21.link/p1120r0) |
| 72 | + |
| 73 | +CWG motion 14: [P0542R5 "Contract-based programming"](http://wg21.link/p0542r5) **see below** |
| 74 | + |
| 75 | +CWG motion 15: [P0941R2 "Feature-test macros"](http://wg21.link/p0941r2) **see below** |
| 76 | + |
| 77 | +CWG motion 16: [P0892R2 "`explicit(bool)`"](http://wg21.link/p0892r2) |
| 78 | + |
| 79 | +### Library working group motions |
| 80 | + |
| 81 | +LWG motions 1-5 apply to the Parallelism TS |
| 82 | + |
| 83 | +LWG motions 6 and 7 apply to the Reflection TS |
| 84 | + |
| 85 | +LWG motions 8 and 9 apply to the Coroutines TS |
| 86 | + |
| 87 | +LWG motion 10 applies to the Networking TS |
| 88 | + |
| 89 | +LWG motion 11: [Library issue resolutions](http://wg21.link/p1082r0) for 14 issues in "Ready" and "Tentatively Ready" status applied: |
| 90 | + |
| 91 | + * [2139](http://wg21.link/lwg2139) What is a user-defined type? **see below** |
| 92 | + * [2970](http://wg21.link/lwg2970) Return type of `std::visit` misspecified |
| 93 | + * [3058](http://wg21.link/lwg3058) Parallel `adjacent_difference` shouldn't require creating temporaries |
| 94 | + * [3062](http://wg21.link/lwg3062) Unnecessary `decay_t` in `is_execution_policy_v` should be `remove_cvref_t` |
| 95 | + * [3067](http://wg21.link/lwg3067) `recursive_directory_iterator::pop` must invalidate |
| 96 | + * [3074](http://wg21.link/lwg3074) Non-member functions for `valarray` should only deduce from the `valarray` |
| 97 | + * [3076](http://wg21.link/lwg3076) `basic_string` CTAD ambiguity |
| 98 | + * [3079](http://wg21.link/lwg3079) [LWG 2935](http://wg21.link/lwg2935) forgot to fix the `existing_p` overloads of `create_directory` |
| 99 | + * [3080](http://wg21.link/lwg3080) Floating point `from_chars` pattern specification breaks round-tripping |
| 100 | + * [3083](http://wg21.link/lwg3083) What should `ios::iword(-1)` do? |
| 101 | + * [3094](http://wg21.link/lwg3094) [time.duration.io]p4 makes surprising claims about encoding |
| 102 | + * [3100](http://wg21.link/lwg3100) Unnecessary and confusing "empty span" wording |
| 103 | + * [3102](http://wg21.link/lwg3102) Clarify `span` `iterator` and `const_iterator` behavior |
| 104 | + * [3104](http://wg21.link/lwg3104) Fixing `duration` division |
| 105 | + * Resolution of [3071](http://wg21.link/lwg3071) (`read_until` still refers to |
| 106 | + "input sequence") from P1082R0 was not part of this motion, as it applies to |
| 107 | + the Networking TS. |
| 108 | + |
| 109 | +LWG motion 12: [Library issue resolution](http://wg21.link/p0475r1) for 1 issue applied: |
| 110 | + |
| 111 | + * [2511](http://wg21.link/lwg2511) Guaranteed copy elision for piecewise construction |
| 112 | + |
| 113 | +LWG motion 13: [P0476R2 "Bit-casting object representations"](http://wg21.link/p0476r2) |
| 114 | + |
| 115 | +LWG motion 14: [P0788R3 "Standard library specification in a concepts and contracts world"](http://wg21.link/p0788r3) |
| 116 | + |
| 117 | +LWG motion 15 was not approved |
| 118 | + |
| 119 | +LWG motion 16: [P0458R2 "Checking for existence of an element in associative containers"](http://wg21.link/p0458r2) |
| 120 | + |
| 121 | +LWG motion 17: [P0759R1 "`fpos` requirements"](http://wg21.link/p0759r1) |
| 122 | + |
| 123 | +LWG motion 18: [P1023R0 "`constexpr` comparison operators for `std::array`"](http://wg21.link/p1023r0) |
| 124 | + |
| 125 | +LWG motion 19: [P0769R2 "Add `shift` to `<algorithm>`"](http://wg21.link/p0769r2) |
| 126 | + |
| 127 | +LWG motion 20: [P0887R1 "The `identity` metafunction"](http://wg21.link/p0887r1) |
| 128 | + |
| 129 | +LWG motion 21: [P0879R0 "`constexpr` for `swap` and `swap`-related functions"](http://wg21.link/p0879r0) applied, resolving 1 issue: |
| 130 | + |
| 131 | + * [2800](http://wg21.link/lwg2800) `constexpr` `swap` |
| 132 | + |
| 133 | +LWG motion 22: [P0758R1 "Implicit conversion traits and utility functions"](http://wg21.link/p0758r1) |
| 134 | + |
| 135 | +LWG motion 23: [P0556R3 "Integral power-of-2 operations"](http://wg21.link/p0556r3) |
| 136 | + |
| 137 | +LWG motion 24: [P0019R8 "`atomic_ref`"](http://wg21.link/p0019r8) |
| 138 | + |
| 139 | +LWG motion 25: [P0935R0 "Eradicating unnecessarily explicit default constructors from the standard library"](http://wg21.link/p0935r0) |
| 140 | + |
| 141 | +LWG motion 26: [P0646R1 "Improving the return value of `erase`-like algorithms"](http://wg21.link/p0646r1) |
| 142 | + |
| 143 | +LWG motion 27: [P0619R4 "Reviewing deprecated facilities of C++17 for C++20"](http://wg21.link/p0619r4) **see below** |
| 144 | + |
| 145 | +LWG motion 28: [P0898R3 "Standard library concepts"](http://wg21.link/p0898r3) **see below** |
| 146 | + |
| 147 | +## Notable editorial changes |
| 148 | + |
| 149 | +### CWG motion 14 |
| 150 | + |
| 151 | +Subclause structure and paragraph order of [dcl.attr.contracts] was reworked. |
| 152 | +Several normatively-redundant statements were converted to notes or removed. |
| 153 | + |
| 154 | +### CWG motion 15 |
| 155 | + |
| 156 | +Multiple papers moved at this meeting included suggested feature-test macros. |
| 157 | +However, these were not presented as editing instructions, because we did not |
| 158 | +have feature-test macros in the standard wording yet. After consultation with |
| 159 | +CWG and LWG, the following feature test macros have been added in addition to |
| 160 | +those listed in CWG motion 15 (all with value `201806L`): |
| 161 | + |
| 162 | + * `__has_cpp_attribute(assert)` |
| 163 | + * `__has_cpp_attribute(ensures)` |
| 164 | + * `__has_cpp_attribute(expects)` |
| 165 | + * `__cpp_explicit_bool` |
| 166 | + * `__cpp_nontype_template_parameter_class` |
| 167 | + * `__cpp_lib_atomic_ref` |
| 168 | + * `__cpp_lib_bit_cast` |
| 169 | + * `__cpp_lib_concepts` |
| 170 | + * `__cpp_lib_constexpr_swap_algorithms` |
| 171 | + * `__cpp_lib_list_remove_return_type` |
| 172 | + |
| 173 | +### CWG motions 16 and 12 |
| 174 | + |
| 175 | +CWG motion 16 would have us change wording that was deleted by CWG motion 12. |
| 176 | +The requested change in CWG motion 16 (from teletype "`explicit`" to body font "explicit") |
| 177 | +was ignored. |
| 178 | + |
| 179 | +### LWG motion 11: issue 2139 |
| 180 | + |
| 181 | +The underlying text has changed between the drafting of the resolution to this |
| 182 | +issue and its application. We believe every requested edit has been applied; |
| 183 | +however, an additional use of "user-defined type" has been added to |
| 184 | +[namespace.std] that should likely also have been covered by this wording. |
| 185 | +It has *not* been changed. |
| 186 | + |
| 187 | +### LWG motions 13 and 23 |
| 188 | + |
| 189 | +These motions both introduce a `<bit>` header, but the organizational structure |
| 190 | +suggested by motion 23 doesn't make sense for the functionality |
| 191 | +added by motion 13. |
| 192 | +The wording of motion 23 has been rearranged to fit into |
| 193 | +the structure established by motion 13. |
| 194 | + |
| 195 | +### LWG motions 16 |
| 196 | + |
| 197 | +Added the new `contains` member function for associative containers to the list |
| 198 | +of member function templates that do not participate in overload resolution |
| 199 | +unless the comparator is transparent, after consultation with LWG. |
| 200 | + |
| 201 | +### LWG motions 19 and 21 |
| 202 | + |
| 203 | +LWG motion 19 adds a `shift_right` algorithm to `<algorithm>` |
| 204 | +as a non-`constexpr` function template. |
| 205 | + |
| 206 | +LWG motion 21 instructs that we mark |
| 207 | +all non-parallel algorithms in `<algorithm>` |
| 208 | +as `constexpr`. |
| 209 | +Naturally, however, |
| 210 | +its proposed wording change does not list the `shift_right` algorithm. |
| 211 | +After consultation with LWG, `shift_right` has been marked `constexpr` |
| 212 | +to satisfy the intent of LWG motion 21. |
| 213 | + |
| 214 | +### LWG motion 27 |
| 215 | + |
| 216 | +Synopses for |
| 217 | +`<ccomplex>`, |
| 218 | +`<cstdalign>`, |
| 219 | +`<cstdbool>`, and |
| 220 | +`<ctgmath>` |
| 221 | +were not removed; |
| 222 | +instead, they have been repurposed as synopses for |
| 223 | +`<complex.h>`, |
| 224 | +`<stdalign.h>`, |
| 225 | +`<stdbool.h>`, and |
| 226 | +`<tgmath.h>`. |
| 227 | +(The latter used to be defined in terms of the former, |
| 228 | +but can no longer be specified in that way.) |
| 229 | +Also introduced a synopsis for `<iso646.h>`. |
| 230 | + |
| 231 | +### LWG motion 28 |
| 232 | + |
| 233 | +Clause labels shortened and simplified throughout. |
| 234 | + |
| 235 | +The single-item clauses [concept.movable], [concept.copyable], |
| 236 | +[concept.semiregular], and [concept.regular] have been merged into their |
| 237 | +parent, [concepts.object]. |
| 238 | + |
| 239 | +The single-item clauses [concept.signed.int] and [concept.unsigned.int] |
| 240 | +have been merged into their parent, [concept.integral]. |
| 241 | + |
| 242 | +Legacy concept names changed from Cpp98Something to Cpp17Something. Many of |
| 243 | +these concepts did not exist in C++98 (which in any case was revoked and |
| 244 | +replaced by C++03). |
| 245 | + |
| 246 | +Reworked "uniform random bit generator" requirements to describe them in terms |
| 247 | +of the UniformRandomBitGenerator concept. |
| 248 | + |
| 249 | +Removed "there need be no subsumption relationship" wording that is already |
| 250 | +implied by the core language rules for concepts. |
| 251 | + |
| 252 | +### Editorial paper [P1076R1 "Clause reorganization"](http://wg21.likn/p1076r1) |
| 253 | + |
| 254 | +The claue reorganization described in P1076R1 and discussed at the WG21 |
| 255 | +Rapperswil meeting has been applied to the working draft, with the following |
| 256 | +modifications: |
| 257 | + |
| 258 | +[class.copy] was left containing only two paragraphs of text, neither of which |
| 259 | +had any normative impact. It has been removed. |
| 260 | + |
| 261 | +The top-level subclauses of [algorithms] have been reordered to make the |
| 262 | +description of the `<numeric>` header fit better into its structure. |
| 263 | + |
| 264 | +Several paragraphs of [class] describing various properties of classes have |
| 265 | +been moved into a new subclause [class.prop] "Properties of clases". |
| 266 | + |
| 267 | +### Removal of single-item subclauses |
| 268 | + |
| 269 | +The single-item subclauses |
| 270 | +[move.iter.op=] and |
| 271 | +[move.iter.op.const] |
| 272 | +have been merged into [move.iter.cons]. |
| 273 | + |
| 274 | +The single-item subclauses |
| 275 | +[move.iter.op.star], |
| 276 | +[move.iter.op.ref], and |
| 277 | +[move.iter.op.index] |
| 278 | +have been merged into [move.iter.elem]. |
| 279 | + |
| 280 | +The single-item subclauses |
| 281 | +[move.iter.op.+], |
| 282 | +[move.iter.op.-], |
| 283 | +[move.iter.op.incr], |
| 284 | +[move.iter.op.+=], |
| 285 | +[move.iter.op.decr], and |
| 286 | +[move.iter.op.-=] |
| 287 | +have been merged into [move.iter.nav]. |
| 288 | + |
| 289 | +The now-empty [move.iter.ops] has been removed. |
| 290 | + |
| 291 | +## Minor editorial fixes |
| 292 | + |
| 293 | +A log of editorial fixes made to the working draft since N4750 is below. |
| 294 | +This list excludes changes |
| 295 | +that do not affect the body text or only affect whitespace or typeface. For a |
| 296 | +complete list including such changes (or for the actual deltas applied by these |
| 297 | +changes), consult the [draft sources on github](https://github.com/cplusplus/draft/compare/n4750...n4762). |
| 298 | + |
0 commit comments