diff --git a/papers/n4812.html b/papers/n4812.html new file mode 100644 index 0000000000..78aa63fbd7 --- /dev/null +++ b/papers/n4812.html @@ -0,0 +1,813 @@ +N4812 +

N4812 Editors' Report -- Programming Languages -- C++

+ +

2019-03-21
+Richard Smith (editor) (Google Inc)
+Thomas Köppe (co-editor) (Google DeepMind)
+Jens Maurer (co-editor)
+Dawn Perchik (co-editor) (Bright Side Computing, LLC)
+<cxxeditor@gmail.com>

+ +

Acknowledgements

+ +

Special thanks to Marshall Clow +for supplying the LaTeX sources for

+ + + +

and to Gor Nishanov +for supplying a pull request for +P0912R5 (CWG motion 15, 22 pages of wording changes).

+ +

Thanks to all those who have submitted editorial +issues +and to those who have provided pull requests with fixes.

+ +

New papers

+ + + +

N4811 is a prior version of this Editors' Report, and is hereby rescinded and +replaced by this version. Thanks to Akira Takahashi for identifying errors in +some hyperlink destinations in that document; the hyperlinks in this version of +the Editors' Report have been corrected.

+ +

Motions incorporated into working draft

+ +

Core working group motions

+ +

CWG motion 1: Core issue resolutions for 14 issues in "ready" status applied, 1 not applied:

+ + + +

CWG motion 2: Core issue resolutions for 22 issues in "tentatively ready" status applied, resolving 24 issues:

+ + + +

CWG motion 3: P1286R2 "Contra CWG DR1778" (DR)

+ + + +

CWG motion 4: P1091R3 "Extending structured bindings to be more like variable declarations"

+ +

CWG motion 5: P1381R1 "Reference capture of structured bindings"

+ +

CWG motion 6: P1041R4 "Make char16_t/char32_t string literals be UTF-16/32"

+ +

CWG motion 7: P1139R2 "Address wording issues related to ISO 10646"

+ +

CWG motion 8: P1323R2 "Contract postconditions and return type deduction"

+ +

CWG motion 9: P0960R3 "Allow initializing aggregates from a parenthesized list of values"

+ +

CWG motion 10: P1009R2 "Array size deduction in new-expressions" (DR)

+ +

CWG motion 11: P1103R3 "Modules"

+ +

CWG motion 12: P1185R2 "<=> != =="

+ +

CWG motions 13 and 14 apply to the Reflection TS

+ +

CWG motion 15: P0912R5 "Coroutines"

+ +

Core motions added a total of 24 pages (and 1 Clause) to Clause 1-15

+ +

Library working group motions

+ +

LWG motion 1 applies to the Library Fundamentals TS

+ +

LWG motion 2: Library issue resolutions for 2 issues in Ready status and 11 issues in Tentatively Ready status applied:

+ + + +

LWG motion 3: P0339R6 "polymorphic_allocator<> as a vocabulary type"

+ +

LWG motion 4: P0340R3 "Making std::underlying_type SFINAE-friendly"

+ +

LWG motion 5 was retracted

+ +

LWG motion 6: P0738R2 "I Stream, You Stream, We All Stream for istream_iterator"

+ +

LWG motion 7: P1458R1 "Mandating the standard library: clause 16 - language support library"

+ +

LWG motion 8: P1459R1 "Mandating the standard library: clause 18 - diagnostics library"

+ +

LWG motion 9: P1462R1 "Mandating the standard library: clause 20 - strings library"

+ +

LWG motion 10: P1463R1 "Mandating the standard library: clause 21 - containers library"

+ +

LWG motion 11: P1464R1 "Mandating the standard library: clause 22 - iterators library"

+ +

LWG motion 12: P1164R1 "Make create_directory() intuitive" (DR)

+ +

LWG motion 13: P0811R3 "Well-behaved interpolation for numbers and pointers"

+ +

LWG motion 14: P1001R2 "Target vectorization policies from Parallelism V2 TS"

+ +

LWG motion 15: P1227R2 "Signed ssize() functions, unsigned size() functions "

+ +

LWG motion 16: P1252R2 "Ranges design cleanup"

+ +

LWG motion 17: P1024R3 "Usability enhancements for std::span"

+ +

LWG motion 18: P0920R2 "Precalculated hash values in lookup"

+ +

LWG motion 19: P1357R1 "Traits for [un]bounded arrays"

+ +

Library motions added a total of 7 pages to Clause 16-32.

+ +

Notable editorial changes

+ +

CWG motion 1

+ +

The edits for CWG2310 inadvertently required the base class to be complete +instead of the derived class in one of the edits. After consultation with CWG, +the derived class is now required to be complete in all cases.

+ +

The edits for CWG2331 were intended to be an editorial cleanup and wording +simplification, but were found to have unintentional normative effect. This +issue is being returned to CWG for redrafting.

+ +

The edits for CWG2332 added a note that was not entirely accurate. The note, +along with the normative text that it references, have been rephrased to +clarify that an injected-class-name is never interpreted as a template-name +in a context in which class template argument deduction would apply (even +though it can be interpreted as a template-name in some cases in a context +where a decl-specifier might be parsed, such as in a template-argument).

+ +

CWG motion 2

+ +

The wording moved for CWG2020 inadvertently omitted some edits that were part +of the wording reviewed by CWG. Those edits were not substantive, and have been +restored editorially.

+ +

CWG motion 12

+ +

Removed redundant restatement of the operator== symmetry rule in defaulted +operator!=; looking for reversed candidates and rewriting == expressions is +already handled by overload resolution, and a reversed operator== can never +be selected anyway because the two arguments are of the same type.

+ +

Likewise the corresponding redundant wording was removed from the rules for +defaulted operators <, >, <=, and >= that inaccurately claimed they +could select a reversed operator<=>.

+ +

CWG motion 15

+ +

Modernized the wording to follow current editorial conventions, and simplified +where possible.

+ +

Fixed a contradiction between the core and library wording; the library wording +allowed a coroutine_handle<> to resume any coroutine, but the core wording +did not account for that possibility and only permitted resumption via a +coroutine_handle<P> with the right promise type P.

+ +

LWG motion 2

+ +

Replaced the references to CopyConstructible and CopyAssignable with the +intended Cpp17CopyConstructible and Cpp17CopyAssignable after consultation +with LWG.

+ +

Section label changes

+ +

Several section labels introduced by the motions papers have been modified +to match our style guide. In addition to the section labels affected by the +above motions, all section labels containing underscores have been renamed +to instead use periods.

+ +

Reversion of prior editorial change

+ +

In N4791 (the post-San-Diego working draft), an editorial change was applied +to repair missing wording in 2018-11 CWG motion 14 +(P0595R2 "std::is_constant_evaluated()"). +This change added a definition of the term "usable in constant expressions" +as applied to objects and references that was inadvertently dropped from the +wording during CWG review.

+ +

Further review within CWG has shown that the dropped wording is also incorrect, +so the editorial fix has been reverted (leaving the definition absent rather +than incorrect), and a proper definition will be inserted by a core issue.

+ +

Minor editorial fixes

+ +

A log of editorial fixes made to the working draft since N4800 is below. +This list excludes changes +that do not affect the body text or only affect whitespace or typeface. For a +complete list including such changes (or for the actual deltas applied by these +changes), consult the draft sources on github.

+ +
commit 142acf0bbde8d6fd20cb67c051d896fec33a84b6
+Author: stryku <stryku2393@gmail.com>
+Date:   Thu Oct 11 18:41:18 2018 +0200
+
+    [decl.init]/10 Fix specified initialization.
+
+    According to [basic.start.static]/2, for objects with static storage duration,
+    zero initialization performs only if constant initialization does not.
+    [decl.init]/10 can be generalized to static initialization.
+    This is an editorial note change.
+
+commit 74def77454a15b6cdb45be0f31916396b4b63b72
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Fri Mar 15 13:45:06 2019 -0700
+
+    [util.smartptr.atomic.shared] [util.smartptr.atomic.weak] Clarify
+    grouping of "either".
+
+commit 4c5701a79cc7c4cc7b9cd9c6070e3cd88961aca7
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri Dec 21 21:04:43 2018 +0100
+
+    [mismatch] LWG3178 std::mismatch is missing an upper bound
+
+commit 04a5e31a02e19e5d1c9e9a0b05c40ce8730c7064
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Sat Jan 26 00:30:13 2019 +0100
+
+    [algorithms] Qualify declarator-id with sub-namespace.
+
+    Also qualify return types where appropriate.
+
+commit 6c844190a533950fc0100eac4da7785d99c87400
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri Mar 15 20:25:59 2019 +0100
+
+    [time.clock.req] Change 'satisfy' to 'meet'.
+
+commit c3adaef44b94cc63a8a8806f398185046461947c
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri Mar 15 19:23:30 2019 +0100
+
+    [numeric.requirements] Define 'numeric type'.
+
+commit 1ce86a62a3cff9fb2bcf6c1a2c37168e023e338b
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Sat Mar 9 22:18:26 2019 +0100
+
+    [time.clock.req] Simplify requirements for Cpp17TrivialClock.
+
+commit 0ba5424c1beddfd8c8403ce882b96dee0f530c7f
+Author: JF Bastien <github@jfbastien.com>
+Date:   Fri Mar 15 13:52:39 2019 -0700
+
+    [basic.fundamental] Rename 'range exponent' to 'width' to align with C
+
+commit 9e00558f2a824421406a6703d1232cc4fb89bb15
+Author: Arthur O'Dwyer <arthur.j.odwyer@gmail.com>
+Date:   Fri Mar 15 16:43:16 2019 -0400
+
+    [std] Fix a bunch of faulty parallelism with "either".
+
+commit 54ddcb970132bfe026c9d9d62d967632b56ae303
+Author: BRevzin <barry.revzin@gmail.com>
+Date:   Fri Mar 15 15:30:07 2019 -0500
+
+    [class.rel] Simplifying wording to avoid talking about a reversed <=>.
+
+    We can never select a reversed <=> here because the operands are of the same type.
+
+commit 5d174b05d8cd08717ed7efc05d0271409651071c
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Fri Mar 15 12:33:42 2019 -0700
+
+    [expr.prim.lambda.capture] Convert paragraphs repeating the
+    "non-odr-usable local entities shall not be odr-used" rule from
+    [basic.def.odr] into notes.
+
+commit 41853024e5e6fcd5feb496f64767d2888d76154f
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Fri Mar 15 11:38:57 2019 -0700
+
+    Revert "[expr.const] Add missing definition of 'usable in constant expressions'"
+
+    The prior editorial fix was an attempt to re-add wording that was
+    missing from P0595R2 (moved as 2018-11 CWG Motion 14). However, CWG
+    analysis has indicated that the editorial fix is incomplete, so we're
+    reverting it to restore the wording to the as-moved state.
+
+    This reverts commit e58439bce8af85e6569328272c2cfb73f5fc44d6.
+
+commit 154f2c59c4377897937f4b0722cfe2b6d726cc59
+Author: birbacher <frank.birbacher@gmail.com>
+Date:   Fri Mar 15 18:39:16 2019 +0000
+
+    [container.node] Add 3 "template" keywords for dependent name (#2676)
+
+    On:
+    [container.node.overview]/4
+    [container.node.cons]/3.1
+    [container.node.dtor]/1
+
+commit 2585d7f5894b46e0aa2f961183060a5201b2cca7
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri Dec 21 19:29:38 2018 +0100
+
+    [std] Replace underscores in stable labels with periods.
+
+commit 554a8926404bd5e0f772a6cb72c04bd12a5b7984
+Author: Casey Carter <Casey@Carter.net>
+Date:   Mon Mar 4 09:29:50 2019 -0800
+
+    [specialized.algorithms] Rename voidify's parameter
+
+    `ptr` is an odd name for a parameter that is a reference to storage for an object.
+
+commit a2dfa61a0d50a24e7be6cbc004bb0f076b8c62b5
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri Mar 8 22:25:38 2019 +0100
+
+    [queue.syn,stack.syn] Add partial specialization of uses_allocator
+
+commit 721f2d606f90cc20a16ad9b4383bc78cb368abdc
+Author: Jonathan Wakely <github@kayari.org>
+Date:   Fri Mar 15 02:53:18 2019 +0000
+
+    [func.not_fn], [func.bind_front] fix phrasing of \mandates and \expects (#2750)
+
+    The Mandates: element should just state its condition, and not say "shall".
+    Cpp17 concept requirements should be phrased as "X meets the
+    Y requirements" not "X shall meet the requirements of Y".
+
+commit 48484c967ee5f3ecb65ff857f8f4794e108ba0cb
+Author: Krystian <sdkrystian@gmail.com>
+Date:   Thu Mar 14 22:49:33 2019 -0400
+
+    [temp.class.spec.mfunc] Correct "class template specialization" to the intended "class template partial specialization"
+
+commit 3117814eaf800a5e1dd387f4c5a0522f2627689e
+Author: languagelawyer <38548419+languagelawyer@users.noreply.github.com>
+Date:   Fri Mar 15 05:48:28 2019 +0300
+
+    [expr.sizeof] Remove the redundant paragraph 3
+
+    Paragraph 1 already says that functions are disallowed and function pointers are allowed.
+
+commit c769f835dadd4a35df9febad684a296d6cb71a53
+Author: JF Bastien <github@jfbastien.com>
+Date:   Thu Mar 14 19:45:53 2019 -0700
+
+    [dcl.attr.contract.cond] Replace return type with 'void' in example that does not return
+
+    Also remove the (unused) name for the return value in the postcondition.
+
+commit d48c79e223cfbd5ec134703e20989235208e9364
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri Mar 8 01:14:16 2019 +0100
+
+    [dcl.enum] Fix singular/plural mismatch.
+
+commit c5fb73ba6a9b71f6e247103ab4baac1c9f72e210
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri Mar 8 01:13:35 2019 +0100
+
+    [conv.prom] b_min and b_max are no longer defined in [dcl.enum]
+
+commit d7d2580c7d8fabe25ada4dd0e091f9997c0916f5
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Sat Mar 9 22:36:47 2019 +0100
+
+    [range.iota,range.adaptors] Add cross-references for private member types.
+
+commit b8fd249c737ff2c3652cf6ef77db25712038d353
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Sun Mar 10 20:20:10 2019 +0100
+
+    [dcl.init] Prepend 'Otherwise' to a bullet
+
+commit dd227824ade24ab51dd4cc926c4b9e87cc29becf
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Sun Mar 10 20:28:41 2019 +0100
+
+    [dcl.attr.contract.cond] References cannot be modified.
+
+    Avoid confusion caused by using the words "makes [...]
+    modifications of the value of [a] parameter" by excluding
+    references.
+
+commit b0116b87bf33fed9648e6e8b1b0c7cee0d90b311
+Author: Jason Merrill <jason@redhat.com>
+Date:   Tue Mar 12 09:06:23 2019 -0400
+
+    [over.match.best] Add number for paragraph 2.
+
+commit f0f7ba234644d3690d18fcba73f618648014a47c
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Wed Mar 13 22:21:42 2019 +0100
+
+    [lib] Use '(inclusive)', not other punctuation
+
+    to indicate inclusive ranges in prose.
+
+commit 5ba461ec9836f95ed7a54b563b06d480f564e987
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Wed Mar 13 22:46:19 2019 +0100
+
+    [class.eq,class.spaceship] Clarify order of comparison.
+
+commit 42e5df5c08c9ef805da304fe05fe387cfc3d33d5
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Thu Mar 14 00:02:25 2019 +0100
+
+    [basic.lookup.argdep] Reorder bullets to group semantics.
+
+commit 927dc13e1010e031692f3a94d8e9599beeb877ac
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Thu Mar 14 17:22:07 2019 -0700
+
+    [array.tuple] Fix broken description of tuple_element for std::array.
+
+commit 0b06fcd5f92bc0439a868471a5fdfdba8a181941
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri Mar 8 22:12:14 2019 +0100
+
+    [ranges.syn] Add ref_view to header synopsis.
+
+commit 6f6e5772b2a2dcf41e3db4f68b6cbc3c0628c061
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Thu Mar 14 16:05:33 2019 -0700
+
+    [algorithms.parallel.exec] Rephrase to avoid incorrect use of "may not".
+
+    Convert rationale sentence to a note.
+
+commit de76c7de8c4f9734e0e4351d2088d4786ee62135
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Tue Mar 5 21:57:10 2019 +0100
+
+    [char.traits.typedefs] Change 'shall meet' to 'meets'
+
+commit e11e27a7873953f0c078901f7ddbb0d7d701c5f7
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Wed Mar 6 21:15:37 2019 +0100
+
+    [mem.poly.allocator.mem] Avoid duplicate colons.
+
+commit 2956ba37186d7e9cbe728cc3870a2a26fb1f0168
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Wed Mar 13 14:14:43 2019 -0700
+
+    [dcl.fct.def.coroutine] Update wording to align with current editorial
+    conventions.
+
+    Reorder and rearrange to reduce the number of variables with long scopes
+    that we define in the wording.
+
+    Fix mismatch between core and library wording where library permits
+    coroutine_handle<void> to resume a coroutine with any promise type, and
+    the core language does not.
+
+commit 8dd4539b24473677809163f5e6d399ba6aa0b27d
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Tue Mar 12 18:15:59 2019 -0700
+
+    [expr.await] Rephrase and modernize wording.
+
+    Invoke temporary materialization conversion directly rather than
+    handwaving about a temporary object. Specify that the o expression is
+    evaluated. Bulletize description of the three different ways that
+    await-suspend is called.
+
+    Fix wording that uses values and objects on the left-hand side of a
+    class member access to instead consistently use expressions.
+
+    Fixes #2774.
+
+commit d69814f61077f7e549ccc39a21fc3b90db4223d6
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Mon Mar 11 20:12:17 2019 -0700
+
+    [temp.param] "a type that is literal" -> "a literal type".
+
+commit c0058816fdfe079095ca8717ad692dc2d498d6a3
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Mon Mar 11 20:11:46 2019 -0700
+
+    [class.eq] Remove redundant repetition of the operator== symmetry rule.
+
+commit 007c0c1a619417f94c2c4efb57be71c09f2c2870
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Wed Mar 6 21:32:09 2019 +0100
+
+    [temp.type] Do not refer to operator==, which excludes built-in ==.
+
+commit caa5c8aedecdf68cfda4f5d95ec9d20451953117
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Tue Mar 5 19:05:25 2019 +0100
+
+    [class.compare.default] Add a note that friends are found by ADL only.
+
+commit c9074b533c835bbf820f5ea09957810ed2c04dab
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Wed Mar 6 20:56:58 2019 +0100
+
+    [expr.new] Move treatment of arrays of unknown bound
+
+commit ce2f08ab94123adb44e58f1176c6ae4f3209eb60
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Mon Mar 11 17:20:25 2019 -0700
+
+    [dcl.init] Merge new direct aggregate init wording into class direct
+    initialization bullet to avoid the wording being unreachable due to an
+    "Otherwise" chain.
+
+commit 691b7c10530d3265afbf445dff3dd129c7c5692e
+Author: Dawn Perchik <dperchik@embarcadero.com>
+Date:   Sun Mar 10 16:15:53 2019 -0700
+
+    [dcl.init] Moved the changed bullet in 17.5 to before 17.6.3.
+
+commit 5f7461d24bc0e9867458a043adf04aa8c4ceed73
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Fri Mar 8 16:11:34 2019 -0800
+
+    [temp.dep.type] Rephrase to avoid suggesting that an expression can be
+    the current instantiation.
+
+    A type can't be the current instantiation either, but that's a
+    pre-existing prevalent problem.
+
+commit cbb21fb0210b6aade5591de94e3a27d7059e9d06
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Fri Mar 8 16:08:02 2019 -0800
+
+    [basic.def.odr] Apply additional edits from CWG review that were not
+    transcribed into P1359R0.
+
+commit ac732bfe4eef01e9e2443dac6138270695d7cbf9
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Fri Mar 8 12:24:49 2019 -0800
+
+    [expr.prim.lambda.capture] Add missing close parentheses in CWG2358
+    examples.
+
+    Fixes #2680.
+
+commit 502e419ca75c9656394d1998036b4b810e8bdb17
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Fri Mar 8 12:00:26 2019 -0800
+
+    [dcl.type.simple] Fix inaccurate note added by CWG2332
+
+    [temp.local] Clarify that the surrounding syntax and construct directly
+    dictates whether an injected-class-name is syntactically a template-name
+    or a type-name, not just what it means.
+
+commit f4346ece403e469e800d635a75baafb9c411aa1b
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Fri Mar 8 11:39:36 2019 -0800
+
+    [expr.static.cast] Fix wording of CWG2310 to match CWG intent (verified
+    on core reflector):
+
+     - in p11, require D to be a complete class type, not B
+     - in p12, rephrase to avoid the suggestion that we're talking about a
+       different D than the one already in scope
+
+commit 6f34b0513ed6d974b86a27429f8f4d02a6c18b88
+Author: Hana Dusíková <hanicka@hanicka.net>
+Date:   Fri Feb 22 11:03:29 2019 -1000
+
+    [pair.astuple, tuple.helper] Fix inconsistent class key in tuple_size/tuple_element. (#2679)
+
+    It was declared as a struct and specializations were classes.
+
+commit 102a791b446f70f939a9b1e2e66fc3553aade19c
+Author: Johel Ernesto Guerrero Peña <johelegp@gmail.com>
+Date:   Fri Feb 22 02:30:23 2019 -0400
+
+    [array.syn] Add reference to [array.tuple]
+
+commit 7fe655909b4e5f01d8a8b71d6b508785c42c739e
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Wed Feb 20 17:04:55 2019 -1000
+
+    [temp.dep] [temp.dep.res] Remove redundant restatement of the two-phase
+    lookup rule. The primary location of the rule is [temp.dep.candidate].
+
+commit 8fbeb52ae5daccc0352798ff023f6cba6aebcd42
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Mon Feb 18 17:15:39 2019 -1000
+
+    [basic.link] The notion of the linkage of a type is no longer used for
+    any purpose. Remove it and move its example next to the rule that
+    justifies it, and simplify said example.
+
+commit cafdbd8036f3cf19e9cfc2f56584b219fb190602
+Author: languagelawyer <38548419+languagelawyer@users.noreply.github.com>
+Date:   Fri Jan 25 00:12:44 2019 +0300
+
+    [expr.sizeof]/2: there are no expressions of reference type
+
+commit 35ce0ae2eb2582dbc00fc824afbfa1d53a64de8d
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Wed Feb 13 17:51:58 2019 -0800
+
+    [depr.array.comp] Fix example of deprecated array comparison
+
+commit 2f0bd979f41953890129fcbdc6ef37e3e90387ad
+Author: Alisdair Meredith <alisdairm@me.com>
+Date:   Sun Feb 10 16:53:15 2019 -0500
+
+    Add missing noexcept cross-refs for invokable traits (#2662)
+
+    All the other traits that use the phrase 'is known not to throw exceptions' also cross-reference the core clause for the noexcept operator, so add the missing cross reference to the more recently added traits.
+
+commit 9f261368736c3666791329145292c1563a291861
+Author: Alberto Barbati <2210776+iaanus@users.noreply.github.com>
+Date:   Sun Feb 10 22:52:36 2019 +0100
+
+    [temp.mem.func] Fixed text in example, which was not updated by CWG 249 (#2658)
+
+commit f668df034ebf27ad53b5addad22af4f1293f829f
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Sun Feb 10 22:50:42 2019 +0100
+
+    [algorithms.general,concepts.general] Add missing entries for summary tables (#2663)
+
diff --git a/papers/n4812.md b/papers/n4812.md new file mode 100644 index 0000000000..095aac97ab --- /dev/null +++ b/papers/n4812.md @@ -0,0 +1,677 @@ +# N4812 Editors' Report -- Programming Languages -- C++ + +2019-03-21 +Richard Smith (editor) (Google Inc) +Thomas Köppe (co-editor) (Google DeepMind) +Jens Maurer (co-editor) +Dawn Perchik (co-editor) (Bright Side Computing, LLC) +`` + +## Acknowledgements + +Special thanks to Marshall Clow +for supplying the LaTeX sources for + + * [P1458R1](http://wg21.link/p1458r1) (LWG motion 7, 42 pages of wording changes) + * [P1459R1](http://wg21.link/p1459r1) (LWG motion 8, 15 pages of wording changes) + * [P1463R1](http://wg21.link/p1463r1) (LWG motion 10, 119 pages of wording changes) and + * [P1464R1](http://wg21.link/p1464r1) (LWG motion 11, 60 pages of wording changes) + +and to Gor Nishanov +for supplying a pull request for +[P0912R5](http://wg21.link/p0912r5) (CWG motion 15, 22 pages of wording changes). + +Thanks to all those who have [submitted editorial +issues](https://github.com/cplusplus/draft/wiki/How-to-submit-an-editorial-issue) +and to those who have provided pull requests with fixes. + +## New papers + + * [N4810](http://wg21.link/n4810) is the current working draft for C++20. It replaces [N4800](http://wg21.link/n4800). + * N4812 is this Editors' Report. + +N4811 is a prior version of this Editors' Report, and is hereby rescinded and +replaced by this version. Thanks to Akira Takahashi for identifying errors in +some hyperlink destinations in that document; the hyperlinks in this version of +the Editors' Report have been corrected. + +## Motions incorporated into working draft + +### Core working group motions + +CWG motion 1: [Core issue resolutions](http://wg21.link/p1358r0) for 14 issues in "ready" status applied, 1 not applied: + + * [2256](http://wg21.link/cwg2256) Lifetime of trivially-destructible objects + * [2267](http://wg21.link/cwg2267) Copy-initialization of temporary in reference direct-initialization + * [2278](http://wg21.link/cwg2278) Copy elision in constant expressions reconsidered + * [2303](http://wg21.link/cwg2303) Partial ordering and recursive variadic inheritance + * [2309](http://wg21.link/cwg2309) Restrictions on nested statements within constexpr functions + * [2310](http://wg21.link/cwg2310) Type completeness and derived-to-base pointer conversions **see below** + * [2317](http://wg21.link/cwg2317) Self-referential default member initializers + * [2318](http://wg21.link/cwg2318) Nondeduced contexts in deduction from a *braced-init-list* + * [2330](http://wg21.link/cwg2330) Missing references to variable templates + * [2331](http://wg21.link/cwg2331) Redundancy in description of class scope **not applied, see below** + * [2332](http://wg21.link/cwg2332) *template-name* as *simple-type-name* vs *injected-class-name* **see below** + * [2336](http://wg21.link/cwg2336) Destructor characteristics vs potentially-constructed subobjects + * [2352](http://wg21.link/cwg2352) Similar types and reference binding + * [2358](http://wg21.link/cwg2358) Explicit capture of value + * [2360](http://wg21.link/cwg2360) `[[maybe_unused]]` and structured bindings + +CWG motion 2: [Core issue resolutions](http://wg21.link/p1359r0) for 22 issues in "tentatively ready" status applied, resolving 24 issues: + + * [581](http://wg21.link/cwg581) Can a templated constructor be explicitly instantiated or specialized? + * [1937](http://wg21.link/cwg1937) Incomplete specification of function pointer from lambda + * [1938](http://wg21.link/cwg1938) Should hosted/freestanding be implementation-defined? + * [2020](http://wg21.link/cwg2020) Inadequate description of odr-use of implicitly-invoked functions **see below** + * [2051](http://wg21.link/cwg2051) Simplifying alias rules + * [2083](http://wg21.link/cwg2083) Incorrect cases of odr-use + * [2103](http://wg21.link/cwg2103) Lvalue-to-rvalue conversion is irrelevant in odr-use of a reference **resolved by 2083** + * [2170](http://wg21.link/cwg2170) Unclear definition of odr-use for arrays **resolved by 2083** + * [2257](http://wg21.link/cwg2257) Lifetime extension of references vs exceptions + * [2266](http://wg21.link/cwg2266) Has dependent type vs is type-dependent + * [2289](http://wg21.link/cwg2289) Uniqueness of structured binding names + * [2353](http://wg21.link/cwg2353) Potential results of a member access expression for a static data member + * [2354](http://wg21.link/cwg2354) Extended alignment and object representation + * [2365](http://wg21.link/cwg2365) Confusing specification for `dynamic_cast` + * [2368](http://wg21.link/cwg2368) Differences in relational and three-way constant comparisons + * [2372](http://wg21.link/cwg2372) Incorrect matching rules for block-scope extern declarations + * [2379](http://wg21.link/cwg2379) Missing prohibition against `constexpr` in friend declaration + * [2380](http://wg21.link/cwg2380) *capture-default* makes too many references odr-usable + * [2381](http://wg21.link/cwg2381) Composite pointer type of pointers to plain and `noexcept` member functions + * [2384](http://wg21.link/cwg2384) Conversion function templates and qualification conversions + * [2385](http://wg21.link/cwg2385) Lookup for *conversion-function-id*s + * [2386](http://wg21.link/cwg2386) `tuple_size` requirements for structured binding + * [2387](http://wg21.link/cwg2387) Linkage of const-qualified variable template + * [2394](http://wg21.link/cwg2394) Const-default-constructible for members + +CWG motion 3: [P1286R2 "Contra CWG DR1778"](http://wg21.link/p1286r2) **(DR)** + + * Alters resolution of [1778](http://wg21.link/cwg1778) *exception-specification* in explicitly-defaulted functions + +CWG motion 4: [P1091R3 "Extending structured bindings to be more like variable declarations"](http://wg21.link/p1091r3) + +CWG motion 5: [P1381R1 "Reference capture of structured bindings"](http://wg21.link/p1381r1) + +CWG motion 6: [P1041R4 "Make `char16_t`/`char32_t` string literals be UTF-16/32"](http://wg21.link/p1041r4) + +CWG motion 7: [P1139R2 "Address wording issues related to ISO 10646"](http://wg21.link/p1139r2) + +CWG motion 8: [P1323R2 "Contract postconditions and return type deduction"](http://wg21.link/p1323r2) + +CWG motion 9: [P0960R3 "Allow initializing aggregates from a parenthesized list of values"](http://wg21.link/p0960r3) + +CWG motion 10: [P1009R2 "Array size deduction in *new-expressions*"](http://wg21.link/p1009r2) **(DR)** + +CWG motion 11: [P1103R3 "Modules"](http://wg21.link/p1103r3) + +CWG motion 12: [P1185R2 "`<=>` `!=` `==`"](http://wg21.link/p1185r2) + +CWG motions 13 and 14 apply to the Reflection TS + +CWG motion 15: [P0912R5 "Coroutines"](http://wg21.link/p0912r5) + +Core motions added a total of 24 pages (and 1 Clause) to Clause 1-15 + +### Library working group motions + +LWG motion 1 applies to the Library Fundamentals TS + +LWG motion 2: [Library issue resolutions](http://wg21.link/p1457r0) for 2 issues in Ready status and 11 issues in Tentatively Ready status applied: + + * [3012](http://wg21.link/lwg3012) `atomic` is unimplementable for non-`is_trivially_copy_constructible` `T` + * [3040](http://wg21.link/lwg3040) `basic_string_view::starts_with` *Effects* are incorrect + * [3077](http://wg21.link/lwg3077) (`push`|`emplace`)`_back` should invalidate the end iterator + * [3087](http://wg21.link/lwg3087) One final `&x` in [list.ops] + * [3101](http://wg21.link/lwg3101) `span`'s `Container` constructors need another constraint + * [3112](http://wg21.link/lwg3112) `system_error` and `filesystem_error` constructors taking a `string` may not be able to meet their postconditions + * [3119](http://wg21.link/lwg3119) Program-definedness of closure types + * [3133](http://wg21.link/lwg3133) Modernizing numeric type requirements + * [3144](http://wg21.link/lwg3144) `span` does not have a `const_pointer` typedef + * [3173](http://wg21.link/lwg3173) Enable CTAD for *`ref-view`* + * [3179](http://wg21.link/lwg3179) `subrange` should always model `Range` + * [3180](http://wg21.link/lwg3180) Inconsistently named return type for `ranges::minmax_element` + * [3182](http://wg21.link/lwg3182) Specification of `Same` could be clearer + +LWG motion 3: [P0339R6 "`polymorphic_allocator<>` as a vocabulary type"](http://wg21.link/p0339r6) + +LWG motion 4: [P0340R3 "Making `std::underlying_type` SFINAE-friendly"](http://wg21.link/p0340r3) + +LWG motion 5 was retracted + +LWG motion 6: [P0738R2 "I Stream, You Stream, We All Stream for `istream_iterator`"](http://wg21.link/p0738r2) + +LWG motion 7: [P1458R1 "Mandating the standard library: clause 16 - language support library"](http://wg21.link/p1458r1) + +LWG motion 8: [P1459R1 "Mandating the standard library: clause 18 - diagnostics library"](http://wg21.link/p1459r1) + +LWG motion 9: [P1462R1 "Mandating the standard library: clause 20 - strings library"](http://wg21.link/p1462r1) + +LWG motion 10: [P1463R1 "Mandating the standard library: clause 21 - containers library"](http://wg21.link/p1463r1) + +LWG motion 11: [P1464R1 "Mandating the standard library: clause 22 - iterators library"](http://wg21.link/p1464r1) + +LWG motion 12: [P1164R1 "Make `create_directory()` intuitive"](http://wg21.link/p1164r1) **(DR)** + +LWG motion 13: [P0811R3 "Well-behaved interpolation for numbers and pointers"](http://wg21.link/p0811r3) + +LWG motion 14: [P1001R2 "Target vectorization policies from Parallelism V2 TS"](http://wg21.link/p1001r2) + +LWG motion 15: [P1227R2 "Signed `ssize()` functions, unsigned `size()` functions "](http://wg21.link/p1227r2) + +LWG motion 16: [P1252R2 "Ranges design cleanup"](http://wg21.link/p1252r2) + +LWG motion 17: [P1024R3 "Usability enhancements for `std::span`"](http://wg21.link/p1024r3) + +LWG motion 18: [P0920R2 "Precalculated hash values in lookup"](http://wg21.link/p0920r2) + +LWG motion 19: [P1357R1 "Traits for [un]bounded arrays"](http://wg21.link/p1357r1) + +Library motions added a total of 7 pages to Clause 16-32. + +## Notable editorial changes + +### CWG motion 1 + +The edits for CWG2310 inadvertently required the base class to be complete +instead of the derived class in one of the edits. After consultation with CWG, +the derived class is now required to be complete in all cases. + +The edits for CWG2331 were intended to be an editorial cleanup and wording +simplification, but were found to have unintentional normative effect. This +issue is being returned to CWG for redrafting. + +The edits for CWG2332 added a note that was not entirely accurate. The note, +along with the normative text that it references, have been rephrased to +clarify that an injected-class-name is never interpreted as a *template-name* +in a context in which class template argument deduction would apply (even +though it can be interpreted as a *template-name* in some cases in a context +where a *decl-specifier* might be parsed, such as in a *template-argument*). + +### CWG motion 2 + +The wording moved for CWG2020 inadvertently omitted some edits that were part +of the wording reviewed by CWG. Those edits were not substantive, and have been +restored editorially. + +### CWG motion 12 + +Removed redundant restatement of the `operator==` symmetry rule in defaulted +`operator!=`; looking for reversed candidates and rewriting `==` expressions is +already handled by overload resolution, and a reversed `operator==` can never +be selected anyway because the two arguments are of the same type. + +Likewise the corresponding redundant wording was removed from the rules for +defaulted operators `<`, `>`, `<=`, and `>=` that inaccurately claimed they +could select a reversed `operator<=>`. + +### CWG motion 15 + +Modernized the wording to follow current editorial conventions, and simplified +where possible. + +Fixed a contradiction between the core and library wording; the library wording +allowed a `coroutine_handle<>` to resume any coroutine, but the core wording +did not account for that possibility and only permitted resumption via a +`coroutine_handle

` with the right promise type `P`. + +### LWG motion 2 + +Replaced the references to *CopyConstructible* and *CopyAssignable* with the +intended *Cpp17CopyConstructible* and *Cpp17CopyAssignable* after consultation +with LWG. + +### Section label changes + +Several section labels introduced by the motions papers have been modified +to match our style guide. In addition to the section labels affected by the +above motions, all section labels containing underscores have been renamed +to instead use periods. + +### Reversion of prior editorial change + +In N4791 (the post-San-Diego working draft), an editorial change was applied +to repair missing wording in 2018-11 CWG motion 14 +([P0595R2 "`std::is_constant_evaluated()`"](http://wg21.link/p0595r2)). +This change added a definition of the term "usable in constant expressions" +as applied to objects and references that was inadvertently dropped from the +wording during CWG review. + +Further review within CWG has shown that the dropped wording is also incorrect, +so the editorial fix has been reverted (leaving the definition absent rather +than incorrect), and a proper definition will be inserted by a core issue. + +## Minor editorial fixes + +A log of editorial fixes made to the working draft since N4800 is below. +This list excludes changes +that do not affect the body text or only affect whitespace or typeface. For a +complete list including such changes (or for the actual deltas applied by these +changes), consult the [draft sources on github](https://github.com/cplusplus/draft/compare/n4800...n4810). + + commit 142acf0bbde8d6fd20cb67c051d896fec33a84b6 + Author: stryku + Date: Thu Oct 11 18:41:18 2018 +0200 + + [decl.init]/10 Fix specified initialization. + + According to [basic.start.static]/2, for objects with static storage duration, + zero initialization performs only if constant initialization does not. + [decl.init]/10 can be generalized to static initialization. + This is an editorial note change. + + commit 74def77454a15b6cdb45be0f31916396b4b63b72 + Author: Richard Smith + Date: Fri Mar 15 13:45:06 2019 -0700 + + [util.smartptr.atomic.shared] [util.smartptr.atomic.weak] Clarify + grouping of "either". + + commit 4c5701a79cc7c4cc7b9cd9c6070e3cd88961aca7 + Author: Jens Maurer + Date: Fri Dec 21 21:04:43 2018 +0100 + + [mismatch] LWG3178 std::mismatch is missing an upper bound + + commit 04a5e31a02e19e5d1c9e9a0b05c40ce8730c7064 + Author: Jens Maurer + Date: Sat Jan 26 00:30:13 2019 +0100 + + [algorithms] Qualify declarator-id with sub-namespace. + + Also qualify return types where appropriate. + + commit 6c844190a533950fc0100eac4da7785d99c87400 + Author: Jens Maurer + Date: Fri Mar 15 20:25:59 2019 +0100 + + [time.clock.req] Change 'satisfy' to 'meet'. + + commit c3adaef44b94cc63a8a8806f398185046461947c + Author: Jens Maurer + Date: Fri Mar 15 19:23:30 2019 +0100 + + [numeric.requirements] Define 'numeric type'. + + commit 1ce86a62a3cff9fb2bcf6c1a2c37168e023e338b + Author: Jens Maurer + Date: Sat Mar 9 22:18:26 2019 +0100 + + [time.clock.req] Simplify requirements for Cpp17TrivialClock. + + commit 0ba5424c1beddfd8c8403ce882b96dee0f530c7f + Author: JF Bastien + Date: Fri Mar 15 13:52:39 2019 -0700 + + [basic.fundamental] Rename 'range exponent' to 'width' to align with C + + commit 9e00558f2a824421406a6703d1232cc4fb89bb15 + Author: Arthur O'Dwyer + Date: Fri Mar 15 16:43:16 2019 -0400 + + [std] Fix a bunch of faulty parallelism with "either". + + commit 54ddcb970132bfe026c9d9d62d967632b56ae303 + Author: BRevzin + Date: Fri Mar 15 15:30:07 2019 -0500 + + [class.rel] Simplifying wording to avoid talking about a reversed <=>. + + We can never select a reversed <=> here because the operands are of the same type. + + commit 5d174b05d8cd08717ed7efc05d0271409651071c + Author: Richard Smith + Date: Fri Mar 15 12:33:42 2019 -0700 + + [expr.prim.lambda.capture] Convert paragraphs repeating the + "non-odr-usable local entities shall not be odr-used" rule from + [basic.def.odr] into notes. + + commit 41853024e5e6fcd5feb496f64767d2888d76154f + Author: Richard Smith + Date: Fri Mar 15 11:38:57 2019 -0700 + + Revert "[expr.const] Add missing definition of 'usable in constant expressions'" + + The prior editorial fix was an attempt to re-add wording that was + missing from P0595R2 (moved as 2018-11 CWG Motion 14). However, CWG + analysis has indicated that the editorial fix is incomplete, so we're + reverting it to restore the wording to the as-moved state. + + This reverts commit e58439bce8af85e6569328272c2cfb73f5fc44d6. + + commit 154f2c59c4377897937f4b0722cfe2b6d726cc59 + Author: birbacher + Date: Fri Mar 15 18:39:16 2019 +0000 + + [container.node] Add 3 "template" keywords for dependent name (#2676) + + On: + [container.node.overview]/4 + [container.node.cons]/3.1 + [container.node.dtor]/1 + + commit 2585d7f5894b46e0aa2f961183060a5201b2cca7 + Author: Jens Maurer + Date: Fri Dec 21 19:29:38 2018 +0100 + + [std] Replace underscores in stable labels with periods. + + commit 554a8926404bd5e0f772a6cb72c04bd12a5b7984 + Author: Casey Carter + Date: Mon Mar 4 09:29:50 2019 -0800 + + [specialized.algorithms] Rename voidify's parameter + + `ptr` is an odd name for a parameter that is a reference to storage for an object. + + commit a2dfa61a0d50a24e7be6cbc004bb0f076b8c62b5 + Author: Jens Maurer + Date: Fri Mar 8 22:25:38 2019 +0100 + + [queue.syn,stack.syn] Add partial specialization of uses_allocator + + commit 721f2d606f90cc20a16ad9b4383bc78cb368abdc + Author: Jonathan Wakely + Date: Fri Mar 15 02:53:18 2019 +0000 + + [func.not_fn], [func.bind_front] fix phrasing of \mandates and \expects (#2750) + + The Mandates: element should just state its condition, and not say "shall". + Cpp17 concept requirements should be phrased as "X meets the + Y requirements" not "X shall meet the requirements of Y". + + commit 48484c967ee5f3ecb65ff857f8f4794e108ba0cb + Author: Krystian + Date: Thu Mar 14 22:49:33 2019 -0400 + + [temp.class.spec.mfunc] Correct "class template specialization" to the intended "class template partial specialization" + + commit 3117814eaf800a5e1dd387f4c5a0522f2627689e + Author: languagelawyer <38548419+languagelawyer@users.noreply.github.com> + Date: Fri Mar 15 05:48:28 2019 +0300 + + [expr.sizeof] Remove the redundant paragraph 3 + + Paragraph 1 already says that functions are disallowed and function pointers are allowed. + + commit c769f835dadd4a35df9febad684a296d6cb71a53 + Author: JF Bastien + Date: Thu Mar 14 19:45:53 2019 -0700 + + [dcl.attr.contract.cond] Replace return type with 'void' in example that does not return + + Also remove the (unused) name for the return value in the postcondition. + + commit d48c79e223cfbd5ec134703e20989235208e9364 + Author: Jens Maurer + Date: Fri Mar 8 01:14:16 2019 +0100 + + [dcl.enum] Fix singular/plural mismatch. + + commit c5fb73ba6a9b71f6e247103ab4baac1c9f72e210 + Author: Jens Maurer + Date: Fri Mar 8 01:13:35 2019 +0100 + + [conv.prom] b_min and b_max are no longer defined in [dcl.enum] + + commit d7d2580c7d8fabe25ada4dd0e091f9997c0916f5 + Author: Jens Maurer + Date: Sat Mar 9 22:36:47 2019 +0100 + + [range.iota,range.adaptors] Add cross-references for private member types. + + commit b8fd249c737ff2c3652cf6ef77db25712038d353 + Author: Jens Maurer + Date: Sun Mar 10 20:20:10 2019 +0100 + + [dcl.init] Prepend 'Otherwise' to a bullet + + commit dd227824ade24ab51dd4cc926c4b9e87cc29becf + Author: Jens Maurer + Date: Sun Mar 10 20:28:41 2019 +0100 + + [dcl.attr.contract.cond] References cannot be modified. + + Avoid confusion caused by using the words "makes [...] + modifications of the value of [a] parameter" by excluding + references. + + commit b0116b87bf33fed9648e6e8b1b0c7cee0d90b311 + Author: Jason Merrill + Date: Tue Mar 12 09:06:23 2019 -0400 + + [over.match.best] Add number for paragraph 2. + + commit f0f7ba234644d3690d18fcba73f618648014a47c + Author: Jens Maurer + Date: Wed Mar 13 22:21:42 2019 +0100 + + [lib] Use '(inclusive)', not other punctuation + + to indicate inclusive ranges in prose. + + commit 5ba461ec9836f95ed7a54b563b06d480f564e987 + Author: Jens Maurer + Date: Wed Mar 13 22:46:19 2019 +0100 + + [class.eq,class.spaceship] Clarify order of comparison. + + commit 42e5df5c08c9ef805da304fe05fe387cfc3d33d5 + Author: Jens Maurer + Date: Thu Mar 14 00:02:25 2019 +0100 + + [basic.lookup.argdep] Reorder bullets to group semantics. + + commit 927dc13e1010e031692f3a94d8e9599beeb877ac + Author: Richard Smith + Date: Thu Mar 14 17:22:07 2019 -0700 + + [array.tuple] Fix broken description of tuple_element for std::array. + + commit 0b06fcd5f92bc0439a868471a5fdfdba8a181941 + Author: Jens Maurer + Date: Fri Mar 8 22:12:14 2019 +0100 + + [ranges.syn] Add ref_view to header synopsis. + + commit 6f6e5772b2a2dcf41e3db4f68b6cbc3c0628c061 + Author: Richard Smith + Date: Thu Mar 14 16:05:33 2019 -0700 + + [algorithms.parallel.exec] Rephrase to avoid incorrect use of "may not". + + Convert rationale sentence to a note. + + commit de76c7de8c4f9734e0e4351d2088d4786ee62135 + Author: Jens Maurer + Date: Tue Mar 5 21:57:10 2019 +0100 + + [char.traits.typedefs] Change 'shall meet' to 'meets' + + commit e11e27a7873953f0c078901f7ddbb0d7d701c5f7 + Author: Jens Maurer + Date: Wed Mar 6 21:15:37 2019 +0100 + + [mem.poly.allocator.mem] Avoid duplicate colons. + + commit 2956ba37186d7e9cbe728cc3870a2a26fb1f0168 + Author: Richard Smith + Date: Wed Mar 13 14:14:43 2019 -0700 + + [dcl.fct.def.coroutine] Update wording to align with current editorial + conventions. + + Reorder and rearrange to reduce the number of variables with long scopes + that we define in the wording. + + Fix mismatch between core and library wording where library permits + coroutine_handle to resume a coroutine with any promise type, and + the core language does not. + + commit 8dd4539b24473677809163f5e6d399ba6aa0b27d + Author: Richard Smith + Date: Tue Mar 12 18:15:59 2019 -0700 + + [expr.await] Rephrase and modernize wording. + + Invoke temporary materialization conversion directly rather than + handwaving about a temporary object. Specify that the o expression is + evaluated. Bulletize description of the three different ways that + await-suspend is called. + + Fix wording that uses values and objects on the left-hand side of a + class member access to instead consistently use expressions. + + Fixes #2774. + + commit d69814f61077f7e549ccc39a21fc3b90db4223d6 + Author: Richard Smith + Date: Mon Mar 11 20:12:17 2019 -0700 + + [temp.param] "a type that is literal" -> "a literal type". + + commit c0058816fdfe079095ca8717ad692dc2d498d6a3 + Author: Richard Smith + Date: Mon Mar 11 20:11:46 2019 -0700 + + [class.eq] Remove redundant repetition of the operator== symmetry rule. + + commit 007c0c1a619417f94c2c4efb57be71c09f2c2870 + Author: Jens Maurer + Date: Wed Mar 6 21:32:09 2019 +0100 + + [temp.type] Do not refer to operator==, which excludes built-in ==. + + commit caa5c8aedecdf68cfda4f5d95ec9d20451953117 + Author: Jens Maurer + Date: Tue Mar 5 19:05:25 2019 +0100 + + [class.compare.default] Add a note that friends are found by ADL only. + + commit c9074b533c835bbf820f5ea09957810ed2c04dab + Author: Jens Maurer + Date: Wed Mar 6 20:56:58 2019 +0100 + + [expr.new] Move treatment of arrays of unknown bound + + commit ce2f08ab94123adb44e58f1176c6ae4f3209eb60 + Author: Richard Smith + Date: Mon Mar 11 17:20:25 2019 -0700 + + [dcl.init] Merge new direct aggregate init wording into class direct + initialization bullet to avoid the wording being unreachable due to an + "Otherwise" chain. + + commit 691b7c10530d3265afbf445dff3dd129c7c5692e + Author: Dawn Perchik + Date: Sun Mar 10 16:15:53 2019 -0700 + + [dcl.init] Moved the changed bullet in 17.5 to before 17.6.3. + + commit 5f7461d24bc0e9867458a043adf04aa8c4ceed73 + Author: Richard Smith + Date: Fri Mar 8 16:11:34 2019 -0800 + + [temp.dep.type] Rephrase to avoid suggesting that an expression can be + the current instantiation. + + A type can't be the current instantiation either, but that's a + pre-existing prevalent problem. + + commit cbb21fb0210b6aade5591de94e3a27d7059e9d06 + Author: Richard Smith + Date: Fri Mar 8 16:08:02 2019 -0800 + + [basic.def.odr] Apply additional edits from CWG review that were not + transcribed into P1359R0. + + commit ac732bfe4eef01e9e2443dac6138270695d7cbf9 + Author: Richard Smith + Date: Fri Mar 8 12:24:49 2019 -0800 + + [expr.prim.lambda.capture] Add missing close parentheses in CWG2358 + examples. + + Fixes #2680. + + commit 502e419ca75c9656394d1998036b4b810e8bdb17 + Author: Richard Smith + Date: Fri Mar 8 12:00:26 2019 -0800 + + [dcl.type.simple] Fix inaccurate note added by CWG2332 + + [temp.local] Clarify that the surrounding syntax and construct directly + dictates whether an injected-class-name is syntactically a template-name + or a type-name, not just what it means. + + commit f4346ece403e469e800d635a75baafb9c411aa1b + Author: Richard Smith + Date: Fri Mar 8 11:39:36 2019 -0800 + + [expr.static.cast] Fix wording of CWG2310 to match CWG intent (verified + on core reflector): + + - in p11, require D to be a complete class type, not B + - in p12, rephrase to avoid the suggestion that we're talking about a + different D than the one already in scope + + commit 6f34b0513ed6d974b86a27429f8f4d02a6c18b88 + Author: Hana Dusíková + Date: Fri Feb 22 11:03:29 2019 -1000 + + [pair.astuple, tuple.helper] Fix inconsistent class key in tuple_size/tuple_element. (#2679) + + It was declared as a struct and specializations were classes. + + commit 102a791b446f70f939a9b1e2e66fc3553aade19c + Author: Johel Ernesto Guerrero Peña + Date: Fri Feb 22 02:30:23 2019 -0400 + + [array.syn] Add reference to [array.tuple] + + commit 7fe655909b4e5f01d8a8b71d6b508785c42c739e + Author: Richard Smith + Date: Wed Feb 20 17:04:55 2019 -1000 + + [temp.dep] [temp.dep.res] Remove redundant restatement of the two-phase + lookup rule. The primary location of the rule is [temp.dep.candidate]. + + commit 8fbeb52ae5daccc0352798ff023f6cba6aebcd42 + Author: Richard Smith + Date: Mon Feb 18 17:15:39 2019 -1000 + + [basic.link] The notion of the linkage of a type is no longer used for + any purpose. Remove it and move its example next to the rule that + justifies it, and simplify said example. + + commit cafdbd8036f3cf19e9cfc2f56584b219fb190602 + Author: languagelawyer <38548419+languagelawyer@users.noreply.github.com> + Date: Fri Jan 25 00:12:44 2019 +0300 + + [expr.sizeof]/2: there are no expressions of reference type + + commit 35ce0ae2eb2582dbc00fc824afbfa1d53a64de8d + Author: Richard Smith + Date: Wed Feb 13 17:51:58 2019 -0800 + + [depr.array.comp] Fix example of deprecated array comparison + + commit 2f0bd979f41953890129fcbdc6ef37e3e90387ad + Author: Alisdair Meredith + Date: Sun Feb 10 16:53:15 2019 -0500 + + Add missing noexcept cross-refs for invokable traits (#2662) + + All the other traits that use the phrase 'is known not to throw exceptions' also cross-reference the core clause for the noexcept operator, so add the missing cross reference to the more recently added traits. + + commit 9f261368736c3666791329145292c1563a291861 + Author: Alberto Barbati <2210776+iaanus@users.noreply.github.com> + Date: Sun Feb 10 22:52:36 2019 +0100 + + [temp.mem.func] Fixed text in example, which was not updated by CWG 249 (#2658) + + commit f668df034ebf27ad53b5addad22af4f1293f829f + Author: Jens Maurer + Date: Sun Feb 10 22:50:42 2019 +0100 + + [algorithms.general,concepts.general] Add missing entries for summary tables (#2663) diff --git a/papers/n4820.pdf b/papers/n4820.pdf new file mode 100644 index 0000000000..026c8a569b Binary files /dev/null and b/papers/n4820.pdf differ diff --git a/papers/n4821.html b/papers/n4821.html new file mode 100644 index 0000000000..4cdd33c605 --- /dev/null +++ b/papers/n4821.html @@ -0,0 +1,734 @@ +N4821 +

N4821 Editors' Report -- Programming Languages -- C++

+ +

2019-06-17
+Richard Smith (editor) (Google Inc)
+Thomas Köppe (co-editor) (Google DeepMind)
+Jens Maurer (co-editor)
+Dawn Perchik (co-editor) (Bright Side Computing, LLC)
+<cxxeditor@gmail.com>

+ +

Acknowledgements

+ +

Thanks to all those who have submitted editorial +issues +and to those who have provided pull requests with fixes.

+ +

New papers

+ + + +

Motions incorporated into working draft

+ +

Fixed missing application of a portion of P1032R1, +originally applied by 2018-11 LWG Motion 11.

+ +

P1032R1 section 10 instructs that a set of changes be systematically applied to +all char_traits specializations. As part of the same set of motions, +P0482R6 (2018-11 CWG Motion 11) added two new +char_traits specializations. The intent was for P1032R1 to also apply to the +new specializations, assuming both motions passed (which they did).

+ +

The application of P1032R1 section 10 to the char_traits specializations +added by P0482R6 was missed by editorial oversight, which is repaired in +N4820.

+ +

Notable editorial changes

+ +

Changes to section labels

+ +

To increase stability of references to the standard, labels are now also shown +for tables and figures, in addition to the existing labels for sections.

+ +

The editors hope that the use of stable table labels enables papers to say +which tables the changes the papers describe affect increases clarity.

+ +

Minor editorial fixes

+ +

A log of editorial fixes made to the working draft since N4810 is below. +This list excludes changes +that do not affect the body text or only affect whitespace or typeface. For a +complete list including such changes (or for the actual deltas applied by these +changes), consult the draft sources on GitHub.

+ +
commit 62c2f858b7c954750069f3514e2de2f58464df65
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Mon Mar 18 14:06:16 2019 -0700
+
+    [lex.header] Fix note describing where a header-name token is formed to
+    match the changes applied by P1103R3.
+
+commit fccd9773064e596c4efa58b408bea0615623ff78
+Author: Casey Carter <Casey@Carter.net>
+Date:   Wed Mar 20 17:32:25 2019 -0700
+
+    [limits.syn,numeric.limits] Declare partial specializations in header synopsis, not class synopsis
+
+    Moves the declarations of the partial specializations of numeric_limits into the header synopsis, out of the class template synopsis.
+
+commit b5ee2beccbe6c39d90768142e564ac749e45f47f
+Author: Krystian <sdkrystian@gmail.com>
+Date:   Thu Mar 28 18:21:23 2019 -0400
+
+    [temp.expl.spec] Fix grammar (add missing article)
+
+    Added "an" before "explicit" to make the sentence grammatically correct.
+
+commit d45c031e2b504cf5b609595751ae22e7122dd4e3
+Author: Akira Takahashi <faithandbrave@gmail.com>
+Date:   Thu Apr 11 19:54:15 2019 +0900
+
+    [memory.syn] Add declaration of primary template "atomic"
+
+    Partial specializations are declared thereafter.
+
+commit f64094025dbbec5daa268f1b5a98f6de37c4e2c2
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Thu Apr 11 12:55:18 2019 +0200
+
+    [equal.range] Fix formatting of 'Returns' clause. (#2823)
+
+commit f90f4ea7ba38fef6675c0900d93543dded8c7260
+Author: Johel Ernesto Guerrero Peña <johelegp@gmail.com>
+Date:   Thu Apr 11 06:56:42 2019 -0400
+
+    [iterator.traits] Remove redundant required expression in cpp17-input-iterator (#2817)
+
+commit 7c1c2611eac4b970a98bf3dd675daa19f9a7fd5c
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Mon Apr 15 15:14:43 2019 -0700
+
+    [expr.ass] Move higher-precedence productions to before the assignment
+    production in the grammar, to be consistent with how we order these
+    productions throughout [expr].
+
+commit 4c21c0c2565effa6c1e672b09540bd6533c02f15
+Author: Eelis <github.com@contacts.eelis.net>
+Date:   Sat Apr 20 01:08:09 2019 +0200
+
+    [time.cal.ym.nonmembers] Add missing \pnum for Complexity element. (#2836)
+
+commit fdd3787e0cf76b9c6a3461a32789cf1ffcf9c39d
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Fri Apr 26 16:27:52 2019 -0700
+
+    [temp.inst] Fix bogus double-spacing after colon in example.
+
+commit 40c9aa75e8f32e8bab935c04459bf8f648aa89b0
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Mon Apr 29 10:52:32 2019 -0700
+
+    [atomics.types.operations] Fix typo "indeteminate"
+
+    Fixes #2849
+
+commit 569f41ce7410becceaf5537c148b1bc420139bb0
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Tue Apr 30 11:21:10 2019 +0200
+
+    [macros] Adjust \tref to include the word 'Table' in the link text. (#2851)
+
+commit 0bae532004c6117b2111d6622d85bd13577a4aaa
+Author: Random Internet Cat <jason.e.cobb@gmail.com>
+Date:   Tue Apr 30 14:57:04 2019 -0400
+
+    [basic.life] Remove erroneous comma in description of treatment of storage out-of-lifetime (#2842)
+
+commit 0f666fa7b5c5a1f869ca0e3bb2506389546a45bd
+Author: Natsu <chino@hotococoa.moe>
+Date:   Wed May 1 03:20:56 2019 +0800
+
+    [cstdio.syn] Rename parameter of function "rename" (#2840)
+
+    The second parameter of function "rename" is called "new", which is a keyword in C++.
+
+commit 8b3480987ee9962cb4191b9230fd9ff6083a273d
+Author: Johel Ernesto Guerrero Peña <johelegp@gmail.com>
+Date:   Tue Apr 30 15:23:12 2019 -0400
+
+    [alg.unique] Remove <> after ranges::equal_to (#2826)
+
+commit 65194f717a16bb57da02e7bd1aea02c835dc89d1
+Author: Johel Ernesto Guerrero Peña <johelegp@gmail.com>
+Date:   Tue Apr 30 15:33:17 2019 -0400
+
+    [algorithms.requirements] Say 'below to account for clause move (#2812)
+
+commit 27e371dae3fc6484cc2f1bf65d06f9578efd3c32
+Author: Johel Ernesto Guerrero Peña <johelegp@gmail.com>
+Date:   Tue Apr 30 16:00:01 2019 -0400
+
+    [iterator.cust] Introduce expression-equivalent list as in [ranges]. (#2845)
+
+commit 205f6c7dff00a5e8c41bc454b0ffe5ac610853ae
+Author: Glen Fernandes <glen.fernandes@gmail.com>
+Date:   Wed May 1 06:05:42 2019 +1000
+
+    [pointer.conversion] Reorder overloads of to_address (#2814)
+
+    pointer.conver
+
+commit da5050ce1092b76ba93699bfd0d6424cd984830a
+Author: Casey Carter <Casey@Carter.net>
+Date:   Tue Apr 30 13:10:02 2019 -0700
+
+    [coroutine.traits.primary] Hyphenate "program-defined" (#2810)
+
+commit f3d90566f3ca7798fec4fe36c425d03d7dfd8e0f
+Author: Jonathan Wakely <cxx@kayari.org>
+Date:   Wed May 1 07:24:45 2019 +0100
+
+    [ranges.dangling] Fix namespace of ranges::dangling (#2829)
+
+    This fixes an editorial mistake in P1252R2; the original proposal correctly
+    defined "dangling" in namespace std::ranges (see P0896R1).
+
+commit 70f8c128e6bef2bf01373ab7c673dee318a89fd6
+Author: frederick-vs-ja <de34@live.cn>
+Date:   Fri May 3 05:29:59 2019 +0800
+
+    [iterators] Add "ranges::" for "iterator_t" (#2860)
+
+    "inserter" and "insert_iterator" are in namespace "std", so
+    "ranges::iterator_t" should be used in their declarations.
+
+commit 7ac32d9c5b134b7e899186b6df8e57aeed7253f1
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Sat May 4 00:57:42 2019 +0200
+
+    [utilities,containers] Harmonize presentation of tuple_element. (#2868)
+
+commit 2eadc8c192dc60981dffd11a1904acda9df5ad01
+Author: Agustín Bergé <k@fusionfenix.com>
+Date:   Sun May 5 19:34:17 2019 -0300
+
+    [optional.ctor] Remove extra dot. (#2875)
+
+commit e095f2d889f382f0ebfb4f16018bda55d437ed2e
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Sun May 5 22:44:42 2019 +0200
+
+    [expr.prim.lambda] Simplify grammar for lambda-expression.
+
+commit 6c87900e78191d1d5d8f79d09b9f78fca83321ff
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Tue May 7 02:22:36 2019 +0200
+
+    [map,multimap] Add index entries for members of value_compare. (#2861)
+
+commit f031dfcd84ad9901a552db8241e50cee4bbd5386
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Mon May 13 16:08:32 2019 -0700
+
+    [module.global] Make the note that only preprocessing directives can
+    appear in the global module fragment prior to preprocessing a bit more
+    obvious and prominent.
+
+commit 32c67d4ee782903e1f051c94e68816a9e188b11f
+Author: Johel Ernesto Guerrero Peña <johelegp@gmail.com>
+Date:   Sat May 18 11:24:20 2019 -0400
+
+    [fs.path.query,fs.op.equivalent] Use 'otherwise', not 'else' (#2883)
+
+commit 40241be416a0babfc41015be4a69ce1a9aa76358
+Author: Casey Carter <Casey@Carter.net>
+Date:   Tue May 21 11:21:54 2019 -0700
+
+    [concept.boolean] Simplify first requirement (#2888)
+
+    See P1084 and P0896.
+
+commit 1b7c624e0339d838d8c91253262e0379d22506a5
+Author: frederick-vs-ja <de34@live.cn>
+Date:   Wed May 22 02:24:07 2019 +0800
+
+    [view.interface] Drop unused exposition-only templates (#2881)
+
+commit 5c1728b61a0a66fe7f1818b399f742274fce36ed
+Author: languagelawyer <38548419+languagelawyer@users.noreply.github.com>
+Date:   Fri May 24 01:26:25 2019 +0300
+
+    [dcl.init.aggr] Aggregates can have inherited non-public data members (#2892)
+
+commit 665a94500cb78d4b6d2795d396b51df2054094a1
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri May 24 20:24:47 2019 +0200
+
+    [expr.alignof,expr.unary.noexcept] Reorder to after [expr.sizeof]. (#2862)
+
+commit 3526e99dc1257aa6fce561dc2dc020068982b42f
+Author: Jonathan Wakely <cxx@kayari.org>
+Date:   Fri May 24 20:27:24 2019 +0100
+
+    [fs.rec.dir.itr.members] Change \ensures to \remarks for pop() (#2830)
+
+commit 68c7072ddb7d5ba66aca6d25a054c0eca8c01775
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri May 24 21:31:22 2019 +0200
+
+    [views.span] Move description of iterators to [span.iterators]. (#2864)
+
+commit aa9fe1fc99da36602e2600ac16636fa7b504b4e5
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri May 24 22:15:00 2019 +0200
+
+    [time.cal.ymwd.nonmembers] Fix typo in parameter names. (#2895)
+
+commit 8cef0f3c119459670335a4a7846344b38ac51918
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Mon May 27 09:04:34 2019 +0200
+
+    [char.traits.specializations.char8.t] Make all members constexpr. (#2833)
+
+    Fix missed application of P1032R1 to the result of applying P0482R6;
+    both papers were moved at the 2018-11 meeting.
+
+commit 127bb3653647a350836bb99b4fdc16716de3957a
+Author: Alisdair Meredith <alisdairm@me.com>
+Date:   Tue May 28 16:02:20 2019 -0400
+
+    [except.terminate] thread has move-assignment, not copy (#2903)
+
+    The copy-assignment operator for std::thread is deleted, but the
+    move-assignment operator documents a call to std::terminate.
+
+commit f788e132dbfe4252f2852b6123d0bac4674e7dd5
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Tue May 28 22:28:49 2019 +0200
+
+    [allocator.adaptor.syn] Avoid confusing term 'memory resource'. (#2904)
+
+commit b2e16a61cdbbf177fd8f9e868c9d611d4d9fa50f
+Author: Jonathan Wakely <cxx@kayari.org>
+Date:   Wed May 29 20:07:18 2019 +0100
+
+    [dcl.mptr] Add \pnum to note already in a separate paragraph (#2907)
+
+commit 5dce3660fdf06d4c63efeffc329d9a9436c51ea5
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Wed May 29 21:54:28 2019 +0200
+
+    [time.zone.info] Add missing 'Returns' items. (#2901)
+
+    Also add a missing 'Effects' item.
+
+commit b9f2d303359502de27d399b13e5de41432ce6909
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Wed May 29 22:33:01 2019 +0200
+
+    [stmt.stmt,basic.scope.block] Remove normative redundancy.
+
+commit 871b9e1d91ad939afe46b66e6139a527e773200e
+Author: Casey Carter <Casey@Carter.net>
+Date:   Thu May 30 11:29:17 2019 -0700
+
+    [coroutine.handle,coroutine.handle.export.import] "static" before "constexpr" (#2811)
+
+commit 899cce08197bb3311e6942dee134cee470625342
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Sat Jun 1 14:23:54 2019 +0200
+
+    [except.uncaught] Clarify duration of uncaught exception.
+
+commit 5df26e149d1cf89c54614fe5f837eef7c6104208
+Author: Richard Smith <richard@metafoo.co.uk>
+Date:   Mon Jun 3 12:28:49 2019 -0700
+
+    [basic.def.odr] Make case consistent in first word of bullets.
+
+commit a61da77b992f7346bb559ba59c5f53a7df90a569
+Author: Casey Carter <Casey@Carter.net>
+Date:   Tue Jun 4 14:07:18 2019 -0700
+
+    [dcl.fct.def.default] Add missing comma
+
+commit 5b8ed33fdb283364a6a5e7b9572f3e5e16650f40
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Thu Nov 30 23:42:08 2017 +0100
+
+    [language.support, utilities] Condense description of exception classes
+
+commit b6f44de194a2e5702d9658c0e5ed1a8f4f647ece
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Wed Jun 5 22:39:40 2019 +0200
+
+    [module.interface] Use 'namespace-definition',
+
+    not the undefined term 'namespace-declaration'.
+
+commit 04e32a6e79d2a51eeb930e89356dfda27bed841d
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri Jun 7 01:56:40 2019 +0200
+
+    [unord.req] Consistently use 'Average case x, worst case y.' (#2921)
+
+    Changed from sometimes having 'Worst case' start a separate sentence.
+
+commit 7830d39615bf46563303156ca5f6609c02dd5820
+Author: Jonathan Wakely <cxx@kayari.org>
+Date:   Tue Jun 11 18:23:12 2019 +0100
+
+    [algorithms.parallel.exec],[alg.set.operations],[alg.min.max],[alg.c.library] remove empty parens (#2925)
+
+    When referring to a function, use its name, not a call expression.
+
+commit 12a28a2eb9f182794fdaf25f1ee5a24e8fa71f1d
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Tue Jun 11 23:02:46 2019 +0200
+
+    [time.cal.ymwdlast.members] Move statement on class properties (#2927)
+
+    to [time.cal.ymwdlast.overview], consistent with
+    neighboring similar subclauses.
+
+commit 18e005d77a64c930252c2f9f809dc2b40124f7f1
+Author: Casey Carter <Casey@Carter.net>
+Date:   Tue Jun 11 14:54:54 2019 -0700
+
+    [alg.random.sample] Remove redundant requirement (#2798)
+
+    [rand.req.urng]/1 requires that UniformRandomBitGenerator
+    model UnsignedIntegral. [alg.random.sample]/1.5 requires Distance
+    to be an integer type. Any integral type is convertible to any other
+    integral type.
+
+commit daa9a7d0937feb54bc9389096324e5ba36df2f9e
+Author: Jonathan Wakely <cxx@kayari.org>
+Date:   Tue May 28 08:15:29 2019 +0100
+
+    [fs.path.append] Fix examples to show correct results for Windows
+
+    Also correct the fact that the results were shown as string literals,
+    not paths, and that the examples for path::operator/=(const path&) were
+    actually using the non-member operator/(const path&, const path&)
+    instead.
+
+    Also line up the comments to the 32nd column.
+
+commit 85f634a82a6f23518245ed251690df52b3555c38
+Author: Jonathan Wakely <cxx@kayari.org>
+Date:   Thu Mar 28 09:20:53 2019 +0000
+
+    [dcl.type.elab] Mix struct/class in example
+
+    Extend the example to show that the choice of 'class' or 'struct' in an
+    elaborated-type-name referring to a class is not significant.
+
+commit a0f56d5ceb8aeb45549b173164302ef263f0d3c4
+Author: Casey Carter <Casey@Carter.net>
+Date:   Wed Jun 12 15:46:55 2019 -0700
+
+    [istream.sentry] Remove unreferenced private typedef-name traits_type (#2818)
+
+commit a3eec72ed7a7cd942081b5d5a90737614c67d057
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Wed Apr 10 23:53:39 2019 +0200
+
+    [basic.lookup.elab] Clarify example to refer to injected-class-name
+
+commit 99ec26cfca252dd5f8843ccf54ded17ed95b2436
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Mon Apr 29 22:34:58 2019 +0200
+
+    [dcl.stc,dcl.type.cv] Avoid redundancy when specifying 'mutable'.
+
+commit 506b67005b66af3afbc6edd7bedc772750d0710b
+Author: Krystian Stasiowski <sdkrystian@gmail.com>
+Date:   Wed Jun 12 18:57:20 2019 -0400
+
+    [namespace.def] Remove redundant mention of "global scope".
+
+    The global scope is a namespace scope.
+
+commit 76a0595989a140d142efc236afbb66d1b6e975b6
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri May 3 01:10:13 2019 +0200
+
+    [expr.call,expr.reinterpret.cast] Adjust cross-references for
+    type violations in function calls.
+
+commit dd7b5190279d29f09db4e3009d37398ed6f24de3
+Author: Johel Ernesto Guerrero Peña <johelegp@gmail.com>
+Date:   Fri May 3 14:03:19 2019 -0400
+
+    [string.view.template][string.view.iterators] Move requirements to a more appropriate place
+
+commit 490d0dad072759b448b097eff8fb7b2c304573cd
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Sun May 5 22:30:29 2019 +0200
+
+    [dcl.dcl,temp.spec] Move normative statements on restrictions for
+    explicit specializations and explicit instantiations
+    to [temp.spec] and its subsections.
+
+commit 8845c5c95a62ab7a196016ff484412ce826d2725
+Author: Jason Cobb <jason.e.cobb@gmail.com>
+Date:   Fri May 10 23:07:40 2019 -0400
+
+    [dcl.dcl]/11 Storage from object definitions has proper alignment
+
+commit 373176cfe330ab22a8f6a4273da4817ab9d17438
+Author: Casey Carter <Casey@Carter.net>
+Date:   Wed May 22 07:44:42 2019 -0700
+
+    [concept.swappable] Strike array poison pill swap overload
+
+    Since lookup is only performed when at least one argument has class or enumeration type, template argument deduction can never succeed for the poisin pill overload with two parameters of reference-to-array type; it can be struck with no normative impact.
+
+commit 8eff9b95eeedd9fb08816c51f2bb4e4c151de40f
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Tue May 28 08:55:10 2019 +0200
+
+    [expr.sizeof,expr.alignof,expr.unary.noexcept] Clarify value category.
+
+    Also remove the undefined term 'constant' and
+    instead add a note pointing to [expr.const].
+
+commit 45d9fae43d97355735d81a839a5dbb7abec60aa4
+Author: Jonathan Wakely <cxx@kayari.org>
+Date:   Wed May 29 09:48:09 2019 +0100
+
+    [basic.compound] Replace four refs with a single one to [dcl.meaning]
+
+commit 2c5066bde3eb4300a4f190b491a89400b827334d
+Author: Jason Cobb <jason.e.cobb@gmail.com>
+Date:   Mon Jun 3 12:26:31 2019 -0400
+
+    [over.call.object] Fix surrogate calls with regards to cv-qualifiers
+
+    Standardizes existing practice. All of GCC, Clang, MSVC, ICC in pedantic mode already behave as if all of these changes were made.
+
+commit a02993d3ca83b88140eb5b03f5798ba2f9a77203
+Author: Casey Carter <Casey@Carter.net>
+Date:   Tue Jun 4 18:28:48 2019 -0700
+
+    [range.semi.wrap] Rename "semiregular" to "semiregular-box"
+
+    ...to avoid confusion with the concept `Semiregular`. Update the uses in [range.single.view, range.filter.view,range.transform.view], and add a reference to [range.single.view] which now precedes [range.semi.wrap] since the "range factories" were pulled out into a separate subclause before the "range adaptors."
+
+commit 042e0356bced518954c5ca1c9425226dbeb8b64a
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Wed Jun 5 22:44:29 2019 +0200
+
+    [stmt.return.coroutine] Move one level up to avoid hanging paragraphs.
+
+commit 5c5570d29e64c3c143dad6175df7a41e7cef6d3d
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri Jun 7 00:02:22 2019 +0200
+
+    [expr.add] Avoid x[i] syntax when defining pointer arithmetic.
+
+commit 7756db991e1343bb60bccf43ae825ff55713bfdb
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri Jun 7 00:26:34 2019 +0200
+
+    [expr.unary.op] Use bullets to clarify the address-of operator.
+
+    Also cover the missed case of a prvalue qualified-id.
+
+commit c60c94398be23f2e5a407c8e3461b692c8fe508d
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Tue Jun 11 20:24:38 2019 +0200
+
+    [lex] Fix stray uses of 'source character set'
+
+    where it is obvious that 'basic source character set'
+    is meant.
+
+commit 2ee3d07e93049866f6602829dd0ebf469e25f0d2
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Tue Jun 11 20:32:42 2019 +0200
+
+    [range.split.outer] Convert trailing cross-reference to prefix style.
+
+commit 6f9959805eb3e8e802192b0fb71dbe160ed68a06
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Sat Jul 21 16:21:40 2018 +0200
+
+    [dcl.array] Rework description.
+
+    Group examples with the corresponding normative statements.
+    Clarify the meaning of 'array type'.
+    Use 'declarator-id' instead of 'identifier'.
+
+commit f6ad222bfafd939180c9c65f7b0116d0d340001b
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Mon May 27 09:20:57 2019 +0200
+
+    [range.prim.size] Clarify by adding 'respectively'.
+
+commit b3b1f637f12e2d0b71e351f5c9c3f6acd5059eaa
+Author: Casey Carter <Casey@Carter.net>
+Date:   Fri Jun 14 14:21:05 2019 -0700
+
+    [library-wide] Use "model" instead of "satisfy" for semantic library concept requirements
+
+    Consistently use "satisfy" to mean the syntactic requirements are met, and "model" to mean the semantic requirements are met.
+
+    Updates: [structure.requirements],[customization.point.object],[res.on.requirements],[concepts], and [range.semi.wrap].
+
+    Fixes #2591.
+
+commit b50067fe2dec316efc24ae80ae352f33eb31c3af
+Author: Casey Carter <Casey@Carter.net>
+Date:   Sun Apr 14 12:36:57 2019 -0700
+
+    [range.counted] Introduce "Counted view"
+
+    Fixes #2825.
+
+commit da3660306d52d7c1813b6cfae71e78851cd37831
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Thu Jun 6 09:21:12 2019 +0200
+
+    [expr.unary.op] Modernize wording for obtaining a pointer.
+
+commit 97066177229afe6f2935da73b848254ea27a16a2
+Author: Marc Mutz <marc.mutz@kdab.com>
+Date:   Mon Jun 17 12:50:30 2019 +0200
+
+    [list.erasure][forward.list.erasure] Fix missing lambda braces (#2936)
+
+commit f8b8c257ae5bce961c0de29ed8e0ce2d88497acc
+Author: Kazutoshi SATODA <k_satoda@f2.dion.ne.jp>
+Date:   Sun Sep 9 00:11:36 2018 +0900
+
+    [expr.new] Harmonize rules of constant array bounds > 0
+
+    While "shall evaluate to a strictly positive value" is not wrong,
+    "shall be greater than zero" is easier and is used in [dcl.array] to
+    describe the same rule.
+
+commit 15c8259726b565f2a9b3adacdcc85a0727841c7c
+Author: Casey Carter <Casey@Carter.net>
+Date:   Mon Jun 17 09:52:08 2019 -0700
+
+    [library-wide] Use "meet" for non-concept type requirements (#2796)
+
+    Partially addresses #1263.
+
diff --git a/papers/n4821.md b/papers/n4821.md new file mode 100644 index 0000000000..c917761e68 --- /dev/null +++ b/papers/n4821.md @@ -0,0 +1,608 @@ +# N4821 Editors' Report -- Programming Languages -- C++ + +2019-06-17 +Richard Smith (editor) (Google Inc) +Thomas Köppe (co-editor) (Google DeepMind) +Jens Maurer (co-editor) +Dawn Perchik (co-editor) (Bright Side Computing, LLC) +`` + +## Acknowledgements + +Thanks to all those who have [submitted editorial +issues](https://github.com/cplusplus/draft/wiki/How-to-submit-an-editorial-issue) +and to those who have provided pull requests with fixes. + +## New papers + + * [N4820](http://wg21.link/n4820) is the current C++ working draft. It replaces [N4810](http://wg21.link/n4810). + * N4821 is this Editors' Report. + +## Motions incorporated into working draft + +Fixed missing application of a portion of [P1032R1](http://wg21.link/p1032r1), +originally applied by 2018-11 LWG Motion 11. + +P1032R1 section 10 instructs that a set of changes be systematically applied to +all `char_traits` specializations. As part of the same set of motions, +[P0482R6](http://wg21.link/p0482r6) (2018-11 CWG Motion 11) added two new +`char_traits` specializations. The intent was for P1032R1 to also apply to the +new specializations, assuming both motions passed (which they did). + +The application of P1032R1 section 10 to the `char_traits` specializations +added by P0482R6 was missed by editorial oversight, which is repaired in +N4820. + +## Notable editorial changes + +### Changes to section labels + +To increase stability of references to the standard, labels are now also shown +for tables and figures, in addition to the existing labels for sections. + +The editors hope that the use of stable table labels enables papers to say +which tables the changes the papers describe affect increases clarity. + +## Minor editorial fixes + +A log of editorial fixes made to the working draft since N4810 is below. +This list excludes changes +that do not affect the body text or only affect whitespace or typeface. For a +complete list including such changes (or for the actual deltas applied by these +changes), consult the [draft sources on GitHub](https://github.com/cplusplus/draft/compare/n4810...n4820). + + commit 62c2f858b7c954750069f3514e2de2f58464df65 + Author: Richard Smith + Date: Mon Mar 18 14:06:16 2019 -0700 + + [lex.header] Fix note describing where a header-name token is formed to + match the changes applied by P1103R3. + + commit fccd9773064e596c4efa58b408bea0615623ff78 + Author: Casey Carter + Date: Wed Mar 20 17:32:25 2019 -0700 + + [limits.syn,numeric.limits] Declare partial specializations in header synopsis, not class synopsis + + Moves the declarations of the partial specializations of numeric_limits into the header synopsis, out of the class template synopsis. + + commit b5ee2beccbe6c39d90768142e564ac749e45f47f + Author: Krystian + Date: Thu Mar 28 18:21:23 2019 -0400 + + [temp.expl.spec] Fix grammar (add missing article) + + Added "an" before "explicit" to make the sentence grammatically correct. + + commit d45c031e2b504cf5b609595751ae22e7122dd4e3 + Author: Akira Takahashi + Date: Thu Apr 11 19:54:15 2019 +0900 + + [memory.syn] Add declaration of primary template "atomic" + + Partial specializations are declared thereafter. + + commit f64094025dbbec5daa268f1b5a98f6de37c4e2c2 + Author: Jens Maurer + Date: Thu Apr 11 12:55:18 2019 +0200 + + [equal.range] Fix formatting of 'Returns' clause. (#2823) + + commit f90f4ea7ba38fef6675c0900d93543dded8c7260 + Author: Johel Ernesto Guerrero Peña + Date: Thu Apr 11 06:56:42 2019 -0400 + + [iterator.traits] Remove redundant required expression in cpp17-input-iterator (#2817) + + commit 7c1c2611eac4b970a98bf3dd675daa19f9a7fd5c + Author: Richard Smith + Date: Mon Apr 15 15:14:43 2019 -0700 + + [expr.ass] Move higher-precedence productions to before the assignment + production in the grammar, to be consistent with how we order these + productions throughout [expr]. + + commit 4c21c0c2565effa6c1e672b09540bd6533c02f15 + Author: Eelis + Date: Sat Apr 20 01:08:09 2019 +0200 + + [time.cal.ym.nonmembers] Add missing \pnum for Complexity element. (#2836) + + commit fdd3787e0cf76b9c6a3461a32789cf1ffcf9c39d + Author: Richard Smith + Date: Fri Apr 26 16:27:52 2019 -0700 + + [temp.inst] Fix bogus double-spacing after colon in example. + + commit 40c9aa75e8f32e8bab935c04459bf8f648aa89b0 + Author: Richard Smith + Date: Mon Apr 29 10:52:32 2019 -0700 + + [atomics.types.operations] Fix typo "indeteminate" + + Fixes #2849 + + commit 569f41ce7410becceaf5537c148b1bc420139bb0 + Author: Jens Maurer + Date: Tue Apr 30 11:21:10 2019 +0200 + + [macros] Adjust \tref to include the word 'Table' in the link text. (#2851) + + commit 0bae532004c6117b2111d6622d85bd13577a4aaa + Author: Random Internet Cat + Date: Tue Apr 30 14:57:04 2019 -0400 + + [basic.life] Remove erroneous comma in description of treatment of storage out-of-lifetime (#2842) + + commit 0f666fa7b5c5a1f869ca0e3bb2506389546a45bd + Author: Natsu + Date: Wed May 1 03:20:56 2019 +0800 + + [cstdio.syn] Rename parameter of function "rename" (#2840) + + The second parameter of function "rename" is called "new", which is a keyword in C++. + + commit 8b3480987ee9962cb4191b9230fd9ff6083a273d + Author: Johel Ernesto Guerrero Peña + Date: Tue Apr 30 15:23:12 2019 -0400 + + [alg.unique] Remove <> after ranges::equal_to (#2826) + + commit 65194f717a16bb57da02e7bd1aea02c835dc89d1 + Author: Johel Ernesto Guerrero Peña + Date: Tue Apr 30 15:33:17 2019 -0400 + + [algorithms.requirements] Say 'below to account for clause move (#2812) + + commit 27e371dae3fc6484cc2f1bf65d06f9578efd3c32 + Author: Johel Ernesto Guerrero Peña + Date: Tue Apr 30 16:00:01 2019 -0400 + + [iterator.cust] Introduce expression-equivalent list as in [ranges]. (#2845) + + commit 205f6c7dff00a5e8c41bc454b0ffe5ac610853ae + Author: Glen Fernandes + Date: Wed May 1 06:05:42 2019 +1000 + + [pointer.conversion] Reorder overloads of to_address (#2814) + + pointer.conver + + commit da5050ce1092b76ba93699bfd0d6424cd984830a + Author: Casey Carter + Date: Tue Apr 30 13:10:02 2019 -0700 + + [coroutine.traits.primary] Hyphenate "program-defined" (#2810) + + commit f3d90566f3ca7798fec4fe36c425d03d7dfd8e0f + Author: Jonathan Wakely + Date: Wed May 1 07:24:45 2019 +0100 + + [ranges.dangling] Fix namespace of ranges::dangling (#2829) + + This fixes an editorial mistake in P1252R2; the original proposal correctly + defined "dangling" in namespace std::ranges (see P0896R1). + + commit 70f8c128e6bef2bf01373ab7c673dee318a89fd6 + Author: frederick-vs-ja + Date: Fri May 3 05:29:59 2019 +0800 + + [iterators] Add "ranges::" for "iterator_t" (#2860) + + "inserter" and "insert_iterator" are in namespace "std", so + "ranges::iterator_t" should be used in their declarations. + + commit 7ac32d9c5b134b7e899186b6df8e57aeed7253f1 + Author: Jens Maurer + Date: Sat May 4 00:57:42 2019 +0200 + + [utilities,containers] Harmonize presentation of tuple_element. (#2868) + + commit 2eadc8c192dc60981dffd11a1904acda9df5ad01 + Author: Agustín Bergé + Date: Sun May 5 19:34:17 2019 -0300 + + [optional.ctor] Remove extra dot. (#2875) + + commit e095f2d889f382f0ebfb4f16018bda55d437ed2e + Author: Jens Maurer + Date: Sun May 5 22:44:42 2019 +0200 + + [expr.prim.lambda] Simplify grammar for lambda-expression. + + commit 6c87900e78191d1d5d8f79d09b9f78fca83321ff + Author: Jens Maurer + Date: Tue May 7 02:22:36 2019 +0200 + + [map,multimap] Add index entries for members of value_compare. (#2861) + + commit f031dfcd84ad9901a552db8241e50cee4bbd5386 + Author: Richard Smith + Date: Mon May 13 16:08:32 2019 -0700 + + [module.global] Make the note that only preprocessing directives can + appear in the global module fragment prior to preprocessing a bit more + obvious and prominent. + + commit 32c67d4ee782903e1f051c94e68816a9e188b11f + Author: Johel Ernesto Guerrero Peña + Date: Sat May 18 11:24:20 2019 -0400 + + [fs.path.query,fs.op.equivalent] Use 'otherwise', not 'else' (#2883) + + commit 40241be416a0babfc41015be4a69ce1a9aa76358 + Author: Casey Carter + Date: Tue May 21 11:21:54 2019 -0700 + + [concept.boolean] Simplify first requirement (#2888) + + See P1084 and P0896. + + commit 1b7c624e0339d838d8c91253262e0379d22506a5 + Author: frederick-vs-ja + Date: Wed May 22 02:24:07 2019 +0800 + + [view.interface] Drop unused exposition-only templates (#2881) + + commit 5c1728b61a0a66fe7f1818b399f742274fce36ed + Author: languagelawyer <38548419+languagelawyer@users.noreply.github.com> + Date: Fri May 24 01:26:25 2019 +0300 + + [dcl.init.aggr] Aggregates can have inherited non-public data members (#2892) + + commit 665a94500cb78d4b6d2795d396b51df2054094a1 + Author: Jens Maurer + Date: Fri May 24 20:24:47 2019 +0200 + + [expr.alignof,expr.unary.noexcept] Reorder to after [expr.sizeof]. (#2862) + + commit 3526e99dc1257aa6fce561dc2dc020068982b42f + Author: Jonathan Wakely + Date: Fri May 24 20:27:24 2019 +0100 + + [fs.rec.dir.itr.members] Change \ensures to \remarks for pop() (#2830) + + commit 68c7072ddb7d5ba66aca6d25a054c0eca8c01775 + Author: Jens Maurer + Date: Fri May 24 21:31:22 2019 +0200 + + [views.span] Move description of iterators to [span.iterators]. (#2864) + + commit aa9fe1fc99da36602e2600ac16636fa7b504b4e5 + Author: Jens Maurer + Date: Fri May 24 22:15:00 2019 +0200 + + [time.cal.ymwd.nonmembers] Fix typo in parameter names. (#2895) + + commit 8cef0f3c119459670335a4a7846344b38ac51918 + Author: Jens Maurer + Date: Mon May 27 09:04:34 2019 +0200 + + [char.traits.specializations.char8.t] Make all members constexpr. (#2833) + + Fix missed application of P1032R1 to the result of applying P0482R6; + both papers were moved at the 2018-11 meeting. + + commit 127bb3653647a350836bb99b4fdc16716de3957a + Author: Alisdair Meredith + Date: Tue May 28 16:02:20 2019 -0400 + + [except.terminate] thread has move-assignment, not copy (#2903) + + The copy-assignment operator for std::thread is deleted, but the + move-assignment operator documents a call to std::terminate. + + commit f788e132dbfe4252f2852b6123d0bac4674e7dd5 + Author: Jens Maurer + Date: Tue May 28 22:28:49 2019 +0200 + + [allocator.adaptor.syn] Avoid confusing term 'memory resource'. (#2904) + + commit b2e16a61cdbbf177fd8f9e868c9d611d4d9fa50f + Author: Jonathan Wakely + Date: Wed May 29 20:07:18 2019 +0100 + + [dcl.mptr] Add \pnum to note already in a separate paragraph (#2907) + + commit 5dce3660fdf06d4c63efeffc329d9a9436c51ea5 + Author: Jens Maurer + Date: Wed May 29 21:54:28 2019 +0200 + + [time.zone.info] Add missing 'Returns' items. (#2901) + + Also add a missing 'Effects' item. + + commit b9f2d303359502de27d399b13e5de41432ce6909 + Author: Jens Maurer + Date: Wed May 29 22:33:01 2019 +0200 + + [stmt.stmt,basic.scope.block] Remove normative redundancy. + + commit 871b9e1d91ad939afe46b66e6139a527e773200e + Author: Casey Carter + Date: Thu May 30 11:29:17 2019 -0700 + + [coroutine.handle,coroutine.handle.export.import] "static" before "constexpr" (#2811) + + commit 899cce08197bb3311e6942dee134cee470625342 + Author: Jens Maurer + Date: Sat Jun 1 14:23:54 2019 +0200 + + [except.uncaught] Clarify duration of uncaught exception. + + commit 5df26e149d1cf89c54614fe5f837eef7c6104208 + Author: Richard Smith + Date: Mon Jun 3 12:28:49 2019 -0700 + + [basic.def.odr] Make case consistent in first word of bullets. + + commit a61da77b992f7346bb559ba59c5f53a7df90a569 + Author: Casey Carter + Date: Tue Jun 4 14:07:18 2019 -0700 + + [dcl.fct.def.default] Add missing comma + + commit 5b8ed33fdb283364a6a5e7b9572f3e5e16650f40 + Author: Jens Maurer + Date: Thu Nov 30 23:42:08 2017 +0100 + + [language.support, utilities] Condense description of exception classes + + commit b6f44de194a2e5702d9658c0e5ed1a8f4f647ece + Author: Jens Maurer + Date: Wed Jun 5 22:39:40 2019 +0200 + + [module.interface] Use 'namespace-definition', + + not the undefined term 'namespace-declaration'. + + commit 04e32a6e79d2a51eeb930e89356dfda27bed841d + Author: Jens Maurer + Date: Fri Jun 7 01:56:40 2019 +0200 + + [unord.req] Consistently use 'Average case x, worst case y.' (#2921) + + Changed from sometimes having 'Worst case' start a separate sentence. + + commit 7830d39615bf46563303156ca5f6609c02dd5820 + Author: Jonathan Wakely + Date: Tue Jun 11 18:23:12 2019 +0100 + + [algorithms.parallel.exec],[alg.set.operations],[alg.min.max],[alg.c.library] remove empty parens (#2925) + + When referring to a function, use its name, not a call expression. + + commit 12a28a2eb9f182794fdaf25f1ee5a24e8fa71f1d + Author: Jens Maurer + Date: Tue Jun 11 23:02:46 2019 +0200 + + [time.cal.ymwdlast.members] Move statement on class properties (#2927) + + to [time.cal.ymwdlast.overview], consistent with + neighboring similar subclauses. + + commit 18e005d77a64c930252c2f9f809dc2b40124f7f1 + Author: Casey Carter + Date: Tue Jun 11 14:54:54 2019 -0700 + + [alg.random.sample] Remove redundant requirement (#2798) + + [rand.req.urng]/1 requires that UniformRandomBitGenerator + model UnsignedIntegral. [alg.random.sample]/1.5 requires Distance + to be an integer type. Any integral type is convertible to any other + integral type. + + commit daa9a7d0937feb54bc9389096324e5ba36df2f9e + Author: Jonathan Wakely + Date: Tue May 28 08:15:29 2019 +0100 + + [fs.path.append] Fix examples to show correct results for Windows + + Also correct the fact that the results were shown as string literals, + not paths, and that the examples for path::operator/=(const path&) were + actually using the non-member operator/(const path&, const path&) + instead. + + Also line up the comments to the 32nd column. + + commit 85f634a82a6f23518245ed251690df52b3555c38 + Author: Jonathan Wakely + Date: Thu Mar 28 09:20:53 2019 +0000 + + [dcl.type.elab] Mix struct/class in example + + Extend the example to show that the choice of 'class' or 'struct' in an + elaborated-type-name referring to a class is not significant. + + commit a0f56d5ceb8aeb45549b173164302ef263f0d3c4 + Author: Casey Carter + Date: Wed Jun 12 15:46:55 2019 -0700 + + [istream.sentry] Remove unreferenced private typedef-name traits_type (#2818) + + commit a3eec72ed7a7cd942081b5d5a90737614c67d057 + Author: Jens Maurer + Date: Wed Apr 10 23:53:39 2019 +0200 + + [basic.lookup.elab] Clarify example to refer to injected-class-name + + commit 99ec26cfca252dd5f8843ccf54ded17ed95b2436 + Author: Jens Maurer + Date: Mon Apr 29 22:34:58 2019 +0200 + + [dcl.stc,dcl.type.cv] Avoid redundancy when specifying 'mutable'. + + commit 506b67005b66af3afbc6edd7bedc772750d0710b + Author: Krystian Stasiowski + Date: Wed Jun 12 18:57:20 2019 -0400 + + [namespace.def] Remove redundant mention of "global scope". + + The global scope is a namespace scope. + + commit 76a0595989a140d142efc236afbb66d1b6e975b6 + Author: Jens Maurer + Date: Fri May 3 01:10:13 2019 +0200 + + [expr.call,expr.reinterpret.cast] Adjust cross-references for + type violations in function calls. + + commit dd7b5190279d29f09db4e3009d37398ed6f24de3 + Author: Johel Ernesto Guerrero Peña + Date: Fri May 3 14:03:19 2019 -0400 + + [string.view.template][string.view.iterators] Move requirements to a more appropriate place + + commit 490d0dad072759b448b097eff8fb7b2c304573cd + Author: Jens Maurer + Date: Sun May 5 22:30:29 2019 +0200 + + [dcl.dcl,temp.spec] Move normative statements on restrictions for + explicit specializations and explicit instantiations + to [temp.spec] and its subsections. + + commit 8845c5c95a62ab7a196016ff484412ce826d2725 + Author: Jason Cobb + Date: Fri May 10 23:07:40 2019 -0400 + + [dcl.dcl]/11 Storage from object definitions has proper alignment + + commit 373176cfe330ab22a8f6a4273da4817ab9d17438 + Author: Casey Carter + Date: Wed May 22 07:44:42 2019 -0700 + + [concept.swappable] Strike array poison pill swap overload + + Since lookup is only performed when at least one argument has class or enumeration type, template argument deduction can never succeed for the poisin pill overload with two parameters of reference-to-array type; it can be struck with no normative impact. + + commit 8eff9b95eeedd9fb08816c51f2bb4e4c151de40f + Author: Jens Maurer + Date: Tue May 28 08:55:10 2019 +0200 + + [expr.sizeof,expr.alignof,expr.unary.noexcept] Clarify value category. + + Also remove the undefined term 'constant' and + instead add a note pointing to [expr.const]. + + commit 45d9fae43d97355735d81a839a5dbb7abec60aa4 + Author: Jonathan Wakely + Date: Wed May 29 09:48:09 2019 +0100 + + [basic.compound] Replace four refs with a single one to [dcl.meaning] + + commit 2c5066bde3eb4300a4f190b491a89400b827334d + Author: Jason Cobb + Date: Mon Jun 3 12:26:31 2019 -0400 + + [over.call.object] Fix surrogate calls with regards to cv-qualifiers + + Standardizes existing practice. All of GCC, Clang, MSVC, ICC in pedantic mode already behave as if all of these changes were made. + + commit a02993d3ca83b88140eb5b03f5798ba2f9a77203 + Author: Casey Carter + Date: Tue Jun 4 18:28:48 2019 -0700 + + [range.semi.wrap] Rename "semiregular" to "semiregular-box" + + ...to avoid confusion with the concept `Semiregular`. Update the uses in [range.single.view, range.filter.view,range.transform.view], and add a reference to [range.single.view] which now precedes [range.semi.wrap] since the "range factories" were pulled out into a separate subclause before the "range adaptors." + + commit 042e0356bced518954c5ca1c9425226dbeb8b64a + Author: Jens Maurer + Date: Wed Jun 5 22:44:29 2019 +0200 + + [stmt.return.coroutine] Move one level up to avoid hanging paragraphs. + + commit 5c5570d29e64c3c143dad6175df7a41e7cef6d3d + Author: Jens Maurer + Date: Fri Jun 7 00:02:22 2019 +0200 + + [expr.add] Avoid x[i] syntax when defining pointer arithmetic. + + commit 7756db991e1343bb60bccf43ae825ff55713bfdb + Author: Jens Maurer + Date: Fri Jun 7 00:26:34 2019 +0200 + + [expr.unary.op] Use bullets to clarify the address-of operator. + + Also cover the missed case of a prvalue qualified-id. + + commit c60c94398be23f2e5a407c8e3461b692c8fe508d + Author: Jens Maurer + Date: Tue Jun 11 20:24:38 2019 +0200 + + [lex] Fix stray uses of 'source character set' + + where it is obvious that 'basic source character set' + is meant. + + commit 2ee3d07e93049866f6602829dd0ebf469e25f0d2 + Author: Jens Maurer + Date: Tue Jun 11 20:32:42 2019 +0200 + + [range.split.outer] Convert trailing cross-reference to prefix style. + + commit 6f9959805eb3e8e802192b0fb71dbe160ed68a06 + Author: Jens Maurer + Date: Sat Jul 21 16:21:40 2018 +0200 + + [dcl.array] Rework description. + + Group examples with the corresponding normative statements. + Clarify the meaning of 'array type'. + Use 'declarator-id' instead of 'identifier'. + + commit f6ad222bfafd939180c9c65f7b0116d0d340001b + Author: Jens Maurer + Date: Mon May 27 09:20:57 2019 +0200 + + [range.prim.size] Clarify by adding 'respectively'. + + commit b3b1f637f12e2d0b71e351f5c9c3f6acd5059eaa + Author: Casey Carter + Date: Fri Jun 14 14:21:05 2019 -0700 + + [library-wide] Use "model" instead of "satisfy" for semantic library concept requirements + + Consistently use "satisfy" to mean the syntactic requirements are met, and "model" to mean the semantic requirements are met. + + Updates: [structure.requirements],[customization.point.object],[res.on.requirements],[concepts], and [range.semi.wrap]. + + Fixes #2591. + + commit b50067fe2dec316efc24ae80ae352f33eb31c3af + Author: Casey Carter + Date: Sun Apr 14 12:36:57 2019 -0700 + + [range.counted] Introduce "Counted view" + + Fixes #2825. + + commit da3660306d52d7c1813b6cfae71e78851cd37831 + Author: Jens Maurer + Date: Thu Jun 6 09:21:12 2019 +0200 + + [expr.unary.op] Modernize wording for obtaining a pointer. + + commit 97066177229afe6f2935da73b848254ea27a16a2 + Author: Marc Mutz + Date: Mon Jun 17 12:50:30 2019 +0200 + + [list.erasure][forward.list.erasure] Fix missing lambda braces (#2936) + + commit f8b8c257ae5bce961c0de29ed8e0ce2d88497acc + Author: Kazutoshi SATODA + Date: Sun Sep 9 00:11:36 2018 +0900 + + [expr.new] Harmonize rules of constant array bounds > 0 + + While "shall evaluate to a strictly positive value" is not wrong, + "shall be greater than zero" is easier and is used in [dcl.array] to + describe the same rule. + + commit 15c8259726b565f2a9b3adacdcc85a0727841c7c + Author: Casey Carter + Date: Mon Jun 17 09:52:08 2019 -0700 + + [library-wide] Use "meet" for non-concept type requirements (#2796) + + Partially addresses #1263. diff --git a/source/algorithms.tex b/source/algorithms.tex index 5434dfa69c..f68441ae72 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -15,14 +15,14 @@ and algorithms from the ISO C library, as summarized in \tref{algorithms.summary}. -\begin{libsumtab}{Algorithms library summary}{tab:algorithms.summary} -\ref{algorithms.requirements} & Algorithms requirements & \\ -\ref{algorithms.parallel} & Parallel algorithms & \\ \hline -\ref{alg.nonmodifying} & Non-modifying sequence operations & \\ -\ref{alg.modifying.operations} & Mutating sequence operations & \tcode{} \\ -\ref{alg.sorting} & Sorting and related operations & \\ \hline -\ref{numeric.ops} & Generalized numeric operations & \tcode{} \\ \rowsep -\ref{alg.c.library} & C library algorithms & \tcode{} \\ +\begin{libsumtab}{Algorithms library summary}{algorithms.summary} +\ref{algorithms.requirements} & Algorithms requirements & \\ +\ref{algorithms.parallel} & Parallel algorithms & \\ \rowsep +\ref{alg.nonmodifying} & Non-modifying sequence operations & \tcode{} \\ +\ref{alg.modifying.operations} & Mutating sequence operations & \\ +\ref{alg.sorting} & Sorting and related operations & \\ \rowsep +\ref{numeric.ops} & Generalized numeric operations & \tcode{} \\ \rowsep +\ref{alg.c.library} & C library algorithms & \tcode{} \\ \end{libsumtab} \rSec1[algorithms.requirements]{Algorithms requirements} @@ -72,35 +72,35 @@ \tcode{InputIterator}, \tcode{InputIterator1}, or \tcode{Input\-Iterator2}, - the template argument shall satisfy the + the template argument shall meet the \oldconcept{InputIterator} requirements\iref{input.iterators}. \item If an algorithm's template parameter is named \tcode{OutputIterator}, \tcode{OutputIterator1}, or \tcode{Output\-Iterator2}, - the template argument shall satisfy the + the template argument shall meet the \oldconcept{OutputIterator} requirements\iref{output.iterators}. \item If an algorithm's template parameter is named \tcode{ForwardIterator}, \tcode{ForwardIterator1}, or \tcode{Forward\-Iterator2}, - the template argument shall satisfy the + the template argument shall meet the \oldconcept{ForwardIterator} requirements\iref{forward.iterators}. \item If an algorithm's template parameter is named \tcode{BidirectionalIterator}, \tcode{Bidirectional\-Iterator1}, or \tcode{BidirectionalIterator2}, - the template argument shall satisfy the + the template argument shall meet the \oldconcept{BidirectionalIterator} requirements\iref{bidirectional.iterators}. \item If an algorithm's template parameter is named \tcode{RandomAccessIterator}, \tcode{Random\-AccessIterator1}, or \tcode{RandomAccessIterator2}, - the template argument shall satisfy the + the template argument shall meet the \oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators}. \end{itemize} @@ -108,7 +108,7 @@ If an algorithm's \effects element specifies that a value pointed to by any iterator passed as an argument is modified, then that algorithm has an additional type requirement: -The type of that argument shall satisfy +The type of that argument shall meet the requirements of a mutable iterator\iref{iterator.requirements}. \begin{note} This requirement does not affect arguments that are named @@ -264,7 +264,7 @@ \tcode{mismatch_result}, \tcode{copy_result}, and \tcode{partition_copy_result} -have the template parameters, data members, and special members specified above. +have the template parameters, data members, and special members specified below. They have no base classes or members other than those specified. \rSec1[algorithms.parallel]{Parallel algorithms} @@ -375,7 +375,7 @@ which are specified as modifying the object. \begin{note} For example, -\tcode{swap()}, +\tcode{swap}, \tcode{++}, \tcode{--}, \tcode{@=}, and @@ -3000,11 +3000,11 @@ \begin{itemdescr} \pnum \requires -\tcode{Function} shall satisfy -the \oldconcept{MoveConstructible} requirements (\tref{moveconstructible}). +\tcode{Function} shall meet +the \oldconcept{MoveConstructible} requirements (\tref{cpp17.moveconstructible}). \begin{note} \tcode{Function} need not meet the requirements of -\oldconcept{CopyConstructible} (\tref{copyconstructible}). +\oldconcept{CopyConstructible} (\tref{cpp17.copyconstructible}). \end{note} \pnum @@ -3013,7 +3013,7 @@ every iterator in the range \range{first}{last}, starting from \tcode{first} and proceeding to \tcode{last - 1}. \begin{note} -If the type of \tcode{first} satisfies the requirements of a mutable iterator, +If the type of \tcode{first} meets the requirements of a mutable iterator, \tcode{f} may apply non-constant functions through the dereferenced iterator. \end{note} @@ -3041,14 +3041,14 @@ \begin{itemdescr} \pnum \requires -\tcode{Function} shall satisfy the \oldconcept{CopyConstructible} requirements. +\tcode{Function} shall meet the \oldconcept{CopyConstructible} requirements. \pnum \effects Applies \tcode{f} to the result of dereferencing every iterator in the range \range{first}{last}. \begin{note} -If the type of \tcode{first} satisfies the requirements of a mutable iterator, +If the type of \tcode{first} meets the requirements of a mutable iterator, \tcode{f} may apply non-constant functions through the dereferenced iterator. \end{note} @@ -3121,7 +3121,7 @@ \begin{itemdescr} \pnum \requires -\tcode{Function} shall satisfy the \oldconcept{MoveConstructible} requirements +\tcode{Function} shall meet the \oldconcept{MoveConstructible} requirements \begin{note} \tcode{Function} need not meet the requirements of \oldconcept{CopyConstructible}. @@ -3136,7 +3136,7 @@ Applies \tcode{f} to the result of dereferencing every iterator in the range \range{first}{first + n} in order. \begin{note} -If the type of \tcode{first} satisfies the requirements of a mutable iterator, +If the type of \tcode{first} meets the requirements of a mutable iterator, \tcode{f} may apply non-constant functions through the dereferenced iterator. \end{note} @@ -3159,7 +3159,7 @@ \begin{itemdescr} \pnum \requires -\tcode{Function} shall satisfy the \oldconcept{CopyConstructible} requirements. +\tcode{Function} shall meet the \oldconcept{CopyConstructible} requirements. \pnum \requires @@ -3170,7 +3170,7 @@ Applies \tcode{f} to the result of dereferencing every iterator in the range \range{first}{first + n}. \begin{note} -If the type of \tcode{first} satisfies the requirements of a mutable iterator, +If the type of \tcode{first} meets the requirements of a mutable iterator, \tcode{f} may apply non-constant functions through the dereferenced iterator. \end{note} @@ -4206,7 +4206,7 @@ For the overload with an \tcode{ExecutionPolicy}, there may be a performance cost if \tcode{iterator_traits::value_type} -is not \oldconcept{\-Move\-Constructible} (\tref{moveconstructible}). +is not \oldconcept{\-Move\-Constructible} (\tref{cpp17.moveconstructible}). \end{note} \pnum @@ -4989,7 +4989,7 @@ \requires For the algorithms in namespace \tcode{std}, the type of \tcode{*first} -shall meet the \oldconcept{MoveAssignable} requirements (\tref{moveassignable}). +shall meet the \oldconcept{MoveAssignable} requirements (\tref{cpp17.moveassignable}). \pnum \effects @@ -5089,7 +5089,7 @@ For the overloads with an \tcode{ExecutionPolicy}, there may be a performance cost if \tcode{iterator_traits::value_type} does not meet -the \oldconcept{\-Move\-Constructible} (\tref{moveconstructible}) requirements. +the \oldconcept{\-Move\-Constructible} (\tref{cpp17.moveconstructible}) requirements. \end{note} \pnum @@ -5133,7 +5133,7 @@ BinaryPredicate pred); template S, class Proj = identity, - IndirectRelation> C = ranges::equal_to<>> + IndirectRelation> C = ranges::equal_to> constexpr I ranges::unique(I first, S last, C comp = {}, Proj proj = {}); template, Proj>> C = ranges::equal_to> @@ -5162,7 +5162,7 @@ For the overloads in namepace \tcode{std}, \tcode{pred} shall be an equivalence relation and the type of \tcode{*first} shall meet -the \oldconcept{MoveAssignable} requirements (\tref{moveassignable}). +the \oldconcept{MoveAssignable} requirements (\tref{cpp17.moveassignable}). \pnum \effects @@ -5262,9 +5262,9 @@ the \oldconcept{ForwardIterator} requirements and its value type is the same as \tcode{T}, then \tcode{T} shall meet - the \oldconcept{CopyAssignable} (\tref{copyassignable}) requirements. + the \oldconcept{CopyAssignable} (\tref{cpp17.copyassignable}) requirements. Otherwise, \tcode{T} shall meet both - the \oldconcept{CopyConstructible} (\tref{copyconstructible}) and + the \oldconcept{CopyConstructible} (\tref{cpp17.copyconstructible}) and \oldconcept{CopyAssignable} requirements. \begin{note} For the overloads with an \tcode{ExecutionPolicy}, @@ -5412,8 +5412,8 @@ \tcode{ForwardIterator} shall meet the \oldconcept{ValueSwappable} requirements\iref{swappable.requirements}, and the type of \tcode{*first} shall meet -the \oldconcept{MoveConstructible} (\tref{moveconstructible}) and -\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. +the \oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{cpp17.moveassignable}) requirements. \pnum \effects @@ -5534,15 +5534,15 @@ \requires \begin{itemize} \item - \tcode{PopulationIterator} shall satisfy + \tcode{PopulationIterator} shall meet the \oldconcept{InputIterator} requirements\iref{input.iterators}. \item - \tcode{SampleIterator} shall satisfy + \tcode{SampleIterator} shall meet the \oldconcept{OutputIterator} requirements\iref{output.iterators}. \item - \tcode{SampleIterator} shall satisfy + \tcode{SampleIterator} shall meet the \oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators} - unless \tcode{Pop\-ulat\-ion\-Iter\-ator} satisfies + unless \tcode{Pop\-ulat\-ion\-Iter\-ator} meets the \oldconcept{ForwardIterator} requirements\iref{forward.iterators}. \item \tcode{PopulationIterator}'s value type shall be @@ -5550,9 +5550,8 @@ \item \tcode{Distance} shall be an integer type. \item - \tcode{remove_reference_t} shall satisfy - the requirements of a uniform random bit generator type\iref{rand.req.urng} - whose return type is convertible to \tcode{Distance}. + \tcode{remove_reference_t} shall meet + the requirements of a uniform random bit generator type\iref{rand.req.urng}. \item \tcode{out} shall not be in the range \range{first}{last}. \end{itemize} @@ -5579,7 +5578,7 @@ \remarks \begin{itemize} \item - Stable if and only if \tcode{PopulationIterator} satisfies + Stable if and only if \tcode{PopulationIterator} meets the \oldconcept{ForwardIterator} requirements. \item To the extent that the implementation of this function makes use @@ -5658,7 +5657,7 @@ \begin{itemdescr} \pnum \requires -The type of \tcode{*first} shall satisfy +The type of \tcode{*first} shall meet the \oldconcept{MoveAssignable} requirements. \pnum @@ -5697,7 +5696,7 @@ \begin{itemdescr} \pnum \requires -The type of \tcode{*first} shall satisfy +The type of \tcode{*first} shall meet the \oldconcept{MoveAssignable} requirements. \tcode{ForwardIterator} shall meet the \oldconcept{BidirectionalIterator} requirements\iref{bidirectional.iterators} or @@ -5709,7 +5708,7 @@ Otherwise, moves the element from position \tcode{first + i} into \tcode{position first + n + i} for each non-negative integer \tcode{i < (last - first) - n}. -In the first overload case, if \tcode{ForwardIterator} satisfies +In the first overload case, if \tcode{ForwardIterator} meets the \oldconcept{BidirectionalIterator} requirements, does so in order starting from \tcode{i = (last - first) - n - 1} and proceeding to \tcode{i = 0}. @@ -5851,8 +5850,8 @@ \tcode{RandomAccessIterator} shall meet the \oldconcept{Value\-Swappable} requirements\iref{swappable.requirements} and the type of \tcode{*first} shall meet -the \oldconcept{MoveConstructible} (\tref{moveconstructible}) and -\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. +the \oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{cpp17.moveassignable}) requirements. \pnum \effects @@ -5909,8 +5908,8 @@ \tcode{RandomAccessIterator} shall meet the \oldconcept{Value\-Swappable} requirements\iref{swappable.requirements} and the type of \tcode{*first} shall meet -the \oldconcept{MoveConstructible} (\tref{moveconstructible}) and -\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. +the \oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{cpp17.moveassignable}) requirements. \pnum \effects @@ -5979,8 +5978,8 @@ \tcode{RandomAccessIterator} shall meet the \oldconcept{ValueSwappable} requirements\iref{swappable.requirements} and the type of \tcode{*first} shall meet -the \oldconcept{MoveConstructible} (\tref{moveconstructible}) and -\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. +the \oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{cpp17.moveassignable}) requirements. \pnum \effects @@ -6081,8 +6080,8 @@ \tcode{RandomAccessIterator} shall meet the \oldconcept{Value\-Swappable} requirements\iref{swappable.requirements}, the type of \tcode{*result_first} shall meet -the \oldconcept{MoveConstructible} (\tref{moveconstructible}) and -\oldconcept{\-Move\-Assignable} (\tref{moveassignable}) requirements, +the \oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible}) and +\oldconcept{\-Move\-Assignable} (\tref{cpp17.moveassignable}) requirements, and the expression \tcode{*first} shall be writable\iref{iterator.requirements.general} to \tcode{result_first}. @@ -6283,8 +6282,8 @@ \tcode{RandomAccessIterator} shall meet the \oldconcept{ValueSwappable} requirements\iref{swappable.requirements}, and the type of \tcode{*first} shall meet -the \oldconcept{MoveConstructible} (\tref{moveconstructible}) and -\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. +the \oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{cpp17.moveassignable}) requirements. \pnum \effects @@ -6481,13 +6480,15 @@ \item For the overloads in namespace \tcode{std}: \begin{codeblock} -\{lower_bound(first, last, value, comp), - upper_bound(first, last, value, comp)\} +{lower_bound(first, last, value, comp), + upper_bound(first, last, value, comp)} \end{codeblock} \item For the overloads in namespace \tcode{ranges}: -\{ranges::lower_bound(first, last, value, comp, proj), - ranges::upper_bound(first, last, value, comp, proj)\} +\begin{codeblock} +{ranges::lower_bound(first, last, value, comp, proj), + ranges::upper_bound(first, last, value, comp, proj)} +\end{codeblock} \end{itemize} \pnum @@ -6679,8 +6680,8 @@ \tcode{BidirectionalIterator} shall meet the \oldconcept{Value\-Swappable} requirements\iref{swappable.requirements} and the type of \tcode{*first} shall meet -the \oldconcept{MoveConstructible} (\tref{moveconstructible}) and -\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. +the \oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{cpp17.moveassignable}) requirements. \pnum \effects @@ -6962,8 +6963,8 @@ \tcode{BidirectionalIterator} shall meet the \oldconcept{Value\-Swappable} requirements\iref{swappable.requirements} and the type of \tcode{*first} shall meet -the \oldconcept{MoveConstructible} (\tref{moveconstructible}) and -\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. +the \oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{cpp17.moveassignable}) requirements. \pnum \effects @@ -7016,9 +7017,9 @@ They also work with \tcode{multiset}s\iref{multiset} containing multiple copies of equivalent elements. The semantics of the set operations are generalized to \tcode{multiset}s -in a standard way by defining \tcode{set_union()} +in a standard way by defining \tcode{set_union} to contain the maximum number of occurrences of every element, -\tcode{set_intersection()} to contain the minimum, and so on. +\tcode{set_intersection} to contain the minimum, and so on. \rSec3[includes]{\tcode{includes}} @@ -7528,8 +7529,8 @@ shall be a valid heap with respect to \tcode{comp} and \tcode{proj}. For the overloads in namespace \tcode{std}, the type of \tcode{*first} shall meet -the \oldconcept{MoveConstructible} requirements (\tref{moveconstructible}) and -the \oldconcept{MoveAssignable} requirements (\tref{moveassignable}). +the \oldconcept{MoveConstructible} requirements (\tref{cpp17.moveconstructible}) and +the \oldconcept{MoveAssignable} requirements (\tref{cpp17.moveassignable}). \pnum \effects @@ -7581,8 +7582,8 @@ \tcode{RandomAccessIterator} shall meet the \oldconcept{ValueSwappable} requirements\iref{swappable.requirements} and the type of \tcode{*first} shall meet -the \oldconcept{MoveConstructible} (\tref{moveconstructible}) and -\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. +the \oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{cpp17.moveassignable}) requirements. \pnum \effects @@ -7635,8 +7636,8 @@ \requires For the overloads in namespace \tcode{std}, the type of \tcode{*first} shall meet -the \oldconcept{Move\-Constructible} (\tref{moveconstructible}) and -\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. +the \oldconcept{Move\-Constructible} (\tref{cpp17.moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{cpp17.moveassignable}) requirements. \pnum \effects @@ -7688,8 +7689,8 @@ \tcode{RandomAccessIterator} shall meet the \oldconcept{ValueSwappable} requirements\iref{swappable.requirements} and the type of \tcode{*first} shall meet -the \oldconcept{MoveConst\-ruct\-ible} (\tref{moveconstructible}) and -\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. +the \oldconcept{MoveConst\-ruct\-ible} (\tref{cpp17.moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{cpp17.moveassignable}) requirements. \pnum \effects @@ -7848,7 +7849,7 @@ \pnum \requires For the first form, type \tcode{T} shall be -\oldconcept{LessThanComparable} (\tref{lessthancomparable}). +\oldconcept{LessThanComparable} (\tref{cpp17.lessthancomparable}). \pnum \returns @@ -7925,7 +7926,7 @@ \pnum \requires For the first form, type \tcode{T} shall be -\oldconcept{LessThanComparable} (\tref{lessthancomparable}). +\oldconcept{LessThanComparable} (\tref{cpp17.lessthancomparable}). \pnum \returns @@ -8004,7 +8005,7 @@ \pnum \requires For the first form, type \tcode{T} shall be -\oldconcept{LessThanComparable} (\tref{lessthancomparable}). +\oldconcept{LessThanComparable} (\tref{cpp17.lessthancomparable}). \pnum \returns @@ -8200,7 +8201,7 @@ \tcode{\{m, M\}}, where \tcode{m} is the first iterator in \range{first}{last} such that no iterator in the range refers to a smaller element, and where \tcode{M} is the last iterator\footnote{This behavior -intentionally differs from \tcode{max_element()}.} +intentionally differs from \tcode{max_element}.} in \range{first}{last} such that no iterator in the range refers to a larger element. \pnum @@ -8225,7 +8226,7 @@ \requires The value of \tcode{lo} shall be no greater than \tcode{hi}. For the first form, type \tcode{T} -shall be \oldconcept{LessThan\-Comparable} (\tref{lessthancomparable}). +shall be \oldconcept{LessThan\-Comparable} (\tref{cpp17.lessthancomparable}). \pnum \returns @@ -8802,9 +8803,9 @@ \begin{itemdescr} \pnum \requires -\tcode{T} shall satisfy -the \oldconcept{CopyConstructible} (\tref{copyconstructible}) -and \oldconcept{CopyAssignable} (\tref{copyassignable}) requirements. +\tcode{T} shall meet +the \oldconcept{CopyConstructible} (\tref{cpp17.copyconstructible}) +and \oldconcept{CopyAssignable} (\tref{cpp17.copyassignable}) requirements. In the range \crange{first}{last}, \tcode{binary_op} shall neither modify elements nor invalidate iterators or subranges.% @@ -8906,7 +8907,7 @@ \requires \begin{itemize} \item - \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{moveconstructible}). + \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible}). \item All of \tcode{binary_op(init, *first)}, \tcode{binary_op(*first, init)}, \tcode{binary_op(init, init)}, and \tcode{binary_op(*first, *first)} @@ -8953,9 +8954,9 @@ \begin{itemdescr} \pnum \requires -\tcode{T} shall satisfy -the \oldconcept{CopyConstructible} (\tref{copyconstructible}) -and \oldconcept{CopyAssignable} (\tref{copyassignable}) requirements. +\tcode{T} shall meet +the \oldconcept{CopyConstructible} (\tref{cpp17.copyconstructible}) +and \oldconcept{CopyAssignable} (\tref{cpp17.copyassignable}) requirements. In the ranges \crange{first1}{last1} and \crange{first2}{first2 + (last1 - first1)} \tcode{binary_op1} and \tcode{binary_op2} @@ -9037,7 +9038,7 @@ \requires \begin{itemize} \item - \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{moveconstructible}). + \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible}). \item All of \begin{itemize} @@ -9085,7 +9086,7 @@ \requires \begin{itemize} \item - \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{moveconstructible}). + \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible}). \item All of \begin{itemize} @@ -9223,7 +9224,7 @@ \requires \begin{itemize} \item - \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{moveconstructible}). + \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible}). \item All of \tcode{binary_op(init, init)}, @@ -9326,7 +9327,7 @@ \begin{itemize} \item If \tcode{init} is provided, - \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{moveconstructible}); + \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible}); otherwise, \tcode{ForwardIterator1}'s value type shall be \oldconcept{MoveConstructible}. \item @@ -9401,7 +9402,7 @@ \requires \begin{itemize} \item - \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{moveconstructible}). + \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible}). \item All of \begin{itemize} @@ -9489,7 +9490,7 @@ \begin{itemize} \item If \tcode{init} is provided, \tcode{T} shall be - \oldconcept{MoveConstructible} (\tref{moveconstructible}); + \oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible}); otherwise, \tcode{ForwardIterator1}'s value type shall be \oldconcept{MoveConstructible}. \item @@ -9582,7 +9583,7 @@ \begin{itemize} \item For the overloads with no \tcode{ExecutionPolicy}, - \tcode{T} shall be \oldconcept{MoveAssignable} (\tref{moveassignable}) and + \tcode{T} shall be \oldconcept{MoveAssignable} (\tref{cpp17.moveassignable}) and shall be constructible from the type of \tcode{*first}. \tcode{acc} (defined below) shall be writable\iref{iterator.requirements.general} @@ -9814,7 +9815,7 @@ \pnum \throws -Any exception thrown by \tcode{compar()}\iref{res.on.exception.handling}. +Any exception thrown by \tcode{compar}\iref{res.on.exception.handling}. \end{itemdescr} \xref diff --git a/source/atomics.tex b/source/atomics.tex index 51a8c0668c..dd0a8aba40 100644 --- a/source/atomics.tex +++ b/source/atomics.tex @@ -9,25 +9,17 @@ \pnum The following subclauses describe atomics requirements and components for types -and operations, as summarized below. - -\begin{libsumtab}{Atomics library summary}{tab:atomics.lib.summary} -\ref{atomics.alias} & Type aliases & - \\ \rowsep -\ref{atomics.order} & Order and consistency & - \\ \rowsep -\ref{atomics.lockfree} & Lock-free property & - \\ \rowsep -\ref{atomics.ref.generic} & Class template \tcode{atomic_ref} & \tcode{} - \\ \rowsep -\ref{atomics.types.generic} & Class template \tcode{atomic} & \tcode{} - \\ \rowsep -\ref{atomics.nonmembers} & Non-member functions & \tcode{} - \\ \rowsep -\ref{atomics.flag} & Flag type and operations & \tcode{} - \\ \rowsep -\ref{atomics.fences} & Fences & \tcode{} - \\ \rowsep +and operations, as summarized in \tref{atomics.summary}. + +\begin{libsumtab}{Atomics library summary}{atomics.summary} +\ref{atomics.alias} & Type aliases & \tcode{} \\ +\ref{atomics.order} & Order and consistency & \\ +\ref{atomics.lockfree} & Lock-free property & \\ +\ref{atomics.ref.generic} & Class template \tcode{atomic_ref} & \\ +\ref{atomics.types.generic} & Class template \tcode{atomic} & \\ +\ref{atomics.nonmembers} & Non-member functions & \\ +\ref{atomics.flag} & Flag type and operations & \\ +\ref{atomics.fences} & Fences & \\ \end{libsumtab} \rSec1[atomics.syn]{Header \tcode{} synopsis} @@ -1008,7 +1000,7 @@ \pnum The following operations perform arithmetic computations. The key, operator, and computation correspondence is identified -in \tref{atomic.arithmetic.computations}. +in \tref{atomic.types.int.comp}. \indexlibrarymember{fetch_add}{atomic_ref<\placeholder{integral}>}% \indexlibrarymember{fetch_and}{atomic_ref<\placeholder{integral}>}% @@ -1122,7 +1114,7 @@ \pnum The following operations perform arithmetic computations. The key, operator, and computation correspondence are identified -in \tref{atomic.arithmetic.computations}. +in \tref{atomic.types.int.comp}. \indexlibrarymember{fetch_add}{atomic_ref<\placeholder{floating-point}>}% \indexlibrarymember{fetch_sub}{atomic_ref<\placeholder{floating-point}>}% @@ -1221,7 +1213,7 @@ \pnum The following operations perform arithmetic computations. The key, operator, and computation correspondence is identified -in \tref{atomic.pointer.computations}. +in \tref{atomic.types.pointer.comp}. \indexlibrarymember{fetch_add}{atomic_ref}% \indexlibrarymember{fetch_sub}{atomic_ref}% @@ -1725,7 +1717,7 @@ \begin{note} For a union with bits that participate in the value representation of some members but not others, compare-and-exchange might always fail. -This is because such padding bits have an indeteminate value when they +This is because such padding bits have an indeterminate value when they do not participate in the value representation of the active member. As a consequence, the following code is not guaranteed to ever succeed: \begin{codeblock} @@ -1857,7 +1849,7 @@ The following operations perform arithmetic computations. The key, operator, and computation correspondence is: \begin{floattable} -{Atomic arithmetic computations}{tab:atomic.arithmetic.computations}{lll|lll} +{Atomic arithmetic computations}{atomic.types.int.comp}{lll|lll} \hline \hdstyle{\tcode{\placeholder{key}}} & \hdstyle{Op} & @@ -2028,7 +2020,7 @@ \pnum The following operations perform arithmetic addition and subtraction computations. The key, operator, and computation correspondence are identified in -\tref{atomic.arithmetic.computations}. +\tref{atomic.types.int.comp}. \indexlibrary{\idxcode{atomic_fetch_add}}% \indexlibrary{\idxcode{atomic_fetch_sub}}% @@ -2166,7 +2158,7 @@ and computation correspondence is: \begin{floattable} -{Atomic pointer computations}{tab:atomic.pointer.computations}{lll|lll} +{Atomic pointer computations}{atomic.types.pointer.comp}{lll|lll} \hline \tcode{Key} & Op & diff --git a/source/basic.tex b/source/basic.tex index a7e73e817a..dac414469e 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -297,7 +297,7 @@ \tcode{e1 . \opt{template} e2} naming a non-static data member, the set contains the potential results of \tcode{e1}. -\item if \tcode{e} is a class member access expression +\item If \tcode{e} is a class member access expression naming a static data member, the set contains the \grammarterm{id-expression} designating the data member. \item If \tcode{e} is a pointer-to-member @@ -941,8 +941,17 @@ \tcode{for}, or \tcode{switch} statement (including the controlled statement), and shall not be redeclared in a subsequent condition of that statement nor in the outermost block (or, for the \tcode{if} -statement, any of the outermost blocks) of the controlled statement; -see~\ref{stmt.select}. +statement, any of the outermost blocks) of the controlled statement. +\begin{example} +\begin{codeblock} +if (int x = f()) { + int x; // ill-formed, redeclaration of \tcode{x} +} +else { + int x; // ill-formed, redeclaration of \tcode{x} +} +\end{codeblock} +\end{example} \rSec2[basic.scope.param]{Function parameter scope} @@ -2343,11 +2352,13 @@ described in~\ref{basic.lookup.qual}, but ignoring any non-type names that have been declared. If the name lookup does not find a previously declared \grammarterm{type-name}, the \grammarterm{elaborated-type-specifier} -is ill-formed. \begin{example} +is ill-formed. +\pnum +\begin{example} \begin{codeblock} struct Node { - struct Node* Next; // OK: Refers to \tcode{Node} at global scope + struct Node* Next; // OK: Refers to injected-class-name \tcode{Node} struct Data* Data; // OK: Declares type \tcode{Data} at global scope and member \tcode{Data} }; @@ -3148,7 +3159,7 @@ Otherwise, such a pointer refers to allocated storage\iref{basic.stc.dynamic.allocation}, and using the pointer as -if the pointer were of type \tcode{void*}, is +if the pointer were of type \tcode{void*} is well-defined. Indirection through such a pointer is permitted but the resulting lvalue may only be used in limited ways, as described below. The program has undefined behavior if: @@ -4568,7 +4579,7 @@ the largest value of the corresponding unsigned type. \end{example} -\begin{floattable}{Minimum width}{tab:width}{ll} +\begin{floattable}{Minimum width}{basic.fundamental.width}{ll} \topline \lhdr{Type} & \rhdr{Minimum width $N$} \\ \capsep @@ -4581,7 +4592,7 @@ \pnum The width of each signed integer type -shall not be less than the values specified in \tref{width}. +shall not be less than the values specified in \tref{basic.fundamental.width}. The value representation of a signed or unsigned integer type comprises $N$ bits, where N is the respective width. Each set of values for any padding bits\iref{basic.types} @@ -4825,8 +4836,8 @@ \pnum These methods of constructing types can be applied recursively; -restrictions are mentioned in~\ref{dcl.ptr}, \ref{dcl.array}, -\ref{dcl.fct}, and~\ref{dcl.ref}. Constructing a type such that the number of +restrictions are mentioned in~\ref{dcl.meaning}. +Constructing a type such that the number of bytes in its object representation exceeds the maximum value representable in the type \tcode{std::size_t}\iref{support.types} is ill-formed. @@ -4985,10 +4996,10 @@ \pnum There is a partial ordering on cv-qualifiers, so that a type can be said to be \defn{more cv-qualified} than another. -\tref{relations.on.const.and.volatile} shows the relations that +\tref{basic.type.qualifier.rel} shows the relations that constitute this ordering. -\begin{floattable}{Relations on \tcode{const} and \tcode{volatile}}{tab:relations.on.const.and.volatile} +\begin{floattable}{Relations on \tcode{const} and \tcode{volatile}}{basic.type.qualifier.rel} {ccc} \topline \cvqual{no cv-qualifier} &<& \tcode{const} \\ @@ -6059,7 +6070,7 @@ \defnx{Constant initialization}{constant initialization} is performed if a variable or temporary object with static or thread storage duration is initialized by a constant initializer\iref{expr.const} for the entity. -\indextext{initialization!runtime}% +\indextext{initialization!zero-initialization}% If constant initialization is not performed, a variable with static storage duration\iref{basic.stc.static} or thread storage duration\iref{basic.stc.thread} is zero-initialized\iref{dcl.init}. diff --git a/source/classes.tex b/source/classes.tex index 41d1654433..0b9e26bccf 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -476,7 +476,7 @@ \begin{bnf} \nontermdef{pure-specifier}\br - \terminal{= 0} + \terminal{=} \terminal{0} \end{bnf} \pnum @@ -3533,7 +3533,7 @@ \begin{importgraphic} {Directed acyclic graph} -{fig:dag} +{class.dag} {figdag.pdf} \end{importgraphic} \end{note} @@ -3629,11 +3629,11 @@ corresponds one-to-one with a distinct \tcode{L} subobject within the object of type \tcode{C}. Given the class \tcode{C} defined above, an object of class \tcode{C} will have two subobjects of class \tcode{L} as -shown in Figure~\ref{fig:nonvirt}. +shown in \fref{class.nonvirt}. \begin{importgraphic} {Non-virtual base} -{fig:nonvirt} +{class.nonvirt} {fignonvirt.pdf} \end{importgraphic} @@ -3659,14 +3659,14 @@ \end{codeblock} \begin{importgraphic} {Virtual base} -{fig:virt} +{class.virt} {figvirt.pdf} \end{importgraphic} For an object \tcode{c} of class type \tcode{C}, a single subobject of type \tcode{V} is shared by every base class subobject of \tcode{c} that has a \tcode{virtual} base class of type \tcode{V}. Given the class \tcode{C} defined above, an object of class \tcode{C} will have one subobject of -class \tcode{V}, as shown in Figure~\ref{fig:virt}. +class \tcode{V}, as shown in \fref{class.virt}. \indextext{DAG!multiple inheritance}% \indextext{DAG!virtual base class}% \end{note} @@ -3690,14 +3690,14 @@ \tcode{B} subobject within the object of type \tcode{AA}. Given the class \tcode{AA} defined above, class \tcode{AA} has two subobjects of class \tcode{B}: \tcode{Z}'s \tcode{B} and the virtual \tcode{B} shared -by \tcode{X} and \tcode{Y}, as shown in Figure~\ref{fig:virtnonvirt}. +by \tcode{X} and \tcode{Y}, as shown in \fref{class.virtnonvirt}. \indextext{DAG!virtual base class}% \indextext{DAG!non-virtual base class}% \indextext{DAG!multiple inheritance}% \begin{importgraphic} {Virtual and non-virtual base} -{fig:virtnonvirt} +{class.virtnonvirt} {figvirtnonvirt.pdf} \end{importgraphic} \end{note} @@ -4396,7 +4396,7 @@ \begin{importgraphic} {Name lookup} -{fig:name} +{class.lookup} {figname.pdf} \end{importgraphic} diff --git a/source/compatibility.tex b/source/compatibility.tex index 33e70c15ed..bdcd591c17 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -898,7 +898,7 @@ \change New keywords. \rationale Required for new features. \effect -Added to \tref{keywords}, the following identifiers are new keywords: +Added to \tref{lex.key}, the following identifiers are new keywords: \tcode{alignas}, \tcode{alignof}, \tcode{char16_t}, diff --git a/source/concepts.tex b/source/concepts.tex index 18763fc951..a2969a1163 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -12,9 +12,9 @@ \pnum The following subclauses describe language-related concepts, comparison concepts, object concepts, and callable concepts as summarized in -\tref{concepts.lib.summary}. +\tref{concepts.summary}. -\begin{libsumtab}{Fundamental concepts library summary}{tab:concepts.lib.summary} +\begin{libsumtab}{Fundamental concepts library summary}{concepts.summary} \ref{concepts.equality} & Equality preservation & \\ \hline \ref{concepts.lang} & Language-related concepts & \tcode{} \\ \ref{concepts.compare} & Comparison concepts & \\ @@ -134,8 +134,9 @@ }; \end{codeblock} -\tcode{T} fails to meet the implicit requirements of \tcode{C}, so \tcode{C} -is not satisfied. Since implementations are not required to validate the syntax +\tcode{T} fails to meet the implicit requirements of \tcode{C}, +so \tcode{T} satisfies but does not model \tcode{C}. +Since implementations are not required to validate the syntax of implicit requirements, it is unspecified whether an implementation diagnoses as ill-formed a program that requires \tcode{C}. \end{example} @@ -332,9 +333,11 @@ return f(); } \end{codeblock} +for some types \tcode{From} and \tcode{To}, and let \tcode{f} be a function with no arguments and return type \tcode{From} such that \tcode{f()} is equality-preserving. -\tcode{\libconcept{ConvertibleTo}} is satisfied only if: +\tcode{From} and \tcode{To} model \tcode{\libconcept{ConvertibleTo}} +only if: \begin{itemize} \item @@ -366,7 +369,7 @@ \tcode{\libconcept{ConvertibleTo}} and \tcode{\libconcept{ConvertibleTo}} -are satisfied, then \tcode{T} and \tcode{U} share a +are modeled, then \tcode{T} and \tcode{U} share a \term{common reference type}, \tcode{C}. \begin{note} \tcode{C} could be the same as \tcode{T}, or \tcode{U}, or it could be a @@ -478,13 +481,13 @@ \begin{itemdescr} \pnum \begin{note} -\tcode{\libconcept{SignedIntegral}} can be satisfied even by types that are +\libconcept{SignedIntegral} can be modeled even by types that are not signed integral types\iref{basic.fundamental}; for example, \tcode{char}. \end{note} \pnum \begin{note} -\tcode{\libconcept{UnsignedIntegral}} can be satisfied even by types that are +\libconcept{UnsignedIntegral} can be modeled even by types that are not unsigned integral types\iref{basic.fundamental}; for example, \tcode{bool}. \end{note} \end{itemdescr} @@ -512,7 +515,8 @@ \tcode{RHS}, and \item \tcode{rcopy} be a distinct object that is equal to \tcode{rhs}. \end{itemize} -\tcode{\libconcept{Assignable}} is satisfied only if +\tcode{LHS} and \tcode{RHS} model +\tcode{\libconcept{Assignable}} only if \begin{itemize} \item \tcode{addressof(lhs = rhs) == addressof(lcopy)}. @@ -578,12 +582,10 @@ \tcode{S} is \tcode{(void)swap(E1, E2)}\footnote{The name \tcode{swap} is used here unqualified.} if \tcode{E1} or \tcode{E2} has class or enumeration type\iref{basic.compound} and that expression is valid, with - overload resolution performed in a context that includes the declarations + overload resolution performed in a context that includes the declaration \begin{codeblock} template void swap(T&, T&) = delete; - template - void swap(T(&)[N], T(&)[N]) = delete; \end{codeblock} and does not include a declaration of \tcode{ranges::swap}. If the function selected by overload resolution does not @@ -722,7 +724,7 @@ \begin{itemdescr} \pnum \begin{note} -Unlike the \oldconcept{Destructible} requirements~(\tref{destructible}), this +Unlike the \oldconcept{Destructible} requirements~(\tref{cpp17.destructible}), this concept forbids destructors that are potentially throwing, even if a particular invocation of the destructor does not actually throw. \end{note} @@ -760,7 +762,7 @@ \pnum If \tcode{T} is an object type, then let \tcode{rv} be an rvalue of type \tcode{T} and \tcode{u2} a distinct object of type \tcode{T} equal to -\tcode{rv}. \tcode{\libconcept{MoveConstructible}} is satisfied only if +\tcode{rv}. \tcode{T} models \libconcept{MoveConstructible} only if \begin{itemize} \item After the definition \tcode{T u = rv;}, \tcode{u} is equal to \tcode{u2}. @@ -788,7 +790,7 @@ \pnum If \tcode{T} is an object type, then let \tcode{v} be an lvalue of type (possibly \tcode{const}) \tcode{T} or an rvalue of type \tcode{const T}. -\tcode{\libconcept{CopyConstructible}} is satisfied only if +\tcode{T} models \libconcept{CopyConstructible} only if \begin{itemize} \item After the definition \tcode{T u = v;}, \tcode{u} is equal to \tcode{v}. @@ -819,7 +821,7 @@ Movable> && // (see \ref{concepts.object}) requires(const remove_reference_t& b1, const remove_reference_t& b2, const bool a) { - requires ConvertibleTo&, bool>; + { b1 } -> ConvertibleTo; { !b1 } -> ConvertibleTo; { b1 && a } -> Same; { b1 || a } -> Same; @@ -837,9 +839,9 @@ \end{itemdecl} \pnum -Let \tcode{b1} and \tcode{b2} be lvalues of type -\tcode{const remove_reference_t}. -\tcode{\libconcept{Boolean}} is satisfied only if +For some type \tcode{B}, let \tcode{b1} and \tcode{b2} be +lvalues of type \tcode{const remove_reference_t}. +\tcode{B} models \libconcept{Boolean} only if \begin{itemize} \item \tcode{bool(b1) == !bool(!b1)}. @@ -883,11 +885,12 @@ \begin{itemdescr} \pnum -Let \tcode{t} and \tcode{u} be lvalues of types +For some types \tcode{T} and \tcode{U}, +let \tcode{t} and \tcode{u} be lvalues of types \tcode{const remove_reference_t} and \tcode{const remove_reference_t} respectively. -\tcode{\placeholder{weakly-equality-comparable-with}} -is satisfied only if: +\tcode{T} and \tcode{U} model +\tcode{\placeholder{weakly-equality-comparable-with}} only if \begin{itemize} \item \tcode{t == u}, \tcode{u == t}, \tcode{t != u}, and \tcode{u != t} have the same domain. @@ -906,7 +909,7 @@ \begin{itemdescr} \pnum Let \tcode{a} and \tcode{b} be objects of type \tcode{T}. -\tcode{\libconcept{EqualityComparable}} is satisfied only if +\tcode{T} models \libconcept{EqualityComparable} only if \tcode{bool(a == b)} is \tcode{true} when \tcode{a} is equal to \tcode{b}\iref{concepts.equality}, and \tcode{false} otherwise. @@ -932,13 +935,15 @@ \begin{itemdescr} \pnum -Let \tcode{t} be an lvalue of type \tcode{const remove_reference_t}, +For some types \tcode{T} and \tcode{U}, +let \tcode{t} be an lvalue of type \tcode{const remove_reference_t}, \tcode{u} be an lvalue of type \tcode{const remove_reference_t}, and \tcode{C} be: \begin{codeblock} common_reference_t&, const remove_reference_t&> \end{codeblock} -\tcode{\libconcept{EqualityComparableWith}} is satisfied only if +\tcode{T} and \tcode{U} model +\tcode{\libconcept{EqualityComparableWith}} only if \tcode{bool(t == u) == bool(C(t) == C(u))}. \end{itemdescr} @@ -960,9 +965,9 @@ \begin{itemdescr} \pnum -Let \tcode{a}, \tcode{b}, and \tcode{c} be lvalues of type -\tcode{const remove_reference_t}. -\tcode{\libconcept{StrictTotallyOrdered}} is satisfied only if +For some type \tcode{T}, let \tcode{a}, \tcode{b}, and \tcode{c} be +lvalues of type \tcode{const remove_reference_t}. +\tcode{T} models \libconcept{StrictTotallyOrdered} only if \begin{itemize} \item Exactly one of \tcode{bool(a < b)}, \tcode{bool(a > b)}, or @@ -1001,13 +1006,15 @@ \begin{itemdescr} \pnum -Let \tcode{t} be an lvalue of type \tcode{const remove_reference_t}, +For some types \tcode{T} and \tcode{U}, +let \tcode{t} be an lvalue of type \tcode{const remove_reference_t}, \tcode{u} be an lvalue of type \tcode{const remove_reference_t}, and \tcode{C} be: \begin{codeblock} common_reference_t&, const remove_reference_t&> \end{codeblock} -\tcode{\libconcept{StrictTotallyOrderedWith}} is satisfied only if +\tcode{T} and \tcode{U} model +\tcode{\libconcept{StrictTotallyOrderedWith}} only if \begin{itemize} \item \tcode{bool(t < u) == bool(C(t) < C(u)).} @@ -1045,14 +1052,14 @@ \begin{itemdescr} \pnum \begin{note} -The \libconcept{Semiregular} concept is satisfied by types that behave similarly +The \libconcept{Semiregular} concept is modeled by types that behave similarly to built-in types like \tcode{int}, except that they might not be comparable with \tcode{==}. \end{note} \pnum \begin{note} -The \libconcept{Regular} concept is satisfied by types that behave similarly to +The \libconcept{Regular} concept is modeled by types that behave similarly to built-in types like \tcode{int} and that are comparable with \tcode{==}. \end{note} @@ -1084,7 +1091,7 @@ \begin{itemdescr} \pnum \begin{example} -A function that generates random numbers can satisfy \libconcept{Invocable}, +A function that generates random numbers can model \libconcept{Invocable}, since the \tcode{invoke} function call expression is not required to be equality-preserving\iref{concepts.equality}. \end{example} @@ -1110,8 +1117,7 @@ \pnum \begin{example} -A random number generator does not satisfy -\libconcept{RegularInvocable}. +A random number generator does not model \libconcept{RegularInvocable}. \end{example} \pnum @@ -1149,7 +1155,7 @@ \begin{itemdescr} \pnum -A \libconcept{Relation} satisfies \libconcept{StrictWeakOrder} only if +A \libconcept{Relation} models \libconcept{StrictWeakOrder} only if it imposes a \term{strict weak ordering} on its arguments. \pnum diff --git a/source/config.tex b/source/config.tex index 54017e5254..75dc7ebf33 100644 --- a/source/config.tex +++ b/source/config.tex @@ -1,8 +1,8 @@ %!TEX root = std.tex %%-------------------------------------------------- %% Version numbers -\newcommand{\docno}{N4810} -\newcommand{\prevdocno}{N4800} +\newcommand{\docno}{N4820} +\newcommand{\prevdocno}{N4810} \newcommand{\cppver}{201703L} %% Release date diff --git a/source/containers.tex b/source/containers.tex index bfceedb1e9..df227bfcd6 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -14,22 +14,20 @@ sequence containers and associative containers, as summarized in -\tref{containers.lib.summary}. +\tref{containers.summary}. -\begin{libsumtab}{Containers library summary}{tab:containers.lib.summary} +\begin{libsumtab}{Containers library summary}{containers.summary} \ref{container.requirements} & Requirements & \\ \rowsep -\ref{sequences} & Sequence containers & \tcode{} \\ - & & \tcode{} \\ - & & \tcode{} \\ - & & \tcode{} \\ - & & \tcode{} \\ \rowsep -\ref{associative} & Associative containers & \tcode{} \\ - & & \tcode{} \\ \rowsep -\ref{unord} & Unordered associative containers & \tcode{} \\ - & & \tcode{} \\ \rowsep -\ref{container.adaptors} & Container adaptors & \tcode{} \\ - & & \tcode{} \\ \rowsep -\ref{views} & Views & \tcode{} \\ \rowsep +\ref{sequences} & Sequence containers & + \tcode{}, \tcode{}, \tcode{}, + \tcode{}, \tcode{} \\ \rowsep +\ref{associative} & Associative containers & + \tcode{}, \tcode{} \\ \rowsep +\ref{unord} & Unordered associative containers & + \tcode{}, \tcode{} \\ \rowsep +\ref{container.adaptors} & Container adaptors & + \tcode{}, \tcode{} \\ \rowsep +\ref{views} & Views & \tcode{} \\ \rowsep \end{libsumtab} @@ -70,9 +68,9 @@ \end{note} \pnum -In Tables~\ref{tab:containers.container.requirements}, -\ref{tab:containers.reversible.requirements}, and -\ref{tab:containers.optional.operations} +In Tables~\ref{tab:container.req}, +\ref{tab:container.rev.req}, and +\ref{tab:container.opt} \tcode{X} denotes a container class containing objects of type \tcode{T}, \tcode{a} and \tcode{b} denote values of type \tcode{X}, \tcode{u} @@ -82,7 +80,7 @@ \begin{libreqtab5} {Container requirements} -{tab:containers.container.requirements} +{container.req} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \chdr{Assertion/note} & \rhdr{Complexity} \\ @@ -360,12 +358,12 @@ random access iterator categories\iref{iterator.requirements}, the container is called \term{reversible} -and satisfies the additional requirements -in \tref{containers.reversible.requirements}. +and meets the additional requirements +in \tref{container.rev.req}. \begin{libreqtab4a} {Reversible container requirements} -{tab:containers.reversible.requirements} +{container.rev.req} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Assertion/note} & \rhdr{Complexity} \\ @@ -461,18 +459,18 @@ model \libconcept{ContiguousIterator}\iref{iterator.concept.contiguous}. \pnum -\tref{containers.optional.operations} lists operations that are provided +\tref{container.opt} lists operations that are provided for some types of containers but not others. Those containers for which the listed operations are provided shall implement the semantics described in -\tref{containers.optional.operations} unless otherwise stated. +\tref{container.opt} unless otherwise stated. If the iterators passed to \tcode{lexicographical_compare} -satisfy the constexpr iterator requirements\iref{iterator.requirements.general} -then the operations described in \tref{containers.optional.operations} +meet the constexpr iterator requirements\iref{iterator.requirements.general} +then the operations described in \tref{container.opt} are implemented by constexpr functions. \begin{libreqtab5} {Optional container operations} -{tab:containers.optional.operations} +{container.opt} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \chdr{Assertion/note} & \rhdr{Complexity} \\ @@ -517,7 +515,7 @@ \pnum All of the containers defined in this Clause and in~\ref{basic.string} except \tcode{array} meet the additional requirements of an allocator-aware container, as described in -\tref{containers.allocatoraware}. +\tref{container.alloc.req}. Given an allocator type \tcode{A} and given a container type \tcode{X} having a \tcode{value_type} identical to \tcode{T} @@ -602,7 +600,7 @@ \end{note} \pnum -In \tref{containers.allocatoraware}, \tcode{X} denotes an allocator-aware container class +In \tref{container.alloc.req}, \tcode{X} denotes an allocator-aware container class with a \tcode{value_type} of \tcode{T} using allocator of type \tcode{A}, \tcode{u} denotes a variable, \tcode{a} and \tcode{b} denote non-const lvalues of type \tcode{X}, @@ -611,7 +609,7 @@ \begin{libreqtab4a} {Allocator-aware container requirements} -{tab:containers.allocatoraware} +{container.alloc.req} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Assertion/note} & \rhdr{Complexity} \\ @@ -716,7 +714,7 @@ as input iterators. Likewise, the extent to which an implementation determines that a type cannot be an allocator is unspecified, except that as a minimum a type \tcode{A} shall not qualify -as an allocator unless it satisfies both of the following conditions: +as an allocator unless it meets both of the following conditions: \begin{itemize} \item The \grammarterm{qualified-id} \tcode{A::value_type} @@ -782,8 +780,8 @@ \end{note} \pnum -In Tables~\ref{tab:containers.sequence.requirements} -and \ref{tab:containers.sequence.optional}, +In Tables~\ref{tab:container.seq.req} +and \ref{tab:container.seq.opt}, \tcode{X} denotes a sequence container class, \tcode{a} denotes a value of type \tcode{X} containing elements of type \tcode{T}, \tcode{u} denotes the name of a variable being declared, @@ -792,7 +790,7 @@ type\iref{temp.deduct} and \tcode{allocator} if it doesn't, \tcode{i} and \tcode{j} -denote iterators satisfying input iterator requirements +denote iterators that meet the \oldconcept{InputIterator} requirements and refer to elements implicitly convertible to \tcode{value_type}, \tcode{[i, j)} denotes a valid range, @@ -816,7 +814,7 @@ \begin{libreqtab3} {Sequence container requirements (in addition to container)} -{tab:containers.sequence.requirements} +{container.seq.req} \\ \topline \lhdr{Expression} & \chdr{Return type} & \rhdr{Assertion/note} \\ & & \rhdr{pre-/post-condition} \\ \capsep @@ -1045,7 +1043,7 @@ \end{itemize} \pnum -\tref{containers.sequence.optional} lists operations +\tref{container.seq.opt} lists operations that are provided for some types of sequence containers but not others. An implementation shall provide @@ -1055,7 +1053,7 @@ \begin{libreqtab4a} {Optional sequence container operations} -{tab:containers.sequence.optional} +{container.seq.opt} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational semantics} & \rhdr{Container} \\ \capsep \endfirsthead @@ -1216,9 +1214,9 @@ ownership to another container with compatible nodes. Containers with compatible nodes have the same node handle type. Elements may be transferred in either direction between container types in the same row of -\tref{containers.node.compat}. +\tref{container.node.compat}. -\begin{floattable}{Container types with compatible nodes}{tab:containers.node.compat} +\begin{floattable}{Container types with compatible nodes}{container.node.compat} {ll} \topline \tcode{map} & \tcode{map} \\ @@ -1257,7 +1255,7 @@ template<@\unspecnc@> class @\placeholder{node-handle}@ { public: - // These type declarations are described in Tables \ref{tab:containers.associative.requirements} and \ref{tab:HashRequirements}. + // These type declarations are described in Tables \ref{tab:container.assoc.req} and \ref{tab:container.hash.req}. using value_type = @\seebelownc{}@; // not present for map containers using key_type = @\seebelownc{}@; // not present for set containers using mapped_type = @\seebelownc{}@; // not present for set containers @@ -1580,18 +1578,18 @@ The associative containers meet all the requirements of Allocator-aware containers\iref{container.requirements.general}, except that for \tcode{map} and \tcode{multimap}, the requirements placed on \tcode{value_type} -in \tref{containers.allocatoraware} apply instead to \tcode{key_type} +in \tref{container.alloc.req} apply instead to \tcode{key_type} and \tcode{mapped_type}. \begin{note} For example, in some cases \tcode{key_type} and \tcode{mapped_type} are required to be \oldconcept{CopyAssignable} even though the associated \tcode{value_type}, \tcode{pair}, is not \oldconcept{CopyAssignable}. \end{note} \pnum -In \tref{containers.associative.requirements}, +In \tref{container.assoc.req}, \tcode{X} denotes an associative container class, \tcode{a} denotes a value of type \tcode{X}, \tcode{a2} denotes a value of a type with nodes compatible with type -\tcode{X} (\tref{containers.node.compat}), +\tcode{X} (\tref{container.node.compat}), \tcode{b} denotes a possibly \tcode{const} value of type \tcode{X}, \tcode{u} denotes the name of a variable being declared, \tcode{a_uniq} denotes a value of type \tcode{X} @@ -1603,7 +1601,7 @@ \tcode{X::key_compare::is_transparent} is valid and denotes a type\iref{temp.deduct}, \tcode{i} and \tcode{j} -satisfy input iterator requirements and refer to elements +meet the \oldconcept{InputIterator} requirements and refer to elements implicitly convertible to \tcode{value_type}, \range{i}{j} denotes a valid range, @@ -1638,7 +1636,7 @@ \begin{libreqtab4b} {Associative container requirements (in addition to container)} -{tab:containers.associative.requirements} +{container.assoc.req} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Assertion/note} & \rhdr{Complexity} \\ & & \chdr{pre-/post-condition} & \\ \capsep @@ -2250,7 +2248,7 @@ The unordered associative containers meet all the requirements of Allocator-aware containers\iref{container.requirements.general}, except that for \tcode{unordered_map} and \tcode{unordered_multimap}, the requirements placed on \tcode{value_type} -in \tref{containers.allocatoraware} apply instead to \tcode{key_type} +in \tref{container.alloc.req} apply instead to \tcode{key_type} and \tcode{mapped_type}. \begin{note} For example, \tcode{key_type} and \tcode{mapped_type} are sometimes required to be \oldconcept{CopyAssignable} even though the associated \tcode{value_type}, \tcode{pair}, is not @@ -2263,12 +2261,12 @@ \indextext{unordered associative containers!unique keys}% \indextext{unordered associative containers!equivalent keys}% \indextext{requirements!container}% -In \tref{HashRequirements}: +In \tref{container.hash.req}: \begin{itemize} \item \tcode{X} denotes an unordered associative container class, \item \tcode{a} denotes a value of type \tcode{X}, \item \tcode{a2} denotes a value of a type with nodes compatible - with type \tcode{X} (\tref{containers.node.compat}), + with type \tcode{X} (\tref{container.node.compat}), \item \tcode{b} denotes a possibly const value of type \tcode{X}, \item \tcode{a_uniq} denotes a value of type \tcode{X} when \tcode{X} supports unique keys, @@ -2314,7 +2312,7 @@ \begin{libreqtab4d} {Unordered associative container requirements (in addition to container)} - {tab:HashRequirements} + {container.hash.req} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Assertion/note} & \rhdr{Complexity} \\ & & \chdr{pre-/post-condition} & \\ \capsep @@ -2508,7 +2506,7 @@ \tcode{X(b)}\br \tcode{X a(b);} & \tcode{X} & Copy constructor. In addition to the requirements - of \tref{containers.container.requirements}, copies the + of \tref{container.req}, copies the hash function, predicate, and maximum load factor. & Average case linear in \tcode{b.size()}, worst case quadratic. \\ \rowsep @@ -2516,7 +2514,7 @@ \tcode{a = b} & \tcode{X\&} & Copy assignment operator. In addition to the - requirements of \tref{containers.container.requirements}, copies + requirements of \tref{container.req}, copies the hash function, predicate, and maximum load factor. & Average case linear in \tcode{b.size()}, worst case quadratic. \\ \rowsep @@ -2622,8 +2620,8 @@ & \expects \tcode{value_type} is \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i}. Neither \tcode{i} nor \tcode{j} are iterators into \tcode{a}.\br \effects Equivalent to \tcode{a.insert(t)} for each element in \tcode{[i,j)}.% -& Average case \bigoh{N}, where $N$ is \tcode{distance(i, j)}. - Worst case \bigoh{N(\tcode{a.size()}\brk{}+\brk{}1)}. +& Average case \bigoh{N}, where $N$ is \tcode{distance(i, j)}, + worst case \bigoh{N(\tcode{a.size()}\brk{}+\brk{}1)}. \\ \rowsep % \tcode{a.insert(il)} @@ -2703,15 +2701,15 @@ to the transferred elements and all iterators referring to \tcode{a} will be invalidated, but iterators to elements remaining in \tcode{a2} will remain valid. & - Average case \bigoh{N}, where $N$ is \tcode{a2.size()}. - Worst case \bigoh{N\tcode{*a.size()}\br\tcode{+} N}. \\ \rowsep + Average case \bigoh{N}, where $N$ is \tcode{a2.size()}, + worst case \bigoh{N\tcode{*a.size()}\br\tcode{+} N}. \\ \rowsep % \indexunordmem{erase}% \tcode{a.erase(k)} & \tcode{size_type} & \effects Erases all elements with key equivalent to \tcode{k}.\br \returns The number of elements erased. -& Average case \bigoh{\tcode{a.count(k)}}. Worst case +& Average case \bigoh{\tcode{a.count(k)}}, worst case \bigoh{\tcode{a.size()}}. \\ \rowsep % @@ -2846,7 +2844,7 @@ & \returns A range containing all elements with keys equivalent to \tcode{k}. Returns \tcode{make_pair(b.end(), b.end())} if no such elements exist.% -& Average case \bigoh{\tcode{b.count(k)}}. Worst case +& Average case \bigoh{\tcode{b.count(k)}}, worst case \bigoh{\tcode{b.size()}}. \\ \rowsep % @@ -2857,7 +2855,7 @@ \returns A range containing all elements with keys equivalent to \tcode{k}. Returns \tcode{make_pair(b.end(), b.end())} if no such elements exist.% -& Average case \bigoh{\tcode{b.count(k)}}. Worst case +& Average case \bigoh{\tcode{b.count(k)}}, worst case \bigoh{\tcode{b.size()}}. \\ \rowsep % @@ -2868,8 +2866,8 @@ \tcode{ke}. Returns \tcode{make_pair(a_tran.end(), a_tran.end())} if no such elements exist.% & Average case - \bigoh{\tcode{a_tran.}\br{}\tcode{count(ke)}}. % avoid overfull - Worst case \bigoh{\tcode{a_tran.}\br{}\tcode{size()}}. % avoid overfull + \bigoh{\tcode{a_tran.}\br{}\tcode{count(ke)}}, % avoid overfull + worst case \bigoh{\tcode{a_tran.}\br{}\tcode{size()}}. % avoid overfull \\ \rowsep % \tcode{a_tran.equal_range(ke, hke)} @@ -2880,8 +2878,8 @@ \tcode{ke}. Returns \tcode{make_pair(a_tran.end(), a_tran.end())} if no such elements exist.% & Average case - \bigoh{\tcode{a_tran.}\br{}\tcode{count(ke)}}. % avoid overfull - Worst case \bigoh{\tcode{a_tran.}\br{}\tcode{size()}}. % avoid overfull + \bigoh{\tcode{a_tran.}\br{}\tcode{count(ke)}}, % avoid overfull + worst case \bigoh{\tcode{a_tran.}\br{}\tcode{size()}}. % avoid overfull \\ \rowsep \indexunordmem{bucket_count}% \tcode{b.bucket_count()} @@ -3373,10 +3371,10 @@ \pnum \indextext{requirements!container}% -An \tcode{array} satisfies all of the requirements of a container and +An \tcode{array} meets all of the requirements of a container and of a reversible container\iref{container.requirements}, except that a default constructed \tcode{array} object is not empty and that \tcode{swap} does not have constant -complexity. An \tcode{array} satisfies some of the requirements of a sequence +complexity. An \tcode{array} meets some of the requirements of a sequence container\iref{sequence.reqmts}. Descriptions are provided here only for operations on \tcode{array} that are not described in @@ -3384,7 +3382,7 @@ for operations where there is additional semantic information. \pnum -The types \tcode{iterator} and \tcode{const_iterator} satisfy +The types \tcode{iterator} and \tcode{const_iterator} meet the constexpr iterator requirements\iref{iterator.requirements.general}. \indexlibrary{\idxcode{array}}% @@ -3574,16 +3572,16 @@ \indexlibrary{\idxcode{tuple_element}}% \begin{itemdecl} -tuple_element>::type +template + struct tuple_element> { + using type = T; + }; \end{itemdecl} \begin{itemdescr} \pnum \mandates \tcode{I < N} is \tcode{true}. - -\pnum -\cvalue The type \tcode{T}. \end{itemdescr} \indexlibrarymember{array}{get}% @@ -3625,9 +3623,9 @@ \pnum A \tcode{deque} -satisfies all of the requirements of a container, of a reversible container +meets all of the requirements of a container, of a reversible container (given in tables in~\ref{container.requirements}), of a sequence container, -including the optional sequence container requirements\iref{sequence.reqmts}, and of an allocator-aware container (\tref{containers.allocatoraware}). +including the optional sequence container requirements\iref{sequence.reqmts}, and of an allocator-aware container (\tref{container.alloc.req}). Descriptions are provided here only for operations on \tcode{deque} that are not described in one of these tables @@ -4018,14 +4016,14 @@ that goal have been omitted.\end{note} \pnum -A \tcode{forward_list} satisfies all of the requirements of a container -(\tref{containers.container.requirements}), except that the \tcode{size()} +A \tcode{forward_list} meets all of the requirements of a container +(\tref{container.req}), except that the \tcode{size()} member function is not provided and \tcode{operator==} has linear complexity. -A \tcode{forward_list} also satisfies all of the requirements for an allocator-aware -container (\tref{containers.allocatoraware}). In addition, a \tcode{forward_list} +A \tcode{forward_list} also meets all of the requirements for an allocator-aware +container (\tref{container.alloc.req}). In addition, a \tcode{forward_list} provides the \tcode{assign} member functions -(\tref{containers.sequence.requirements}) and several of the optional -container requirements (\tref{containers.sequence.optional}). +(\tref{container.seq.req}) and several of the optional +container requirements (\tref{container.seq.opt}). Descriptions are provided here only for operations on \tcode{forward_list} that are not described in that table or for operations where there is additional semantic information. @@ -4160,7 +4158,7 @@ \pnum An incomplete type \tcode{T} may be used when instantiating \tcode{forward_list} -if the allocator satisfies the +if the allocator meets the allocator completeness requirements\iref{allocator.requirements.completeness}. \tcode{T} shall be complete before any member of the resulting specialization of \tcode{forward_list} is referenced. @@ -4485,7 +4483,7 @@ In this subclause, arguments for a template parameter named \tcode{Predicate} or \tcode{BinaryPredicate} -shall satisfy the corresponding requirements in \ref{algorithms.requirements}. +shall meet the corresponding requirements in \ref{algorithms.requirements}. For \tcode{merge} and \tcode{sort}, the definitions and requirements in \ref{alg.sorting} apply. @@ -4700,7 +4698,7 @@ \begin{itemdescr} \pnum \effects -Equivalent to: \tcode{erase_if(c, [\&](auto\& elem) { return elem == value; });} +Equivalent to: \tcode{erase_if(c, [\&](auto\& elem) \{ return elem == value; \});} \end{itemdescr} \indexlibrary{\idxcode{erase_if}!\idxcode{forward_list}}% @@ -4731,12 +4729,12 @@ algorithms only need sequential access anyway. \pnum -A \tcode{list} satisfies all of the requirements of a container, of +A \tcode{list} meets all of the requirements of a container, of a reversible container (given in two tables in \ref{container.requirements}), of a sequence container, including most of the optional sequence container requirements\iref{sequence.reqmts}, and of an allocator-aware container -(\tref{containers.allocatoraware}). +(\tref{container.alloc.req}). The exceptions are the \tcode{operator[]} and @@ -4882,7 +4880,7 @@ \pnum An incomplete type \tcode{T} may be used when instantiating \tcode{list} -if the allocator satisfies the +if the allocator meets the allocator completeness requirements\iref{allocator.requirements.completeness}. \tcode{T} shall be complete before any member of the resulting specialization of \tcode{list} is referenced. @@ -5093,7 +5091,7 @@ In this subclause, arguments for a template parameter named \tcode{Predicate} or \tcode{BinaryPredicate} -shall satisfy the corresponding requirements in \ref{algorithms.requirements}. +shall meet the corresponding requirements in \ref{algorithms.requirements}. For \tcode{merge} and \tcode{sort}, the definitions and requirements in \ref{alg.sorting} apply. @@ -5392,7 +5390,7 @@ \begin{itemdescr} \pnum \effects -Equivalent to: \tcode{erase_if(c, [\&](auto\& elem) { return elem == value; });} +Equivalent to: \tcode{erase_if(c, [\&](auto\& elem) \{ return elem == value; \});} \end{itemdescr} \indexlibrary{\idxcode{erase_if}!\idxcode{list}}% @@ -5422,11 +5420,11 @@ to improve efficiency. \pnum -A \tcode{vector} satisfies all of the requirements of a container and of a +A \tcode{vector} meets all of the requirements of a container and of a reversible container (given in two tables in~\ref{container.requirements}), of a sequence container, including most of the optional sequence container requirements\iref{sequence.reqmts}, of an allocator-aware container -(\tref{containers.allocatoraware}), +(\tref{container.alloc.req}), and, for an element type other than \tcode{bool}, of a contiguous container\iref{container.requirements.general}. The exceptions are the @@ -5553,7 +5551,7 @@ \pnum An incomplete type \tcode{T} may be used when instantiating \tcode{vector} -if the allocator satisfies the +if the allocator meets the allocator completeness requirements\iref{allocator.requirements.completeness}. \tcode{T} shall be complete before any member of the resulting specialization of \tcode{vector} is referenced. @@ -6301,8 +6299,8 @@ \pnum A \tcode{map} -satisfies all of the requirements of a container, of a reversible container\iref{container.requirements}, of -an associative container\iref{associative.reqmts}, and of an allocator-aware container (\tref{containers.allocatoraware}). +meets all of the requirements of a container, of a reversible container\iref{container.requirements}, of +an associative container\iref{associative.reqmts}, and of an allocator-aware container (\tref{container.alloc.req}). A \tcode{map} also provides most operations described in~\ref{associative.reqmts} @@ -6330,6 +6328,8 @@ that are not described in one of those tables or for operations where there is additional semantic information. +\indexlibrarymember{comp}{map::value_compare}% +\indexlibrarymember{operator()}{map::value_compare}% \begin{codeblock} namespace std { template, @@ -6845,10 +6845,10 @@ \pnum A -\tcode{multimap} satisfies all of the requirements of a container and of a +\tcode{multimap} meets all of the requirements of a container and of a reversible container\iref{container.requirements}, of an associative container\iref{associative.reqmts}, and of an allocator-aware container -(\tref{containers.allocatoraware}). +(\tref{container.alloc.req}). A \tcode{multimap} also provides most operations described in~\ref{associative.reqmts} @@ -6876,6 +6876,8 @@ that are not described in one of those tables or for operations where there is additional semantic information. +\indexlibrarymember{comp}{multimap::value_compare}% +\indexlibrarymember{operator()}{multimap::value_compare}% \begin{codeblock} namespace std { template, @@ -7164,10 +7166,10 @@ supports bidirectional iterators. \pnum -A \tcode{set} satisfies all of the requirements of a container, of a reversible +A \tcode{set} meets all of the requirements of a container, of a reversible container\iref{container.requirements}, of an associative container\iref{associative.reqmts}, and of an allocator-aware container -(\tref{containers.allocatoraware}). +(\tref{container.alloc.req}). A \tcode{set} also provides most operations described in~\ref{associative.reqmts} @@ -7443,10 +7445,10 @@ supports bidirectional iterators. \pnum -A \tcode{multiset} satisfies all of the requirements of a container, of a +A \tcode{multiset} meets all of the requirements of a container, of a reversible container\iref{container.requirements}, of an associative container\iref{associative.reqmts}, and of an allocator-aware container -(\tref{containers.allocatoraware}). +(\tref{container.alloc.req}). \tcode{multiset} also provides most operations described in~\ref{associative.reqmts} for duplicate keys. @@ -7878,7 +7880,7 @@ supports forward iterators. \pnum -An \tcode{unordered_map} satisfies all of the requirements of a container, of an unordered associative container, and of an allocator-aware container (\tref{containers.allocatoraware}). It provides the operations described in the preceding requirements table for unique keys; that is, an \tcode{unordered_map} supports the \tcode{a_uniq} operations in that table, not the \tcode{a_eq} operations. For an \tcode{unordered_map} the \tcode{key type} is \tcode{Key}, the mapped type is \tcode{T}, and the value type is \tcode{pair}. +An \tcode{unordered_map} meets all of the requirements of a container, of an unordered associative container, and of an allocator-aware container (\tref{container.alloc.req}). It provides the operations described in the preceding requirements table for unique keys; that is, an \tcode{unordered_map} supports the \tcode{a_uniq} operations in that table, not the \tcode{a_eq} operations. For an \tcode{unordered_map} the \tcode{key type} is \tcode{Key}, the mapped type is \tcode{T}, and the value type is \tcode{pair}. \pnum This subclause only describes operations on \tcode{unordered_map} that @@ -8478,9 +8480,9 @@ supports forward iterators. \pnum -An \tcode{unordered_multimap} satisfies all of the requirements of a container, of an +An \tcode{unordered_multimap} meets all of the requirements of a container, of an unordered associative container, and of an allocator-aware container -(\tref{containers.allocatoraware}). It provides the operations described in the +(\tref{container.alloc.req}). It provides the operations described in the preceding requirements table for equivalent keys; that is, an \tcode{unordered_multimap} supports the \tcode{a_eq} operations in that table, not the \tcode{a_uniq} operations. For an \tcode{unordered_multimap} the \tcode{key type} is \tcode{Key}, the @@ -8867,7 +8869,7 @@ supports forward iterators. \pnum -An \tcode{unordered_set} satisfies all of the requirements of a container, of an unordered associative container, and of an allocator-aware container (\tref{containers.allocatoraware}). It provides the operations described in the preceding requirements table for unique keys; that is, an \tcode{unordered_set} supports the \tcode{a_uniq} operations in that table, not the \tcode{a_eq} operations. For an \tcode{unordered_set} the \tcode{key type} and the value type are both \tcode{Key}. The \tcode{iterator} and \tcode{const_iterator} types are both constant iterator types. It is unspecified whether they are the same type. +An \tcode{unordered_set} meets all of the requirements of a container, of an unordered associative container, and of an allocator-aware container (\tref{container.alloc.req}). It provides the operations described in the preceding requirements table for unique keys; that is, an \tcode{unordered_set} supports the \tcode{a_uniq} operations in that table, not the \tcode{a_eq} operations. For an \tcode{unordered_set} the \tcode{key type} and the value type are both \tcode{Key}. The \tcode{iterator} and \tcode{const_iterator} types are both constant iterator types. It is unspecified whether they are the same type. \pnum This subclause only describes operations on \tcode{unordered_set} that @@ -9203,9 +9205,9 @@ supports forward iterators. \pnum -An \tcode{unordered_multiset} satisfies all of the requirements of a container, of an +An \tcode{unordered_multiset} meets all of the requirements of a container, of an unordered associative container, and of an allocator-aware container -(\tref{containers.allocatoraware}). It provides the operations described in the +(\tref{container.alloc.req}). It provides the operations described in the preceding requirements table for equivalent keys; that is, an \tcode{unordered_multiset} supports the \tcode{a_eq} operations in that table, not the \tcode{a_uniq} operations. For an \tcode{unordered_multiset} the \tcode{key type} and the value type are @@ -10468,17 +10470,6 @@ A \tcode{span} is a view over a contiguous sequence of objects, the storage of which is owned by some other object. -\pnum -The iterator types \tcode{span::iterator} and \tcode{span::const_iterator} -model \libconcept{ContiguousIterator}\iref{iterator.concept.contiguous}, -meet the \oldconcept{RandomAccessIterator} -requirements\iref{random.access.iterators}, -and -meet the requirements for -constexpr iterators\iref{iterator.requirements.general}. -All requirements on container iterators\iref{container.requirements} apply to -\tcode{span::iterator} and \tcode{span::const_iterator} as well. - \pnum All member functions of \tcode{span} have constant time complexity. @@ -10497,7 +10488,7 @@ using const_pointer = const element_type*; using reference = element_type&; using const_reference = const element_type&; - using iterator = @\impdefx{type of \tcode{span::iterator}}@; + using iterator = @\impdefx{type of \tcode{span::iterator}}@; // see \ref{span.iterators} using const_iterator = @\impdefx{type of \tcode{span::const_iterator}}@; using reverse_iterator = std::reverse_iterator; using const_reverse_iterator = std::reverse_iterator; @@ -10966,6 +10957,26 @@ \rSec3[span.iterators]{Iterator support} +\indexlibrarymember{iterator}{span}% +\indexlibrarymember{const_iterator}{span}% +\begin{itemdecl} +using iterator = @\impdefx{type of \tcode{span::iterator}}@; +using const_iterator = @\impdefx{type of \tcode{span::const_iterator}}@; +\end{itemdecl} + +\begin{itemdescr} +\pnum +The types +model \libconcept{ContiguousIterator}\iref{iterator.concept.contiguous}, +meet the \oldconcept{RandomAccessIterator} +requirements\iref{random.access.iterators}, +and +meet the requirements for +constexpr iterators\iref{iterator.requirements.general}. +All requirements on container iterators\iref{container.requirements} apply to +\tcode{span::iterator} and \tcode{span::const_iterator} as well. +\end{itemdescr} + \indexlibrarymember{span}{begin}% \begin{itemdecl} constexpr iterator begin() const noexcept; @@ -11102,17 +11113,16 @@ \indexlibrary{\idxcode{tuple_element}}% \begin{itemdecl} -tuple_element>::type +template + struct tuple_element> { + using type = ElementType; + }; \end{itemdecl} \begin{itemdescr} \pnum \mandates \tcode{Extent != dynamic_extent \&\& I < Extent} is \tcode{true}. - -\pnum -\cvalue -The type \tcode{ElementType}. \end{itemdescr} \indexlibrary{\idxcode{get}}% diff --git a/source/declarations.tex b/source/declarations.tex index dc6707cef2..8e45d5243f 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -227,8 +227,7 @@ a definition unless it contains the \tcode{extern} specifier and has no initializer\iref{basic.def}. \indextext{initialization!definition and}% -A -definition causes the appropriate amount of storage to be reserved and +An object definition causes storage of appropriate size and alignment to be reserved and any appropriate initialization\iref{dcl.init} to be done. \pnum @@ -356,11 +355,11 @@ \tcode{static}\iref{class.union.anon}). The \grammarterm{storage-class-specifier} applies to the name declared by each \grammarterm{init-declarator} in the list and not to any names declared by -other specifiers. A \grammarterm{storage-class-specifier} -other than \tcode{thread_local} -shall not be -specified in an explicit specialization\iref{temp.expl.spec} or an -explicit instantiation\iref{temp.explicit} directive. +other specifiers. +\begin{note} +See \ref{temp.expl.spec} and \ref{temp.explicit} for restrictions +in explicit specializations and explicit instantiations, respectively. +\end{note} \pnum \begin{note} @@ -491,10 +490,12 @@ \end{example} \pnum +\begin{note} The \tcode{mutable} specifier on a class data member nullifies a \tcode{const} specifier applied to the containing class object and permits modification of the mutable class member even though the rest of -the object is const\iref{dcl.type.cv}. +the object is const~(\ref{basic.type.qualifier}, \ref{dcl.type.cv}). +\end{note} \rSec2[dcl.fct.spec]{Function specifiers}% \indextext{specifier!function}% @@ -1214,8 +1215,7 @@ \pnum \indextext{const object!undefined change to}% -Except that any class member declared \tcode{mutable}\iref{dcl.stc} -can be modified, any attempt to modify~(\ref{expr.ass}, +Any attempt to modify~(\ref{expr.ass}, \ref{expr.post.incr}, \ref{expr.pre.incr}) a const object\iref{basic.type.qualifier} during its lifetime\iref{basic.life} results in undefined behavior. @@ -1349,14 +1349,14 @@ specify either a previously-declared type, a type determined from an expression, or one of the fundamental types\iref{basic.fundamental}. -\tref{simple.type.specifiers} +\tref{dcl.type.simple} summarizes the valid combinations of \grammarterm{simple-type-specifier}{s} and the types they specify. \begin{simpletypetable} {\grammarterm{simple-type-specifier}{s} and the types they specify} -{tab:simple.type.specifiers} +{dcl.type.simple} {ll} \topline \hdstyle{Specifier(s)} & \hdstyle{Type} \\ \capsep @@ -1495,6 +1495,8 @@ \begin{codeblock} enum class E { a, b }; enum E x = E::a; // OK +struct S { } s; +class S* p = &s; // OK \end{codeblock} \end{example} @@ -2944,6 +2946,7 @@ or ``\cv{}~\tcode{void}''. +\pnum \begin{note} See also~\ref{expr.unary} and~\ref{expr.mptr.oper}. The type ``pointer to member'' is distinct from the type ``pointer'', @@ -2956,89 +2959,76 @@ \indextext{declarator!array} \pnum -In a declaration -\tcode{T} -\tcode{D} -where -\tcode{D} -has the form +In a declaration \tcode{T} \tcode{D} where \tcode{D} has the form \begin{ncsimplebnf} -\terminal{D1 [} \opt{constant-expression} \terminal{]} \opt{attribute-specifier-seq} +\terminal{D1} \terminal{[} \opt{constant-expression} \terminal{]} \opt{attribute-specifier-seq} \end{ncsimplebnf} -and the type of the identifier in the declaration -\tcode{T} -\tcode{D1} -is -``\placeholder{derived-declarator-type-list} -\tcode{T}'', -then the type of the identifier of -\tcode{D} -is an array type; if the type of the identifier of \tcode{D} -contains the \tcode{auto} \grammarterm{type-specifier}, -the program is ill-formed. -\tcode{T} -is called the array -\term{element type}; -this type shall not be a reference type, \cv{}~\tcode{void}, -or a function type. -\indextext{declaration!array}% -If the -\grammarterm{constant-expression}\iref{expr.const} -is present, it shall be a converted constant -expression of type \tcode{std::size_t} and -its value shall be greater than zero. -The constant expression specifies the -\indextext{array!bound}% +and the type of the contained \grammarterm{declarator-id} +in the declaration \tcode{T} \tcode{D1} +is ``\placeholder{derived-declarator-type-list} \tcode{T}'', +the type of the \grammarterm{declarator-id} in \tcode{D} is +``\placeholder{derived-declarator-type-list} array of \tcode{N} \tcode{T}''. +The \grammarterm{constant-expression} +shall be a converted constant expression of type \tcode{std::size_t}\iref{expr.const}. \indextext{bound, of array}% -\term{bound} -of (number of elements in) the array. -If the value of the constant expression is -\tcode{N}, -the array has -\tcode{N} -elements numbered -\tcode{0} -to -\tcode{N-1}, -and the type of the identifier of -\tcode{D} -is ``\placeholder{derived-declarator-type-list} array of -\tcode{N} -\tcode{T}''. -An object of array type contains a contiguously allocated non-empty set of -\tcode{N} -subobjects of type -\tcode{T}. -Except as noted below, if -the constant expression is omitted, the type of the identifier of -\tcode{D} -is ``\placeholder{derived-declarator-type-list} array of unknown bound of -\tcode{T}'', -an incomplete object type. -The type ``\placeholder{derived-declarator-type-list} array of -\tcode{N} -\tcode{T}'' -is a different type from the type -``\placeholder{derived-declarator-type-list} array of unknown bound of -\tcode{T}'', -see~\ref{basic.types}. +Its value \tcode{N} specifies the \defnx{array bound}{array!bound}, +i.e., the number of elements in the array; +\tcode{N} shall be greater than zero. + +\pnum +In a declaration \tcode{T} \tcode{D} where \tcode{D} has the form + +\begin{ncsimplebnf} +\terminal{D1 [ ]} \opt{attribute-specifier-seq} +\end{ncsimplebnf} + +and the type of the contained \grammarterm{declarator-id} +in the declaration \tcode{T} \tcode{D1} +is ``\placeholder{derived-declarator-type-list} \tcode{T}'', +the type of the \grammarterm{declarator-id} in \tcode{D} is +``\placeholder{derived-declarator-type-list} array of unknown bound of \tcode{T}'', except as specified below. + +\pnum +\indextext{declaration!array}% +A type of the form ``array of \tcode{N} \tcode{U}'' or +``array of unknown bound of \tcode{U}'' is an \defn{array type}. +The optional \grammarterm{attribute-specifier-seq} +appertains to the array type. + +\pnum +\tcode{U} is called the array \defn{element type}; +this type shall not be +a placeholder type\iref{dcl.spec.auto}, +a reference type, +a function type, +an array of unknown bound, or +\cv{}~\tcode{void}. +\begin{note} +An array can be constructed +from one of the fundamental types (except \tcode{void}), +from a pointer, +from a pointer to member, +from a class, +from an enumeration type, +or from an array of known bound. +\end{note} +\begin{example} +\begin{codeblock} +float fa[17], *afp[17]; +\end{codeblock} +declares an array of \tcode{float} numbers and +an array of pointers to \tcode{float} numbers. +\end{example} + +\pnum Any type of the form -``\grammarterm{cv-qualifier-seq} array of -\tcode{N} -\tcode{T}'' +``\grammarterm{cv-qualifier-seq} array of \tcode{N} \tcode{U}'' is adjusted to -``array of -\tcode{N} -\grammarterm{cv-qualifier-seq} -\tcode{T}'', -and similarly for -``array of unknown bound of -\tcode{T}''. -The optional \grammarterm{attribute-specifier-seq} appertains to the array. +``array of \tcode{N} \grammarterm{cv-qualifier-seq} \tcode{U}'', +and similarly for ``array of unknown bound of \tcode{U}''. \begin{example} - \begin{codeblock} typedef int A[5], AA[2][3]; typedef const A CA; // type is ``array of 5 \tcode{const int}'' @@ -3046,69 +3036,60 @@ \end{codeblock} \end{example} \begin{note} -An -``array of -\tcode{N} -\grammarterm{cv-qualifier-seq} -\tcode{T}'' +An ``array of \tcode{N} \grammarterm{cv-qualifier-seq} \tcode{U}'' has cv-qualified type; see~\ref{basic.type.qualifier}. \end{note} \pnum -An array can be constructed from one of the fundamental types -(except -\tcode{void}), -from a pointer, -from a pointer to member, from a class, -from an enumeration type, -or from another array. +An object of type ``array of \tcode{N} \tcode{U}'' contains +a contiguously allocated non-empty set +of \tcode{N} subobjects of type \tcode{U}, +known as the \defnx{elements}{array!element} of the array, +and numbered \tcode{0} to \tcode{N-1}. \pnum -\indextext{declarator!multidimensional array}% -When several ``array of'' specifications are adjacent, a -multidimensional array -type is created; -only the first of -the constant expressions that specify the bounds -of the arrays may be omitted. In addition to declarations in which an incomplete object type is allowed, an array bound may be omitted in some cases in the declaration of a function parameter\iref{dcl.fct}. An array bound may also be omitted -when the declarator is followed by an -\grammarterm{initializer}\iref{dcl.init}, -when a declarator for a static data member is followed by a -\grammarterm{brace-or-equal-initializer}\iref{class.mem}, -or in an explicit type conversion\iref{expr.type.conv}. -In these cases, the bound is calculated from the number +when an object (but not a non-static data member) of array type is initialized +and the declarator is followed by an initializer +(\ref{dcl.init}, \ref{class.mem}, \ref{expr.type.conv}, \ref{expr.new}). \indextext{array size!default}% -of initial elements (say, -\tcode{N}) +In these cases, the array bound is calculated +from the number of initial elements (say, \tcode{N}) supplied\iref{dcl.init.aggr}, -and the type of the identifier of -\tcode{D} -is ``array of -\tcode{N} -\tcode{T}''. +and the type of the array is ``array of \tcode{N} \tcode{U}''. + +\pnum Furthermore, if there is a preceding declaration of the entity in the same scope in which the bound was specified, an omitted array bound is taken to be the same as in that earlier declaration, and similarly for the definition of a static data member of a class. - -\pnum \begin{example} \begin{codeblock} -float fa[17], *afp[17]; +extern int x[10]; +struct S { + static int y[10]; +}; + +int x[]; // OK: bound is 10 +int S::y[]; // OK: bound is 10 + +void f() { + extern int x[]; + int i = sizeof(x); // error: incomplete object type +} \end{codeblock} -declares an array of -\tcode{float} -numbers and an array of -pointers to -\tcode{float} -numbers. \end{example} \pnum +\indextext{declarator!multidimensional array}% +\begin{note} +When several ``array of'' specifications are adjacent, +a multidimensional array type is created; +only the first of the constant expressions +that specify the bounds of the arrays may be omitted. \begin{example} \begin{codeblock} int x3d[3][5][7]; @@ -3163,30 +3144,11 @@ \tcode{x3d} (an integer). \end{example} -\begin{note} The first subscript in the declaration helps determine the amount of storage consumed by an array but plays no other part in subscript calculations. \end{note} -\pnum -\begin{example} -\begin{codeblock} -extern int x[10]; -struct S { - static int y[10]; -}; - -int x[]; // OK: bound is 10 -int S::y[]; // OK: bound is 10 - -void f() { - extern int x[]; - int i = sizeof(x); // error: incomplete object type -} -\end{codeblock} -\end{example} - \pnum \begin{note} Conversions affecting expressions of array type are described in~\ref{conv.array}. @@ -3210,7 +3172,7 @@ \tcode{D} has the form \begin{ncsimplebnf} -\terminal{D1 (} parameter-declaration-clause \terminal{)} \opt{cv-qualifier-seq}\br +\terminal{D1} \terminal{(} parameter-declaration-clause \terminal{)} \opt{cv-qualifier-seq}\br \bnfindent\opt{ref-qualifier} \opt{noexcept-specifier} \opt{attribute-specifier-seq} \end{ncsimplebnf} and the type of the contained @@ -3247,7 +3209,7 @@ has the form \begin{ncsimplebnf} -\terminal{D1 (} parameter-declaration-clause \terminal{)} \opt{cv-qualifier-seq}\br +\terminal{D1} \terminal{(} parameter-declaration-clause \terminal{)} \opt{cv-qualifier-seq}\br \bnfindent\opt{ref-qualifier} \opt{noexcept-specifier} \opt{attribute-specifier-seq} trailing-return-type \end{ncsimplebnf} @@ -3285,7 +3247,7 @@ \begin{bnf} \nontermdef{parameter-declaration-clause}\br \opt{parameter-declaration-list} \opt{\terminal{...}}\br - parameter-declaration-list \terminal{, ...} + parameter-declaration-list \terminal{,} \terminal{...} \end{bnf} \begin{bnf} @@ -4620,7 +4582,7 @@ \item no user-declared or inherited constructors\iref{class.ctor}, \item -no private or protected non-static data members\iref{class.access}, +no private or protected direct non-static data members\iref{class.access}, \item no virtual functions\iref{class.virtual}, and \item @@ -6095,7 +6057,7 @@ Explicitly-defaulted functions and implicitly-declared functions are collectively called \defn{defaulted} functions, and the implementation shall provide implicit definitions -for them~(\ref{class.ctor} +for them~(\ref{class.ctor}, \ref{class.dtor}, \ref{class.copy.ctor}, \ref{class.copy.assign}), which might mean defining them as deleted. A function is @@ -6250,7 +6212,7 @@ \end{example} \pnum -\indextext{promise type|see{coroutine!promise type}}% +\indextext{promise type|see{coroutine, promise type}}% The \defnx{promise type}{coroutine!promise type} of a coroutine is \tcode{std::coroutine_traits::promise_type}, where @@ -6277,7 +6239,7 @@ % FIXME: \bnfindent \exposid{promise}\terminal{.get_return_object()} \terminal{;} % ... except that it's not a discarded-value expression \bnfindent \terminal{co_await} \terminal{\exposid{promise}.initial_suspend()} \terminal{;}\br -\bnfindent \terminal{try \{}\br +\bnfindent \terminal{try} \terminal{\{}\br \bnfindent\bnfindent function-body\br \bnfindent \terminal{\} catch ( ... ) \{}\br \bnfindent\bnfindent \terminal{\exposid{promise}.unhandled_exception()} \terminal{;}\br @@ -6626,7 +6588,7 @@ \begin{bnf} \nontermdef{enum-specifier}\br enum-head \terminal{\{} \opt{enumerator-list} \terminal{\}}\br - enum-head \terminal{\{} enumerator-list \terminal{, \}} + enum-head \terminal{\{} enumerator-list \terminal{,} \terminal{\}} \end{bnf} \begin{bnf} @@ -7006,8 +6968,7 @@ \end{bnf} \pnum -Every \grammarterm{namespace-definition} shall appear in the global scope -or in a namespace scope\iref{basic.scope.namespace}. +Every \grammarterm{namespace-definition} shall appear at namespace scope\iref{basic.scope.namespace}. \pnum In a \grammarterm{named-namespace-definition}, @@ -7141,7 +7102,7 @@ replaced by \begin{ncsimplebnf} -\opt{\keyword{inline}} \keyword{namespace} \exposid{unique} \terminal{\{ /* empty body */ \}}\br +\opt{\keyword{inline}} \keyword{namespace} \exposid{unique} \terminal{\{} \terminal{/* empty body */} \terminal{\}}\br \keyword{using} \keyword{namespace} \exposid{unique} \terminal{;}\br \keyword{namespace} \exposid{unique} \terminal{\{} namespace-body \terminal{\}} \end{ncsimplebnf} @@ -8055,7 +8016,7 @@ \begin{bnf} \nontermdef{asm-definition}\br - \opt{attribute-specifier-seq} \keyword{asm} \terminal{(} string-literal \terminal{) ;} + \opt{attribute-specifier-seq} \keyword{asm} \terminal{(} string-literal \terminal{)} \terminal{;} \end{bnf} The \tcode{asm} declaration is conditionally-supported; its meaning is @@ -8438,8 +8399,11 @@ is not allowed to apply to that entity or statement, the program is ill-formed. If an \grammarterm{attribute-specifier-seq} appertains to a friend declaration\iref{class.friend}, that declaration shall be a -definition. No \grammarterm{attribute-specifier-seq} shall appertain to an explicit -instantiation\iref{temp.explicit}. +definition. +\begin{note} +An \grammarterm{attribute-specifier-seq} cannot appeartain to +an explicit instantiation\iref{temp.explicit}. +\end{note} \pnum For an \grammarterm{attribute-token} diff --git a/source/diagnostics.tex b/source/diagnostics.tex index 1cc9dd3e3f..63dfcbd9d2 100644 --- a/source/diagnostics.tex +++ b/source/diagnostics.tex @@ -12,9 +12,9 @@ reporting several kinds of exceptional conditions, documenting program assertions, and a global variable for error number codes, -as summarized in \tref{diagnostics.lib.summary}. +as summarized in \tref{diagnostics.summary}. -\begin{libsumtab}{Diagnostics library summary}{tab:diagnostics.lib.summary} +\begin{libsumtab}{Diagnostics library summary}{diagnostics.summary} \ref{std.exceptions} & Exception classes & \tcode{} \\ \rowsep \ref{assertions} & Assertions & \tcode{} \\ \rowsep \ref{errno} & Error numbers & \tcode{} \\ \rowsep diff --git a/source/exceptions.tex b/source/exceptions.tex index 6a53134326..f51a90e76a 100644 --- a/source/exceptions.tex +++ b/source/exceptions.tex @@ -38,7 +38,7 @@ % \begin{bnf} \nontermdef{handler}\br - \terminal{catch (} exception-declaration \terminal{)} compound-statement + \terminal{catch} \terminal{(} exception-declaration \terminal{)} compound-statement \end{bnf} \begin{bnf} @@ -1068,7 +1068,7 @@ of the parallel algorithm exits via an exception\iref{algorithms.parallel.exceptions}, or \item% -when the destructor or the copy assignment operator is invoked on an object +when the destructor or the move assignment operator is invoked on an object of type \tcode{std::thread} that refers to a joinable thread (\ref{thread.thread.destr}, \ref{thread.thread.assign}), or @@ -1115,7 +1115,10 @@ An exception is considered uncaught after completing the initialization of the exception object\iref{except.throw} until completing the activation of a handler for the exception\iref{except.handle}. -This includes stack unwinding. +\begin{note} +As a consequence, an exception is considered uncaught +during any stack unwinding resulting from it being thrown. +\end{note} If an exception is rethrown~(\ref{expr.throw}, \ref{propagation}), it is considered uncaught from the point of rethrow until the rethrown exception is caught. diff --git a/source/expressions.tex b/source/expressions.tex index 6db8a8a545..d21a71f3b5 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -128,11 +128,11 @@ \rSec2[basic.lval]{Value category} \pnum -Expressions are categorized according to the taxonomy in Figure~\ref{fig:categories}. +Expressions are categorized according to the taxonomy in \fref{basic.lval}. \begin{importgraphic} {Expression category taxonomy} -{fig:categories} +{basic.lval} {valuecategories.pdf} \end{importgraphic} @@ -1533,11 +1533,8 @@ \begin{bnf} \nontermdef{lambda-expression}\br - lambda-introducer compound-statement\br - lambda-introducer lambda-declarator \opt{requires-clause} compound-statement\br - lambda-introducer \terminal{<} template-parameter-list \terminal{>} \opt{requires-clause} compound-statement\br - lambda-introducer \terminal{<} template-parameter-list \terminal{>} \opt{requires-clause}\br - \bnfindent lambda-declarator \opt{requires-clause} compound-statement + lambda-introducer \opt{lambda-declarator} compound-statement\br + lambda-introducer \terminal{<} template-parameter-list \terminal{>} \opt{requires-clause} \opt{lambda-declarator} compound-statement \end{bnf} \begin{bnf} @@ -1548,7 +1545,7 @@ \begin{bnf} \nontermdef{lambda-declarator}\br \terminal{(} parameter-declaration-clause \terminal{)} \opt{decl-specifier-seq}\br - \bnfindent\opt{noexcept-specifier} \opt{attribute-specifier-seq} \opt{trailing-return-type} + \bnfindent\opt{noexcept-specifier} \opt{attribute-specifier-seq} \opt{trailing-return-type} \opt{requires-clause} \end{bnf} \pnum @@ -1655,7 +1652,7 @@ \tcode{<}~\grammarterm{template-parameter-list}{}~\tcode{>}, if any. The trailing \grammarterm{requires-clause} of the function call operator or operator template is the \grammarterm{requires-clause} -following the \grammarterm{lambda-declarator}, if any. +of the \grammarterm{lambda-declarator}, if any. \begin{note} The function call operator for a generic lambda might be an abbreviated function template\iref{dcl.fct}. @@ -1966,7 +1963,7 @@ identifier\br \terminal{\&} identifier\br \keyword{this}\br - \terminal{* this} + \terminal{*} \terminal{this} \end{bnf} \begin{bnf} @@ -2820,14 +2817,14 @@ typename-specifier \terminal{(} \opt{expression-list} \terminal{)}\br simple-type-specifier braced-init-list\br typename-specifier braced-init-list\br - postfix-expression \opt{\terminal{. template}} id-expression\br - postfix-expression \opt{\terminal{-> template}} id-expression\br + postfix-expression \opt{\terminal{.} \terminal{template}} id-expression\br + postfix-expression \opt{\terminal{->} \terminal{template}} id-expression\br postfix-expression \terminal{++}\br postfix-expression \terminal{-{-}}\br - \keyword{dynamic_cast} \terminal{<} type-id \terminal{> (} expression \terminal{)}\br - \keyword{static_cast} \terminal{<} type-id \terminal{> (} expression \terminal{)}\br - \keyword{reinterpret_cast} \terminal{<} type-id \terminal{> (} expression \terminal{)}\br - \keyword{const_cast} \terminal{<} type-id \terminal{> (} expression \terminal{)}\br + \keyword{dynamic_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br + \keyword{static_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br + \keyword{reinterpret_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br + \keyword{const_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br \keyword{typeid} \terminal{(} expression \terminal{)}\br \keyword{typeid} \terminal{(} type-id \terminal{)} \end{bnf} @@ -2949,7 +2946,7 @@ Calling a function through an expression whose function type is different from the function type of the called function's -definition results in undefined behavior\iref{dcl.link}. +definition results in undefined behavior. \pnum \indextext{function argument|see{argument}}% @@ -3877,7 +3874,7 @@ \begin{note} The effect of calling a function through a pointer to a function type\iref{dcl.fct} that is not the same as the type used in the -definition of the function is undefined. +definition of the function is undefined\iref{expr.call}. \end{note} Except that converting a prvalue of type ``pointer to \tcode{T1}'' to the type ``pointer to @@ -4154,22 +4151,28 @@ \indextext{name!address of cv-qualified}% \indextext{expression!pointer-to-member constant}% The result of the unary \tcode{\&} operator is a pointer to its operand. -The operand shall be an lvalue or a \grammarterm{qualified-id}. +\begin{itemize} +\item If the operand is a \grammarterm{qualified-id} naming a non-static or variant member \tcode{m} of some class \tcode{C} with type \tcode{T}, the result has type ``pointer to member of class \tcode{C} of type \tcode{T}'' and is a prvalue designating \tcode{C::m}. -Otherwise, if the type of the expression is \tcode{T}, the result has type ``pointer to -\tcode{T}'' and is a prvalue that is the address of the designated object\iref{intro.memory} -or a pointer to the designated function. \begin{note} In particular, the address of an -object of type ``\cv{}~\tcode{T}'' is ``pointer to \cv{}~\tcode{T}'', with the same -cv-qualification. \end{note} +\item +Otherwise, if the operand is an lvalue of type \tcode{T}, +the resulting expression is a prvalue of type ``pointer to \tcode{T}'' +whose result is a pointer to the designated object\iref{intro.memory} or function. +\begin{note} +In particular, taking the address of a variable of type ``\cv{}~\tcode{T}'' +yields a pointer of type ``pointer to \cv{}~\tcode{T}''. +\end{note} For purposes of pointer arithmetic\iref{expr.add} and comparison~(\ref{expr.rel}, \ref{expr.eq}), an object that is not an array element whose address is taken in this way is considered to belong to an array with one element of type \tcode{T}. +\item +Otherwise, the program is ill-formed. +\end{itemize} \begin{example} - \begin{codeblock} struct A { int i; }; struct B : A { }; @@ -4558,16 +4561,73 @@ \end{example} \pnum -The result of \tcode{sizeof} and \tcode{sizeof...} is a constant of type -\tcode{std::size_t}. -\begin{note} \indextext{\idxcode{size_t}}% \indexlibrary{\idxcode{size_t}}% -\tcode{std::size_t} is defined in the standard header +The result of \tcode{sizeof} and \tcode{sizeof...} is a prvalue of type +\tcode{std::size_t}. +\begin{note} +A \tcode{sizeof} expression +is an integral constant expression\iref{expr.const}. +The type \tcode{std::size_t} is defined in the standard header +\indexhdr{cstddef}% +\tcode{}~(\ref{cstddef.syn}, \ref{support.types.layout}). +\end{note} + +\rSec3[expr.alignof]{Alignof} + +\pnum +\indextext{\idxcode{alignof}}% +\indextext{expression!\idxcode{alignof}}% +An \tcode{alignof} expression yields the alignment requirement +of its operand type. The operand shall be a \grammarterm{type-id} +representing a complete object type, or an array thereof, or a reference +to one of those types. + +\pnum +The result is a prvalue of type \tcode{std::size_t}. +\begin{note} +An \tcode{alignof} expression +is an integral constant expression\iref{expr.const}. +The type \tcode{std::size_t} is defined in the standard header +\indexhdr{cstddef}% +\tcode{}~(\ref{cstddef.syn}, \ref{support.types.layout}). +\end{note} + +\pnum +When \tcode{alignof} is applied to a reference type, the result +is the alignment of the referenced type. When \tcode{alignof} +is applied to an array type, the result is the alignment of the +element type. + +\rSec3[expr.unary.noexcept]{\tcode{noexcept} operator} + +\pnum +\indextext{\idxcode{noexcept}}% +\indextext{expression!\idxcode{noexcept}}% +The \tcode{noexcept} operator determines whether the evaluation of its operand, +which is an unevaluated operand\iref{expr.prop}, can throw an +exception\iref{except.throw}. + +\begin{bnf} +\nontermdef{noexcept-expression}\br + \keyword{noexcept} \terminal{(} expression \terminal{)} +\end{bnf} + +\pnum +The result of the \tcode{noexcept} operator is a prvalue of type \tcode{bool}. +\begin{note} +A \grammarterm{noexcept-expression} +is an integral constant expression\iref{expr.const}. +The type \tcode{std::size_t} is defined in the standard header \indexhdr{cstddef}% \tcode{}~(\ref{cstddef.syn}, \ref{support.types.layout}). \end{note} +\pnum +The result of the \tcode{noexcept} operator is \tcode{true} +unless the \grammarterm{expression} is potentially-throwing\iref{except.spec}. +\indextext{expression!unary|)} + \rSec3[expr.new]{New} \pnum @@ -4731,7 +4791,7 @@ Every \grammarterm{constant-expression} in a \grammarterm{noptr-new-declarator} shall be a converted constant expression\iref{expr.const} of type \tcode{std::size_t} and -shall evaluate to a strictly positive value. +its value shall be greater than zero. \begin{example} Given the definition \tcode{int n = 42}, \tcode{new float[n][5]} is well-formed (because \tcode{n} is the @@ -5137,7 +5197,7 @@ \begin{bnf} \nontermdef{delete-expression}\br \opt{\terminal{::}} \keyword{delete} cast-expression\br - \opt{\terminal{::}} \keyword{delete} \terminal{[ ]} cast-expression + \opt{\terminal{::}} \keyword{delete} \terminal{[} \terminal{]} cast-expression \end{bnf} The first alternative is a @@ -5366,49 +5426,6 @@ Access and ambiguity control are done for both the deallocation function and the destructor~(\ref{class.dtor}, \ref{class.free}). -\rSec3[expr.alignof]{Alignof} - -\pnum -\indextext{\idxcode{alignof}}% -\indextext{expression!\idxcode{alignof}}% -An \tcode{alignof} expression yields the alignment requirement -of its operand type. The operand shall be a \grammarterm{type-id} -representing a complete object type, or an array thereof, or a reference -to one of those types. - -\pnum -The result is an integral constant of type -\tcode{std::size_t}. - -\pnum -When \tcode{alignof} is applied to a reference type, the result -is the alignment of the referenced type. When \tcode{alignof} -is applied to an array type, the result is the alignment of the -element type. - -\rSec3[expr.unary.noexcept]{\tcode{noexcept} operator} - -\pnum -\indextext{\idxcode{noexcept}}% -\indextext{expression!\idxcode{noexcept}}% -The \tcode{noexcept} operator determines whether the evaluation of its operand, -which is an unevaluated operand\iref{expr.prop}, can throw an -exception\iref{except.throw}. - -\begin{bnf} -\nontermdef{noexcept-expression}\br - \keyword{noexcept} \terminal{(} expression \terminal{)} -\end{bnf} - -\pnum -The result of the \tcode{noexcept} operator is a constant of type \tcode{bool} -and is a prvalue. - -\pnum -The result of the \tcode{noexcept} operator is \tcode{true} -unless the \grammarterm{expression} is potentially-throwing\iref{except.spec}. -\indextext{expression!unary|)} - \rSec2[expr.cast]{Explicit type conversion (cast notation)}% \indextext{expression!cast|(} @@ -5711,20 +5728,20 @@ \begin{itemize} \item If \tcode{P} evaluates to a null pointer value and \tcode{J} evaluates to 0, the result is a null pointer value. -\item Otherwise, if \tcode{P} points to element $\mathtt{x[}i\mathtt{]}$ -of an array object \tcode{x} with $n$ elements,% +\item Otherwise, if \tcode{P} points to an array element $i$ +of an array object \tcode{x} with $n$ elements\iref{dcl.array},% \footnote{An object that is not an array element is considered to belong to a single-element array for this purpose; see~\ref{expr.unary.op}. A pointer past the last element of an array \tcode{x} of $n$ elements -is considered to be equivalent to a pointer to a hypothetical element -$\mathtt{x[}n\mathtt{]}$ for this purpose; see~\ref{basic.compound}.} +is considered to be equivalent to a pointer to a hypothetical array element +$n$ for this purpose; see~\ref{basic.compound}.} the expressions \tcode{P + J} and \tcode{J + P} (where \tcode{J} has the value $j$) -point to the (possibly-hypothetical) element -$\mathtt{x[}i + j\mathtt{]}$ if $0 \le i + j \le n$ +point to the (possibly-hypothetical) array element +$i + j$ of \tcode{x} if $0 \le i + j \le n$ and the expression \tcode{P - J} -points to the (possibly-hypothetical) element -$\mathtt{x[}i - j\mathtt{]}$ if $0 \le i - j \le n$. +points to the (possibly-hypothetical) array element +$i - j$ of \tcode{x} if $0 \le i - j \le n$. \item Otherwise, the behavior is undefined. \end{itemize} @@ -5743,7 +5760,7 @@ \item If \tcode{P} and \tcode{Q} both evaluate to null pointer values, the result is 0. \item Otherwise, if \tcode{P} and \tcode{Q} point to, respectively, -elements $\mathtt{x[}i\mathtt{]}$ and $\mathtt{x[}j\mathtt{]}$ +array elements $i$ and $j$ of the same array object \tcode{x}, the expression \tcode{P - Q} has the value $i - j$. \item Otherwise, the behavior is undefined. @@ -6648,9 +6665,9 @@ \begin{bnf} \nontermdef{assignment-expression}\br conditional-expression\br - logical-or-expression assignment-operator initializer-clause\br yield-expression\br - throw-expression + throw-expression\br + logical-or-expression assignment-operator initializer-clause \end{bnf} \begin{bnf} diff --git a/source/future.tex b/source/future.tex index 7e801a3c19..5c541d9da3 100644 --- a/source/future.tex +++ b/source/future.tex @@ -109,9 +109,9 @@ For compatibility with the \indextext{library!C standard}% C standard library, the \Cpp{} standard library provides -the \defnx{C headers}{headers!C library} shown in \tref{future.c.headers}. +the \defnx{C headers}{headers!C library} shown in \tref{depr.c.headers}. -\begin{multicolfloattable}{C headers}{tab:future.c.headers} +\begin{multicolfloattable}{C headers}{depr.c.headers} {lllll} \tcode{} \\ \tcode{} \\ @@ -269,7 +269,6 @@ namespace scope\iref{basic.scope.namespace} of the namespace \tcode{std} and are then injected into the global namespace scope by explicit \grammarterm{using-declaration}{s}\iref{namespace.udecl}. -\indextext{namespace}% \pnum \begin{example} @@ -316,7 +315,7 @@ \begin{itemdescr} \pnum \requires -Type \tcode{T} is \oldconcept{EqualityComparable} (\tref{equalitycomparable}). +Type \tcode{T} is \oldconcept{EqualityComparable} (\tref{cpp17.equalitycomparable}). \pnum \returns @@ -331,7 +330,7 @@ \begin{itemdescr} \pnum \requires -Type \tcode{T} is \oldconcept{LessThanComparable} (\tref{lessthancomparable}). +Type \tcode{T} is \oldconcept{LessThanComparable} (\tref{cpp17.lessthancomparable}). \pnum \returns @@ -346,7 +345,7 @@ \begin{itemdescr} \pnum \requires -Type \tcode{T} is \oldconcept{LessThanComparable} (\tref{lessthancomparable}). +Type \tcode{T} is \oldconcept{LessThanComparable} (\tref{cpp17.lessthancomparable}). \pnum \returns @@ -361,7 +360,7 @@ \begin{itemdescr} \pnum \requires -Type \tcode{T} is \oldconcept{LessThanComparable} (\tref{lessthancomparable}). +Type \tcode{T} is \oldconcept{LessThanComparable} (\tref{cpp17.lessthancomparable}). \pnum \returns @@ -515,10 +514,10 @@ \tcode{strstreambuf}, initializing the base class with \tcode{streambuf()}. -The postconditions of this function are indicated in \tref{future.strstreambuf.effects}. +The postconditions of this function are indicated in \tref{depr.strstreambuf.cons.sz}. \end{itemdescr} -\begin{libtab2}{\tcode{strstreambuf(streamsize)} effects}{tab:future.strstreambuf.effects} +\begin{libtab2}{\tcode{strstreambuf(streamsize)} effects}{depr.strstreambuf.cons.sz} {ll} {Element}{Value} \tcode{strmode} & \tcode{dynamic} \\ @@ -539,10 +538,10 @@ \tcode{strstreambuf}, initializing the base class with \tcode{streambuf()}. -The postconditions of this function are indicated in \tref{future.strstreambuf1.effects}. +The postconditions of this function are indicated in \tref{depr.strstreambuf.cons.alloc}. \begin{libtab2}{\tcode{strstreambuf(void* (*)(size_t), void (*)(void*))} effects} -{tab:future.strstreambuf1.effects} +{depr.strstreambuf.cons.alloc} {ll} {Element}{Value} \tcode{strmode} & \tcode{dynamic} \\ @@ -569,10 +568,10 @@ \tcode{strstreambuf}, initializing the base class with \tcode{streambuf()}. -The postconditions of this function are indicated in \tref{future.strstreambuf2.effects}. +The postconditions of this function are indicated in \tref{depr.strstreambuf.cons.ptr}. \begin{libtab2}{\tcode{strstreambuf(charT*, streamsize, charT*)} effects} -{tab:future.strstreambuf2.effects} +{depr.strstreambuf.cons.ptr} {ll} {Element}{Value} \tcode{strmode} & 0 \\ @@ -898,9 +897,9 @@ \pnum \effects Alters the stream position within one of the -controlled sequences, if possible, as indicated in \tref{future.seekoff.positioning}. +controlled sequences, if possible, as indicated in \tref{depr.strstreambuf.seekoff.pos}. -\begin{libtab2}{\tcode{seekoff} positioning}{tab:future.seekoff.positioning} +\begin{libtab2}{\tcode{seekoff} positioning}{depr.strstreambuf.seekoff.pos} {p{2.5in}l}{Conditions}{Result} \tcode{(which \& ios::in) != 0} & positions the input sequence \\ \rowsep @@ -920,9 +919,9 @@ For a sequence to be positioned, if its next pointer is a null pointer, the positioning operation fails. Otherwise, the function determines \tcode{newoff} as indicated in -\tref{future.newoff.values}. +\tref{depr.strstreambuf.seekoff.newoff}. -\begin{libtab2}{\tcode{newoff} values}{tab:future.newoff.values} +\begin{libtab2}{\tcode{newoff} values}{depr.strstreambuf.seekoff.newoff} {p{2.0in}p{2.0in}}{Condition}{\tcode{newoff} Value} \tcode{way == ios::beg} & 0 \\ \rowsep @@ -2251,7 +2250,7 @@ described by the class \tcode{Tr}, to and from a byte stream buffer of type \tcode{streambuf}. Conversion between a sequence of \tcode{Elem} values and multibyte sequences is performed by an object of class -\tcode{Codecvt}, which shall satisfy the requirements +\tcode{Codecvt}, which shall meet the requirements of the standard code-conversion facet \tcode{codecvt}. \pnum @@ -2341,7 +2340,7 @@ \pnum The \tcode{ctype} locale category includes the following facets as if they were specified -in table \tref{localization.category.facets} of \ref{locale.category}. +in table \tref{locale.category.facets} of \ref{locale.category}. \begin{codeblock} codecvt @@ -2351,7 +2350,7 @@ \pnum The \tcode{ctype} locale category includes the following facets as if they were specified -in table \tref{localization.required.specializations} of \ref{locale.category}. +in table \tref{locale.spec} of \ref{locale.category}. \begin{codeblock} codecvt_byname diff --git a/source/headers b/source/headers deleted file mode 100644 index e163259d6f..0000000000 --- a/source/headers +++ /dev/null @@ -1,54 +0,0 @@ -5 -algorithm -array -atomic -bitset -chrono -codecvt -complex -condition_variable -deque -exception -forward_list -fstream -functional -future -initializer_list -iomanip -ios -iosfwd -iostream -istream -iterator -limits -list -locale -map -memory -mutex -new -numeric -ostream -queue -random -ratio -regex -scoped_allocator -set -sstream -stack -stdexcept -streambuf -string -strstream -system_error -thread -tuple -type_traits -typeindex -typeinfo -unordered_map -unordered_set -utility -valarray -vector diff --git a/source/iostreams.tex b/source/iostreams.tex index 1ec261bd50..72291bd914 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -18,36 +18,37 @@ stream formatting and manipulators, string streams, and file streams, -as summarized in \tref{iostreams.lib.summary}. +as summarized in \tref{iostreams.summary}. -\begin{libsumtab}{Input/output library summary}{tab:iostreams.lib.summary} +\begin{libsumtab}{Input/output library summary}{iostreams.summary} \ref{iostreams.requirements} & Requirements & \\ \rowsep \ref{iostream.forward} & Forward declarations & \tcode{} \\ \rowsep \ref{iostream.objects} & Standard iostream objects & \tcode{} \\ \rowsep \ref{iostreams.base} & Iostreams base classes & \tcode{} \\ \rowsep \ref{stream.buffers} & Stream buffers & \tcode{} \\ \rowsep -\ref{iostream.format} & Formatting and manipulators & \tcode{} \\ - & & \tcode{} \\ - & & \tcode{} \\ \rowsep +\ref{iostream.format} & Formatting and manipulators & + \tcode{}, \tcode{}, \tcode{} \\ \rowsep \ref{string.streams} & String streams & \tcode{} \\ \rowsep \ref{file.streams} & File streams & \tcode{} \\ \rowsep \ref{syncstream} & Synchronized output streams & \tcode{} \\ \rowsep \ref{filesystems} & File systems & \tcode{} \\ \rowsep -\ref{c.files} & C library files & \tcode{} \\ - & & \tcode{} \\ +\ref{c.files} & C library files & + \tcode{}, \tcode{} \\ \end{libsumtab} \pnum -Figure~\ref{fig:streampos} illustrates relationships among various types +\begin{note} +\fref{iostreams.streampos} illustrates relationships among various types described in this clause. A line from \textbf{A} to \textbf{B} indicates that \textbf{A} is an alias (e.g., a typedef) for \textbf{B} or that \textbf{A} is defined in terms of \textbf{B}. \begin{importgraphic} -{Stream position, offset, and size types [non-normative]} -{fig:streampos} +{Stream position, offset, and size types} +{iostreams.streampos} {figstreampos.pdf} \end{importgraphic} +\end{note} \rSec1[iostreams.requirements]{Iostreams requirements} @@ -96,7 +97,7 @@ In the classes of \ref{input.output}, a template parameter with name \tcode{charT} represents a member of the set of types containing \tcode{char}, \tcode{wchar_t}, and any other \impldef{set of character types that iostreams templates can be instantiated for} -character types that satisfy the requirements for a character on which any of +character types that meet the requirements for a character on which any of the iostream components can be instantiated. \rSec2[iostreams.threadsafety]{Thread safety} @@ -964,9 +965,9 @@ The type \tcode{fmtflags} is a bitmask type\iref{bitmask.types}. -Setting its elements has the effects indicated in \tref{iostreams.fmtflags.effects}. +Setting its elements has the effects indicated in \tref{ios.fmtflags}. -\begin{libefftab}{\tcode{fmtflags} effects}{tab:iostreams.fmtflags.effects} +\begin{libefftab}{\tcode{fmtflags} effects}{ios.fmtflags} \tcode{boolalpha} & insert and extract \tcode{bool} type in alphabetic format\\ \tcode{dec} & @@ -1003,9 +1004,9 @@ \pnum Type \tcode{fmtflags} -also defines the constants indicated in \tref{iostreams.fmtflags.constants}. +also defines the constants indicated in \tref{ios.fmtflags.const}. -\begin{floattable}{\tcode{fmtflags} constants}{tab:iostreams.fmtflags.constants} +\begin{floattable}{\tcode{fmtflags} constants}{ios.fmtflags.const} {ll} \topline \lhdr{Constant} & \rhdr{Allowable values} \\ \capsep @@ -1027,9 +1028,9 @@ The type \tcode{iostate} is a bitmask type\iref{bitmask.types} -that contains the elements indicated in \tref{iostreams.iostate.effects}. +that contains the elements indicated in \tref{ios.iostate}. -\begin{libefftab}{\tcode{iostate} effects}{tab:iostreams.iostate.effects} +\begin{libefftab}{\tcode{iostate} effects}{ios.iostate} \tcode{badbit} & indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error from a file); \\ @@ -1063,9 +1064,9 @@ The type \tcode{openmode} is a bitmask type\iref{bitmask.types}. -It contains the elements indicated in \tref{iostreams.openmode.effects}. +It contains the elements indicated in \tref{ios.openmode}. -\begin{libefftab}{\tcode{openmode} effects}{tab:iostreams.openmode.effects} +\begin{libefftab}{\tcode{openmode} effects}{ios.openmode} \tcode{app} & seek to end before each write \\ \tcode{ate} & @@ -1093,9 +1094,9 @@ The type \tcode{seekdir} is an enumerated type\iref{enumerated.types} -that contains the elements indicated in \tref{iostreams.seekdir.effects}. +that contains the elements indicated in \tref{ios.seekdir}. -\begin{libefftabmean}{\tcode{seekdir} effects}{tab:iostreams.seekdir.effects} +\begin{libefftabmean}{\tcode{seekdir} effects}{ios.seekdir} \tcode{beg} & request a seek (for subsequent input or output) relative to the beginning of the stream \\ \tcode{cur} & @@ -1670,23 +1671,23 @@ It holds a state object whose type is equal to the template parameter \tcode{stateT}. Type \tcode{stateT} shall meet -the \oldconcept{DefaultConstructible} (\tref{defaultconstructible}), -\oldconcept{CopyConstructible} (\tref{copyconstructible}), -\oldconcept{CopyAssignable} (\tref{copyassignable}), and -\oldconcept{Destructible} (\tref{destructible}) requirements. +the \oldconcept{DefaultConstructible} (\tref{cpp17.defaultconstructible}), +\oldconcept{CopyConstructible} (\tref{cpp17.copyconstructible}), +\oldconcept{CopyAssignable} (\tref{cpp17.copyassignable}), and +\oldconcept{Destructible} (\tref{cpp17.destructible}) requirements. If \tcode{is_trivially_copy_constructible_v} is \tcode{true}, then \tcode{fpos} has a trivial copy constructor. If \tcode{is_trivially_copy_assignable} is \tcode{true}, then \tcode{fpos} has a trivial copy assignment operator. If \tcode{is_trivially_destructible_v} is \tcode{true}, then \tcode{fpos} has a trivial destructor. -All specializations of \tcode{fpos} satisfy +All specializations of \tcode{fpos} meet the \oldconcept{DefaultConstructible}, \oldconcept{CopyConstructible}, \oldconcept{CopyAssignable}, \oldconcept{Destructible}, -and \oldconcept{EqualityComparable} (\tref{equalitycomparable}) requirements. -In addition, the expressions shown in \tref{iostreams.position.requirements} +and \oldconcept{EqualityComparable} (\tref{cpp17.equalitycomparable}) requirements. +In addition, the expressions shown in \tref{fpos.operations} are valid and have the indicated semantics. In that table, \begin{itemize} @@ -1701,7 +1702,7 @@ \begin{libreqtab4c} {Position type requirements} -{tab:iostreams.position.requirements} +{fpos.operations} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ & & \chdr{semantics} & \rhdr{pre-/post-condition} \\ \capsep @@ -1899,9 +1900,9 @@ \begin{itemdescr} \pnum \ensures -The postconditions of this function are indicated in \tref{iostreams.basicios.init.effects}. +The postconditions of this function are indicated in \tref{basic.ios.cons}. -\begin{libefftabvalue}{\tcode{basic_ios::init()} effects}{tab:iostreams.basicios.init.effects} +\begin{libefftabvalue}{\tcode{basic_ios::init()} effects}{basic.ios.cons} \tcode{rdbuf()} & \tcode{sb} \\ \tcode{tie()} & @@ -2122,11 +2123,10 @@ \pnum \ensures -The postconditions of this function are indicated in \tref{iostreams.copyfmt.effects}. - +The postconditions of this function are indicated in \tref{basic.ios.copyfmt}. \begin{LibEffTab}{\tcode{basic_ios::copyfmt()} effects} -{tab:iostreams.copyfmt.effects}{Value}{1.2in} +{basic.ios.copyfmt}{Value}{1.2in} \tcode{rdbuf()} & \textit{unchanged} \\ \tcode{tie()} & @@ -4425,7 +4425,6 @@ namespace std { template> class basic_istream::sentry { - using traits_type = traits; bool ok_; // \expos public: explicit sentry(basic_istream& is, bool noskipws = false); @@ -7782,9 +7781,9 @@ \pnum \effects Alters the stream position within one of the -controlled sequences, if possible, as indicated in \tref{iostreams.seekoff.positioning}. +controlled sequences, if possible, as indicated in \tref{stringbuf.seekoff.pos}. -\begin{libtab2}{\tcode{seekoff} positioning}{tab:iostreams.seekoff.positioning} +\begin{libtab2}{\tcode{seekoff} positioning}{stringbuf.seekoff.pos} {p{2.5in}l}{Conditions}{Result} \tcode{(which \& ios_base::in)}\tcode{ == ios_base::in} & positions the input sequence \\ \rowsep @@ -7805,7 +7804,7 @@ \pnum For a sequence to be positioned, the function determines \tcode{newoff} as indicated in -\tref{iostreams.newoff.values}. +\tref{stringbuf.seekoff.newoff}. If the sequence's next pointer (either \tcode{gptr()} @@ -7814,7 +7813,7 @@ is a null pointer and \tcode{newoff} is nonzero, the positioning operation fails. -\begin{libtab2}{\tcode{newoff} values}{tab:iostreams.newoff.values} +\begin{libtab2}{\tcode{newoff} values}{stringbuf.seekoff.newoff} {lp{2.0in}}{Condition}{\tcode{newoff} Value} \tcode{way == ios_base::beg} & 0 \\ \rowsep @@ -8786,11 +8785,11 @@ \indexlibrary{\idxcode{fopen}}% with the second argument determined from \tcode{mode \& \~{}ios_base::ate} -as indicated in \tref{iostreams.file.open.modes}. +as indicated in \tref{filebuf.open.modes}. If \tcode{mode} is not some combination of flags shown in the table then the open fails. -\begin{floattable}{File open modes}{tab:iostreams.file.open.modes} +\begin{floattable}{File open modes}{filebuf.open.modes} {cccccl} \topline \multicolumn{5}{|c}{\tcode{ios_base} flag combination} & \tcode{stdio} equivalent \\ @@ -9175,9 +9174,9 @@ The function determines one of three values for the argument \tcode{whence}, of type \tcode{int}, -as indicated in \tref{iostreams.seekoff.effects}. +as indicated in \tref{filebuf.seekoff}. -\begin{libtab2}{\tcode{seekoff} effects}{tab:iostreams.seekoff.effects} +\begin{libtab2}{\tcode{seekoff} effects}{filebuf.seekoff} {ll}{\tcode{way} Value}{\tcode{stdio} Equivalent} \tcode{basic_ios::beg} & \tcode{SEEK_SET} \\ \tcode{basic_ios::cur} & \tcode{SEEK_CUR} \\ @@ -10194,7 +10193,7 @@ \begin{itemdescr} \pnum \effects -Move constructs from \tcode{other} (\tref{moveconstructible}). +Move constructs from \tcode{other} (\tref{cpp17.moveconstructible}). \pnum \ensures @@ -10458,8 +10457,8 @@ \end{codeblock} \pnum -\tcode{Allocator} shall satisfy the \oldconcept{Allocator} requirements -(\tref{utilities.allocator.requirements}). +\tcode{Allocator} shall meet the \oldconcept{Allocator} requirements +(\tref{cpp17.allocator}). \pnum \begin{example} @@ -10789,7 +10788,7 @@ unless \tcode{EcharT} is one of the encoded character types. \pnum -Template parameters named \tcode{InputIterator} shall satisfy the +Template parameters named \tcode{InputIterator} shall meet the \oldconcept{InputIterator} requirements\iref{input.iterators} and shall have a value type that is one of the encoded character types. @@ -10801,8 +10800,8 @@ they are not included as permitted types. \end{note} \pnum -Template parameters named \tcode{Allocator} shall satisfy the -\oldconcept{Allocator} requirements (\tref{utilities.allocator.requirements}). +Template parameters named \tcode{Allocator} shall meet the +\oldconcept{Allocator} requirements (\tref{cpp17.allocator}). \rSec3[fs.req.namespace]{Namespaces and headers} @@ -11861,21 +11860,23 @@ \begin{example} Even if \tcode{//host} is interpreted as a \grammarterm{root-name}, both of the paths \tcode{path("//host")/"foo"} and \tcode{path("//host/")/"foo"} -equal \tcode{"//host/foo"}. +equal \tcode{"//host/foo"} (although the former might use backslash as the +preferred separator). Expression examples: \begin{codeblock} // On POSIX, -path("foo") / ""; // yields \tcode{"foo/"} -path("foo") / "/bar"; // yields \tcode{"/bar"} -// On Windows, backslashes replace slashes in the above yields +path("foo") /= path(""); // yields \tcode{path("foo/")} +path("foo") /= path("/bar"); // yields \tcode{path("/bar")} // On Windows, -path("foo") / "c:/bar"; // yields \tcode{"c:/bar"} -path("foo") / "c:"; // yields \tcode{"c:"} -path("c:") / ""; // yields \tcode{"c:"} -path("c:foo") / "/bar"; // yields \tcode{"c:/bar"} -path("c:foo") / "c:bar"; // yields \tcode{"c:foo/bar"} +path("foo") /= path(""); // yields \tcode{path("foo\textbackslash\textbackslash{}")} +path("foo") /= path("/bar"); // yields \tcode{path("/bar")} +path("foo") /= path("c:/bar"); // yields \tcode{path("c:/bar")} +path("foo") /= path("c:"); // yields \tcode{path("c:")} +path("c:") /= path(""); // yields \tcode{path("c:")} +path("c:foo") /= path("/bar"); // yields \tcode{path("c:/bar")} +path("c:foo") /= path("c:bar"); // yields \tcode{path("c:foo\textbackslash\textbackslash{}bar")} \end{codeblock} \end{example} @@ -12429,7 +12430,7 @@ \begin{itemdescr} \pnum -\returns \tcode{true} if the pathname in the generic format is empty, else \tcode{false}. +\returns \tcode{true} if the pathname in the generic format is empty, otherwise \tcode{false}. \end{itemdescr} \indexlibrarymember{has_root_path}{path}% @@ -12520,7 +12521,7 @@ \begin{itemdescr} \pnum \returns \tcode{true} if the pathname in the native format - contains an absolute path\iref{fs.class.path}, else \tcode{false}. + contains an absolute path\iref{fs.class.path}, otherwise \tcode{false}. \pnum \begin{example} \tcode{path("/").is_absolute()} is @@ -12661,7 +12662,7 @@ in the generic format\iref{fs.path.generic}. \pnum -A \tcode{path::iterator} is a constant iterator satisfying all the +A \tcode{path::iterator} is a constant iterator meeting all the requirements of a bidirectional iterator\iref{bidirectional.iterators} except that, for dereferenceable iterators \tcode{a} and \tcode{b} @@ -12984,10 +12985,10 @@ \pnum This enum specifies constants used to identify the format of the character -sequence, with the meanings listed in \tref{enum.path.format}. +sequence, with the meanings listed in \tref{fs.enum.path.format}. \begin{floattable} -{Enum \tcode{path::format}}{tab:enum.path.format}{lp{4in}} +{Enum \tcode{path::format}}{fs.enum.path.format}{lp{4in}} \topline \lhdr{Name} & \rhdr{Meaning} \\\capsep \tcode{native_format} & The native pathname format. \\\rowsep @@ -13012,7 +13013,7 @@ The values of the constants are distinct. \begin{floattable} -{Enum class \tcode{file_type}}{tab:fs.enum.file.type} +{Enum class \tcode{file_type}}{fs.enum.file.type} {lp{4.5in}} \topline \lhdr{Constant} & @@ -13051,14 +13052,14 @@ \pnum The \tcode{enum class} type \tcode{copy_options} is a bitmask type\iref{bitmask.types} that specifies bitmask constants used to control the semantics of -copy operations. The constants are specified in option groups with the meanings listed in \tref{fs.enum.copy_options}. +copy operations. The constants are specified in option groups with the meanings listed in \tref{fs.enum.copy.opts}. The constant \tcode{none} represents the empty bitmask, and is shown in each option group for purposes of exposition; implementations shall provide only a single definition. Every other constant in the table represents a distinct bitmask element. \begin{floattable} -{Enum class \tcode{copy_options}}{tab:fs.enum.copy_options} +{Enum class \tcode{copy_options}}{fs.enum.copy.opts} {lp{4in}} \topline \ohdrx{2}{Option group controlling \tcode{copy_file} function effects for existing target files} \\ \rowsep @@ -13111,7 +13112,7 @@ permissions, with the meanings listed in \tref{fs.enum.perms}. \begin{floattable} -{Enum class \tcode{perms}}{tab:fs.enum.perms} +{Enum class \tcode{perms}}{fs.enum.perms} {lrlp{3.2in}} \topline \lhdr{Name} & \chdr{Value} & \chdr{POSIX} & \rhdr{Definition or notes} \\ @@ -13168,13 +13169,13 @@ The \tcode{enum class} type \tcode{perm_options} is a bitmask type\iref{bitmask.types} that specifies bitmask constants used to control the semantics of permissions operations, -with the meanings listed in \tref{enum.perm_options}. +with the meanings listed in \tref{fs.enum.perm.opts}. The bitmask constants are bitmask elements. -In \tref{enum.perm_options} \tcode{perm} denotes a value of type \tcode{perms} +In \tref{fs.enum.perm.opts} \tcode{perm} denotes a value of type \tcode{perms} passed to \tcode{permissions}. \begin{floattable} -{Enum class \tcode{perm_options}}{tab:enum.perm_options}{x{.15\hsize}x{.70\hsize}} +{Enum class \tcode{perm_options}}{fs.enum.perm.opts}{x{.15\hsize}x{.70\hsize}} \topline \lhdr{Name} & \rhdr{Meaning} \\ \capsep @@ -13198,12 +13199,12 @@ \pnum The \tcode{enum class} type \tcode{directory_options} is a bitmask type\iref{bitmask.types} that specifies bitmask constants used to identify - directory traversal options, with the meanings listed in \tref{fs.enum.directory_options}. + directory traversal options, with the meanings listed in \tref{fs.enum.dir.opts}. The constant \tcode{none} represents the empty bitmask; every other constant in the table represents a distinct bitmask element. \begin{floattable} -{Enum class \tcode{directory_options}}{tab:fs.enum.directory_options} +{Enum class \tcode{directory_options}}{fs.enum.dir.opts} {lp{3in}} \topline \lhdr{Name} & @@ -13841,8 +13842,8 @@ \end{codeblock} \pnum - \tcode{directory_iterator} satisfies the - \oldconcept{InputIterator} requirements\iref{input.iterators}. +\tcode{directory_iterator} meets the +\oldconcept{InputIterator} requirements\iref{input.iterators}. \pnum If an iterator of type \tcode{directory_iterator} reports an error or @@ -14313,15 +14314,15 @@ Otherwise, cease iteration of the directory currently being iterated over, and continue iteration over the parent directory. -\pnum -\ensures Any copies of the previous value of \tcode{*this} -are no longer required -to be dereferenceable nor to be in the domain of \tcode{==}. - \pnum \throws As specified in~\ref{fs.err.report}. \end{itemdescr} +\pnum +\remarks Any copies of the previous value of \tcode{*this} +are no longer required +to be dereferenceable nor to be in the domain of \tcode{==}. + \indexlibrarymember{disable_recursion_pending}{recursive_directory_iterator}% \begin{itemdecl} void disable_recursion_pending(); @@ -14963,7 +14964,7 @@ \begin{itemdescr} \pnum \returns \tcode{true}, if \tcode{p1} and \tcode{p2} resolve to the same file - system entity, else \tcode{false}. The signature with argument \tcode{ec} + system entity, otherwise \tcode{false}. The signature with argument \tcode{ec} returns \tcode{false} if an error occurs. \pnum @@ -15983,7 +15984,7 @@ namespace std { int remove(const char* filename); - int rename(const char* old, const char* new); + int rename(const char* old_p, const char* new_p); FILE* tmpfile(); char* tmpnam(char* s); int fclose(FILE* stream); diff --git a/source/iterators.tex b/source/iterators.tex index 505093f841..9d7ab18636 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -17,9 +17,9 @@ iterator primitives, predefined iterators, and stream iterators, -as summarized in \tref{iterators.lib.summary}. +as summarized in \tref{iterators.summary}. -\begin{libsumtab}{Iterators library summary}{tab:iterators.lib.summary} +\begin{libsumtab}{Iterators library summary}{iterators.summary} \ref{iterator.requirements} & Iterator requirements & \tcode{} \\ \ref{iterator.primitives} & Iterator primitives & \\ \ref{predef.iterators} & Iterator adaptors & \\ @@ -323,7 +323,7 @@ template class insert_iterator; template constexpr insert_iterator - inserter(Container& x, iterator_t i); + inserter(Container& x, ranges::iterator_t i); // \ref{move.iterators}, move iterators and sentinels template class move_iterator; @@ -500,7 +500,7 @@ \term{contiguous iterators}, as shown in \tref{iterators.relations}. -\begin{floattable}{Relations among iterator categories}{tab:iterators.relations} +\begin{floattable}{Relations among iterator categories}{iterators.relations} {lllll} \topline \textbf{Contiguous} & @@ -526,18 +526,18 @@ \libconcept{Iterator} concept\iref{iterator.concept.iterator}. \pnum -Forward iterators satisfy all the requirements of input +Forward iterators meet all the requirements of input iterators and can be used whenever an input iterator is specified; -Bidirectional iterators also satisfy all the requirements of +Bidirectional iterators also meet all the requirements of forward iterators and can be used whenever a forward iterator is specified; -Random access iterators also satisfy all the requirements of bidirectional +Random access iterators also meet all the requirements of bidirectional iterators and can be used whenever a bidirectional iterator is specified; -Contiguous iterators also satisfy all the requirements of random access +Contiguous iterators also meet all the requirements of random access iterators and can be used whenever a random access iterator is specified. \pnum -Iterators that further satisfy the requirements of output iterators are +Iterators that further meet the requirements of output iterators are called \defnx{mutable iterators}{mutable iterator}. Nonmutable iterators are referred to as \defnx{constant iterators}{constant iterator}. @@ -576,7 +576,7 @@ Results of most expressions are undefined for singular values; the only exceptions are destroying an iterator that holds a singular value, the assignment of a non-singular value to -an iterator that holds a singular value, and, for iterators that satisfy the +an iterator that holds a singular value, and, for iterators that meet the \oldconcept{DefaultConstructible} requirements, using a value-initialized iterator as the source of a copy or move operation. \begin{note} This guarantee is not offered for default-initialization, although the distinction only matters for types @@ -614,12 +614,15 @@ \range{i}{s} denotes a valid range. \pnum -A counted range \range{i}{n} is empty if \tcode{n == 0}; otherwise, \range{i}{n} -refers to the \tcode{n} elements in the data structure starting with the element -pointed to by \tcode{i} and up to but not including the element, if any, pointed to by -the result of \tcode{n} applications of \tcode{++i}. A counted range -\range{i}{n} is valid if and only if \tcode{n == 0}; or \tcode{n} is positive, -\tcode{i} is dereferenceable, and \range{++i}{-{-}n} is valid. +A \defnadj{counted}{range} \range{i}{n} is empty if \tcode{n == 0}; +otherwise, \range{i}{n} refers to +the \tcode{n} elements in the data structure +starting with the element pointed to by \tcode{i} and up to but not including +the element, if any, pointed to by +the result of \tcode{n} applications of \tcode{++i}. +A counted range \range{i}{n} is valid if and only if \tcode{n == 0}; +or \tcode{n} is positive, \tcode{i} is dereferenceable, +and \range{++i}{-{-}n} is valid. \pnum The result of the application of library functions @@ -866,7 +869,6 @@ typename readable_traits::value_type; typename common_reference_t&&, typename readable_traits::value_type&>; - *i++; typename common_reference_t::value_type&>; requires SignedIntegral::difference_type>; @@ -1049,7 +1051,7 @@ The name \tcode{ranges::iter_move} denotes a customization point object\iref{customization.point.object}. The expression \tcode{ranges::\-iter_move(E)} for some subexpression \tcode{E} is -expression-equivalent to the following: +expression-equivalent to: \begin{itemize} \item \tcode{iter_move(E)}, if that expression is valid, with overload @@ -1104,7 +1106,7 @@ \pnum The expression \tcode{ranges::iter_swap(E1, E2)} for some subexpressions -\tcode{E1} and \tcode{E2} is expression-equivalent to the following: +\tcode{E1} and \tcode{E2} is expression-equivalent to: \begin{itemize} \item \tcode{(void)iter_swap(E1, E2)}, if that expression is valid, @@ -1732,7 +1734,7 @@ \pnum The \oldconcept{Iterator} requirements form the basis of the iterator -taxonomy; every iterator satisfies the \oldconcept{Iterator} requirements. This +taxonomy; every iterator meets the \oldconcept{\-Iterator} requirements. This set of requirements specifies operations for dereferencing and incrementing an iterator. Most algorithms will require additional operations to read\iref{input.iterators} or write\iref{output.iterators} values, or @@ -1740,20 +1742,20 @@ \ref{bidirectional.iterators}, \ref{random.access.iterators}). \pnum -A type \tcode{X} satisfies the \oldconcept{Iterator} requirements if: +A type \tcode{X} meets the \oldconcept{Iterator} requirements if: \begin{itemize} -\item \tcode{X} satisfies the \oldconcept{CopyConstructible}, \oldconcept{CopyAssignable}, and +\item \tcode{X} meets the \oldconcept{CopyConstructible}, \oldconcept{CopyAssignable}, and \oldconcept{Destructible} requirements\iref{utility.arg.requirements} and lvalues of type \tcode{X} are swappable\iref{swappable.requirements}, and -\item the expressions in \tref{iterator.requirements} are valid and have +\item the expressions in \tref{iterator} are valid and have the indicated semantics. \end{itemize} \begin{libreqtab4b} {\oldconcept{Iterator} requirements} -{tab:iterator.requirements} +{iterator} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ & & \chdr{semantics} & \rhdr{pre-/post-condition} \\ \capsep @@ -1781,16 +1783,16 @@ \pnum A class or pointer type \tcode{X} -satisfies the requirements of an input iterator for the value type +meets the requirements of an input iterator for the value type \tcode{T} if -\tcode{X} satisfies the \oldconcept{Iterator}\iref{iterator.iterators} and -\oldconcept{EqualityComparable} (\tref{equalitycomparable}) requirements and -the expressions in \tref{iterator.input.requirements} are valid and have +\tcode{X} meets the \oldconcept{Iterator}\iref{iterator.iterators} and +\oldconcept{EqualityComparable} (\tref{cpp17.equalitycomparable}) requirements and +the expressions in \tref{inputiterator} are valid and have the indicated semantics. \pnum -In \tref{iterator.input.requirements}, the term +In \tref{inputiterator}, the term \term{the domain of \tcode{==}} is used in the ordinary mathematical sense to denote the set of values over which @@ -1820,7 +1822,7 @@ \begin{libreqtab4b} {\oldconcept{InputIterator} requirements (in addition to \oldconcept{Iterator})} -{tab:iterator.input.requirements} +{inputiterator} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ & & \chdr{semantics} & \rhdr{pre-/post-condition} \\ \capsep @@ -1877,7 +1879,7 @@ They should be \term{single pass} algorithms. -Value type \tcode{T} is not required to be a \oldconcept{CopyAssignable} type (\tref{copyassignable}). +Value type \tcode{T} is not required to be a \oldconcept{CopyAssignable} type (\tref{cpp17.copyassignable}). These algorithms can be used with istreams as the source of the input data through the \tcode{istream_iterator} class template. @@ -1888,14 +1890,14 @@ \pnum A class or pointer type \tcode{X} -satisfies the requirements of an output iterator -if \tcode{X} satisfies the \oldconcept{Iterator} requirements\iref{iterator.iterators} -and the expressions in \tref{iterator.output.requirements} +meets the requirements of an output iterator +if \tcode{X} meets the \oldconcept{Iterator} requirements\iref{iterator.iterators} +and the expressions in \tref{outputiterator} are valid and have the indicated semantics. \begin{libreqtab4b} {\oldconcept{OutputIterator} requirements (in addition to \oldconcept{Iterator})} -{tab:iterator.output.requirements} +{outputiterator} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ & & \chdr{semantics} & \rhdr{pre-/post-condition} \\ \capsep @@ -1948,18 +1950,18 @@ \pnum A class or pointer type \tcode{X} -satisfies the requirements of a forward iterator if +meets the requirements of a forward iterator if \begin{itemize} -\item \tcode{X} satisfies the \oldconcept{InputIterator} requirements\iref{input.iterators}, +\item \tcode{X} meets the \oldconcept{InputIterator} requirements\iref{input.iterators}, -\item \tcode{X} satisfies the \oldconcept{DefaultConstructible} +\item \tcode{X} meets the \oldconcept{DefaultConstructible} requirements\iref{utility.arg.requirements}, \item if \tcode{X} is a mutable iterator, \tcode{reference} is a reference to \tcode{T}; if \tcode{X} is a constant iterator, \tcode{reference} is a reference to \tcode{const T}, -\item the expressions in \tref{iterator.forward.requirements} +\item the expressions in \tref{forwarditerator} are valid and have the indicated semantics, and \item objects of type \tcode{X} offer the multi-pass guarantee, described below. @@ -1997,7 +1999,7 @@ \begin{libreqtab4b} {\oldconcept{ForwardIterator} requirements (in addition to \oldconcept{InputIterator})} -{tab:iterator.forward.requirements} +{forwarditerator} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ & & \chdr{semantics} & \rhdr{pre-/post-condition} \\ \capsep @@ -2032,13 +2034,13 @@ \pnum A class or pointer type \tcode{X} -satisfies the requirements of a bidirectional iterator if, -in addition to satisfying the \oldconcept{ForwardIterator} requirements, -the following expressions are valid as shown in \tref{iterator.bidirectional.requirements}. +meets the requirements of a bidirectional iterator if, +in addition to meeting the \oldconcept{ForwardIterator} requirements, +the following expressions are valid as shown in \tref{bidirectionaliterator}. \begin{libreqtab4b} {\oldconcept{BidirectionalIterator} requirements (in addition to \oldconcept{ForwardIterator})} -{tab:iterator.bidirectional.requirements} +{bidirectionaliterator} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ & & \chdr{semantics} & \rhdr{pre-/post-condition} \\ \capsep @@ -2077,13 +2079,13 @@ \pnum A class or pointer type \tcode{X} -satisfies the requirements of a random access iterator if, -in addition to satisfying the \oldconcept{BidirectionalIterator} requirements, -the following expressions are valid as shown in \tref{iterator.random.access.requirements}. +meets the requirements of a random access iterator if, +in addition to meeting the \oldconcept{BidirectionalIterator} requirements, +the following expressions are valid as shown in \tref{randomaccessiterator}. \begin{libreqtab4b} {\oldconcept{RandomAccessIterator} requirements (in addition to \oldconcept{BidirectionalIterator})} -{tab:iterator.random.access.requirements} +{randomaccessiterator} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ & & \chdr{semantics} & \rhdr{pre-/post-condition} \\ \capsep @@ -3492,7 +3494,7 @@ \pnum An insert iterator is constructed from a container and possibly one of its iterators pointing to where insertion takes place if it is neither at the beginning nor at the end of the container. -Insert iterators satisfy the requirements of output iterators. +Insert iterators meet the requirements of output iterators. \tcode{operator*} returns the insert iterator itself. The assignment @@ -3748,7 +3750,7 @@ class insert_iterator { protected: Container* container = nullptr; - iterator_t iter = iterator_t(); + ranges::iterator_t iter = ranges::iterator_t(); public: using iterator_category = output_iterator_tag; @@ -3759,7 +3761,7 @@ using container_type = Container; insert_iterator() = default; - constexpr insert_iterator(Container& x, iterator_t i); + constexpr insert_iterator(Container& x, ranges::iterator_t i); constexpr insert_iterator& operator=(const typename Container::value_type& value); constexpr insert_iterator& operator=(typename Container::value_type&& value); @@ -3774,7 +3776,7 @@ \indexlibrary{\idxcode{insert_iterator}!constructor}% \begin{itemdecl} -constexpr insert_iterator(Container& x, iterator_t i); +constexpr insert_iterator(Container& x, ranges::iterator_t i); \end{itemdecl} \begin{itemdescr} @@ -3854,7 +3856,7 @@ \begin{itemdecl} template constexpr insert_iterator - inserter(Container& x, iterator_t i); + inserter(Container& x, ranges::iterator_t i); \end{itemdecl} \begin{itemdescr} diff --git a/source/lex.tex b/source/lex.tex index 1bc1a163dc..24dda44cd0 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -123,7 +123,7 @@ source file to be processed from phase 1 through phase 4, recursively. All preprocessing directives are then deleted. -\item Each source character set member in a character literal or a string +\item Each basic source character set member in a character literal or a string literal, as well as each escape sequence and \grammarterm{universal-character-name} in a character literal or a non-raw string literal, is converted to the corresponding member of the execution character set~(\ref{lex.ccon}, \ref{lex.string}); if @@ -395,9 +395,9 @@ \tcode{[} and \tcode{<:} will be different, maintaining the source spelling, but the tokens can otherwise be freely interchanged. } The set of alternative tokens is defined in -\tref{alternative.tokens}. +\tref{lex.digraph}. -\begin{tokentable}{Alternative tokens}{tab:alternative.tokens}{Alternative}{Primary} +\begin{tokentable}{Alternative tokens}{lex.digraph}{Alternative}{Primary} \tcode{<\%} & \tcode{\{} & \tcode{and} & \tcode{\&\&} & \tcode{and_eq} & \tcode{\&=} \\ \rowsep @@ -497,8 +497,11 @@ \end{bnf} \pnum -\begin{note} Header name preprocessing tokens only appear within a -\tcode{\#include} preprocessing directive (see~\ref{lex.pptoken}). \end{note} +\begin{note} Header name preprocessing tokens only appear within +a \tcode{\#include} preprocessing directive, +a \tcode{__has_include} preprocessing expression, or +after certain occurrences of an \tcode{import} token +(see~\ref{lex.pptoken}). \end{note} The sequences in both forms of \grammarterm{header-name}{s} are mapped in an \impldef{mapping header name to header or external source file} manner to headers or to external source file names as specified in~\ref{cpp.include}. @@ -580,10 +583,10 @@ An identifier is an arbitrarily long sequence of letters and digits. Each \grammarterm{universal-character-name} in an identifier shall designate a character whose encoding in ISO/IEC 10646 falls into one of the ranges -specified in \tref{charname.allowed}. +specified in \tref{lex.name.allowed}. The initial element shall not be a \grammarterm{universal-character-name} designating a character whose encoding falls into one of the ranges -specified in \tref{charname.disallowed}. +specified in \tref{lex.name.disallowed}. Upper- and lower-case letters are different. All characters are significant.\footnote{On systems in which linkers cannot accept extended characters, an encoding of the \grammarterm{universal-character-name} may be used in @@ -595,7 +598,7 @@ identifiers. In \Cpp{}, upper- and lower-case letters are considered different for all identifiers, including external identifiers. } -\begin{floattable}{Ranges of characters allowed}{tab:charname.allowed} +\begin{floattable}{Ranges of characters allowed}{lex.name.allowed} {lllll} \topline \tcode{00A8} & @@ -645,7 +648,7 @@ \\ \end{floattable} -\begin{floattable}{Ranges of characters disallowed initially (combining characters)}{tab:charname.disallowed} +\begin{floattable}{Ranges of characters disallowed initially (combining characters)}{lex.name.disallowed} {llll} \topline \tcode{0300-036F} & @@ -662,14 +665,14 @@ \indextext{\idxcode{final}}% \indextext{\idxcode{module}}% \indextext{\idxcode{override}}% -The identifiers in \tref{identifiers.special} have a special meaning when +The identifiers in \tref{lex.name.special} have a special meaning when appearing in a certain context. When referred to in the grammar, these identifiers are used explicitly rather than using the \grammarterm{identifier} grammar production. Unless otherwise specified, any ambiguity as to whether a given \grammarterm{identifier} has a special meaning is resolved to interpret the token as a regular \grammarterm{identifier}. -\begin{multicolfloattable}{Identifiers with special meaning}{tab:identifiers.special} +\begin{multicolfloattable}{Identifiers with special meaning}{lex.name.special} {lll} \keyword{audit} \\ \keyword{axiom} \\ @@ -710,11 +713,11 @@ \enlargethispage{\baselineskip}% \pnum \indextext{keyword|(}% -The identifiers shown in \tref{keywords} are reserved for use +The identifiers shown in \tref{lex.key} are reserved for use as keywords (that is, they are unconditionally treated as keywords in phase 7) except in an \grammarterm{attribute-token}\iref{dcl.attr.grammar}: -\begin{multicolfloattable}{Keywords}{tab:keywords} +\begin{multicolfloattable}{Keywords}{lex.key} {lllll} \keyword{alignas} \\ \keyword{alignof} \\ @@ -807,12 +810,12 @@ \pnum Furthermore, the alternative representations shown in -\tref{alternative.representations} for certain operators and +\tref{lex.key.digraph} for certain operators and punctuators\iref{lex.digraph} are reserved and shall not be used otherwise: -\begin{floattable}{Alternative representations}{tab:alternative.representations} +\begin{floattable}{Alternative representations}{lex.key.digraph} {llllll} \topline \keyword{and} & \keyword{and_eq} & \keyword{bitand} & \keyword{bitor} & \keyword{compl} & \keyword{not} \\ @@ -1003,11 +1006,11 @@ \indextext{suffix!\idxcode{l}}% \indextext{suffix!\idxcode{u}}% The type of an integer literal is the first of the corresponding list -in \tref{lex.type.integer.literal} in which its value can be +in \tref{lex.icon.type} in which its value can be represented. \enlargethispage{\baselineskip}% -\begin{LongTable}{Types of integer literals}{tab:lex.type.integer.literal}{l|l|l} +\begin{LongTable}{Types of integer literals}{lex.icon.type}{l|l|l} \\ \topline \lhdr{Suffix} & \chdr{Decimal literal} & \rhdr{Binary, octal, or hexadecimal literal} \\ \capsep \endfirsthead @@ -1106,7 +1109,7 @@ \begin{bnf} \nontermdef{c-char}\br - \textnormal{any member of the source character set except the single-quote \terminal{'}, backslash \terminal{\textbackslash}, or new-line character}\br + \textnormal{any member of the basic source character set except the single-quote \terminal{'}, backslash \terminal{\textbackslash}, or new-line character}\br escape-sequence\br universal-character-name \end{bnf} @@ -1252,7 +1255,7 @@ \indextext{\idxcode{\textbackslash}|see{backslash character}}% \indextext{escape character|see{backslash character}}% \tcode{\textbackslash}, can be represented according to -\tref{escape.sequences}. +\tref{lex.ccon.esc}. \indextext{escape sequence!undefined}% The double quote \tcode{"} and the question mark \tcode{?}, can be represented as themselves or by the escape sequences @@ -1261,11 +1264,11 @@ shall be represented by the escape sequences \tcode{\textbackslash'} and \tcode{\textbackslash\textbackslash} respectively. Escape sequences in which the character following the backslash is not listed in -\tref{escape.sequences} are conditionally-supported, with \impldef{semantics of +\tref{lex.ccon.esc} are conditionally-supported, with \impldef{semantics of non-standard escape sequences} semantics. An escape sequence specifies a single character. -\begin{floattable}{Escape sequences}{tab:escape.sequences} +\begin{floattable}{Escape sequences}{lex.ccon.esc} {llm} \topline new-line & NL(LF) & \tcode{\textbackslash n} \\ @@ -1457,7 +1460,7 @@ \begin{bnf} \nontermdef{s-char}\br - \textnormal{any member of the source character set except the double-quote \terminal{"}, backslash \terminal{\textbackslash}, or new-line character}\br + \textnormal{any member of the basic source character set except the double-quote \terminal{"}, backslash \terminal{\textbackslash}, or new-line character}\br escape-sequence\br universal-character-name \end{bnf} @@ -1662,7 +1665,7 @@ \end{note} \tref{lex.string.concat} has some examples of valid concatenations. -\begin{floattable}{String literal concatenations}{tab:lex.string.concat} +\begin{floattable}{String literal concatenations}{lex.string.concat} {lll|lll|lll} \topline \multicolumn{2}{|c}{Source} & diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 02141c4041..049ba253ce 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -22,24 +22,27 @@ \ref{\firstlibchapter}--\ref{\lastlibchapter}, as shown in \tref{library.categories}. -\begin{libsumtabbase}{Library categories}{tab:library.categories}{Clause}{Category} -\ref{language.support} & & Language support library \\ -\ref{concepts} & & Concepts library \\ -\ref{diagnostics} & & Diagnostics library \\ -\ref{utilities} & & General utilities library \\ -\ref{strings} & & Strings library \\ -\ref{containers} & & Containers library \\ -\ref{iterators} & & Iterators library \\ -\ref{ranges} & & Ranges library \\ -\ref{algorithms} & & Algorithms library \\ -\ref{numerics} & & Numerics library \\ -\ref{time} & & Time library \\ -\ref{localization} & & Localization library \\ -\ref{input.output} & & Input/output library \\ -\ref{re} & & Regular expressions library \\ -\ref{atomics} & & Atomic operations library \\ -\ref{thread} & & Thread support library \\ -\end{libsumtabbase} +\begin{floattable}{Library categories}{library.categories} +{ll} +\topline +\hdstyle{Clause} & \hdstyle{Category} \\ \capsep +\ref{language.support} & Language support library \\ +\ref{concepts} & Concepts library \\ +\ref{diagnostics} & Diagnostics library \\ +\ref{utilities} & General utilities library \\ +\ref{strings} & Strings library \\ +\ref{containers} & Containers library \\ +\ref{iterators} & Iterators library \\ +\ref{ranges} & Ranges library \\ +\ref{algorithms} & Algorithms library \\ +\ref{numerics} & Numerics library \\ +\ref{time} & Time library \\ +\ref{localization} & Localization library \\ +\ref{input.output} & Input/output library \\ +\ref{re} & Regular expressions library \\ +\ref{atomics} & Atomic operations library \\ +\ref{thread} & Thread support library \\ +\end{floattable} \pnum The language support library\iref{language.support} provides components that are @@ -478,7 +481,7 @@ \item Template arguments \item Derived classes \item Containers, iterators, and algorithms that meet an interface convention or - satisfy a concept + model a concept \end{itemize} \pnum @@ -494,7 +497,7 @@ \pnum Requirements are stated in terms of well-defined expressions that define valid terms of -the types that satisfy the requirements. For every set of well-defined expression +the types that meet the requirements. For every set of well-defined expression requirements there is either a named concept or a table that specifies an initial set of the valid expressions and their semantics. Any generic algorithm\iref{algorithms} that uses the well-defined expression requirements is described in terms of the valid expressions for @@ -505,7 +508,7 @@ requirements. Names in \textit{italic} type that begin with the prefix \oldconcept{} refer to sets of well-defined expression requirements typically presented in tabular form, possibly with additional prose semantic requirements. -For example, \oldconcept{Destructible}~(\tref{destructible}) is such a named +For example, \oldconcept{Destructible}~(\tref{cpp17.destructible}) is such a named requirement. Names in \tcode{constant width} type refer to library concepts which are presented as a concept definition\iref{temp}, possibly with additional prose semantic requirements. For example, @@ -527,13 +530,13 @@ \pnum Required operations of any concept defined in this document need not be total functions; that is, some arguments to a required operation may -result in the required semantics failing to be satisfied. +result in the required semantics failing to be met. \begin{example} The required \tcode{<} operator of the \libconcept{StrictTotallyOrdered} concept\iref{concept.stricttotallyordered} does not meet the semantic requirements of that concept when operating on NaNs. \end{example} -This does not affect whether a type satisfies the concept. +This does not affect whether a type models the concept. \pnum A declaration may explicitly impose requirements through its associated @@ -677,7 +680,7 @@ \pnum Complexity requirements specified in the library clauses are upper bounds, -and implementations that provide better complexity guarantees satisfy +and implementations that provide better complexity guarantees meet the requirements. \pnum @@ -712,6 +715,7 @@ \pnum The following function is defined for exposition only to aid in the specification of the library: +\indexlibrary{decay-copy@\tcode{\placeholder{decay-copy}}}% \begin{codeblock} template constexpr decay_t @\placeholdernc{decay-copy}@(T&& v) noexcept(is_nothrow_convertible_v>) // \expos @@ -993,7 +997,7 @@ enforcing semantic requirements on that interaction. \pnum -The type of a customization point object shall satisfy +The type of a customization point object shall model \libconcept{Semiregular}\iref{concepts.object}. \pnum @@ -1001,7 +1005,7 @@ be equal\iref{concepts.equality}. \pnum -The type \tcode{T} of a customization point object shall satisfy +The type \tcode{T} of a customization point object shall model \tcode{\libconcept{Invocable}}\iref{concept.invocable} when the types in \tcode{Args...} meet the requirements specified in that customization point object's definition. When the types of \tcode{Args...} do @@ -1009,7 +1013,7 @@ a function call operator that participates in overload resolution. \pnum -Each customization point object type constrains its return type to satisfy a +Each customization point object type constrains its return type to model a particular concept. \pnum @@ -1059,7 +1063,7 @@ \begin{itemdescr} \pnum \requires -Type \tcode{T} is \oldconcept{EqualityComparable} (\tref{equalitycomparable}). +Type \tcode{T} is \oldconcept{EqualityComparable} (\tref{cpp17.equalitycomparable}). \pnum \returns @@ -1074,7 +1078,7 @@ \begin{itemdescr} \pnum \requires -Type \tcode{T} is \oldconcept{LessThanComparable} (\tref{lessthancomparable}). +Type \tcode{T} is \oldconcept{LessThanComparable} (\tref{cpp17.lessthancomparable}). \pnum \returns @@ -1089,7 +1093,7 @@ \begin{itemdescr} \pnum \requires -Type \tcode{T} is \oldconcept{LessThanComparable} (\tref{lessthancomparable}). +Type \tcode{T} is \oldconcept{LessThanComparable} (\tref{cpp17.lessthancomparable}). \pnum \returns @@ -1104,7 +1108,7 @@ \begin{itemdescr} \pnum \requires -Type \tcode{T} is \oldconcept{LessThanComparable} (\tref{lessthancomparable}). +Type \tcode{T} is \oldconcept{LessThanComparable} (\tref{cpp17.lessthancomparable}). \pnum \returns @@ -1208,9 +1212,9 @@ \pnum The \Cpp{} standard library provides the \defnx{\Cpp{} library headers}{header!C++ library}, -shown in \tref{cpp.library.headers}. +shown in \tref{headers.cpp}. -\begin{multicolfloattable}{\Cpp{} library headers}{tab:cpp.library.headers} +\begin{multicolfloattable}{\Cpp{} library headers}{headers.cpp} {llll} \tcode{} \\ \tcode{} \\ @@ -1290,14 +1294,14 @@ \pnum The facilities of the C standard library are provided in the \indextext{library!C standard}% -additional headers shown in \tref{cpp.c.headers}.% +additional headers shown in \tref{headers.cpp.c}.% \footnote{It is intentional that there is no \Cpp{} header for any of these C headers: \tcode{}\indextext{\idxhdr{stdatomic.h}!absence thereof}, \tcode{}\indextext{\idxhdr{stdnoreturn.h}!absence thereof}, \tcode{}\indextext{\idxhdr{threads.h}!absence thereof}.} -\begin{multicolfloattable}{\Cpp{} headers for C library facilities}{tab:cpp.c.headers} +\begin{multicolfloattable}{\Cpp{} headers for C library facilities}{headers.cpp.c} {lllllll} \tcode{} \\ \tcode{} \\ @@ -1391,7 +1395,7 @@ that may be declared in some header. These names are also subject to the restrictions of~\ref{macro.names}. -\begin{multicolfloattable}{C standard Annex K names}{tab:c.annex.k.names} +\begin{multicolfloattable}{C standard Annex K names}{c.annex.k.names} {llll} \tcode{abort_handler_s} \\ \tcode{asctime_s} \\ @@ -1487,11 +1491,12 @@ \pnum A freestanding implementation\indextext{implementation!freestanding} has an \impldef{headers for freestanding implementation} set of headers. This set shall -include at least the headers shown in \tref{cpp.headers.freestanding}. +include at least the headers shown in \tref{headers.cpp.fs}. -\begin{libsumtab}{\Cpp{} headers for freestanding implementations}{tab:cpp.headers.freestanding} +\begin{libsumtab}{\Cpp{} headers for freestanding implementations}{headers.cpp.fs} \ref{support.types} & Types & \tcode{} \\ \rowsep -\ref{support.limits} & Implementation properties & \tcode{} \tcode{} \tcode{} \tcode{} \\ \rowsep +\ref{support.limits} & Implementation properties & + \tcode{}, \tcode{}, \tcode{}, \tcode{} \\ \rowsep \ref{cstdint} & Integer types & \tcode{} \\ \rowsep \ref{support.start.term} & Start and termination & \tcode{} \\ \rowsep \ref{support.dynamic} & Dynamic memory management & \tcode{} \\ \rowsep @@ -1625,7 +1630,7 @@ \pnum The template definitions in the \Cpp{} standard library refer to various named requirements whose details are set out in -Tables~\ref{tab:equalitycomparable}--\ref{tab:destructible}. +Tables~\ref{tab:cpp17.equalitycomparable}--\ref{tab:cpp17.destructible}. In these tables, \tcode{T} is an object or reference type to be supplied by a \Cpp{} program instantiating a template; \tcode{a}, @@ -1644,7 +1649,7 @@ signatures is called using the default argument\iref{dcl.fct.default}. \indextext{requirements!\idxoldconcept{EqualityComparable}}% -\begin{concepttable}{\oldconcept{EqualityComparable} requirements}{equalitycomparable} +\begin{concepttable}{\oldconcept{EqualityComparable} requirements}{cpp17.equalitycomparable} {x{1in}x{1in}p{3in}} \topline \hdstyle{Expression} & \hdstyle{Return type} & \rhdr{Requirement} \\ \capsep @@ -1663,7 +1668,7 @@ \end{concepttable} \indextext{requirements!\idxoldconcept{LessThanComparable}}% -\begin{concepttable}{\oldconcept{LessThanComparable} requirements}{lessthancomparable} +\begin{concepttable}{\oldconcept{LessThanComparable} requirements}{cpp17.lessthancomparable} {x{1in}x{1in}p{3in}} \topline \hdstyle{Expression} & \hdstyle{Return type} & \hdstyle{Requirement} \\ \capsep @@ -1674,7 +1679,7 @@ \enlargethispage{-3\baselineskip} \indextext{requirements!\idxoldconcept{DefaultConstructible}}% -\begin{concepttable}{\oldconcept{DefaultConstructible} requirements}{defaultconstructible} +\begin{concepttable}{\oldconcept{DefaultConstructible} requirements}{cpp17.defaultconstructible} {x{2.15in}p{3in}} \topline \hdstyle{Expression} & \hdstyle{Post-condition} \\ \capsep @@ -1685,7 +1690,7 @@ \end{concepttable} \indextext{requirements!\idxoldconcept{MoveConstructible}}% -\begin{concepttable}{\oldconcept{MoveConstructible} requirements}{moveconstructible} +\begin{concepttable}{\oldconcept{MoveConstructible} requirements}{cpp17.moveconstructible} {p{1in}p{4.15in}} \topline \hdstyle{Expression} & \hdstyle{Post-condition} \\ \capsep @@ -1700,7 +1705,7 @@ \end{concepttable} \indextext{requirements!\idxoldconcept{CopyConstructible}}% -\begin{concepttable}{\oldconcept{CopyConstructible} requirements (in addition to \oldconcept{MoveConstructible})}{copyconstructible} +\begin{concepttable}{\oldconcept{CopyConstructible} requirements (in addition to \oldconcept{MoveConstructible})}{cpp17.copyconstructible} {p{1in}p{4.15in}} \topline \hdstyle{Expression} & \hdstyle{Post-condition} \\ \capsep @@ -1710,7 +1715,7 @@ \end{concepttable} \indextext{requirements!\idxoldconcept{MoveAssignable}}% -\begin{concepttable}{\oldconcept{MoveAssignable} requirements}{moveassignable} +\begin{concepttable}{\oldconcept{MoveAssignable} requirements}{cpp17.moveassignable} {p{1in}p{1in}p{1in}p{1.9in}} \topline \hdstyle{Expression} & \hdstyle{Return type} & \hdstyle{Return value} & \hdstyle{Post-condition} \\ \capsep @@ -1726,7 +1731,7 @@ \end{concepttable} \indextext{requirements!\idxoldconcept{CopyAssignable}}% -\begin{concepttable}{\oldconcept{CopyAssignable} requirements (in addition to \oldconcept{MoveAssignable})}{copyassignable} +\begin{concepttable}{\oldconcept{CopyAssignable} requirements (in addition to \oldconcept{MoveAssignable})}{cpp17.copyassignable} {p{1in}p{1in}p{1in}p{1.9in}} \topline \hdstyle{Expression} & \hdstyle{Return type} & \hdstyle{Return value} & \hdstyle{Post-condition} \\ \capsep @@ -1734,7 +1739,7 @@ \end{concepttable} \indextext{requirements!\idxoldconcept{Destructible}} -\begin{concepttable}{\oldconcept{Destructible} requirements}{destructible} +\begin{concepttable}{\oldconcept{Destructible} requirements}{cpp17.destructible} {p{1in}p{4.15in}} \topline \hdstyle{Expression} & \hdstyle{Post-condition} \\ \capsep @@ -1790,8 +1795,8 @@ swappable with any rvalue or lvalue, respectively, of type \tcode{T}. \pnum -A type \tcode{X} satisfying any of the iterator requirements\iref{iterator.requirements} -satisfies the \oldconcept{ValueSwappable} requirements if, +A type \tcode{X} meeting any of the iterator requirements\iref{iterator.requirements} +meets the \oldconcept{ValueSwappable} requirements if, for any dereferenceable object \tcode{x} of type \tcode{X}, \tcode{*x} is swappable. @@ -1844,19 +1849,19 @@ \pnum A \oldconcept{NullablePointer} type is a pointer-like type that supports null values. -A type \tcode{P} satisfies the \oldconcept{\-Nullable\-Pointer} requirements if: +A type \tcode{P} meets the \oldconcept{\-Nullable\-Pointer} requirements if: \begin{itemize} -\item \tcode{P} satisfies the \oldconcept{EqualityComparable}, +\item \tcode{P} meets the \oldconcept{EqualityComparable}, \oldconcept{DefaultConstructible}, \oldconcept{CopyConstructible}, \oldconcept{\-Copy\-Assign\-able}, and \oldconcept{Destructible} requirements, \item lvalues of type \tcode{P} are swappable\iref{swappable.requirements}, -\item the expressions shown in \tref{nullablepointer} are +\item the expressions shown in \tref{cpp17.nullablepointer} are valid and have the indicated semantics, and -\item \tcode{P} satisfies all the other requirements of this subclause. +\item \tcode{P} meets all the other requirements of this subclause. \end{itemize} \pnum @@ -1875,13 +1880,13 @@ via an exception. \pnum -In \tref{nullablepointer}, \tcode{u} denotes an identifier, \tcode{t} +In \tref{cpp17.nullablepointer}, \tcode{u} denotes an identifier, \tcode{t} denotes a non-\tcode{const} lvalue of type \tcode{P}, \tcode{a} and \tcode{b} denote values of type (possibly \tcode{const}) \tcode{P}, and \tcode{np} denotes a value of type (possibly \tcode{const}) \tcode{std::nullptr_t}. \indextext{requirements!\idxoldconcept{NullablePointer}}% -\begin{concepttable}{\oldconcept{NullablePointer} requirements}{nullablepointer} +\begin{concepttable}{\oldconcept{NullablePointer} requirements}{cpp17.nullablepointer} {lll} \topline Expression & Return type & Operational semantics \\ \capsep @@ -1926,19 +1931,19 @@ \begin{itemize} \item it is a function object type\iref{function.objects}, -\item it satisfies the \oldconcept{CopyConstructible} (\tref{copyconstructible}) and - \oldconcept{Destructible} (\tref{destructible}) requirements, and -\item the expressions shown in \tref{hash} +\item it meets the \oldconcept{CopyConstructible} (\tref{cpp17.copyconstructible}) and + \oldconcept{Destructible} (\tref{cpp17.destructible}) requirements, and +\item the expressions shown in \tref{cpp17.hash} are valid and have the indicated semantics. \end{itemize} \pnum Given \tcode{Key} is an argument type for function objects of type \tcode{H}, in -\tref{hash} \tcode{h} is a value of type (possibly \tcode{const}) \tcode{H}, +\tref{cpp17.hash} \tcode{h} is a value of type (possibly \tcode{const}) \tcode{H}, \tcode{u} is an lvalue of type \tcode{Key}, and \tcode{k} is a value of a type convertible to (possibly \tcode{const}) \tcode{Key}. -\begin{concepttable}{\oldconcept{Hash} requirements}{hash} +\begin{concepttable}{\oldconcept{Hash} requirements}{cpp17.hash} {llp{.55\hsize}} \topline Expression & Return type & Requirement \\ \capsep @@ -1974,24 +1979,24 @@ \pnum The class template \tcode{allocator_traits}\iref{allocator.traits} supplies a uniform interface to all allocator types. -\tref{desc.var.def} describes the types manipulated -through allocators. \tref{utilities.allocator.requirements} +\tref{allocator.req.var} describes the types manipulated +through allocators. \tref{cpp17.allocator} describes the requirements on allocator types and thus on types used to instantiate \tcode{allocator_traits}. A requirement is optional if the last column of -\tref{utilities.allocator.requirements} specifies a default for a +\tref{cpp17.allocator} specifies a default for a given expression. Within the standard library \tcode{allocator_traits} template, an optional requirement that is not supplied by an allocator is replaced by the specified default expression. A user specialization of \tcode{allocator_traits} may provide different defaults and may provide defaults for different requirements than the primary template. Within -Tables~\ref{tab:desc.var.def} and~\ref{tab:utilities.allocator.requirements}, +Tables~\ref{tab:allocator.req.var} and~\ref{tab:cpp17.allocator}, the use of \tcode{move} and \tcode{forward} always refers to \tcode{std::move} and \tcode{std::forward}, respectively. \begin{libreqtab2} {Descriptive variable definitions} -{tab:desc.var.def} +{allocator.req.var} \\ \topline \lhdr{Variable} & \rhdr{Definition} \\ \capsep \endfirsthead @@ -2026,9 +2031,11 @@ \tcode{args} & a function parameter pack with the pattern \tcode{Args\&\&} \\ \end{libreqtab2} +\clearpage + \begin{libreqtab4d} {\oldconcept{Allocator} requirements} -{tab:utilities.allocator.requirements} +{cpp17.allocator} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Assertion/note} & \rhdr{Default} \\ & & \chdr{pre-/post-condition} & \\ \capsep @@ -2239,12 +2246,12 @@ \pnum Note B: If \tcode{X::propagate_on_container_copy_assignment::value} is \tcode{true}, -\tcode{X} shall satisfy the -\oldconcept{\-Copy\-Assign\-able} requirements (\tref{copyassignable}) +\tcode{X} shall meet the +\oldconcept{\-Copy\-Assign\-able} requirements (\tref{cpp17.copyassignable}) and the copy operation shall not throw exceptions. If \tcode{X::propagate_on_container_move_assignment::value} is \tcode{true}, -\tcode{X} shall satisfy the -\oldconcept{\-Move\-Assign\-able} requirements (\tref{moveassignable}) +\tcode{X} shall meet the +\oldconcept{\-Move\-Assign\-able} requirements (\tref{cpp17.moveassignable}) and the move operation shall not throw exceptions. If \tcode{X::propagate_on_container_swap::value} is \tcode{true}, lvalues of type \tcode{X} shall be swappable\iref{swappable.requirements} @@ -2252,10 +2259,10 @@ \pnum An allocator type \tcode{X} shall meet the -\oldconcept{CopyConstructible} requirements (\tref{copyconstructible}). +\oldconcept{CopyConstructible} requirements (\tref{cpp17.copyconstructible}). The \tcode{X::pointer}, \tcode{X::const_pointer}, \tcode{X::void_pointer}, and \tcode{X::const_void_pointer} types shall meet the -\oldconcept{Nullable\-Pointer} requirements (\tref{nullablepointer}). +\oldconcept{Nullable\-Pointer} requirements (\tref{cpp17.nullablepointer}). No constructor, comparison function, copy operation, move operation, or swap operation on these pointer types shall exit via an exception. \tcode{X::pointer} and \tcode{X::const_pointer} shall also @@ -2319,8 +2326,8 @@ \pnum \begin{example} The following is an allocator class template supporting the minimal -interface that satisfies the requirements of -\tref{utilities.allocator.requirements}: +interface that meets the requirements of +\tref{cpp17.allocator}: \begin{codeblock} template @@ -2345,7 +2352,7 @@ \pnum If \tcode{X} is an allocator class for type \tcode{T}, -\tcode{X} additionally satisfies the allocator completeness requirements if, +\tcode{X} additionally meets the allocator completeness requirements if, whether or not \tcode{T} is a complete type: \begin{itemize} @@ -2624,7 +2631,7 @@ A translation unit shall not \tcode{\#define} or \tcode{\#undef} names lexically identical to keywords, -to the identifiers listed in \tref{identifiers.special}, +to the identifiers listed in \tref{lex.name.special}, to the \grammarterm{attribute-token}{s} described in~\ref{dcl.attr}, or to the identifiers \tcode{expects} or \tcode{ensures}, except that the names \tcode{likely} and \tcode{unlikely} may be @@ -2988,7 +2995,7 @@ \rSec3[res.on.requirements]{Semantic requirements} \pnum If the semantic requirements of a declaration's -constraints\iref{structure.requirements} are not satisfied at the point of use, +constraints\iref{structure.requirements} are not modeled at the point of use, the program is ill-formed, no diagnostic required. \rSec2[conforming]{Conforming implementations} diff --git a/source/locales.tex b/source/locales.tex index 542130dfc6..06c5c740cd 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -14,11 +14,11 @@ \pnum The following subclauses describe components for locales themselves, the standard facets, and facilities -from the ISO C library, as summarized in \tref{localization.lib.summary}. +from the ISO C library, as summarized in \tref{localization.summary}. -\begin{libsumtab}{Localization library summary}{tab:localization.lib.summary} +\begin{libsumtab}{Localization library summary}{localization.summary} \ref{locales} & Locales & \tcode{} \\ -\ref{locale.categories} & Standard \tcode{locale} Categories & \\ \rowsep +\ref{locale.categories} & Standard \tcode{locale} categories & \\ \rowsep \ref{c.locales} & C library locales & \tcode{} \\ \end{libsumtab} @@ -340,9 +340,9 @@ value identifies a set of locale categories. Each locale category, in turn, identifies a set of locale facets, including at least those -shown in \tref{localization.category.facets}. +shown in \tref{locale.category.facets}. -\begin{floattable}{Locale category facets}{tab:localization.category.facets} +\begin{floattable}{Locale category facets}{locale.category.facets} {ml} \topline \lhdr{Category} & \rhdr{Includes facets} \\ \capsep @@ -369,7 +369,7 @@ either constructed, or returned by \tcode{locale::classic()}, and any facet \tcode{Facet} -shown in \tref{localization.category.facets}, +shown in \tref{locale.category.facets}, \tcode{has_facet(loc)} is \tcode{true}. Each @@ -381,9 +381,9 @@ \pnum An implementation is required to provide those specializations for facet templates identified as members of a category, and for those -shown in \tref{localization.required.specializations}. +shown in \tref{locale.spec}. -\begin{floattable}{Required specializations}{tab:localization.required.specializations} +\begin{floattable}{Required specializations}{locale.spec} {ml} \topline \lhdr{Category} & \rhdr{Includes facets} \\ \capsep @@ -439,7 +439,7 @@ or \tcode{OutputIterator} indicates the set of -all possible specializations on parameters that satisfy the +all possible specializations on parameters that meet the \oldconcept{InputIterator} requirements or \oldconcept{OutputIterator} requirements, respectively\iref{iterator.requirements}. A template parameter with name @@ -447,7 +447,7 @@ represents the set of types containing \tcode{char}, \tcode{wchar_t}, and any other \impldef{set of character types that iostreams templates can be instantiated for} -character types that satisfy +character types that meet the requirements for a character on which any of the iostream components can be instantiated. A template parameter with name @@ -836,7 +836,7 @@ \remarks This member operator template (and therefore \tcode{locale} -itself) satisfies requirements for a comparator predicate template argument\iref{algorithms} +itself) meets the requirements for a comparator predicate template argument\iref{algorithms} applied to strings. \pnum @@ -1174,7 +1174,7 @@ for character classing during input parsing. \pnum -The specializations required in \tref{localization.category.facets}\iref{locale.category}, namely +The specializations required in \tref{locale.category.facets}\iref{locale.category}, namely \tcode{ctype} and \tcode{ctype}, @@ -1895,7 +1895,7 @@ argument selects the pair of character encodings being mapped between. \pnum -The specializations required in \tref{localization.category.facets}\iref{locale.category} +The specializations required in \tref{locale.category.facets}\iref{locale.category} convert the implementation-defined native character set. \tcode{codecvt} implements a degenerate conversion; @@ -2111,9 +2111,9 @@ \pnum \returns -An enumeration value, as summarized in \tref{localization.convert.result.values.out.in}. +An enumeration value, as summarized in \tref{locale.codecvt.inout}. -\begin{floattable}{\tcode{do_in/do_out} result values}{tab:localization.convert.result.values.out.in} +\begin{floattable}{\tcode{do_in/do_out} result values}{locale.codecvt.inout} {lp{3in}} \topline \lhdr{Value} & \rhdr{Meaning} \\ \capsep @@ -2163,9 +2163,9 @@ \pnum \returns -An enumeration value, as summarized in \tref{localization.convert.result.values.unshift}. +An enumeration value, as summarized in \tref{locale.codecvt.unshift}. -\begin{floattable}{\tcode{do_unshift} result values}{tab:localization.convert.result.values.unshift} +\begin{floattable}{\tcode{do_unshift} result values}{locale.codecvt.unshift} {lp{.50\hsize}} \topline \lhdr{Value} & \rhdr{Meaning} \\ \capsep @@ -2318,8 +2318,8 @@ and \tcode{num_get} in the subclauses of~\ref{category.numeric} only apply to the -specializations required in Tables~\ref{tab:localization.category.facets} -and~\ref{tab:localization.required.specializations}\iref{locale.category}, namely +specializations required in Tables~\ref{tab:locale.category.facets} +and~\ref{tab:locale.spec}\iref{locale.category}, namely \tcode{num_get}, \tcode{num_get}, \tcode{num_get}, @@ -2522,11 +2522,11 @@ For conversion to an integral type, the function determines the integral conversion specifier as indicated in -\tref{localization.integer.conversions.in}. +\tref{facet.num.get.int}. The table is ordered. That is, the first line whose condition is true applies. -\begin{floattable}{Integer conversions}{tab:localization.integer.conversions.in} +\begin{floattable}{Integer conversions}{facet.num.get.int} {lc} \topline \lhdr{State} & \tcode{stdio} equivalent \\ \capsep @@ -2546,9 +2546,9 @@ \tcode{\%p}. A length modifier is added to the conversion specification, if needed, -as indicated in \tref{localization.length.modifier.in}. +as indicated in \tref{facet.num.get.length}. -\begin{floattable}{Length modifier}{tab:localization.length.modifier.in} +\begin{floattable}{Length modifier}{facet.num.get.length} {lc} \topline \lhdr{Type} & Length modifier \\ \capsep @@ -2908,9 +2908,9 @@ For conversion from an integral type other than a character type, the function determines the integral conversion specifier as indicated in -\tref{localization.integer.conversions.out}. +\tref{facet.num.put.int}. -\begin{floattable}{Integer conversions}{tab:localization.integer.conversions.out} +\begin{floattable}{Integer conversions}{facet.num.put.int} {lc} \topline \lhdr{State} & \tcode{stdio} equivalent \\ \capsep @@ -2922,9 +2922,9 @@ \end{floattable} For conversion from a floating-point type, the function determines -the floating-point conversion specifier as indicated in \tref{localization.fp.conversions.out}. +the floating-point conversion specifier as indicated in \tref{facet.num.put.fp}. -\begin{floattable}{Floating-point conversions}{tab:localization.fp.conversions.out} +\begin{floattable}{Floating-point conversions}{facet.num.put.fp} {lc} \topline \lhdr{State} & \tcode{stdio} equivalent \\ \capsep @@ -2939,9 +2939,9 @@ For conversions from an integral or floating-point type a length modifier is added to the -conversion specifier as indicated in \tref{localization.length.modifier.out}. +conversion specifier as indicated in \tref{facet.num.put.length}. -\begin{floattable}{Length modifier}{tab:localization.length.modifier.out} +\begin{floattable}{Length modifier}{facet.num.put.length} {lc} \topline \lhdr{Type} & Length modifier \\ \capsep @@ -2954,9 +2954,9 @@ \end{floattable} The conversion specifier has the following optional additional qualifiers -prepended as indicated in \tref{localization.numeric.conversions}. +prepended as indicated in \tref{facet.num.put.conv}. -\begin{floattable}{Numeric conversions}{tab:localization.numeric.conversions} +\begin{floattable}{Numeric conversions}{facet.num.put.conv} {llc} \topline \lhdr{Type(s)} & \chdr{State} & \tcode{stdio} equivalent \\ \capsep @@ -3018,9 +3018,9 @@ \tcode{0} which is \textit{not} -a padding character.} is determined according to \tref{localization.fill.padding}. +a padding character.} is determined according to \tref{facet.num.put.fill}. -\begin{floattable}{Fill padding}{tab:localization.fill.padding} +\begin{floattable}{Fill padding}{facet.num.put.fill} {p{3in}l} \topline \lhdr{State} & \rhdr{Location} \\ \capsep @@ -3126,7 +3126,7 @@ \pnum \tcode{numpunct<>} specifies numeric punctuation. -The specializations required in \tref{localization.category.facets}\iref{locale.category}, namely +The specializations required in \tref{locale.category.facets}\iref{locale.category}, namely \tcode{numpunct<\brk{}wchar_t>} and \tcode{numpunct}, @@ -3368,7 +3368,7 @@ \tcode{operator()}, uses the collate facet to allow a locale to act directly as the predicate argument for standard algorithms\iref{algorithms} and containers operating on strings. -The specializations required in \tref{localization.category.facets}\iref{locale.category}, namely +The specializations required in \tref{locale.category.facets}\iref{locale.category}, namely \tcode{collate} and \tcode{collate}, @@ -3431,7 +3431,7 @@ if the first string is greater than the second, \tcode{-1} if less, zero otherwise. -The specializations required in \tref{localization.category.facets}\iref{locale.category}, namely +The specializations required in \tref{locale.category.facets}\iref{locale.category}, namely \tcode{collate} and \tcode{collate}, @@ -3509,8 +3509,8 @@ and \tcode{time_get} in the subclauses of~\ref{category.time} only apply to the -specializations required in Tables~\ref{tab:localization.category.facets} -and~\ref{tab:localization.required.specializations}\iref{locale.category}. +specializations required in Tables~\ref{tab:locale.category.facets} +and~\ref{tab:locale.spec}\iref{locale.category}. Their members use their \tcode{ios_base\&}, \tcode{ios_base::iostate\&}, @@ -3811,9 +3811,9 @@ to produce one of the following formats, or until it encounters an error. The format depends on the value returned by \tcode{date_order()} as shown in -\tref{lib.locale.time.get.virtuals.dogetdate}. +\tref{locale.time.get.dogetdate}. -\begin{libtab2}{\tcode{do_get_date} effects}{tab:lib.locale.time.get.virtuals.dogetdate} +\begin{libtab2}{\tcode{do_get_date} effects}{locale.time.get.dogetdate} {ll}{\tcode{date_order()}}{Format} \tcode{no_order} & \tcode{"\%m\%d\%y"} \\ \tcode{dmy} & \tcode{"\%d\%m\%y"} \\ @@ -4118,8 +4118,8 @@ and \tcode{money_get} in the subclauses of~\ref{category.monetary} only apply to the -specializations required in Tables~\ref{tab:localization.category.facets} -and~\ref{tab:localization.required.specializations}\iref{locale.category}. +specializations required in Tables~\ref{tab:locale.category.facets} +and~\ref{tab:locale.spec}\iref{locale.category}. Their members use their \tcode{ios_base\&}, \tcode{ios_base::io\-state\&}, @@ -4825,7 +4825,7 @@ \begin{itemdescr} \pnum \returns -The specializations required in \tref{localization.required.specializations}\iref{locale.category}, namely +The specializations required in \tref{locale.spec}\iref{locale.category}, namely \tcode{moneypunct}, \tcode{moneypunct<\brk{}wchar_t>}, \tcode{moneypunct}, @@ -5083,7 +5083,7 @@ \begin{floattable} {Potential \tcode{setlocale} data races} -{tab:setlocale.data.races} +{setlocale.data.races} {lllll} \topline diff --git a/source/macros.tex b/source/macros.tex index a17d45b4ea..0659030280 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -272,7 +272,9 @@ \newcommand{\iref}[1]{\nolinebreak[3] (\ref{#1})} %% Inline non-parenthesized table reference (override memoir's \tref) -\renewcommand{\tref}[1]{\tablerefname \nolinebreak[3] \ref{tab:#1}} +\renewcommand{\tref}[1]{\hyperref[tab:#1]{\tablerefname \nolinebreak[3] \ref*{tab:#1}}} +%% Inline non-parenthesized figure reference (override memoir's \fref) +\renewcommand{\fref}[1]{\hyperref[fig:#1]{\figurerefname \nolinebreak[3] \ref*{fig:#1}}} %% NTBS, etc. \newcommand{\NTS}[1]{\textsc{#1}} @@ -545,7 +547,7 @@ \includegraphics[scale=.35]{#3} } { -\caption{\cptn}\label{\lbl}% +\caption{\cptn \quad [fig:\lbl]}\label{fig:\lbl}% \end{figure}} %%-------------------------------------------------- diff --git a/source/modules.tex b/source/modules.tex index b5b476e404..f36a1c3c7e 100644 --- a/source/modules.tex +++ b/source/modules.tex @@ -132,7 +132,7 @@ \begin{itemize} \item is a replaceable global allocation or deallocation function (\ref{new.delete.single}, \ref{new.delete.array}), or -\item is a \grammarterm{namespace-declaration} with external linkage, or +\item is a \grammarterm{namespace-definition} with external linkage, or \item appears within a \grammarterm{linkage-specification}, \end{itemize} it is attached to the global module. @@ -560,16 +560,18 @@ \end{bnf} \pnum -A \grammarterm{global-module-fragment} specifies the contents of the -\defn{global module fragment} for a module unit. -The global module fragment can be used to provide declarations -that are attached to the global module and usable within the module unit. \begin{note} Prior to phase 4 of translation, only preprocessing directives can appear -in the global module fragment\iref{cpp.glob.frag}. +in the \grammarterm{top-level-declaration-seq}\iref{cpp.glob.frag}. \end{note} +\pnum +A \grammarterm{global-module-fragment} specifies the contents of the +\defn{global module fragment} for a module unit. +The global module fragment can be used to provide declarations +that are attached to the global module and usable within the module unit. + \pnum A declaration $D$ is \defn{decl-reachable} from a declaration $S$ in the same translation unit if: @@ -862,7 +864,7 @@ \rSec1[module.reach]{Reachability} -\indextext{necessarily reachable|see{reachable!necessarily}} +\indextext{necessarily reachable|see{reachable, necessarily}} \pnum A translation unit $U$ is \defnx{necessarily reachable}{reachable!necessarily!translation unit} diff --git a/source/numerics.tex b/source/numerics.tex index b948bceed7..5f1defb9d6 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -14,17 +14,17 @@ \textit{n}-at-a-time) arrays, generalized numeric algorithms, and mathematical functions for floating-point types, -as summarized in \tref{numerics.lib.summary}. +as summarized in \tref{numerics.summary}. -\begin{libsumtab}{Numerics library summary}{tab:numerics.lib.summary} +\begin{libsumtab}{Numerics library summary}{numerics.summary} \ref{numeric.requirements} & Requirements & \\ \rowsep \ref{cfenv} & Floating-point environment & \tcode{} \\ \rowsep \ref{complex.numbers} & Complex numbers & \tcode{} \\ \rowsep \ref{bit} & Bit manipulation & \tcode{} \\ \rowsep \ref{rand} & Random number generation & \tcode{} \\ \rowsep \ref{numarray} & Numeric arrays & \tcode{} \\ \rowsep -\ref{c.math} & Mathematical functions for & \tcode{} \\ - & floating-point types & \tcode{} \\ +\ref{c.math} & Mathematical functions for floating-point types & + \tcode{}, \tcode{} \\ \end{libsumtab} \rSec1[numeric.requirements]{Numeric type requirements} @@ -38,7 +38,7 @@ components are parameterized by the type of information they contain and manipulate. A \Cpp{} program shall instantiate these components only with a numeric type. A \defnadj{numeric}{type} is a cv-unqualified object type \tcode{T} -that satisfies the +that meets the \oldconcept{DefaultConstructible}, \oldconcept{CopyConstructible}, \oldconcept{CopyAssignable}, and @@ -61,7 +61,7 @@ \tcode{valarray} can be successfully instantiated and will exhibit well-defined behavior if and only if -\tcode{T} satisfies additional requirements specified for each such member +\tcode{T} meets additional requirements specified for each such member or related function. \pnum @@ -1471,7 +1471,7 @@ and \term{random number distributions}. These categorizations are applicable -to types that satisfy the corresponding requirements, +to types that meet the corresponding requirements, to objects instantiated from such types, and to templates producing such types when instantiated. \begin{note} @@ -1717,21 +1717,21 @@ named \tcode{Sseq} is undefined unless the corresponding template argument is cv-unqualified and - satisfies the requirements + meets the requirements of seed sequence\iref{rand.req.seedseq}. \item that has a template type parameter named \tcode{URBG} is undefined unless the corresponding template argument is cv-unqualified and - satisfies the requirements + meets the requirements of uniform random bit generator\iref{rand.req.urng}. \item that has a template type parameter named \tcode{Engine} is undefined unless the corresponding template argument is cv-unqualified and - satisfies the requirements + meets the requirements of random number engine\iref{rand.req.eng}. \item that has a template type parameter @@ -1773,13 +1773,13 @@ phrases of the form ``\tcode{x} is an iterator of a specific kind'' shall be interpreted as equivalent to the more formal requirement that ``\tcode{x} is a value -of a type satisfying the requirements +of a type meeting the requirements of the specified iterator type''. \pnum Throughout this subclause \ref{rand}, any constructor that can be called with a single argument -and that satisfies a requirement specified in this subclause +and that meets a requirement specified in this subclause shall be declared \tcode{explicit}. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1806,12 +1806,12 @@ \pnum A class \tcode{S} -satisfies the requirements +meets the requirements of a seed sequence if the expressions shown -in \tref{SeedSequence} +in \tref{rand.req.seedseq} are valid and have the indicated semantics, -and if \tcode{S} also satisfies all other requirements +and if \tcode{S} also meets all other requirements of this subclause \ref{rand.req.seedseq}. In that Table and throughout this subclause: \begin{itemize} @@ -1838,7 +1838,7 @@ \begin{libreqtab4d} {Seed sequence requirements} - {tab:SeedSequence} + {rand.req.seedseq} \\ \topline \lhdr{Expression} & \chdr{Return type} @@ -2031,14 +2031,14 @@ \pnum A class \tcode{E} -that satisfies the requirements +that meets the requirements of a uniform random bit generator\iref{rand.req.urng} -also satisfies the requirements +also meets the requirements of a \term{random number engine} if the expressions shown -in \tref{RandomEngine} +in \tref{rand.req.eng} are valid and have the indicated semantics, -and if \tcode{E} also satisfies all other requirements +and if \tcode{E} also meets all other requirements of this subclause \ref{rand.req.eng}. In that Table and throughout this subclause: \begin{itemize} @@ -2053,7 +2053,7 @@ \tcode{s} is a value of \tcode{T}; \item \tcode{q} is an lvalue - satisfying the requirements of a seed sequence\iref{rand.req.seedseq}; + meeting the requirements of a seed sequence\iref{rand.req.seedseq}; \item \tcode{z} is a value of type \tcode{unsigned long long}; @@ -2070,7 +2070,7 @@ \begin{libreqtab4d} {Random number engine requirements} - {tab:RandomEngine} + {rand.req.eng} \\ \topline \lhdr{Expression} & \chdr{Return type} @@ -2243,9 +2243,9 @@ \end{libreqtab4d} \pnum -\tcode{E} shall satisfy the -\oldconcept{CopyConstructible} (\tref{copyconstructible}) -and \oldconcept{CopyAssignable} (\tref{copyassignable}) requirements. +\tcode{E} shall meet the +\oldconcept{CopyConstructible} (\tref{cpp17.copyconstructible}) +and \oldconcept{CopyAssignable} (\tref{cpp17.copyassignable}) requirements. These operations shall each be of complexity no worse than \bigoh{\text{size of state}}. @@ -2350,7 +2350,7 @@ \end{itemdescr} \pnum -\tcode{A} shall also satisfy +\tcode{A} shall also meet the following additional requirements: \begin{itemize} \item @@ -2416,13 +2416,13 @@ \pnum A class \tcode{D} -satisfies the requirements +meets the requirements of a \term{random number distribution} if the expressions shown -in \tref{RandomDistribution} +in \tref{rand.req.dist} are valid and have the indicated semantics, and if \tcode{D} and its associated types -also satisfy all other requirements +also meet all other requirements of this subclause \ref{rand.req.dist}. In that Table and throughout this subclause, \begin{itemize} @@ -2448,7 +2448,7 @@ \tcode{p} is a (possibly \tcode{const}) value of \tcode{P}; \item \tcode{g}, \tcode{g1}, and \tcode{g2} are lvalues of a type - satisfying the requirements + meeting the requirements of a uniform random bit generator\iref{rand.req.urng}; \item \tcode{os} is an lvalue of the type of some class template specialization @@ -2463,7 +2463,7 @@ \begin{libreqtab4d} {Random number distribution requirements} - {tab:RandomDistribution} + {rand.req.dist} \\ \topline \lhdr{Expression} & \chdr{Return type} @@ -2622,9 +2622,9 @@ \end{libreqtab4d} \pnum -\tcode{D} shall satisfy the -\oldconcept{CopyConstructible} (\tref{copyconstructible}) -and \oldconcept{CopyAssignable} (\tref{copyassignable}) requirements. +\tcode{D} shall meet the +\oldconcept{CopyConstructible} (\tref{cpp17.copyconstructible}) +and \oldconcept{CopyAssignable} (\tref{cpp17.copyassignable}) requirements. \pnum The sequence of numbers @@ -2654,11 +2654,11 @@ for convenience of exposition only. \pnum -\tcode{P} shall satisfy the -\oldconcept{CopyConstructible} (\tref{copyconstructible}), -\oldconcept{CopyAssignable} (\tref{copyassignable}), +\tcode{P} shall meet the +\oldconcept{CopyConstructible} (\tref{cpp17.copyconstructible}), +\oldconcept{CopyAssignable} (\tref{cpp17.copyassignable}), and -\oldconcept{Equality\-Comp\-arable} (\tref{equalitycomparable}) requirements. +\oldconcept{Equality\-Comp\-arable} (\tref{cpp17.equalitycomparable}) requirements. \pnum For each of the constructors of \tcode{D} @@ -2698,7 +2698,7 @@ \pnum Each type instantiated from a class template specified in this subclause~\ref{rand.eng} -satisfies the requirements +meets the requirements of a random number engine\iref{rand.req.eng} type. \pnum @@ -3235,7 +3235,7 @@ \pnum Each type instantiated from a class template specified in this subclause~\ref{rand.adapt} -satisfies the requirements +meets the requirements of a random number engine adaptor\iref{rand.req.adapt} type. \pnum @@ -3861,8 +3861,8 @@ double entropy() const noexcept; @\textit{// no copy functions}@ - random_device(const random_device& ) = delete; - void operator=(const random_device& ) = delete; + random_device(const random_device&) = delete; + void operator=(const random_device&) = delete; }; \end{codeblock} @@ -3969,8 +3969,8 @@ void param(OutputIterator dest) const; // no copy functions - seed_seq(const seed_seq& ) = delete; - void operator=(const seed_seq& ) = delete; + seed_seq(const seed_seq&) = delete; + void operator=(const seed_seq&) = delete; private: vector v; // \expos @@ -4014,7 +4014,7 @@ \begin{itemdescr} \pnum\requires - \tcode{InputIterator} shall satisfy the + \tcode{InputIterator} shall meet the \oldconcept{InputIterator} requirements\iref{input.iterators}. Moreover, \tcode{iterator_traits::value_type} @@ -4036,7 +4036,7 @@ \begin{itemdescr} \pnum\requires \tcode{RandomAccessIterator} - shall satisfy the + shall meet the \oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators} and the requirements of a mutable iterator. Moreover, @@ -4143,7 +4143,7 @@ \begin{itemdescr} \pnum\requires - \tcode{OutputIterator} shall satisfy the + \tcode{OutputIterator} shall meet the \oldconcept{OutputIterator} requirements\iref{output.iterators}. Moreover, the expression @@ -4250,7 +4250,7 @@ \pnum Each type instantiated from a class template specified in this subclause~\ref{rand.dist} -satisfies the requirements +meets the requirements of a random number distribution\iref{rand.req.dist} type. \pnum @@ -5827,7 +5827,7 @@ \begin{itemdescr} \pnum \requires - \tcode{InputIterator} shall satisfy the + \tcode{InputIterator} shall meet the \oldconcept{InputIterator} requirements\iref{input.iterators}. Moreover, \tcode{iterator_traits::value_type} @@ -6000,7 +6000,7 @@ \begin{itemdescr} \pnum\requires \tcode{InputIteratorB} and \tcode{InputIteratorW} - shall each satisfy the + shall each meet the \oldconcept{InputIterator} requirements\iref{input.iterators}. Moreover, the \grammarterm{id-expression}s @@ -6211,7 +6211,7 @@ \begin{itemdescr} \pnum\requires \tcode{InputIteratorB} and \tcode{InputIteratorW} - shall each satisfy the + shall each meet the \oldconcept{InputIterator} requirements\iref{input.iterators}. Moreover, the \grammarterm{id-expression}s diff --git a/source/overloading.tex b/source/overloading.tex index 6df045151e..a079cdde3c 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -845,11 +845,11 @@ form \begin{ncsimplebnf} -\keyword{operator} conversion-type-id \terminal{(\,)} cv-qualifier \opt{ref-qualifier} \opt{noexcept-specifier} \opt{attribute-specifier-seq} \terminal{;} +\keyword{operator} conversion-type-id \terminal{(\,)} \opt{cv-qualifier-seq} \opt{ref-qualifier} \opt{noexcept-specifier} \opt{attribute-specifier-seq} \terminal{;} \end{ncsimplebnf} -where -\grammarterm{cv-qualifier} +where the optional +\grammarterm{cv-qualifier-seq} is the same cv-qualification as, or a greater cv-qualification than, \cv{}, and where @@ -982,12 +982,12 @@ operator. Therefore, the operator notation is first transformed to the equivalent function-call notation as summarized in -\tref{over.rel.op.func} +\tref{over.match.oper} (where \tcode{@} denotes one of the operators covered in the specified subclause). However, the operands are sequenced in the order prescribed for the built-in operator\iref{expr.compound}. -\begin{floattable}{Relationship between operator and function call notation}{tab:over.rel.op.func} +\begin{floattable}{Relationship between operator and function call notation}{over.match.oper} {l|m|m|m} \topline \hdstyle{Subclause} & \hdstyle{Expression} & \hdstyle{As member function} & \hdstyle{As non-member function} \\ \capsep @@ -2140,7 +2140,7 @@ \rSec4[over.ics.scs]{Standard conversion sequences} \pnum -\tref{over.conversions} +\tref{over.ics.scs} summarizes the conversions defined in \ref{conv} and partitions them into four disjoint categories: Lvalue Transformation, Qualification Adjustment, Promotion, and Conversion. @@ -2172,7 +2172,7 @@ \pnum \indextext{conversion rank}% -Each conversion in \tref{over.conversions} +Each conversion in \tref{over.ics.scs} also has an associated rank (Exact Match, Promotion, or Conversion). These are used @@ -2185,7 +2185,7 @@ the sequence has Promotion rank; otherwise, the sequence has Exact Match rank. -\begin{floattable}{Conversions}{tab:over.conversions}{l|c|c|c} +\begin{floattable}{Conversions}{over.ics.scs}{l|c|c|c} \topline \hdstyle{Conversion} & \hdstyle{Category} & \hdstyle{Rank} & \hdstyle{Subclause} \\ \capsep No conversions required & Identity & & \\ \cline{1-2}\cline{4-4} diff --git a/source/preprocessor.tex b/source/preprocessor.tex index 8a523e862b..1f2c35d974 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -294,7 +294,7 @@ that the availability of an attribute can be detected by any non-zero result. \end{note} -\begin{floattable}{\xname{has_cpp_attribute} values}{tab:cpp.cond.ha} +\begin{floattable}{\xname{has_cpp_attribute} values}{cpp.cond.ha} {ll} \topline \lhdr{Attribute} & \rhdr{Value} \\ \rowsep @@ -1663,7 +1663,7 @@ \end{note} \end{description} -\begin{LongTable}{Feature-test macros}{tab:cpp.predefined.ft}{ll} +\begin{LongTable}{Feature-test macros}{cpp.predefined.ft}{ll} \\ \topline \lhdr{Macro name} & \rhdr{Value} \\ \capsep \endfirsthead diff --git a/source/ranges.tex b/source/ranges.tex index 8b94a6415c..b6c81d768d 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -13,7 +13,7 @@ range primitives as summarized in \tref{range.summary}. -\begin{libsumtab}{Ranges library summary}{tab:range.summary} +\begin{libsumtab}{Ranges library summary}{range.summary} \ref{range.access} & Range access & \tcode{} \\ \ref{range.req} & Requirements & \\ \ref{range.utility} & Range utilities & \\ @@ -525,7 +525,7 @@ Otherwise, \tcode{(ranges::end(E) - ranges::begin(E))} if it is a valid expression and the types \tcode{I} and \tcode{S} of \tcode{ranges::begin(E)} and - \tcode{ranges::end(E)} model + \tcode{ranges::end(E)} (respectively) model both \tcode{SizedSentinel}\iref{iterator.concept.sizedsentinel} and \tcode{Forward\-Iterator}. However, \tcode{E} is evaluated only once. @@ -1005,18 +1005,6 @@ \indexlibrary{\idxcode{view_interface}}% \begin{codeblock} namespace std::ranges { - template - struct @\placeholdernc{range-common-iterator-impl}@ { // \expos - using type = common_iterator, sentinel_t>; - }; - template - struct @\placeholdernc{range-common-iterator-impl}@ { // \expos - using type = iterator_t; - }; - template - using @\placeholdernc{range-common-iterator}@ = // \expos - typename @\placeholdernc{range-common-iterator-impl}@::type; - template requires is_class_v && Same> class view_interface : public view_base { @@ -1460,7 +1448,7 @@ whose lifetime has ended for a particular rvalue \tcode{Range} argument which does not model \tcode{\placeholder{forwarding-range}}\iref{range.range}. \begin{codeblock} -namespace std { +namespace std::ranges { struct dangling { constexpr dangling() noexcept = default; template @@ -1474,14 +1462,14 @@ \begin{codeblock} vector f(); auto result1 = ranges::find(f(), 42); // \#1 -static_assert(Same); +static_assert(Same); auto vec = f(); auto result2 = ranges::find(vec, 42); // \#2 static_assert(Same::iterator>); auto result3 = ranges::find(subrange{vec}, 42); // \#3 static_assert(Same::iterator>); \end{codeblock} -The call to \tcode{ranges::find} at \#1 returns \tcode{dangling} +The call to \tcode{ranges::find} at \#1 returns \tcode{ranges::dangling} since \tcode{f()} is an rvalue \tcode{vector}; the \tcode{vector} could potentially be destroyed before a returned iterator is dereferenced. @@ -1561,7 +1549,7 @@ requires is_object_v class single_view : public view_interface> { private: - @\placeholdernc{semiregular}@ value_; // \expos + @\placeholdernc{semiregular-box}@ value_; // \expos{} (see \ref{range.semi.wrap}) public: single_view() = default; constexpr explicit single_view(const T& t); @@ -2083,7 +2071,7 @@ \effects Equivalent to: \tcode{return x.value_ == y.value_;} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{iota_view::iterator}} +\indexlibrary{\idxcode{operator"!=}!\idxcode{iota_view::iterator}} \begin{itemdecl} friend constexpr bool operator!=(const iterator& x, const iterator& y) requires EqualityComparable; @@ -2232,7 +2220,7 @@ \effects Equivalent to: \tcode{return y == x;} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{iota_view::sentinel}} +\indexlibrary{\idxcode{operator"!=}!\idxcode{iota_view::sentinel}} \begin{itemdecl} friend constexpr bool operator!=(const iterator& x, const sentinel& y); \end{itemdecl} @@ -2242,7 +2230,7 @@ \effects Equivalent to: \tcode{return !(x == y);} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{iota_view::sentinel}} +\indexlibrary{\idxcode{operator"!=}!\idxcode{iota_view::sentinel}} \begin{itemdecl} friend constexpr bool operator!=(const sentinel& x, const iterator& y); \end{itemdecl} @@ -2340,28 +2328,28 @@ \rSec2[range.semi.wrap]{Semiregular wrapper} \pnum -Many of the types in this subclause are specified in terms of -an exposition-only class template \tcode{\placeholder{semiregular}}. -\tcode{\placeholder{semiregular}} behaves exactly like \tcode{optional} +Many types in this subclause are specified in terms of +an exposition-only class template \tcode{\placeholder{semiregular-box}}. +\tcode{\placeholder{semiregular-box}} behaves exactly like \tcode{optional} with the following differences: \begin{itemize} -\item \tcode{\placeholder{semiregular}} constrains +\item \tcode{\placeholder{semiregular-box}} constrains its type parameter \tcode{T} with \tcode{\libconcept{CopyConstructible} \&\& is_object_v}. \item If \tcode{T} models \libconcept{DefaultConstructible}, the default -constructor of \tcode{\placeholder{semiregular}} is equivalent to: +constructor of \tcode{\placeholder{semiregular-box}} is equivalent to: \begin{codeblock} -constexpr @\placeholder{semiregular}@() noexcept(is_nothrow_default_constructible_v) - : @\placeholder{semiregular}@{in_place} +constexpr @\placeholder{semiregular-box}@() noexcept(is_nothrow_default_constructible_v) + : @\placeholder{semiregular-box}@{in_place} { } \end{codeblock} \item If \tcode{\libconcept{Assignable}} is not -satisfied, the copy assignment operator is equivalent to: +modeled, the copy assignment operator is equivalent to: \begin{codeblock} -@\placeholder{semiregular}@& operator=(const @\placeholder{semiregular}@& that) +@\placeholder{semiregular-box}@& operator=(const @\placeholder{semiregular-box}@& that) noexcept(is_nothrow_copy_constructible_v) { if (that) emplace(*that); @@ -2370,10 +2358,10 @@ } \end{codeblock} -\item If \tcode{\libconcept{Assignable}} is not satisfied, +\item If \tcode{\libconcept{Assignable}} is not modeled, the move assignment operator is equivalent to: \begin{codeblock} -@\placeholder{semiregular}@& operator=(@\placeholder{semiregular}@&& that) +@\placeholder{semiregular-box}@& operator=(@\placeholder{semiregular-box}@&& that) noexcept(is_nothrow_move_constructible_v) { if (that) emplace(std::move(*that)); @@ -2500,13 +2488,13 @@ requires View && is_object_v class filter_view : public view_interface> { private: - V base_ = V(); // \expos - @\placeholdernc{semiregular}@ pred_; // \expos + V base_ = V(); // \expos + @\placeholdernc{semiregular-box}@ pred_; // \expos // \ref{range.filter.iterator}, class \tcode{filter_view::iterator} - class iterator; // \expos + class iterator; // \expos // \ref{range.filter.sentinel}, class \tcode{filter_view::sentinel} - class sentinel; // \expos + class sentinel; // \expos public: filter_view() = default; @@ -2786,7 +2774,7 @@ \effects Equivalent to: \tcode{return x.current_ == y.current_;} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{filter_view::iterator}}% +\indexlibrary{\idxcode{operator"!=}!\idxcode{filter_view::iterator}}% \begin{itemdecl} friend constexpr bool operator!=(const iterator& x, const iterator& y) requires EqualityComparable>; @@ -2883,7 +2871,7 @@ \effects Equivalent to: \tcode{return y == x;} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{filter_view::sentinel}}% +\indexlibrary{\idxcode{operator"!=}!\idxcode{filter_view::sentinel}}% \begin{itemdecl} friend constexpr bool operator!=(const iterator& x, const sentinel& y); \end{itemdecl} @@ -2893,7 +2881,7 @@ \effects Equivalent to: \tcode{return !(x == y);} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{filter_view::sentinel}}% +\indexlibrary{\idxcode{operator"!=}!\idxcode{filter_view::sentinel}}% \begin{itemdecl} friend constexpr bool operator!=(const sentinel& x, const iterator& y); \end{itemdecl} @@ -2947,7 +2935,7 @@ template struct sentinel; // \expos V base_ = V(); // \expos - @\placeholdernc{semiregular}@ fun_; // \expos + @\placeholdernc{semiregular-box}@ fun_; // \expos public: transform_view() = default; @@ -3351,7 +3339,7 @@ \effects Equivalent to: \tcode{return x.current_ == y.current_;} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{transform_view::iterator}}% +\indexlibrary{\idxcode{operator"!=}!\idxcode{transform_view::iterator}}% \begin{itemdecl} friend constexpr bool operator!=(const iterator& x, const iterator& y) requires EqualityComparable>; @@ -3540,7 +3528,7 @@ \effects Equivalent to: \tcode{return y == x;} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{transform_view::sentinel}}% +\indexlibrary{\idxcode{operator"!=}!\idxcode{transform_view::sentinel}}% \begin{itemdecl} friend constexpr bool operator!=(const iterator& x, const sentinel& y); \end{itemdecl} @@ -3550,7 +3538,7 @@ \effects Equivalent to: \tcode{return !(x == y);} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{transform_view::sentinel}}% +\indexlibrary{\idxcode{operator"!=}!\idxcode{transform_view::sentinel}}% \begin{itemdecl} friend constexpr bool operator!=(const sentinel& x, const iterator& y); \end{itemdecl} @@ -3560,7 +3548,7 @@ \effects Equivalent to: \tcode{return !(y == x);} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{transform_view::sentinel}}% +\indexlibrary{\idxcode{operator"!=}!\idxcode{transform_view::sentinel}}% \begin{itemdecl} friend constexpr iter_difference_t> operator-(const iterator& x, const sentinel& y) @@ -3572,7 +3560,7 @@ \effects Equivalent to: \tcode{return x.current_ - y.end_;} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{transform_view::sentinel}}% +\indexlibrary{\idxcode{operator"!=}!\idxcode{transform_view::sentinel}}% \begin{itemdecl} friend constexpr iter_difference_t> operator-(const sentinel& y, const iterator& x) @@ -3794,7 +3782,7 @@ \tcode{return y.count() == 0 || y.base() == x.end_;} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{take_view::sentinel}}% +\indexlibrary{\idxcode{operator"!=}!\idxcode{take_view::sentinel}}% \begin{itemdecl} friend constexpr bool operator!=(const sentinel& x, const CI& y); friend constexpr bool operator!=(const CI& y, const sentinel& x); @@ -4210,7 +4198,7 @@ \tcode{return x.outer_ == y.outer_ \&\& x.inner_ == y.inner_;} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{join_view::iterator}} +\indexlibrary{\idxcode{operator"!=}!\idxcode{join_view::iterator}} \begin{itemdecl} friend constexpr bool operator!=(const iterator& x, const iterator& y) requires ref_is_glvalue && EqualityComparable> && @@ -4301,7 +4289,7 @@ \effects Equivalent to: \tcode{return y == x;} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{join_view::sentinel}} +\indexlibrary{\idxcode{operator"!=}!\idxcode{join_view::sentinel}} \begin{itemdecl} friend constexpr bool operator!=(const iterator& x, const sentinel& y); \end{itemdecl} @@ -4311,7 +4299,7 @@ \effects Equivalent to: \tcode{return !(x == y);} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{join_view::sentinel}} +\indexlibrary{\idxcode{operator"!=}!\idxcode{join_view::sentinel}} \begin{itemdecl} friend constexpr bool operator!=(const sentinel& x, const iterator& y); \end{itemdecl} @@ -4487,7 +4475,8 @@ using iterator_concept = conditional_t, forward_iterator_tag, input_iterator_tag>; using iterator_category = input_iterator_tag; - struct value_type; // see \ref{range.split.outer.value} + // \ref{range.split.outer.value}, class \tcode{split_view::outer_iterator::value_type} + struct value_type; using difference_type = iter_difference_t>; outer_iterator() = default; @@ -4611,7 +4600,7 @@ \effects Equivalent to: \tcode{return x.current_ == y.current_;} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{split_view::outer_iterator}}% +\indexlibrary{\idxcode{operator"!=}!\idxcode{split_view::outer_iterator}}% \begin{itemdecl} friend constexpr bool operator!=(const outer_iterator& x, const outer_iterator& y) requires ForwardRange; @@ -4634,7 +4623,7 @@ Equivalent to: \tcode{return x.\placeholder{current} == ranges::end(x.parent_->base_);} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{split_view::outer_iterator}}% +\indexlibrary{\idxcode{operator"!=}!\idxcode{split_view::outer_iterator}}% \begin{itemdecl} friend constexpr bool operator!=(const outer_iterator& x, default_sentinel_t y); friend constexpr bool operator!=(default_sentinel_t y, const outer_iterator& x); @@ -4797,7 +4786,7 @@ \effects Equivalent to: \tcode{return x.i_.current_ == y.i_.current_;} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{split_view::inner_iterator}}% +\indexlibrary{\idxcode{operator"!=}!\idxcode{split_view::inner_iterator}}% \begin{itemdecl} friend constexpr bool operator!=(const inner_iterator& x, const inner_iterator& y) requires ForwardRange; @@ -4831,7 +4820,7 @@ \end{codeblock} \end{itemdescr} -\indexlibrary{\idxcode{operator!=}!\idxcode{split_view::inner_iterator}}% +\indexlibrary{\idxcode{operator"!=}!\idxcode{split_view::inner_iterator}}% \begin{itemdecl} friend constexpr bool operator!=(const inner_iterator& x, default_sentinel_t y); friend constexpr bool operator!=(default_sentinel_t y, const inner_iterator& x); @@ -4867,6 +4856,11 @@ \rSec2[range.counted]{Counted view} +\pnum +A counted view presents a \libconcept{View} of the elements +of the counted range\iref{iterator.requirements.general} \range{i}{n} +for some iterator \tcode{i} and non-negative integer \tcode{n}. + \pnum The name \tcode{view::counted} denotes a customization point object\iref{customization.point.object}. diff --git a/source/regex.tex b/source/regex.tex index 2d2f8c99c4..72c3b73cce 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -18,15 +18,15 @@ result of a regular expression match, a series of algorithms that allow a character sequence to be operated upon by a regular expression, and two iterator types for -enumerating regular expression matches, as summarized in \tref{re.lib.summary}. +enumerating regular expression matches, as summarized in \tref{re.summary}. -\begin{libsumtab}{Regular expressions library summary}{tab:re.lib.summary} +\begin{libsumtab}{Regular expressions library summary}{re.summary} \ref{re.def} & Definitions & \\ \ref{re.req} & Requirements & \\ \rowsep -\ref{re.const} & Constants & \\ +\ref{re.const} & Constants & \tcode{} \\ \ref{re.badexp} & Exception type & \\ \ref{re.traits} & Traits & \\ -\ref{re.regex} & Regular expression template & \tcode{} \\ +\ref{re.regex} & Regular expression template & \\ \ref{re.submatch} & Submatches & \\ \ref{re.results} & Match results & \\ \ref{re.alg} & Algorithms & \\ @@ -87,7 +87,7 @@ This subclause defines requirements on classes representing regular expression traits. \begin{note} The class template \tcode{regex_traits}, defined in \ref{re.traits}, -satisfies these requirements. \end{note} +meets these requirements. \end{note} \pnum The class template \tcode{basic_regex}, defined in @@ -108,7 +108,7 @@ \indextext{requirements!regular expression traits}% \indextext{regular expression!requirements}% \indextext{locale}% -In \tref{re:RegexpTraits} \tcode{X} denotes a traits class +In \tref{re.req} \tcode{X} denotes a traits class defining types and functions for the character container type \tcode{charT}; \tcode{u} is an object of type \tcode{X}; \tcode{v} is an object of type \tcode{const @@ -125,7 +125,7 @@ \begin{libreqtab3} {Regular expression traits class requirements} - {tab:re:RegexpTraits} + {re.req} \\ \topline \lhdr{Expression} & \chdr{Return type} & \rhdr{Assertion/note pre-/post-condition } \\ \capsep \endfirsthead @@ -246,7 +246,7 @@ \pnum \begin{note} -Class template \tcode{regex_traits} satisfies the requirements for a +Class template \tcode{regex_traits} meets the requirements for a regular expression traits class when it is specialized for \tcode{char} or \tcode{wchar_t}. This class template is described in the header \tcode{}, and is described in \ref{re.traits}. @@ -654,14 +654,14 @@ \indexlibrary{\idxcode{syntax_option_type}!\idxcode{egrep}}% The type \tcode{syntax_option_type} is an \impldef{type of \tcode{syntax_option_type}} bitmask type\iref{bitmask.types}. Setting its elements has the effects listed in -\tref{re:syntaxoption}. A valid value of type +\tref{re.synopt}. A valid value of type \tcode{syntax_option_type} shall have at most one of the grammar elements \tcode{ECMAScript}, \tcode{basic}, \tcode{extended}, \tcode{awk}, \tcode{grep}, \tcode{egrep}, set. If no grammar element is set, the default grammar is \tcode{ECMAScript}. \begin{libefftab} {\tcode{syntax_option_type} effects} - {tab:re:syntaxoption} + {re.synopt} % \tcode{icase} & Specifies that matching of regular expressions against a character @@ -794,13 +794,13 @@ \tcode{format_default} constants are empty bitmasks. Matching a regular expression against a sequence of characters \range{first}{last} proceeds according to the rules of the grammar specified for the regular -expression object, modified according to the effects listed in \tref{re:matchflag} for +expression object, modified according to the effects listed in \tref{re.matchflag} for any bitmask elements set. \begin{longlibefftab} {\tcode{regex_constants::match_flag_type} effects when obtaining a match against a character container sequence \range{first}{last}.} - {tab:re:matchflag} + {re.matchflag} % \indexlibrary{\idxcode{match_not_bol}}% \tcode{match_not_bol} & @@ -913,11 +913,11 @@ The type \tcode{error_type} is an \impldef{type of \tcode{regex_constants::error_type}} enumerated type\iref{enumerated.types}. Values of type \tcode{error_type} represent the error -conditions described in \tref{re:errortype}: +conditions described in \tref{re.err}: \begin{longliberrtab} {\tcode{error_type} values in the C locale} - {tab:re:errortype} + {re.err} \tcode{error_collate} & The expression contained an invalid collating element name. \\ \rowsep @@ -1052,7 +1052,7 @@ \indextext{requirements!regular expression traits}% \indextext{\idxcode{regex_traits}!specializations}% The specializations \tcode{regex_traits} and -\tcode{regex_traits} shall be valid and shall satisfy the +\tcode{regex_traits} shall be valid and shall meet the requirements for a regular expression traits class\iref{re.req}. \indexlibrarymember{regex_traits}{char_class_type}% @@ -1279,7 +1279,7 @@ the last argument passed to \tcode{imbue}. \end{itemdescr} -\begin{floattable}{Character class names and corresponding \tcode{ctype} masks}{tab:re.traits.classnames}{lll} +\begin{floattable}{Character class names and corresponding \tcode{ctype} masks}{re.traits.classnames}{lll} \topline \lhdr{Narrow character name} & \chdr{Wide character name} & \rhdr{Corresponding \tcode{ctype_base::mask} value} \\\capsep \tcode{"alnum"} & \tcode{L"alnum"} & \tcode{ctype_base::alnum} \\ \rowsep @@ -1696,7 +1696,7 @@ \begin{itemdescr} \pnum \requires -\tcode{InputIterator} shall satisfy the +\tcode{InputIterator} shall meet the \oldconcept{InputIterator} requirements\iref{input.iterators}. \pnum @@ -2426,7 +2426,7 @@ \indextext{requirements!container}% \indextext{requirements!sequence}% \indextext{\idxcode{match_results}!as sequence}% -The class template \tcode{match_results} satisfies the requirements of an +The class template \tcode{match_results} meets the requirements of an allocator-aware container and of a sequence container (\ref{container.requirements.general}, \ref{sequence.reqmts}) except that only @@ -2573,7 +2573,7 @@ \begin{itemdescr} \pnum \effects\ Move constructs an object of class \tcode{match_results} from \tcode{m} -satisfying the same postconditions as \tref{re:results:assign}. Additionally, +satisfying the same postconditions as \tref{re.results.const}. Additionally, the stored \tcode{Allocator} value is move constructed from \tcode{m.get_allocator()}. \pnum @@ -2588,7 +2588,7 @@ \begin{itemdescr} \pnum \effects Assigns \tcode{m} to \tcode{*this}. The postconditions of this -function are indicated in \tref{re:results:assign}. +function are indicated in \tref{re.results.const}. \end{itemdescr} \indexlibrarymember{match_results}{operator=}% @@ -2599,12 +2599,12 @@ \begin{itemdescr} \pnum \effects\ Move-assigns \tcode{m} to \tcode{*this}. The postconditions of this function -are indicated in \tref{re:results:assign}. +are indicated in \tref{re.results.const}. \end{itemdescr} \begin{libefftabvalue} {\tcode{match_results} assignment operator effects} - {tab:re:results:assign} + {re.results.const} \tcode{ready()} & \tcode{m.ready()} \\ \rowsep \tcode{size()} & \tcode{m.size()} \\ \rowsep \tcode{str(n)} & \tcode{m.str(n)} for all integers \tcode{n < m.size()} \\ \rowsep @@ -2790,7 +2790,7 @@ \begin{itemdescr} \pnum -\requires \tcode{ready() == true} and \tcode{OutputIter} shall satisfy the requirements for a +\requires \tcode{ready() == true} and \tcode{OutputIter} shall meet the requirements for a \oldconcept{OutputIterator}\iref{output.iterators}. \pnum @@ -2979,7 +2979,7 @@ \begin{itemdescr} \pnum \requires -The type \tcode{BidirectionalIterator} shall satisfy the +The type \tcode{BidirectionalIterator} shall meet the \oldconcept{BidirectionalIterator} requirements\iref{bidirectional.iterators}. \pnum @@ -3009,12 +3009,12 @@ on parameter \tcode{m} is unspecified except that \tcode{m.size()} returns \tcode{0} and \tcode{m.empty()} returns \tcode{true}. Otherwise the effects on parameter \tcode{m} are given in -\tref{re:alg:match}. +\tref{re.alg.match}. \end{itemdescr} \begin{longlibefftabvalue} {Effects of \tcode{regex_match} algorithm} - {tab:re:alg:match} + {re.alg.match} \tcode{m.size()} & \tcode{1 + e.mark_count()} @@ -3163,7 +3163,7 @@ \begin{itemdescr} \pnum \requires -Type \tcode{BidirectionalIterator} shall satisfy the +Type \tcode{BidirectionalIterator} shall meet the \oldconcept{BidirectionalIterator} requirements\iref{bidirectional.iterators}. \pnum @@ -3178,12 +3178,12 @@ If the function returns \tcode{false}, then the effect on parameter \tcode{m} is unspecified except that \tcode{m.size()} returns \tcode{0} and \tcode{m.empty()} returns \tcode{true}. Otherwise -the effects on parameter \tcode{m} are given in \tref{re:alg:search}. +the effects on parameter \tcode{m} are given in \tref{re.alg.search}. \end{itemdescr} \begin{longlibefftabvalue} {Effects of \tcode{regex_search} algorithm} - {tab:re:alg:search} + {re.alg.search} \tcode{m.size()} & \tcode{1 + e.mark_count()} @@ -4050,7 +4050,7 @@ The regular expression grammar may be modified by any \tcode{regex_constants::syntax_option_type} flags specified when constructing an object of type specialization of \tcode{basic_regex} -according to the rules in Table \ref{tab:re:syntaxoption}. +according to the rules in \tref{re.synopt}. \pnum A \tcode{ClassName} production, when used in \tcode{ClassAtomExClass}, diff --git a/source/statements.tex b/source/statements.tex index 93bb5d4f9a..f958ecf175 100644 --- a/source/statements.tex +++ b/source/statements.tex @@ -84,24 +84,14 @@ \pnum \indextext{statement!declaration in \tcode{if}}% \indextext{statement!declaration in \tcode{switch}}% -A name introduced by a declaration in a \grammarterm{condition} -(introduced by either the \grammarterm{decl-specifier-seq} or the -\grammarterm{declarator} of the condition) is in scope from its point of -declaration until the end of the substatements controlled by the -condition. If the name is redeclared in the outermost block of a -substatement controlled by the condition, the declaration that -redeclares the name is ill-formed. -\begin{example} - -\begin{codeblock} -if (int x = f()) { - int x; // ill-formed, redeclaration of \tcode{x} -} -else { - int x; // ill-formed, redeclaration of \tcode{x} -} -\end{codeblock} -\end{example} +\begin{note} +A name introduced in a \grammarterm{selection-statement} or +\grammarterm{iteration-statement} outside of any substatement +is in scope from its point of +declaration until the end of the statement's substatements. +Such a name cannot be redeclared in the outermost block of +any of the substatements\iref{basic.scope.block}. +\end{note} \pnum The value of a \grammarterm{condition} that is an initialized declaration @@ -456,7 +446,7 @@ \begin{bnf} \nontermdef{iteration-statement}\br \keyword{while} \terminal{(} condition \terminal{)} statement\br - \keyword{do} statement \keyword{while} \terminal{(} expression \terminal{) ;}\br + \keyword{do} statement \keyword{while} \terminal{(} expression \terminal{)} \terminal{;}\br \keyword{for} \terminal{(} init-statement \opt{condition} \terminal{;} \opt{expression} \terminal{)} statement\br \keyword{for} \terminal{(} \opt{init-statement} for-range-declaration \terminal{:} for-range-initializer \terminal{)} statement \end{bnf} @@ -538,7 +528,7 @@ \begin{ncsimplebnf} \exposid{label} \terminal{:}\br \terminal{\{}\br -\bnfindent \keyword{if} \terminal{(} condition \terminal{) \{}\br +\bnfindent \keyword{if} \terminal{(} condition \terminal{)} \terminal{\{}\br \bnfindent \bnfindent statement\br \bnfindent \bnfindent \keyword{goto} \exposid{label} \terminal{;}\br \bnfindent \terminal{\}}\br @@ -591,7 +581,7 @@ \begin{ncsimplebnf} \terminal{\{}\br \bnfindent init-statement\br -\bnfindent \keyword{while} \terminal{(} condition \terminal{) \{}\br +\bnfindent \keyword{while} \terminal{(} condition \terminal{)} \terminal{\{}\br \bnfindent\bnfindent statement\br \bnfindent\bnfindent expression \terminal{;}\br \bnfindent \terminal{\}}\br @@ -652,8 +642,8 @@ \bnfindent \keyword{auto} \terminal{\&\&}\exposid{range} \terminal{=} for-range-initializer \terminal{;}\br \bnfindent \keyword{auto} \exposid{begin} \terminal{=} begin-expr \terminal{;}\br \bnfindent \keyword{auto} \exposid{end} \terminal{=} end-expr \terminal{;}\br -\bnfindent \keyword{for} \terminal{( ;} \exposid{begin} \terminal{!=} \exposid{end}\terminal{; ++}\exposid{begin} \terminal{) \{}\br -\bnfindent\bnfindent for-range-declaration \terminal{= *} \exposid{begin} \terminal{;}\br +\bnfindent \keyword{for} \terminal{(} \terminal{;} \exposid{begin} \terminal{!=} \exposid{end}\terminal{;} \terminal{++}\exposid{begin} \terminal{)} \terminal{\{}\br +\bnfindent\bnfindent for-range-declaration \terminal{=} \terminal{*} \exposid{begin} \terminal{;}\br \bnfindent\bnfindent statement\br \bnfindent \terminal{\}}\br \terminal{\}} @@ -871,7 +861,7 @@ before the destruction of local variables\iref{stmt.jump} of the block enclosing the \tcode{return} statement. -\rSec3[stmt.return.coroutine]{The \tcode{co_return} statement}% +\rSec2[stmt.return.coroutine]{The \tcode{co_return} statement}% \indextext{\idxcode{co_return}}% \indextext{coroutine return|see{\tcode{co_return}}}% @@ -893,7 +883,7 @@ promise object\iref{dcl.fct.def.coroutine}. A \tcode{co_return} statement is equivalent to: \begin{ncsimplebnf} -\terminal{\{} S\terminal{; goto} \exposid{final-suspend}\terminal{;} \terminal{\}} +\terminal{\{} S\terminal{;} \terminal{goto} \exposid{final-suspend}\terminal{;} \terminal{\}} \end{ncsimplebnf} where \exposid{final-suspend} is the exposition-only label diff --git a/source/strings.tex b/source/strings.tex index eef5db0a36..cbba04ae5d 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -15,18 +15,15 @@ The following subclauses describe a character traits class, string classes, and null-terminated sequence utilities, -as summarized in \tref{strings.lib.summary}. +as summarized in \tref{strings.summary}. -\begin{libsumtab}{Strings library summary}{tab:strings.lib.summary} -\ref{char.traits} & Character traits & \tcode{} \\ \rowsep -\ref{string.classes} & String classes & \tcode{} \\ \rowsep +\begin{libsumtab}[x{2.1in}]{Strings library summary}{strings.summary} +\ref{char.traits} & Character traits & \tcode{} \\ +\ref{string.classes} & String classes & \\ \rowsep \ref{string.view} & String view classes & \tcode{} \\ \rowsep - & & \tcode{} \\ - & & \tcode{} \\ -\ref{c.strings} & Null-terminated sequence utilities & \tcode{} \\ - & & \tcode{} \\ - & & \tcode{} \\ - & & \tcode{} \\ +\ref{c.strings} & Null-terminated sequence utilities & + \tcode{}, \tcode{}, \tcode{}, + \tcode{}, \tcode{}, \tcode{} \\ \end{libsumtab} \rSec1[char.traits]{Character traits} @@ -43,7 +40,7 @@ \tcode{char_traits}, and \tcode{char_traits}, -that satisfy those requirements. +that meet those requirements. \pnum Most classes specified in \ref{string.classes}, \ref{string.view}, @@ -72,7 +69,7 @@ \rSec2[char.traits.require]{Character traits requirements} \pnum -In \tref{char.traits.require}, +In \tref{char.traits.req}, \tcode{X} denotes a traits class defining types and functions for the character container type @@ -112,7 +109,7 @@ \begin{libreqtab4d} {Character traits requirements} -{tab:char.traits.require} +{char.traits.req} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Assertion/note} & \rhdr{Complexity}\\ & & \chdr{pre-/post-condition} & \\ \capsep @@ -226,10 +223,10 @@ \pnum \expects \tcode{state_type} meets the -\oldconcept{Destructible} (\tref{destructible}), -\oldconcept{CopyAssignable} (\tref{copyassignable}), -\oldconcept{CopyConstructible} (\tref{copyconstructible}), and -\oldconcept{DefaultConstructible} (\tref{defaultconstructible}) requirements. +\oldconcept{Destructible} (\tref{cpp17.destructible}), +\oldconcept{CopyAssignable} (\tref{cpp17.copyassignable}), +\oldconcept{CopyConstructible} (\tref{cpp17.copyconstructible}), and +\oldconcept{DefaultConstructible} (\tref{cpp17.defaultconstructible}) requirements. \end{itemdescr} \rSec2[char.traits.specializations]{\tcode{char_traits} specializations} @@ -333,9 +330,9 @@ static constexpr size_t length(const char_type* s); static constexpr const char_type* find(const char_type* s, size_t n, const char_type& a); - static char_type* move(char_type* s1, const char_type* s2, size_t n); - static char_type* copy(char_type* s1, const char_type* s2, size_t n); - static char_type* assign(char_type* s, size_t n, char_type a); + static constexpr char_type* move(char_type* s1, const char_type* s2, size_t n); + static constexpr char_type* copy(char_type* s1, const char_type* s2, size_t n); + static constexpr char_type* assign(char_type* s, size_t n, char_type a); static constexpr int_type not_eof(int_type c) noexcept; static constexpr char_type to_char_type(int_type c) noexcept; static constexpr int_type to_int_type(char_type c) noexcept; @@ -1106,7 +1103,7 @@ objects as needed. The \tcode{Allocator} object used is obtained as described in \ref{container.requirements.general}. In every specialization \tcode{basic_string}, -the type \tcode{traits} shall satisfy +the type \tcode{traits} shall meet the character traits requirements\iref{char.traits}. \begin{note} The program is ill-formed if \tcode{traits::char_type} @@ -1302,7 +1299,7 @@ \pnum \effects Constructs a string from the values in the range \range{begin}{end}, -as indicated in \tref{containers.sequence.requirements}. +as indicated in \tref{container.seq.req}. \end{itemdescr} \indexlibrary{\idxcode{basic_string}!constructor}% @@ -4075,14 +4072,17 @@ \end{codeblock} \pnum -In every specialization \tcode{basic_string_view}, the type \tcode{traits} shall satisfy the character traits requirements\iref{char.traits}. +In every specialization \tcode{basic_string_view}, the type \tcode{traits} shall meet the character traits requirements\iref{char.traits}. \begin{note} The program is ill-formed if \tcode{traits::char_type} is not the same type as \tcode{charT}. \end{note} \pnum -The type \tcode{iterator} satisfies -the constexpr iterator requirements\iref{iterator.requirements.general}. +For a \tcode{basic_string_view str}, +any operation that invalidates a pointer +in the range \range{str.data()}{\brk{}str.data() + str.size()} +invalidates pointers, iterators, and references +returned from \tcode{str}'s member functions. \pnum The complexity of \tcode{basic_string_view} member functions is \bigoh{1} @@ -4148,13 +4148,11 @@ \pnum A type that meets the requirements of a constant -\oldconcept{RandomAccessIterator}\iref{random.access.iterators} and -models \libconcept{ContiguousIterator}\iref{iterator.concept.contiguous}, +\oldconcept{RandomAccessIterator}\iref{random.access.iterators}, +models \libconcept{ContiguousIterator}\iref{iterator.concept.contiguous}, and +meets the constexpr iterator requirements\iref{iterator.requirements.general}, whose \tcode{value_type} is the template parameter \tcode{charT}. -\pnum -For a \tcode{basic_string_view str}, any operation that invalidates a pointer in the range \range{str.data()}{str.data() + str.size()} invalidates pointers, iterators, and references returned from \tcode{str}'s member functions. - \pnum All requirements on container iterators\iref{container.requirements} apply to \tcode{basic_string_view::const_iterator} as well. \end{itemdescr} @@ -4470,7 +4468,7 @@ \returns The nonzero result if the result of the comparison is nonzero. Otherwise, returns a value as indicated in \tref{string.view.compare}. -\begin{libtab2}{\tcode{compare()} results}{tab:string.view.compare}{cc}{Condition}{Return Value} +\begin{libtab2}{\tcode{compare()} results}{string.view.compare}{cc}{Condition}{Return Value} \tcode{size() < str.size()} & \tcode{< 0}\\ \tcode{size() == str.size()} & \tcode{ \ 0}\\ \tcode{size() > str.size()} & \tcode{> 0}\\ @@ -4807,7 +4805,7 @@ Let \tcode{S} be \tcode{basic_string_view}, and \tcode{sv} be an instance of \tcode{S}. Implementations shall provide sufficient additional overloads marked \tcode{constexpr} and \tcode{noexcept} so that an object \tcode{t} with an implicit conversion to \tcode{S} can be compared according to \tref{string.view.comparison.overloads}. -\begin{libtab2}{Additional \tcode{basic_string_view} comparison overloads}{tab:string.view.comparison.overloads}{cc}{Expression}{Equivalent to} +\begin{libtab2}{Additional \tcode{basic_string_view} comparison overloads}{string.view.comparison.overloads}{cc}{Expression}{Equivalent to} \tcode{t == sv} & \tcode{S(t) == sv} \\ \tcode{sv == t} & \tcode{sv == S(t)} \\ \tcode{t != sv} & \tcode{S(t) != sv} \\ diff --git a/source/styles.tex b/source/styles.tex index 1bff754958..745b566be3 100644 --- a/source/styles.tex +++ b/source/styles.tex @@ -111,22 +111,8 @@ leftmargin=\bnfindentrest, listparindent=-\bnfindentinc, itemindent=\listparindent} %%-------------------------------------------------- -%% set caption style and delimiter +%% set caption style \captionstyle{\centering} -\captiondelim{ --- } -% override longtable's caption delimiter to match -\makeatletter -\def\LT@makecaption#1#2#3{% - \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{% - \sbox\@tempboxa{#1{#2 --- }#3}% - \ifdim\wd\@tempboxa>\hsize - #1{#2 --- }#3% - \else - \hbox to\hsize{\hfil\box\@tempboxa\hfil}% - \fi - \endgraf\vskip\baselineskip}% - \hss}}} -\makeatother %%-------------------------------------------------- %% set global styles that get reset by \mainmatter @@ -156,13 +142,13 @@ %% (copied verbatim from listings.sty version 1.6 except where commented) \makeatletter -\lst@CheckVersion{1.7}{\lst@CheckVersion{1.6}{\lst@CheckVersion{1.5b}{ +\lst@CheckVersion{1.8b}{\lst@CheckVersion{1.7}{\lst@CheckVersion{1.6}{\lst@CheckVersion{1.5b}{ \typeout{^^J% ***^^J% *** This file requires listings.sty version 1.6.^^J% *** You have version \lst@version; exiting ...^^J% ***^^J}% - \batchmode \@@end}}} + \batchmode \@@end}}}} \def\lst@Init#1{% \begingroup diff --git a/source/support.tex b/source/support.tex index c4e9903869..dc2c9ba54f 100644 --- a/source/support.tex +++ b/source/support.tex @@ -20,15 +20,13 @@ support for contract violation handling, support for exception processing, support for initializer lists, and other runtime support, -as summarized in \tref{lang.sup.lib.summary}. - -\begin{libsumtab}{Language support library summary}{tab:lang.sup.lib.summary} -\ref{support.types} & Common definitions & \tcode{} \\ - & & \tcode{} \\ \rowsep -\ref{support.limits} & Implementation properties & \tcode{} \\ - & & \tcode{} \\ - & & \tcode{} \\ - & & \tcode{} \\ \rowsep +as summarized in \tref{support.summary}. + +\begin{libsumtab}{Language support library summary}{support.summary} +\ref{support.types} & Common definitions & + \tcode{}, \tcode{} \\ \rowsep +\ref{support.limits} & Implementation properties & + \tcode{}, \tcode{}, \tcode{}, \tcode{} \\ \rowsep \ref{cstdint} & Integer types & \tcode{} \\ \rowsep \ref{support.start.term} & Start and termination & \tcode{} \\ \rowsep \ref{support.dynamic} & Dynamic memory management & \tcode{} \\ \rowsep @@ -38,10 +36,8 @@ \ref{support.initlist} & Initializer lists & \tcode{} \\ \rowsep \ref{cmp} & Comparisons & \tcode{} \\ \rowsep \ref{support.coroutine} & Coroutines & \tcode{} \\ \rowsep -\ref{support.runtime} & Other runtime support & \tcode{} \\ - & & \tcode{} \\ - & & \tcode{} \\ - & & \tcode{} \\ +\ref{support.runtime} & Other runtime support & + \tcode{}, \tcode{}, \tcode{}, \tcode{} \\ \end{libsumtab} \rSec1[support.types]{Common definitions} @@ -522,7 +518,7 @@ \end{note} \begin{LongTable}{Standard library feature-test macros} -{tab:support.ft}{llx{.3\hsize}} +{support.ft}{llx{.3\hsize}} \\ \topline \lhdr{Macro name} & \chdr{Value} & \rhdr{Header(s)} \\ \capsep \endfirsthead @@ -730,6 +726,10 @@ // \ref{numeric.limits}, class template \tcode{numeric_limits} template class numeric_limits; + template class numeric_limits; + template class numeric_limits; + template class numeric_limits; + template<> class numeric_limits; template<> class numeric_limits; @@ -888,10 +888,6 @@ static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; - - template class numeric_limits; - template class numeric_limits; - template class numeric_limits; } \end{codeblock} @@ -2731,9 +2727,7 @@ namespace std { class bad_alloc : public exception { public: - bad_alloc() noexcept; - bad_alloc(const bad_alloc&) noexcept; - bad_alloc& operator=(const bad_alloc&) noexcept; + // see \ref{exception} for the specification of the special member functions const char* what() const noexcept override; }; } @@ -2754,12 +2748,6 @@ \pnum \returns An \impldef{return value of \tcode{bad_alloc::what}} \ntbs{}. - -\pnum -\remarks -The message may be a null-terminated multibyte string\iref{multibyte.strings}, -suitable for conversion and display as a -\tcode{wstring}~(\ref{string.classes}, \ref{locale.codecvt}). \end{itemdescr} \indexlibrary{\idxcode{bad_array_new_length}}% @@ -2770,7 +2758,7 @@ namespace std { class bad_array_new_length : public bad_alloc { public: - bad_array_new_length() noexcept; + // see \ref{exception} for the specification of the special member functions const char* what() const noexcept override; }; } @@ -2791,12 +2779,6 @@ \pnum \returns An \impldef{return value of \tcode{bad_array_new_length::what}} \ntbs{}. - -\pnum -\remarks -The message may be a null-terminated multibyte string\iref{multibyte.strings}, -suitable for conversion and display as a -\tcode{wstring}~(\ref{string.classes}, \ref{locale.codecvt}). \end{itemdescr} \rSec3[new.handler]{Type \tcode{new_handler}} @@ -3124,9 +3106,7 @@ namespace std { class bad_cast : public exception { public: - bad_cast() noexcept; - bad_cast(const bad_cast&) noexcept; - bad_cast& operator=(const bad_cast&) noexcept; + // see \ref{exception} for the specification of the special member functions const char* what() const noexcept override; }; } @@ -3150,12 +3130,6 @@ \pnum \returns An \impldef{return value of \tcode{bad_cast::what}} \ntbs{}. - -\pnum -\remarks -The message may be a null-terminated multibyte string\iref{multibyte.strings}, -suitable for conversion and display as a -\tcode{wstring}~(\ref{string.classes}, \ref{locale.codecvt}) \end{itemdescr} \rSec2[bad.typeid]{Class \tcode{bad_typeid}} @@ -3166,9 +3140,7 @@ namespace std { class bad_typeid : public exception { public: - bad_typeid() noexcept; - bad_typeid(const bad_typeid&) noexcept; - bad_typeid& operator=(const bad_typeid&) noexcept; + // see \ref{exception} for the specification of the special member functions const char* what() const noexcept override; }; } @@ -3192,12 +3164,6 @@ \pnum \returns An \impldef{return value of \tcode{bad_typeid::what}} \ntbs{}. - -\pnum -\remarks -The message may be a null-terminated multibyte string\iref{multibyte.strings}, -suitable for conversion and display as a -\tcode{wstring}~(\ref{string.classes}, \ref{locale.codecvt}) \end{itemdescr} \rSec1[support.contract]{Contract violation handling} @@ -3353,12 +3319,20 @@ expressions, to report errors detected during program execution. \pnum -Each standard library class \tcode{T} that derives from class \tcode{exception} shall have a -publicly accessible copy constructor and a publicly accessible copy assignment -operator that do not exit with an exception. These member functions shall meet +Each standard library class \tcode{T} that derives from class \tcode{exception} +has the following publicly accessible member functions, each of them having +a non-throwing exception specification\iref{except.spec}: +\begin{itemize} +\item default constructor (unless the class synopsis shows other constructors) +\item copy constructor +\item copy assignment operator +\end{itemize} +The copy constructor and the copy assignment operator meet the following postcondition: If two objects \tcode{lhs} and \tcode{rhs} both have dynamic type \tcode{T} and \tcode{lhs} is a copy of \tcode{rhs}, then -\tcode{strcmp(lhs.what(), rhs.what())} shall equal 0. +\tcode{strcmp(lhs.what(), rhs.what())} is equal to \tcode{0}. +The \tcode{what()} member function of each such \tcode{T} satisfies the +constraints specified for \tcode{exception::what()} (see below). \indexlibrary{\idxcode{exception}!constructor}% \indexlibrarymember{operator=}{exception}% @@ -3413,9 +3387,7 @@ namespace std { class bad_exception : public exception { public: - bad_exception() noexcept; - bad_exception(const bad_exception&) noexcept; - bad_exception& operator=(const bad_exception&) noexcept; + // see \ref{exception} for the specification of the special member functions const char* what() const noexcept override; }; } @@ -3438,12 +3410,6 @@ \pnum \returns An \impldef{return value of \tcode{bad_exception::what}} \ntbs{}. - -\pnum -\remarks -The message may be a null-terminated multibyte string\iref{multibyte.strings}, -suitable for conversion and display as a -\tcode{wstring}~(\ref{string.classes}, \ref{locale.codecvt}). \end{itemdescr} \rSec2[exception.terminate]{Abnormal termination} @@ -3567,7 +3533,7 @@ \pnum \tcode{exception_ptr} meets the requirements of -\oldconcept{NullablePointer} (\tref{nullablepointer}). +\oldconcept{NullablePointer} (\tref{cpp17.nullablepointer}). \pnum Two non-null values of type \tcode{exception_ptr} are equivalent and compare equal if and @@ -3951,10 +3917,10 @@ from one of the following exposition-only enumerations: \begin{codeblock} -enum class eq { equal = 0, equivalent = equal, - nonequal = 1, nonequivalent = nonequal }; // \expos -enum class ord { less = -1, greater = 1 }; // \expos -enum class ncmp { unordered = -127 }; // \expos +enum class @\placeholdernc{eq}@ { @\placeholdernc{equal}@ = 0, @\placeholdernc{equivalent}@ = @\placeholdernc{equal}@, + @\placeholdernc{nonequal}@ = 1, @\placeholdernc{nonequivalent}@ = @\placeholdernc{nonequal}@ }; // \expos +enum class @\placeholdernc{ord}@ { @\placeholdernc{less}@ = -1, @\placeholdernc{greater}@ = 1 }; // \expos +enum class @\placeholdernc{ncmp}@ { @\placeholdernc{unordered}@ = -127 }; // \expos \end{codeblock} \pnum @@ -3971,7 +3937,7 @@ these parameters can accept literal \tcode{0} as a corresponding argument. \begin{example} \tcode{nullptr_t} -satisfies this requirement. +meets this requirement. \end{example} In this context, the behavior of a program that supplies an argument other than a literal \tcode{0} is undefined. @@ -4000,7 +3966,7 @@ int value; // \expos // exposition-only constructor - constexpr explicit weak_equality(eq v) noexcept : value(int(v)) {} // \expos + constexpr explicit weak_equality(@\placeholder{eq}@ v) noexcept : value(int(v)) {} // \expos public: // valid values @@ -4017,8 +3983,8 @@ }; // valid values' definitions - inline constexpr weak_equality weak_equality::equivalent(eq::equivalent); - inline constexpr weak_equality weak_equality::nonequivalent(eq::nonequivalent); + inline constexpr weak_equality weak_equality::equivalent(@\placeholder{eq}@::@\placeholder{equivalent}@); + inline constexpr weak_equality weak_equality::nonequivalent(@\placeholder{eq}@::@\placeholder{nonequivalent}@); } \end{codeblock} @@ -4077,7 +4043,7 @@ int value; // \expos // exposition-only constructor - constexpr explicit strong_equality(eq v) noexcept : value(int(v)) {} // \expos + constexpr explicit strong_equality(@\placeholder{eq}@ v) noexcept : value(int(v)) {} // \expos public: // valid values @@ -4099,10 +4065,10 @@ }; // valid values' definitions - inline constexpr strong_equality strong_equality::equal(eq::equal); - inline constexpr strong_equality strong_equality::nonequal(eq::nonequal); - inline constexpr strong_equality strong_equality::equivalent(eq::equivalent); - inline constexpr strong_equality strong_equality::nonequivalent(eq::nonequivalent); + inline constexpr strong_equality strong_equality::equal(@\placeholder{eq}@::@\placeholder{equal}@); + inline constexpr strong_equality strong_equality::nonequal(@\placeholder{eq}@::@\placeholder{nonequal}@); + inline constexpr strong_equality strong_equality::equivalent(@\placeholder{eq}@::@\placeholder{equivalent}@); + inline constexpr strong_equality strong_equality::nonequivalent(@\placeholder{eq}@::@\placeholder{nonequivalent}@); } \end{codeblock} @@ -4176,11 +4142,11 @@ // exposition-only constructors constexpr explicit - partial_ordering(eq v) noexcept : value(int(v)), is_ordered(true) {} // \expos + partial_ordering(@\placeholder{eq}@ v) noexcept : value(int(v)), is_ordered(true) {} // \expos constexpr explicit - partial_ordering(ord v) noexcept : value(int(v)), is_ordered(true) {} // \expos + partial_ordering(@\placeholder{ord}@ v) noexcept : value(int(v)), is_ordered(true) {} // \expos constexpr explicit - partial_ordering(ncmp v) noexcept : value(int(v)), is_ordered(false) {} // \expos + partial_ordering(@\placeholder{ncmp}@ v) noexcept : value(int(v)), is_ordered(false) {} // \expos public: // valid values @@ -4210,10 +4176,10 @@ }; // valid values' definitions - inline constexpr partial_ordering partial_ordering::less(ord::less); - inline constexpr partial_ordering partial_ordering::equivalent(eq::equivalent); - inline constexpr partial_ordering partial_ordering::greater(ord::greater); - inline constexpr partial_ordering partial_ordering::unordered(ncmp::unordered); + inline constexpr partial_ordering partial_ordering::less(@\placeholder{ord}@::@\placeholder{less}@); + inline constexpr partial_ordering partial_ordering::equivalent(@\placeholder{eq}@::@\placeholder{equivalent}@); + inline constexpr partial_ordering partial_ordering::greater(@\placeholder{ord}@::@\placeholder{greater}@); + inline constexpr partial_ordering partial_ordering::unordered(@\placeholder{ncmp}@::@\placeholder{unordered}@); } \end{codeblock} @@ -4321,8 +4287,8 @@ int value; // \expos // exposition-only constructors - constexpr explicit weak_ordering(eq v) noexcept : value(int(v)) {} // \expos - constexpr explicit weak_ordering(ord v) noexcept : value(int(v)) {} // \expos + constexpr explicit weak_ordering(@\placeholder{eq}@ v) noexcept : value(int(v)) {} // \expos + constexpr explicit weak_ordering(@\placeholder{ord}@ v) noexcept : value(int(v)) {} // \expos public: // valid values @@ -4352,9 +4318,9 @@ }; // valid values' definitions - inline constexpr weak_ordering weak_ordering::less(ord::less); - inline constexpr weak_ordering weak_ordering::equivalent(eq::equivalent); - inline constexpr weak_ordering weak_ordering::greater(ord::greater); + inline constexpr weak_ordering weak_ordering::less(@\placeholder{ord}@::@\placeholder{less}@); + inline constexpr weak_ordering weak_ordering::equivalent(@\placeholder{eq}@::@\placeholder{equivalent}@); + inline constexpr weak_ordering weak_ordering::greater(@\placeholder{ord}@::@\placeholder{greater}@); } \end{codeblock} @@ -4467,8 +4433,8 @@ int value; // \expos // exposition-only constructors - constexpr explicit strong_ordering(eq v) noexcept : value(int(v)) {} // \expos - constexpr explicit strong_ordering(ord v) noexcept : value(int(v)) {} // \expos + constexpr explicit strong_ordering(@\placeholder{eq}@ v) noexcept : value(int(v)) {} // \expos + constexpr explicit strong_ordering(@\placeholder{ord}@ v) noexcept : value(int(v)) {} // \expos public: // valid values @@ -4501,10 +4467,10 @@ }; // valid values' definitions - inline constexpr strong_ordering strong_ordering::less(ord::less); - inline constexpr strong_ordering strong_ordering::equal(eq::equal); - inline constexpr strong_ordering strong_ordering::equivalent(eq::equivalent); - inline constexpr strong_ordering strong_ordering::greater(ord::greater); + inline constexpr strong_ordering strong_ordering::less(@\placeholder{ord}@::@\placeholder{less}@); + inline constexpr strong_ordering strong_ordering::equal(@\placeholder{eq}@::@\placeholder{equal}@); + inline constexpr strong_ordering strong_ordering::equivalent(@\placeholder{eq}@::@\placeholder{equivalent}@); + inline constexpr strong_ordering strong_ordering::greater(@\placeholder{ord}@::@\placeholder{greater}@); } \end{codeblock} @@ -4892,7 +4858,7 @@ \term{coroutine traits}, and defines the class template \tcode{coroutine_traits} -that satisfies those requirements. +that meets those requirements. \rSec3[coroutine.traits.primary]{Class template \tcode{coroutine_traits}} @@ -4912,7 +4878,7 @@ Otherwise, \tcode{coroutine_traits} has no members. \pnum -Program defined specializations of this template shall define a publicly +Program-defined specializations of this template shall define a publicly accessible nested type named \tcode{promise_type}. \rSec2[coroutine.handle]{Class template \tcode{coroutine_handle}} @@ -4930,7 +4896,7 @@ // \ref{coroutine.handle.export.import}, export/import constexpr void* address() const noexcept; - constexpr static coroutine_handle from_address(void* addr); + static constexpr coroutine_handle from_address(void* addr); // \ref{coroutine.handle.observers}, observers constexpr explicit operator bool() const noexcept; @@ -4954,7 +4920,7 @@ coroutine_handle& operator=(nullptr_t) noexcept; // \ref{coroutine.handle.export.import}, export/import - constexpr static coroutine_handle from_address(void* addr); + static constexpr coroutine_handle from_address(void* addr); // \ref{coroutine.handle.promise}, promise access Promise& promise() const; @@ -5029,8 +4995,8 @@ \indexlibrarymember{from_address}{coroutine_handle}% \begin{itemdecl} -constexpr static coroutine_handle<> coroutine_handle<>::from_address(void* addr); -constexpr static coroutine_handle coroutine_handle::from_address(void* addr); +static constexpr coroutine_handle<> coroutine_handle<>::from_address(void* addr); +static constexpr coroutine_handle coroutine_handle::from_address(void* addr); \end{itemdecl} \begin{itemdescr} diff --git a/source/tables.tex b/source/tables.tex index 1b63834806..1d2facbaf3 100644 --- a/source/tables.tex +++ b/source/tables.tex @@ -47,31 +47,41 @@ { } +% floattablebase without TableBase, used for lib2dtab2base +\newenvironment{floattablebasex}[4] +{ + \begin{table}[#4] + \caption{\label{tab:#2}#1 \quad [tab:#2]} + \begin{center} + \begin{tabular}{|#3|} +} +{ + \bottomline + \end{tabular} + \end{center} + \end{table} +} + + % General Usage: TITLE is the title of the table, XREF is the % cross-reference for the table. LAYOUT is a sequence of column % type specifiers (e.g. cp{1.0}c), without '|' for the left edge % or right edge. -% usage: \begin{floattablebase}{TITLE}{XREF}{COLUMNS}{PLACEMENT} +% usage: \begin{floattablebase}{TITLE}{XREF}{LAYOUT}{PLACEMENT} % produces floating table, location determined within limits % by LaTeX. \newenvironment{floattablebase}[4] { \begin{TableBase} - \begin{table}[#4] - \caption{\label{#2}#1} - \begin{center} - \begin{tabular}{|#3|} + \begin{floattablebasex}{#1}{#2}{#3}{#4} } { - \bottomline - \end{tabular} - \end{center} - \end{table} + \end{floattablebasex} \end{TableBase} } -% usage: \begin{floattable}{TITLE}{XREF}{COLUMNS} +% usage: \begin{floattable}{TITLE}{XREF}{LAYOUT} % produces floating table, location determined within limits % by LaTeX. \newenvironment{floattable}[3] @@ -94,7 +104,7 @@ \end{tabular} } -% usage: \begin{multicolfloattable}{TITLE}{XREF}{COLUMNS} +% usage: \begin{multicolfloattable}{TITLE}{XREF}{LAYOUT} % produces floating table, location determined within limits % by LaTeX. \newenvironment{multicolfloattable}[3] @@ -129,61 +139,45 @@ % produces three-column table with column headers HDR1 and HDR2. % Used in "Library Categories" table in standard, and used as % base for other library summary tables. -\newenvironment{libsumtabbase}[4] +\newenvironment{libsumtabbase}[5] { - \begin{floattable}{#1}{#2}{lll} + \begin{floattable}{#2}{#3}{ll#1} \topline - \lhdrx{2}{#3} & \hdstyle{#4} \\ \capsep + & \hdstyle{#4} & \hdstyle{#5} \\ \capsep } { \end{floattable} } -% usage: \begin{libsumtab}{TITLE}{XREF} +% usage: \begin{libsumtab}[LASTCOLUMN]{TITLE}{XREF} % produces three-column table with column headers "Subclause" and "Header(s)". % Used in "C++ Headers for Freestanding Implementations" table in standard. -\newenvironment{libsumtab}[2] +\newenvironment{libsumtab}[3][l] { - \begin{libsumtabbase}{#1}{#2}{Subclause}{Header(s)} + \begin{libsumtabbase}{#1}{#2}{#3}{Subclause}{Header} } { \end{libsumtabbase} } -% usage: \begin{concepttable}{TITLE}{TAG}{LAYOUT} +% usage: \begin{concepttable}{TITLE}{XREF}{LAYOUT} % produces table at current location \newenvironment{concepttable}[3] { - \begin{TableBase} - \begin{table}[!htb] - \caption[#1]{\label{tab:#2}#1} - \begin{center} - \begin{tabular}{|#3|} + \begin{floattablebase}{#1}{#2}{#3}{!htb} } { - \bottomline - \end{tabular} - \end{center} - \end{table} - \end{TableBase} + \end{floattablebase} } -% usage: \begin{simpletypetable}{TITLE}{TAG}{LAYOUT} +% usage: \begin{simpletypetable}{TITLE}{XREF}{LAYOUT} % produces table at current location \newenvironment{simpletypetable}[3] { - \begin{TableBase} - \begin{table}[!htb] - \caption{#1}\label{#2} - \begin{center} - \begin{tabular}{|#3|} + \begin{floattablebase}{#1}{#2}{#3}{!htb} } { - \bottomline - \end{tabular} - \end{center} - \end{table} - \end{TableBase} + \end{floattablebase} } % usage: \begin{LongTable}{TITLE}{XREF}{LAYOUT} @@ -192,8 +186,8 @@ { \newcommand{\continuedcaption}{\caption[]{#1 (continued)}} \begin{TableBase} - \begin{longtable} - {|#3|}\caption{#1}\label{#2} + \begin{longtable}{|#3|} + \caption{#1 \quad [tab:#2]}\label{tab:#2} } { \bottomline @@ -423,18 +417,6 @@ \end{LibEffTab} } -% usage: \begin{libefftabvaluenarrow}{TITLE}{XREF} -% produces a two-column effects table with right column -% header "Value", width 1.5 in. Used in basic_string_view effects -% tables in standard. -\newenvironment{libefftabvaluenarrow}[2] -{ - \begin{LibEffTab}{#1}{#2}{Value}{1.5in} -} -{ - \end{LibEffTab} -} - % Same as libefftabvalue except that it uses a long table and a % slightly wider column. \newenvironment{longlibefftabvalue}[2] @@ -487,21 +469,17 @@ \newcommand{\hdstyle}[1]{\textbf{##1}} \newcommand{\rowhdr}[1]{\hdstyle{##1}&} \newcommand{\colhdr}[1]{\multicolumn{1}{|>{\centering}m{#6}|}{\hdstyle{##1}}} - %% FIXME: figure out a way to reuse floattable here - \begin{table}[htbp] - \caption{\label{#2}#1} - \begin{center} - \begin{tabular}{|>{\centering}m{#5}|@{}p{0.2\normalbaselineskip}@{}|m{#6}|m{#7}|} + \begin{floattablebasex} + {#1}{#2} + {>{\centering}m{#5}|@{}p{0.2\normalbaselineskip}@{}|m{#6}|m{#7} } + {htbp} %% table header \topline \multicolumn{1}{c}{}&&\colhdr{#3}&\colhdr{#4}\\ \capsep } { - \bottomline - \end{tabular} - \end{center} - \end{table} + \end{floattablebasex} } \newenvironment{lib2dtab2}[4]{ diff --git a/source/templates.tex b/source/templates.tex index 69e946c552..bf11adf624 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -2754,11 +2754,11 @@ which evaluates to \tcode{false}. \end{example} If $N$ is zero for a unary fold-expression, -the value of the expression is shown in \tref{fold.empty}; -if the operator is not listed in \tref{fold.empty}, +the value of the expression is shown in \tref{temp.fold.empty}; +if the operator is not listed in \tref{temp.fold.empty}, the instantiation is ill-formed. -\begin{floattable}{Value of folding empty sequences}{tab:fold.empty} +\begin{floattable}{Value of folding empty sequences}{temp.fold.empty} {ll} \topline \lhdr{Operator} & \rhdr{Value when pack is empty} \\ @@ -5122,10 +5122,10 @@ simple-type-specifier \terminal{(} \opt{expression-list} \terminal{)}\br \opt{\terminal{::}} \keyword{new} \opt{new-placement} new-type-id \opt{new-initializer}\br \opt{\terminal{::}} \keyword{new} \opt{new-placement} \terminal{(} type-id \terminal{)} \opt{new-initializer}\br -\keyword{dynamic_cast} \terminal{<} type-id \terminal{> (} expression \terminal{)}\br -\keyword{static_cast} \terminal{<} type-id \terminal{> (} expression \terminal{)}\br -\keyword{const_cast} \terminal{<} type-id \terminal{> (} expression \terminal{)}\br -\keyword{reinterpret_cast} \terminal{<} type-id \terminal{> (} expression \terminal{)}\br +\keyword{dynamic_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br +\keyword{static_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br +\keyword{const_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br +\keyword{reinterpret_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br \terminal{(} type-id \terminal{)} cast-expression \end{ncsimplebnf} @@ -5142,7 +5142,7 @@ \keyword{typeid} \terminal{(} expression \terminal{)}\br \keyword{typeid} \terminal{(} type-id \terminal{)}\br \opt{\terminal{::}} \keyword{delete} cast-expression\br -\opt{\terminal{::}} \keyword{delete} \terminal{[ ]} cast-expression\br +\opt{\terminal{::}} \keyword{delete} \terminal{[} \terminal{]} cast-expression\br \keyword{throw} \opt{assignment-expression}\br \keyword{noexcept} \terminal{(} expression \terminal{)} \end{ncsimplebnf} @@ -5249,9 +5249,9 @@ \begin{ncsimplebnf} simple-type-specifier \terminal{(} \opt{expression-list} \terminal{)}\br -\keyword{static_cast} \terminal{<} type-id \terminal{> (} expression \terminal{)}\br -\keyword{const_cast} \terminal{<} type-id \terminal{> (} expression \terminal{)}\br -\keyword{reinterpret_cast} \terminal{<} type-id \terminal{> (} expression \terminal{)}\br +\keyword{static_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br +\keyword{const_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br +\keyword{reinterpret_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br \terminal{(} type-id \terminal{)} cast-expression \end{ncsimplebnf} @@ -5984,7 +5984,7 @@ template void h(decltype(int{B ? f() : 0})); template void h(...); void x() { - g(0); // OK, \tcode{B ? f() : 0} is not potentially constant evaluated + g(0); // OK, \tcode{B ? f() :\ 0} is not potentially constant evaluated h(0); // error, instantiates \tcode{f} even though \tcode{B} evaluates to \tcode{false} and // list-initialization of \tcode{int} from \tcode{int} cannot be narrowing } @@ -6213,12 +6213,6 @@ A member function, member class or static data member of a class template can be explicitly instantiated from the member definition associated with its class template. -An explicit instantiation of a -function template, -member function of a class template, or -variable template -shall not -use the \tcode{inline}, \tcode{constexpr}, or \tcode{consteval} specifiers. \pnum The syntax for explicit instantiation is: @@ -6232,6 +6226,19 @@ definition and an explicit instantiation declaration. An explicit instantiation declaration begins with the \tcode{extern} keyword. +\pnum +An explicit instantiation shall not use +a \grammarterm{storage-class-specifier}\iref{dcl.stc} +other than \keyword{thread_local}. +An explicit instantiation of a +function template, +member function of a class template, or +variable template +shall not +use the \tcode{inline}, \tcode{constexpr}, or \tcode{consteval} specifiers. +No \grammarterm{attribute-specifier-seq}\iref{dcl.attr.grammar} +shall appertain to an explicit instantiation. + \pnum If the explicit instantiation is for a class or member class, the \grammarterm{elaborated-type-specifier} in the \grammarterm{declaration} @@ -6496,7 +6503,7 @@ \begin{bnf} \nontermdef{explicit-specialization}\br - \keyword{template} \terminal{< >} declaration + \keyword{template} \terminal{<} \terminal{>} declaration \end{bnf} \begin{example} @@ -6527,6 +6534,11 @@ types will be sorted by functions generated from the template. \end{example} +\pnum +An explicit specialization shall not use +a \grammarterm{storage-class-specifier}\iref{dcl.stc} +other than \keyword{thread_local}. + \pnum An explicit specialization may be declared in any scope in which the corresponding primary template @@ -6870,7 +6882,7 @@ except that the declaration shall not explicitly specialize a class member template if its enclosing class templates are not explicitly specialized as well. -In such explicit specialization declaration, the keyword +In such an explicit specialization declaration, the keyword \tcode{template} followed by a \grammarterm{template-parameter-list} @@ -8612,6 +8624,8 @@ // template argument value in the type \tcode{A<2>} \end{codeblock} \end{example} + +\pnum The type of \tcode{N} in the type \tcode{T[N]} is \tcode{std::size_t}. \begin{example} \begin{codeblock} @@ -8988,7 +9002,7 @@ \begin{bnf} \nontermdef{deduction-guide}\br - \opt{\keyword{explicit}} template-name \terminal{(} parameter-declaration-clause \terminal{) ->} simple-template-id \terminal{;} + \opt{\keyword{explicit}} template-name \terminal{(} parameter-declaration-clause \terminal{)} \terminal{->} simple-template-id \terminal{;} \end{bnf} \pnum diff --git a/source/threads.tex b/source/threads.tex index 72111de61a..b44121a225 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -7,13 +7,13 @@ The following subclauses describe components to create and manage threads\iref{intro.multithread}, perform mutual exclusion, and communicate conditions and values -between threads, as summarized in \tref{thread.lib.summary}. +between threads, as summarized in \tref{thread.summary}. -\begin{libsumtab}{Thread support library summary}{tab:thread.lib.summary} +\begin{libsumtab}{Thread support library summary}{thread.summary} \ref{thread.req} & Requirements & \\ \rowsep \ref{thread.threads} & Threads & \tcode{} \\ \rowsep -\ref{thread.mutex} & Mutual exclusion & \tcode{} \\ - & & \tcode{} \\ \rowsep +\ref{thread.mutex} & Mutual exclusion & + \tcode{}, \tcode{} \\ \rowsep \ref{thread.condition}& Condition variables & \tcode{} \\ \rowsep \ref{futures} & Futures & \tcode{} \\ \end{libsumtab} @@ -132,7 +132,7 @@ \term{native resolution}. \pnum -Implementation-provided clocks that are used for these functions shall satisfy the +Implementation-provided clocks that are used for these functions shall meet the \oldconcept{TrivialClock} requirements\iref{time.clock.req}. \pnum @@ -506,7 +506,7 @@ \begin{itemdescr} \pnum -\requires\ \tcode{F} and each $\tcode{T}_i$ in \tcode{Args} shall satisfy the +\requires\ \tcode{F} and each $\tcode{T}_i$ in \tcode{Args} shall meet the \oldconcept{MoveConstructible} requirements. \tcode{% \placeholdernc{INVOKE}(\brk{}% @@ -874,11 +874,11 @@ The \defn{mutex types} are the standard library types \tcode{mutex}, \tcode{recursive_mutex}, \tcode{timed_mutex}, \tcode{recursive_timed_mutex}, \tcode{shared_mutex}, and \tcode{shared_timed_mutex}. -They shall satisfy the requirements set out in this subclause. In this description, \tcode{m} +They shall meet the requirements set out in this subclause. In this description, \tcode{m} denotes an object of a mutex type. \pnum -The mutex types shall satisfy the \oldconcept{Lockable} requirements\iref{thread.req.lockable.req}. +The mutex types shall meet the \oldconcept{Lockable} requirements\iref{thread.req.lockable.req}. \pnum The mutex types shall be \oldconcept{DefaultConstructible} and \oldconcept{Destructible}. If @@ -1044,7 +1044,7 @@ \end{note} \pnum -The class \tcode{mutex} shall satisfy all of the mutex +The class \tcode{mutex} shall meet all of the mutex requirements\iref{thread.mutex.requirements}. It shall be a standard-layout class\iref{class.prop}. @@ -1088,7 +1088,7 @@ (for \tcode{lock()}) until the first thread has completely released ownership. \pnum -The class \tcode{recursive_mutex} shall satisfy all of the mutex +The class \tcode{recursive_mutex} shall meet all of the mutex requirements\iref{thread.mutex.requirements}. It shall be a standard-layout class\iref{class.prop}. @@ -1124,7 +1124,7 @@ instantiation of \tcode{time_point}\iref{time.point}. \pnum -The timed mutex types shall satisfy the \oldconcept{TimedLockable} +The timed mutex types shall meet the \oldconcept{TimedLockable} requirements\iref{thread.req.lockable.timed}. \pnum @@ -1231,7 +1231,7 @@ failed to obtain ownership). \pnum -The class \tcode{timed_mutex} shall satisfy all of the timed mutex +The class \tcode{timed_mutex} shall meet all of the timed mutex requirements\iref{thread.timedmutex.requirements}. It shall be a standard-layout class\iref{class.prop}. @@ -1282,7 +1282,7 @@ times out (having failed to obtain ownership). \pnum -The class \tcode{recursive_timed_mutex} shall satisfy all of the timed mutex +The class \tcode{recursive_timed_mutex} shall meet all of the timed mutex requirements\iref{thread.timedmutex.requirements}. It shall be a standard-layout class\iref{class.prop}. @@ -1313,9 +1313,9 @@ \pnum The standard library types \tcode{shared_mutex} and \tcode{shared_timed_mutex} -are \defn{shared mutex types}. Shared mutex types shall satisfy the requirements of +are \defn{shared mutex types}. Shared mutex types shall meet the requirements of mutex types\iref{thread.mutex.requirements.mutex}, and additionally -shall satisfy the requirements set out below. In this description, +shall meet the requirements set out below. In this description, \tcode{m} denotes an object of a shared mutex type. \pnum @@ -1448,7 +1448,7 @@ with shared ownership semantics. \pnum -The class \tcode{shared_mutex} shall satisfy all of the +The class \tcode{shared_mutex} shall meet all of the shared mutex requirements\iref{thread.sharedmutex.requirements}. It shall be a standard-layout class\iref{class.prop}. @@ -1467,10 +1467,10 @@ \pnum The standard library type \tcode{shared_timed_mutex} is a -\defn{shared timed mutex type}. Shared timed mutex types shall satisfy the requirements of +\defn{shared timed mutex type}. Shared timed mutex types shall meet the requirements of timed mutex types\iref{thread.timedmutex.requirements}, shared mutex types\iref{thread.sharedmutex.requirements}, and additionally -shall satisfy the requirements set out below. In this description, +shall meet the requirements set out below. In this description, \tcode{m} denotes an object of a shared timed mutex type, \tcode{rel_type} denotes an object of an instantiation of \tcode{duration}\iref{time.duration}, and @@ -1588,7 +1588,7 @@ ownership semantics. \pnum -The class \tcode{shared_timed_mutex} shall satisfy all of the +The class \tcode{shared_timed_mutex} shall meet all of the shared timed mutex requirements\iref{thread.sharedtimedmutex.requirements}. It shall be a standard-layout class\iref{class.prop}. @@ -1664,7 +1664,7 @@ object throughout the \tcode{lock_guard} object's lifetime\iref{basic.life}. The behavior of a program is undefined if the lockable object referenced by \tcode{pm} does not exist for the entire lifetime of the \tcode{lock_guard} -object. The supplied \tcode{Mutex} type shall satisfy the \oldconcept{BasicLockable} +object. The supplied \tcode{Mutex} type shall meet the \oldconcept{BasicLockable} requirements\iref{thread.req.lockable.basic}. \indexlibrary{\idxcode{lock_guard}!constructor}% @@ -1740,9 +1740,9 @@ object. When \tcode{sizeof...(MutexTypes)} is \tcode{1}, the supplied \tcode{Mutex} type -shall satisfy the \oldconcept{BasicLockable} requirements\iref{thread.req.lockable.basic}. +shall meet the \oldconcept{BasicLockable} requirements\iref{thread.req.lockable.basic}. Otherwise, each of the mutex types -shall satisfy the \oldconcept{Lockable} requirements\iref{thread.req.lockable.req}. +shall meet the \oldconcept{Lockable} requirements\iref{thread.req.lockable.req}. \indexlibrary{\idxcode{scoped_lock}!constructor}% \begin{itemdecl} @@ -1855,7 +1855,7 @@ \tcode{pm} is not null and the lockable object pointed to by \tcode{pm} does not exist for the entire remaining lifetime\iref{basic.life} of the \tcode{unique_lock} object. The supplied -\tcode{Mutex} type shall satisfy the \oldconcept{BasicLockable} +\tcode{Mutex} type shall meet the \oldconcept{BasicLockable} requirements\iref{thread.req.lockable.basic}. \pnum @@ -1918,7 +1918,7 @@ \begin{itemdescr} \pnum \requires -The supplied \tcode{Mutex} type shall satisfy the \oldconcept{Lockable} +The supplied \tcode{Mutex} type shall meet the \oldconcept{Lockable} requirements\iref{thread.req.lockable.req}. If \tcode{mutex_type} is not a recursive mutex the calling thread does not own the mutex. @@ -1958,7 +1958,7 @@ \begin{itemdescr} \pnum \requires If \tcode{mutex_type} is not a recursive mutex the calling thread -does not own the mutex. The supplied \tcode{Mutex} type shall satisfy the +does not own the mutex. The supplied \tcode{Mutex} type shall meet the \oldconcept{TimedLockable} requirements\iref{thread.req.lockable.timed}. \pnum @@ -1979,7 +1979,7 @@ \begin{itemdescr} \pnum \requires If \tcode{mutex_type} is not a recursive mutex the calling thread does not own the mutex. -The supplied \tcode{Mutex} type shall satisfy the \oldconcept{TimedLockable} requirements\iref{thread.req.lockable.timed}. +The supplied \tcode{Mutex} type shall meet the \oldconcept{TimedLockable} requirements\iref{thread.req.lockable.timed}. \pnum \effects Constructs an object of type \tcode{unique_lock} and calls \tcode{m.try_lock_for(rel_time)}. @@ -2059,7 +2059,7 @@ \begin{itemdescr} \pnum -\requires The supplied \tcode{Mutex} shall satisfy the \oldconcept{Lockable} +\requires The supplied \tcode{Mutex} shall meet the \oldconcept{Lockable} requirements\iref{thread.req.lockable.req}. \pnum @@ -2093,7 +2093,7 @@ \begin{itemdescr} \pnum -\requires The supplied \tcode{Mutex} type shall satisfy the \oldconcept{TimedLockable} +\requires The supplied \tcode{Mutex} type shall meet the \oldconcept{TimedLockable} requirements\iref{thread.req.lockable.timed}. \pnum @@ -2127,7 +2127,7 @@ \begin{itemdescr} \pnum -\requires The supplied \tcode{Mutex} type shall satisfy the \oldconcept{TimedLockable} requirements\iref{thread.req.lockable.timed}. +\requires The supplied \tcode{Mutex} type shall meet the \oldconcept{TimedLockable} requirements\iref{thread.req.lockable.timed}. \pnum \effects As if by \tcode{pm->try_lock_for(rel_time)}. @@ -2296,7 +2296,7 @@ is undefined if the contained pointer \tcode{pm} is not null and the lockable object pointed to by \tcode{pm} does not exist for the entire remaining lifetime\iref{basic.life} of the \tcode{shared_lock} object. The supplied -\tcode{Mutex} type shall satisfy the shared mutex +\tcode{Mutex} type shall meet the shared mutex requirements\iref{thread.sharedtimedmutex.requirements}. \pnum @@ -2675,7 +2675,7 @@ \begin{itemdescr} \pnum -\requires Each template parameter type shall satisfy the \oldconcept{Lockable} requirements. \begin{note} The +\requires Each template parameter type shall meet the \oldconcept{Lockable} requirements. \begin{note} The \tcode{unique_lock} class template meets these requirements when suitably instantiated. \end{note} @@ -2699,7 +2699,7 @@ \begin{itemdescr} \pnum -\requires Each template parameter type shall satisfy the \oldconcept{Lockable} requirements, +\requires Each template parameter type shall meet the \oldconcept{Lockable} requirements, \begin{note} The \tcode{unique_lock} class template meets these requirements when suitably instantiated. \end{note} @@ -3305,7 +3305,7 @@ \rSec2[thread.condition.condvarany]{Class \tcode{condition_variable_any}} \pnum -A \tcode{Lock} type shall satisfy the \oldconcept{BasicLockable} +A \tcode{Lock} type shall meet the \oldconcept{BasicLockable} requirements\iref{thread.req.lockable.basic}. \begin{note} All of the standard mutex types meet this requirement. If a \tcode{Lock} type other than one of the standard mutex types or a \tcode{unique_lock} wrapper for a standard mutex type @@ -3914,8 +3914,8 @@ \begin{itemdescr} \pnum -\requires \tcode{Alloc} shall satisfy the \oldconcept{Allocator} -requirements (\tref{utilities.allocator.requirements}). +\requires \tcode{Alloc} shall meet the \oldconcept{Allocator} +requirements (\tref{cpp17.allocator}). \end{itemdescr} @@ -4777,7 +4777,7 @@ \begin{itemdescr} \pnum \requires \tcode{F} and each $\tcode{T}_i$ in \tcode{Args} shall -satisfy the +meet the \oldconcept{MoveConstructible} requirements, and \begin{codeblock} @\placeholdernc{INVOKE}@(@\placeholdernc{decay-copy}@(std::forward(f)), diff --git a/source/time.tex b/source/time.tex index 95abf28e35..4bcdba97b2 100644 --- a/source/time.tex +++ b/source/time.tex @@ -7,9 +7,9 @@ \indexlibrary{\idxcode{chrono}}% This Clause describes the chrono library\iref{time.syn} and various C functions\iref{ctime.syn} that provide generally useful time -utilities, as summarized in \tref{time.lib.summary}. +utilities, as summarized in \tref{time.summary}. -\begin{libsumtab}{Time library summary}{tab:time.lib.summary} +\begin{libsumtab}{Time library summary}{time.summary} \ref{time.clock.req} & \oldconcept{Clock} requirements & \\ \rowsep \ref{time.traits} & Time-related traits & \tcode{} \\ \ref{time.duration} & Class template \tcode{duration} & \\ @@ -1024,7 +1024,7 @@ A clock is a bundle consisting of a \tcode{duration}, a \tcode{time_point}, and a function \tcode{now()} to get the current \tcode{time_point}. The origin of the clock's \tcode{time_point} is referred to as the clock's \defn{epoch}. - A clock shall satisfy the requirements in \tref{time.clock}. + A clock shall meet the requirements in \tref{time.clock}. \pnum In \tref{time.clock} \tcode{C1} and \tcode{C2} denote clock types. \tcode{t1} and @@ -1037,7 +1037,7 @@ \begin{libreqtab3a} {\oldconcept{Clock} requirements} -{tab:time.clock} +{time.clock} \\ \topline \lhdr{Expression} & \chdr{Return type} & \rhdr{Operational semantics} \\ \capsep \endfirsthead @@ -1082,11 +1082,11 @@ A type \tcode{TC} meets the \oldconcept{TrivialClock} requirements if: \begin{itemize} -\item \tcode{TC} satisfies the \oldconcept{Clock} requirements\iref{time.clock.req}, +\item \tcode{TC} meets the \oldconcept{Clock} requirements\iref{time.clock.req}, \item the types \tcode{TC::rep}, \tcode{TC::duration}, and \tcode{TC::time_point} -meet the \oldconcept{EqualityComparable} (\tref{equalitycomparable}) and -\oldconcept{LessThanComparable} (\tref{lessthancomparable}) +meet the \oldconcept{EqualityComparable} (\tref{cpp17.equalitycomparable}) and +\oldconcept{LessThanComparable} (\tref{cpp17.lessthancomparable}) requirements and the requirements of numeric types\iref{numeric.requirements}. \begin{note} This means, in particular, that operations on these types will not throw exceptions. \end{note} @@ -1240,7 +1240,7 @@ that a type cannot meet the \oldconcept{Clock} requirements is unspecified, except that as a minimum a type \tcode{T} shall not qualify as a \oldconcept{Clock} -unless it satisfies all of the following conditions: +unless it meets all of the following conditions: \begin{itemize} \item the \grammarterm{qualified-id}s @@ -2191,7 +2191,7 @@ \pnum \tcode{Clock} shall either -satisfy the \oldconcept{Clock} requirements\iref{time.clock.req} +meet the \oldconcept{Clock} requirements\iref{time.clock.req} or be the type \tcode{local_t}. \pnum @@ -2546,7 +2546,7 @@ \rSec1[time.clock]{Clocks} \pnum -The types defined in this subclause shall satisfy the +The types defined in this subclause shall meet the \oldconcept{TrivialClock} requirements\iref{time.clock.req} unless otherwise specified. @@ -3983,8 +3983,8 @@ but may hold non-negative values outside this range. It can be constructed with any \tcode{unsigned} value, which will be subsequently truncated to fit into \tcode{day}'s unspecified internal storage. -\tcode{day} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}) -and \oldconcept{LessThanComparable} (Table~\ref{tab:lessthancomparable}), +\tcode{day} is \oldconcept{EqualityComparable} (\tref{cpp17.equalitycomparable}) +and \oldconcept{LessThanComparable} (\tref{cpp17.lessthancomparable}), and participates in basic arithmetic with \tcode{days} objects, which represent a difference between two \tcode{day} objects. @@ -4273,8 +4273,8 @@ but may hold non-negative values outside this range. It can be constructed with any \tcode{unsigned} value, which will be subsequently truncated to fit into \tcode{month}'s unspecified internal storage. -\tcode{month} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}) -and \oldconcept{LessThanComparable} (Table~\ref{tab:lessthancomparable}), +\tcode{month} is \oldconcept{EqualityComparable} (\tref{cpp17.equalitycomparable}) +and \oldconcept{LessThanComparable} (\tref{cpp17.lessthancomparable}), and participates in basic arithmetic with \tcode{months} objects, which represent a difference between two \tcode{month} objects. @@ -4583,8 +4583,8 @@ It can represent values in the range \crange{min()}{max()}. It can be constructed with any \tcode{int} value, which will be subsequently truncated to fit into \tcode{year}'s unspecified internal storage. -\tcode{year} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}) -and \oldconcept{LessThanComparable} (Table~\ref{tab:lessthancomparable}), +\tcode{year} is \oldconcept{EqualityComparable} (\tref{cpp17.equalitycomparable}) +and \oldconcept{LessThanComparable} (\tref{cpp17.lessthancomparable}), and participates in basic arithmetic with \tcode{years} objects, which represent a difference between two \tcode{year} objects. @@ -4929,7 +4929,7 @@ it may hold non-negative values outside this range. It can be constructed with any \tcode{unsigned} value, which will be subsequently truncated to fit into \tcode{weekday}'s unspecified internal storage. -\tcode{weekday} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}). +\tcode{weekday} is \oldconcept{EqualityComparable} (\tref{cpp17.equalitycomparable}). \begin{note} \tcode{weekday} is not \oldconcept{LessThanComparable} @@ -5493,8 +5493,8 @@ \pnum \tcode{month_day} represents a specific day of a specific month, but with an unspecified year. -\tcode{month_day} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}) -and \oldconcept{LessThanComparable} (Table~\ref{tab:lessthancomparable}). +\tcode{month_day} is \oldconcept{EqualityComparable} (\tref{cpp17.equalitycomparable}) +and \oldconcept{LessThanComparable} (\tref{cpp17.lessthancomparable}). \pnum \tcode{month_day} is a trivially copyable and standard-layout class type. @@ -5979,8 +5979,8 @@ \tcode{year_month} represents a specific month of a specific year, but with an unspecified day. \tcode{year_month} is a field-based time point with a resolution of \tcode{months}. -\tcode{year_month} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}) -and \oldconcept{LessThanComparable} (Table~\ref{tab:lessthancomparable}). +\tcode{year_month} is \oldconcept{EqualityComparable} (\tref{cpp17.equalitycomparable}) +and \oldconcept{LessThanComparable} (\tref{cpp17.lessthancomparable}). \pnum \tcode{year_month} is a trivially copyable and standard-layout class type. @@ -6115,6 +6115,7 @@ \pnum \returns A \tcode{year_month} value \tcode{z} such that \tcode{z - ym == dm}. +\pnum \complexity \bigoh{1} with respect to the value of \tcode{dm}. \end{itemdescr} @@ -6286,8 +6287,8 @@ For the latter, there is a conversion to \tcode{sys_days}, which efficiently supports \tcode{days}-oriented arithmetic. \end{note} -\tcode{year_month_day} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}) -and \oldconcept{LessThanComparable} (Table~\ref{tab:lessthancomparable}), +\tcode{year_month_day} is \oldconcept{EqualityComparable} (\tref{cpp17.equalitycomparable}) +and \oldconcept{LessThanComparable} (\tref{cpp17.lessthancomparable}), \pnum \tcode{year_month_day} is a trivially copyable and standard-layout class type. @@ -6713,8 +6714,8 @@ For the latter, there is a conversion to \tcode{sys_days}, which efficiently supports \tcode{days}-oriented arithmetic. \end{note} -\tcode{year_month_day_last} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}) -and \oldconcept{LessThanComparable} (Table~\ref{tab:lessthancomparable}), +\tcode{year_month_day_last} is \oldconcept{EqualityComparable} (\tref{cpp17.equalitycomparable}) +and \oldconcept{LessThanComparable} (\tref{cpp17.lessthancomparable}), \pnum \tcode{year_month_day_last} is a trivially copyable and standard-layout class type. @@ -7013,7 +7014,7 @@ For the latter, there is a conversion to \tcode{sys_days}, which efficiently supports \tcode{days}-oriented arithmetic. \end{note} -\tcode{year_month_weekday} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}). +\tcode{year_month_weekday} is \oldconcept{EqualityComparable} (\tref{cpp17.equalitycomparable}). \pnum \tcode{year_month_weekday} is a trivially copyable and standard-layout class type. @@ -7278,7 +7279,7 @@ \begin{itemdescr} \pnum -\returns \tcode{ymwd + dm}. +\returns \tcode{ymwd + dy}. \end{itemdescr} \indexlibrarymember{operator-}{year_month_weekday}% @@ -7288,7 +7289,7 @@ \begin{itemdescr} \pnum -\returns \tcode{ymwd + (-dm)}. +\returns \tcode{ymwd + (-dy)}. \end{itemdescr} \indexlibrarymember{operator<<}{year_month_weekday}% @@ -7347,13 +7348,13 @@ For the latter, there is a conversion to \tcode{sys_days}, which efficiently supports \tcode{days}-oriented arithmetic. \end{note} -\tcode{year_month_weekday_last} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}). - -\rSec3[time.cal.ymwdlast.members]{Member functions} +\tcode{year_month_weekday_last} is \oldconcept{EqualityComparable} (\tref{cpp17.equalitycomparable}). \pnum \tcode{year_month_weekday_last} is a trivially copyable and standard-layout class type. +\rSec3[time.cal.ymwdlast.members]{Member functions} + \indexlibrary{\idxcode{year_month_weekday_last}!constructor}% \begin{itemdecl} constexpr year_month_weekday_last(const chrono::year& y, const chrono::month& m, @@ -9325,6 +9326,10 @@ \pnum \effects Streams out the \tcode{sys_info} object \tcode{r} in an unspecified format. + +\pnum +\returns +\tcode{os}. \end{itemdescr} \rSec3[time.zone.info.local]{Class \tcode{local_info}} @@ -9396,7 +9401,12 @@ \begin{itemdescr} \pnum +\effects Streams out the \tcode{local_info} object \tcode{r} in an unspecified format. + +\pnum +\returns +\tcode{os}. \end{itemdescr} \rSec2[time.zone.timezone]{Class \tcode{time_zone}} @@ -10594,7 +10604,7 @@ \pnum Each conversion specifier is replaced by appropriate characters -as described in Table~\ref{tab:time.format.spec}. +as described in \tref{time.format.spec}. Some of the conversion specifiers depend on the locale which is imbued to the \tcode{basic_ostream}. If the \tcode{Streamable} object does not contain @@ -10612,7 +10622,7 @@ and \tcode{\%Z} or \tcode{\%z} are contained in \tcode{fmt}, \tcode{os.setstate(ios_base::failbit)} shall be called. -\begin{LongTable}{Meaning of \tcode{format} conversion specifiers}{tab:time.format.spec}{lx{.8\hsize}} +\begin{LongTable}{Meaning of \tcode{format} conversion specifiers}{time.format.spec}{lx{.8\hsize}} \\ \topline \lhdr{Specifier} & \rhdr{Replacement} \\ \capsep \endfirsthead @@ -10946,7 +10956,7 @@ \tcode{setstate(ios_base::failbit)} is called on the \tcode{basic_istream}. -\begin{LongTable}{Meaning of \tcode{parse} flags}{tab:time.parse.spec}{lx{.8\hsize}} +\begin{LongTable}{Meaning of \tcode{parse} flags}{time.parse.spec}{lx{.8\hsize}} \\ \topline \lhdr{Flag} & \rhdr{Parsed value} \\ \capsep \endfirsthead diff --git a/source/utilities.tex b/source/utilities.tex index e11319da09..749006ed1f 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -6,19 +6,19 @@ \pnum This Clause describes utilities that are generally useful in \Cpp{} programs; some of these utilities are used by other elements of the \Cpp{} standard library. -These utilities are summarized in \tref{util.lib.summary}. +These utilities are summarized in \tref{utilities.summary}. -\begin{libsumtab}{General utilities library summary}{tab:util.lib.summary} -\ref{utility} & Utility components & \tcode{} \\ \rowsep -\ref{intseq} & Compile-time integer sequences & \tcode{} \\ \rowsep -\ref{pairs} & Pairs & \tcode{} \\ \rowsep +\begin{libsumtab}{General utilities library summary}{utilities.summary} +\ref{utility} & Utility components & \tcode{} \\ +\ref{intseq} & Compile-time integer sequences & \\ +\ref{pairs} & Pairs & \\ \rowsep \ref{tuple} & Tuples & \tcode{} \\ \rowsep \ref{optional} & Optional objects & \tcode{} \\ \rowsep \ref{variant} & Variants & \tcode{} \\ \rowsep \ref{any} & Storage for any type & \tcode{} \\ \rowsep \ref{bitset} & Fixed-size sequences of bits & \tcode{} \\ \rowsep -\ref{memory} & Memory & \tcode{} \\ - & & \tcode{} \\ \rowsep +\ref{memory} & Memory & + \tcode{}, \tcode{} \\ \rowsep \ref{smartptr} & Smart pointers & \tcode{} \\ \rowsep \ref{mem.res} & Memory resources & \tcode{} \\ \rowsep \ref{allocator.adaptor} & Scoped allocators & \tcode{} \\ \rowsep @@ -202,9 +202,9 @@ Type \tcode{T} shall be -\oldconcept{MoveConstructible} (\tref{moveconstructible}) +\oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible}) and -\oldconcept{MoveAssignable} (\tref{moveassignable}). +\oldconcept{MoveAssignable} (\tref{cpp17.moveassignable}). \pnum \effects @@ -886,14 +886,17 @@ \indexlibrary{\idxcode{tuple_element}}% \begin{itemdecl} -tuple_element>::type +template + struct tuple_element> { + using type = @\seebelow@ ; + }; \end{itemdecl} \begin{itemdescr} \pnum \requires \tcode{I < 2}. The program is ill-formed if \tcode{I} is out of bounds. \pnum -\textit{Value:} The type \tcode{T1} if \tcode{I == 0}, otherwise the type \tcode{T2}. +\ctype The type \tcode{T1} if \tcode{I == 0}, otherwise the type \tcode{T2}. \end{itemdescr} \indexlibrarymember{get}{pair}% @@ -1422,8 +1425,8 @@ \begin{itemdescr} \pnum -\requires \tcode{Alloc} shall satisfy the -\oldconcept{Allocator} requirements (\tref{utilities.allocator.requirements}). +\requires \tcode{Alloc} shall meet the +\oldconcept{Allocator} requirements (\tref{cpp17.allocator}). \pnum \effects Equivalent to the preceding constructors except that each element is constructed with @@ -1691,7 +1694,7 @@ $\cv_i$ \tcode{tuple<$\tcode{Args}_i$...>}, where $\cv_i$ is the (possibly empty) $i^\text{th}$ \grammarterm{cv-qualifier-seq} and $\tcode{Args}_i$ is the template parameter pack representing the element types in $\tcode{U}_i$. Let $\tcode{A}_{ik}$ be the ${k}^\text{th}$ type in $\tcode{Args}_i$. For all -$\tcode{A}_{ik}$ the following requirements shall be satisfied: +$\tcode{A}_{ik}$ the following requirements shall be met: \begin{itemize} \item If $\tcode{T}_i$ is deduced as an lvalue reference type, then \tcode{is_constructible_v<$\tcode{A}_{ik}$, $\cv{}_i\;\tcode{A}_{ik}$\&> == true}, otherwise @@ -1785,7 +1788,7 @@ \begin{itemdescr} \pnum -\remarks All specializations of \tcode{tuple_size} shall satisfy the +\remarks All specializations of \tcode{tuple_size} shall meet the \oldconcept{UnaryTypeTrait} requirements\iref{meta.rqmts} with a base characteristic of \tcode{integral_constant} for some \tcode{N}. @@ -1828,7 +1831,7 @@ Let \tcode{TS} denote \tcode{tuple_size} of the \cv-unqualified type \tcode{T}. If the expression \tcode{TS::value} is well-formed when treated as an unevaluated operand, then each -of the three templates shall satisfy the \oldconcept{UnaryTypeTrait} requirements\iref{meta.rqmts} +of the three templates shall meet the \oldconcept{UnaryTypeTrait} requirements\iref{meta.rqmts} with a base characteristic of \begin{codeblock} integral_constant @@ -1865,7 +1868,7 @@ \begin{itemdescr} \pnum Let \tcode{TE} denote \tcode{tuple_element_t} of the \cv-unqualified type \tcode{T}. Then -each of the three templates shall satisfy the \oldconcept{TransformationTrait} +each of the three templates shall meet the \oldconcept{TransformationTrait} requirements\iref{meta.rqmts} with a member typedef \tcode{type} that names the following type: @@ -2082,8 +2085,8 @@ \begin{itemdescr} \pnum -\requires \tcode{Alloc} shall satisfy the \oldconcept{Allocator} -requirements (\tref{utilities.allocator.requirements}). +\requires \tcode{Alloc} shall meet the \oldconcept{Allocator} +requirements (\tref{cpp17.allocator}). \pnum \begin{note} Specialization of this trait informs other library components that @@ -2291,7 +2294,7 @@ \pnum \tcode{T} shall be an object type other than \cv{} \tcode{in_place_t} or \cv{} \tcode{nullopt_t} -and shall satisfy the \oldconcept{Destructible} requirements (\tref{destructible}). +and shall meet the \oldconcept{Destructible} requirements (\tref{cpp17.destructible}). \rSec3[optional.ctor]{Constructors} @@ -2336,7 +2339,7 @@ This constructor shall be defined as deleted unless \tcode{is_copy_constructible_v} is \tcode{true}. If \tcode{is_trivially_copy_constructible_v} is \tcode{true}, -this constructor is trivial.. +this constructor is trivial. \end{itemdescr} \indexlibrary{\idxcode{optional}!constructor}% @@ -2583,7 +2586,7 @@ \pnum \effects See \tref{optional.assign.copy}. -\begin{lib2dtab2}{\tcode{optional::operator=(const optional\&)} effects}{tab:optional.assign.copy} +\begin{lib2dtab2}{\tcode{optional::operator=(const optional\&)} effects}{optional.assign.copy} {\tcode{*this} contains a value} {\tcode{*this} does not contain a value} @@ -2630,7 +2633,7 @@ \effects See \tref{optional.assign.move}. The result of the expression \tcode{bool(rhs)} remains unchanged. -\begin{lib2dtab2}{\tcode{optional::operator=(optional\&\&)} effects}{tab:optional.assign.move} +\begin{lib2dtab2}{\tcode{optional::operator=(optional\&\&)} effects}{optional.assign.move} {\tcode{*this} contains a value} {\tcode{*this} does not contain a value} @@ -2711,7 +2714,7 @@ \pnum \effects See \tref{optional.assign.copy.templ}. -\begin{lib2dtab2}{\tcode{optional::operator=(const optional\&)} effects}{tab:optional.assign.copy.templ} +\begin{lib2dtab2}{\tcode{optional::operator=(const optional\&)} effects}{optional.assign.copy.templ} {\tcode{*this} contains a value} {\tcode{*this} does not contain a value} @@ -2773,7 +2776,7 @@ \effects See \tref{optional.assign.move.templ}. The result of the expression \tcode{bool(rhs)} remains unchanged. -\begin{lib2dtab2}{\tcode{optional::operator=(optional\&\&)} effects}{tab:optional.assign.move.templ} +\begin{lib2dtab2}{\tcode{optional::operator=(optional\&\&)} effects}{optional.assign.move.templ} {\tcode{*this} contains a value} {\tcode{*this} does not contain a value} @@ -2899,7 +2902,7 @@ \pnum \effects See \tref{optional.swap}. -\begin{lib2dtab2}{\tcode{optional::swap(optional\&)} effects}{tab:optional.swap} +\begin{lib2dtab2}{\tcode{optional::swap(optional\&)} effects}{optional.swap} {\tcode{*this} contains a value} {\tcode{*this} does not contain a value} @@ -3139,29 +3142,23 @@ \begin{codeblock} class bad_optional_access : public exception { public: - bad_optional_access(); + // see \ref{exception} for the specification of the special member functions + const char* what() const noexcept override; }; \end{codeblock} \pnum The class \tcode{bad_optional_access} defines the type of objects thrown as exceptions to report the situation where an attempt is made to access the value of an optional object that does not contain a value. -\indexlibrary{\idxcode{bad_optional_access}!constructor}% \indexlibrarymember{what}{bad_optional_access}% \begin{itemdecl} -bad_optional_access(); +const char* what() const noexcept override; \end{itemdecl} \begin{itemdescr} \pnum -\effects -Constructs an object of class \tcode{bad_optional_access}. - -\pnum -\ensures -\tcode{what()} returns an -\impldef{return value of \tcode{bad_optional_access::what}} -\ntbs{}. +\returns +An \impldef{return value of \tcode{bad_optional_access::what}} \ntbs{}. \end{itemdescr} \rSec2[optional.relops]{Relational operators} @@ -4580,7 +4577,7 @@ \begin{itemdescr} \pnum \remarks -All specializations of \tcode{variant_size} shall satisfy the +All specializations of \tcode{variant_size} shall meet the \oldconcept{UnaryTypeTrait} requirements\iref{meta.rqmts} with a base characteristic of \tcode{integral_constant} for some \tcode{N}. \end{itemdescr} @@ -4595,7 +4592,7 @@ \begin{itemdescr} \pnum Let \tcode{VS} denote \tcode{variant_size} of the cv-unqualified -type \tcode{T}. Then each of the three templates shall satisfy the +type \tcode{T}. Then each of the three templates shall meet the \oldconcept{UnaryTypeTrait} requirements\iref{meta.rqmts} with a base characteristic of \tcode{integral_constant}. \end{itemdescr} @@ -4989,7 +4986,7 @@ \begin{codeblock} class bad_variant_access : public exception { public: - bad_variant_access() noexcept; + // see \ref{exception} for the specification of the special member functions const char* what() const noexcept override; }; \end{codeblock} @@ -4998,16 +4995,6 @@ Objects of type \tcode{bad_variant_access} are thrown to report invalid accesses to the value of a \tcode{variant} object. -\indexlibrary{\idxcode{bad_variant_access}!constructor}% -\begin{itemdecl} -bad_variant_access() noexcept; -\end{itemdecl} - -\begin{itemdescr} -\pnum -Constructs a \tcode{bad_variant_access} object. -\end{itemdescr} - \indexlibrarymember{what}{bad_variant_access}% \begin{itemdecl} const char* what() const noexcept override; @@ -5095,6 +5082,7 @@ \begin{codeblock} class bad_any_cast : public bad_cast { public: + // see \ref{exception} for the specification of the special member functions const char* what() const noexcept override; }; \end{codeblock} @@ -5110,11 +5098,6 @@ \begin{itemdescr} \pnum \returns An \impldef{return value of \tcode{bad_any_cast::what}} \ntbs{}. - -\pnum -\remarks -The message may be a null-terminated multibyte string\iref{multibyte.strings}, -suitable for conversion and display as a wstring~(\ref{string.classes}, \ref{locale.codecvt}). \end{itemdescr} \rSec2[any.class]{Class \tcode{any}} @@ -5162,7 +5145,7 @@ \end{codeblock} \pnum -An object of class \tcode{any} stores an instance of any type that satisfies the constructor requirements or it has no value, +An object of class \tcode{any} stores an instance of any type that meets the constructor requirements or it has no value, and this is referred to as the \defn{state} of the class \tcode{any} object. The stored instance is called the \defnx{contained value}{contained value!\idxcode{any}}. Two states are equivalent if either they both have no value, or they both have a value and the contained values are equivalent. @@ -5240,7 +5223,7 @@ \pnum \requires -\tcode{VT} shall satisfy the \oldconcept{CopyConstructible} requirements. +\tcode{VT} shall meet the \oldconcept{CopyConstructible} requirements. \pnum \effects @@ -5269,7 +5252,7 @@ Let \tcode{VT} be \tcode{decay_t}. \pnum -\requires \tcode{VT} shall satisfy the \oldconcept{CopyConstructible} requirements. +\requires \tcode{VT} shall meet the \oldconcept{CopyConstructible} requirements. \pnum \effects Initializes the contained value as if direct-non-list-initializing an object of @@ -5299,7 +5282,7 @@ Let \tcode{VT} be \tcode{decay_t}. \pnum -\requires \tcode{VT} shall satisfy the \oldconcept{CopyConstructible} requirements. +\requires \tcode{VT} shall meet the \oldconcept{CopyConstructible} requirements. \pnum \effects Initializes the contained value as if direct-non-list-initializing an object of @@ -5383,7 +5366,7 @@ \pnum \requires -\tcode{VT} shall satisfy the \oldconcept{CopyConstructible} requirements. +\tcode{VT} shall meet the \oldconcept{CopyConstructible} requirements. \pnum \effects @@ -5419,7 +5402,7 @@ \pnum \requires -\tcode{VT} shall satisfy the \oldconcept{CopyConstructible} requirements. +\tcode{VT} shall meet the \oldconcept{CopyConstructible} requirements. \pnum \effects Calls \tcode{reset()}. @@ -5457,7 +5440,7 @@ \pnum \requires -\tcode{VT} shall satisfy the \oldconcept{CopyConstructible} requirements. +\tcode{VT} shall meet the \oldconcept{CopyConstructible} requirements. \pnum \effects Calls \tcode{reset()}. Then initializes the contained value @@ -6559,10 +6542,10 @@ template struct pointer_traits; // \ref{pointer.conversion}, pointer conversion - template - auto to_address(const Ptr& p) noexcept; template constexpr T* to_address(T* p) noexcept; + template + auto to_address(const Ptr& p) noexcept; // \ref{util.dynamic.safety}, pointer safety enum class pointer_safety { relaxed, preferred, strict }; @@ -7004,6 +6987,7 @@ template struct hash>; // \ref{util.smartptr.atomic}, atomic smart pointers + template struct atomic; template struct atomic>; template struct atomic>; } @@ -7137,28 +7121,28 @@ \indexlibrary{\idxcode{to_address}}% \begin{itemdecl} -template auto to_address(const Ptr& p) noexcept; +template constexpr T* to_address(T* p) noexcept; \end{itemdecl} \begin{itemdescr} \pnum -\returns -\tcode{pointer_traits::to_address(p)} if that expression is well-formed -(see \ref{pointer.traits.optmem}), -otherwise \tcode{to_address(p.operator->())}. +\requires \tcode{T} is not a function type. Otherwise the program is ill-formed. + +\pnum +\returns \tcode{p}. \end{itemdescr} \indexlibrary{\idxcode{to_address}}% \begin{itemdecl} -template constexpr T* to_address(T* p) noexcept; +template auto to_address(const Ptr& p) noexcept; \end{itemdecl} \begin{itemdescr} \pnum -\requires \tcode{T} is not a function type. Otherwise the program is ill-formed. - -\pnum -\returns \tcode{p}. +\returns +\tcode{pointer_traits::to_address(p)} if that expression is well-formed +(see \ref{pointer.traits.optmem}), +otherwise \tcode{to_address(p.operator->())}. \end{itemdescr} \rSec2[util.dynamic.safety]{Pointer safety} @@ -7374,8 +7358,8 @@ The \tcode{allocator_arg_t} struct is an empty class type used as a unique type to disambiguate constructor and function overloading. Specifically, several types (see \tcode{tuple}~\ref{tuple}) have constructors with \tcode{allocator_arg_t} as the first -argument, immediately followed by an argument of a type that satisfies the -\oldconcept{Allocator} requirements (\tref{utilities.allocator.requirements}). +argument, immediately followed by an argument of a type that meets the +\oldconcept{Allocator} requirements (\tref{cpp17.allocator}). \rSec2[allocator.uses]{\tcode{uses_allocator}} @@ -7923,7 +7907,7 @@ \rSec2[default.allocator]{The default allocator} \pnum -All specializations of the default allocator satisfy the +All specializations of the default allocator meet the allocator completeness requirements\iref{allocator.requirements.completeness}. \indexlibrary{\idxcode{allocator}}% @@ -9029,8 +9013,8 @@ pointer as appropriate for that deleter. \pnum -If the deleter's type \tcode{D} is not a reference type, \tcode{D} shall satisfy -the \oldconcept{Destructible} requirements (\tref{destructible}). +If the deleter's type \tcode{D} is not a reference type, \tcode{D} shall meet +the \oldconcept{Destructible} requirements (\tref{cpp17.destructible}). \pnum If the \grammarterm{qualified-id} \tcode{remove_reference_t::pointer} is valid and denotes a @@ -9038,10 +9022,10 @@ D>::pointer} shall be a synonym for \tcode{remove_reference_t::pointer}. Otherwise \tcode{unique_ptr::pointer} shall be a synonym for \tcode{element_type*}. The type \tcode{unique_ptr::pointer} shall -satisfy the \oldconcept{NullablePointer} requirements (\tref{nullablepointer}). +meet the \oldconcept{NullablePointer} requirements (\tref{cpp17.nullablepointer}). \pnum -\begin{example} Given an allocator type \tcode{X} (\tref{utilities.allocator.requirements}) and +\begin{example} Given an allocator type \tcode{X} (\tref{cpp17.allocator}) and letting \tcode{A} be a synonym for \tcode{allocator_traits}, the types \tcode{A::pointer}, \tcode{A::const_pointer}, \tcode{A::void_pointer}, and \tcode{A::const_void_pointer} may be used as \tcode{unique_ptr::pointer}. \end{example} @@ -9057,7 +9041,7 @@ \begin{itemdescr} \pnum \requires \tcode{D} shall -satisfy the \oldconcept{DefaultConstructible} requirements (\tref{defaultconstructible}), +meet the \oldconcept{DefaultConstructible} requirements (\tref{cpp17.defaultconstructible}), and that construction shall not throw an exception. \pnum @@ -9082,7 +9066,7 @@ \begin{itemdescr} \pnum \requires \tcode{D} shall -satisfy the \oldconcept{DefaultConstructible} requirements (\tref{defaultconstructible}), +meet the \oldconcept{DefaultConstructible} requirements (\tref{cpp17.defaultconstructible}), and that construction shall not throw an exception. \pnum @@ -9112,10 +9096,10 @@ \begin{itemdescr} \pnum \requires For the first constructor, if \tcode{D} is not a reference type, -\tcode{D} shall satisfy the \oldconcept{CopyConstructible} requirements and +\tcode{D} shall meet the \oldconcept{CopyConstructible} requirements and such construction shall not exit via an exception. For the second constructor, if \tcode{D} is not a reference type, -\tcode{D} shall satisfy the \oldconcept{MoveConstructible} requirements and +\tcode{D} shall meet the \oldconcept{MoveConstructible} requirements and such construction shall not exit via an exception. \pnum @@ -9161,8 +9145,8 @@ \begin{itemdescr} \pnum \requires If \tcode{D} is not a reference type, -\tcode{D} shall satisfy the \oldconcept{MoveConstructible} -requirements (\tref{moveconstructible}). +\tcode{D} shall meet the \oldconcept{MoveConstructible} +requirements (\tref{cpp17.moveconstructible}). Construction of the deleter from an rvalue of type \tcode{D} shall not throw an exception. @@ -9250,11 +9234,11 @@ \begin{itemdescr} \pnum -\requires If \tcode{D} is not a reference type, \tcode{D} shall satisfy the -\oldconcept{MoveAssignable} requirements (\tref{moveassignable}) and assignment +\requires If \tcode{D} is not a reference type, \tcode{D} shall meet the +\oldconcept{MoveAssignable} requirements (\tref{cpp17.moveassignable}) and assignment of the deleter from an rvalue of type \tcode{D} shall not throw an exception. Otherwise, \tcode{D} is a reference type; -\tcode{remove_reference_t} shall satisfy the \oldconcept{CopyAssignable} +\tcode{remove_reference_t} shall meet the \oldconcept{CopyAssignable} requirements and assignment of the deleter from an lvalue of type \tcode{D} shall not throw an exception. @@ -9968,7 +9952,8 @@ namespace std { class bad_weak_ptr : public exception { public: - bad_weak_ptr() noexcept; + // see \ref{exception} for the specification of the special member functions + const char* what() const noexcept override; }; } \end{codeblock} @@ -9977,16 +9962,15 @@ An exception of type \tcode{bad_weak_ptr} is thrown by the \tcode{shared_ptr} constructor taking a \tcode{weak_ptr}. -\indexlibrary{\idxcode{bad_weak_ptr}!constructor}% \indexlibrarymember{what}{bad_weak_ptr}% \begin{itemdecl} -bad_weak_ptr() noexcept; +const char* what() const noexcept override; \end{itemdecl} \begin{itemdescr} -\pnum\ensures \tcode{what()} returns an -\impldef{return value of \tcode{bad_weak_ptr::what}} \ntbs{}. - +\pnum +\returns +An \impldef{return value of \tcode{bad_weak_ptr::what}} \ntbs{}. \end{itemdescr} \rSec2[util.smartptr.shared]{Class template \tcode{shared_ptr}} @@ -10188,8 +10172,8 @@ initialized with \tcode{std::move(d)} shall not throw exceptions. The expression \tcode{d(p)} shall have well-defined behavior and shall not throw exceptions. -\tcode{A} shall satisfy the \oldconcept{Allocator} requirements -(\tref{utilities.allocator.requirements}). +\tcode{A} shall meet the \oldconcept{Allocator} requirements +(\tref{cpp17.allocator}). \pnum\effects Constructs a \tcode{shared_ptr} object that owns the object \tcode{p} and the deleter \tcode{d}. @@ -10600,8 +10584,8 @@ \begin{itemdescr} \pnum -\requires \tcode{A} shall satisfy the \oldconcept{Allocator} -requirements (\tref{utilities.allocator.requirements}). +\requires \tcode{A} shall meet the \oldconcept{Allocator} +requirements (\tref{cpp17.allocator}). \pnum \effects Allocates memory for an object of type \tcode{T} @@ -12355,7 +12339,7 @@ \pnum A specialization of class template \tcode{pmr::polymorphic_allocator} -satisfies the \oldconcept{Allocator} requirements (\tref{utilities.allocator.requirements}). +meets the \oldconcept{Allocator} requirements (\tref{cpp17.allocator}). Constructed with different memory resources, different instances of the same specialization of \tcode{pmr::polymorphic_allocator} can exhibit entirely different allocation behavior. @@ -12365,7 +12349,7 @@ \pnum All specializations of class template \tcode{pmr::polymorphic_allocator} -satisfy the allocator completeness requirements\iref{allocator.requirements.completeness}. +meet the allocator completeness requirements\iref{allocator.requirements.completeness}. \indexlibrary{\idxcode{polymorphic_allocator}}% \indexlibrarymember{value_type}{polymorphic_allocator}% @@ -13332,7 +13316,7 @@ \pnum The class template \tcode{scoped_allocator_adaptor} is an allocator template that -specifies the memory resource (the outer allocator) to be used by a container (as any +specifies an allocator resource (the outer allocator) to be used by a container (as any other allocator does) and also specifies an inner allocator resource to be passed to the constructor of every element within the container. This adaptor is instantiated with one outer and zero or more inner allocator types. If instantiated with only one allocator @@ -15361,7 +15345,7 @@ uses \tcode{is_bind_expression} to detect subexpressions. \pnum -Instantiations of the \tcode{is_bind_expression} template shall satisfy +Instantiations of the \tcode{is_bind_expression} template shall meet the \oldconcept{UnaryTypeTrait} requirements\iref{meta.rqmts}. The implementation shall provide a definition that has a base characteristic of \tcode{true_type} if \tcode{T} is a type returned from \tcode{bind}, @@ -15385,7 +15369,7 @@ \tcode{is_placeholder} to detect placeholders. \pnum -Instantiations of the \tcode{is_placeholder} template shall satisfy +Instantiations of the \tcode{is_placeholder} template shall meet the \oldconcept{UnaryTypeTrait} requirements\iref{meta.rqmts}. The implementation shall provide a definition that has the base characteristic of \tcode{integral_constant} if \tcode{T} is the type of @@ -15450,9 +15434,9 @@ \tcode{fd} or of one of the values $\tcode{td}_i$ throws an exception. \pnum -\remarks The return type shall satisfy the \oldconcept{MoveConstructible} requirements. If all -of \tcode{FD} and $\tcode{TD}_i$ satisfy the \oldconcept{CopyConstructible} requirements, then the -return type shall satisfy the \oldconcept{CopyConstructible} requirements. \begin{note} This implies +\remarks The return type shall meet the \oldconcept{MoveConstructible} requirements. If all +of \tcode{FD} and $\tcode{TD}_i$ meet the \oldconcept{CopyConstructible} requirements, then the +return type shall meet the \oldconcept{CopyConstructible} requirements. \begin{note} This implies that all of \tcode{FD} and $\tcode{TD}_i$ are \oldconcept{MoveConst\-ruct\-ible}. \end{note} \end{itemdescr} @@ -15493,9 +15477,9 @@ \tcode{fd} or of one of the values $\tcode{td}_i$ throws an exception. \pnum -\remarks The return type shall satisfy the \oldconcept{MoveConstructible} requirements. If all -of \tcode{FD} and $\tcode{TD}_i$ satisfy the \oldconcept{CopyConstructible} requirements, then the -return type shall satisfy the \oldconcept{CopyConstructible} requirements. \begin{note} This implies +\remarks The return type shall meet the \oldconcept{MoveConstructible} requirements. If all +of \tcode{FD} and $\tcode{TD}_i$ meet the \oldconcept{CopyConstructible} requirements, then the +return type shall meet the \oldconcept{CopyConstructible} requirements. \begin{note} This implies that all of \tcode{FD} and $\tcode{TD}_i$ are \oldconcept{MoveConst\-ruct\-ible}. \end{note} \end{itemdescr} @@ -15596,26 +15580,16 @@ namespace std { class bad_function_call : public exception { public: - // \ref{func.wrap.badcall.const}, constructor - bad_function_call() noexcept; + // see \ref{exception} for the specification of the special member functions + const char* what() const noexcept override; }; } \end{codeblock} -\rSec4[func.wrap.badcall.const]{Constructor} - -\indexlibrary{\idxcode{bad_function_call}!constructor}% \indexlibrarymember{what}{bad_function_call}% -\begin{itemdecl} -bad_function_call() noexcept; -\end{itemdecl} - \begin{itemdescr} -\pnum\effects Constructs a \tcode{bad_function_call} object. -\end{itemdescr} - -\begin{itemdescr} -\pnum\ensures \tcode{what()} returns an +\pnum +\returns An \impldef{return value of \tcode{bad_function_call::what}} \ntbs{}. \end{itemdescr} @@ -16028,7 +16002,7 @@ \pnum Each specialization of a class template specified in this subclause \ref{func.search} -shall satisfy the \oldconcept{CopyConst\-ruct\-ible} and \oldconcept{CopyAssignable} requirements. +shall meet the \oldconcept{CopyConst\-ruct\-ible} and \oldconcept{CopyAssignable} requirements. Template parameters named \begin{itemize} \item \tcode{ForwardIterator}, @@ -16040,10 +16014,10 @@ \item \tcode{BinaryPredicate} \end{itemize} of templates specified in this subclause -\ref{func.search} shall satisfy the same requirements and semantics as +\ref{func.search} shall meet the same requirements and semantics as specified in \ref{algorithms.general}. -Template parameters named \tcode{Hash} shall satisfy the \oldconcept{Hash} -requirements (\tref{hash}). +Template parameters named \tcode{Hash} shall meet the \oldconcept{Hash} +requirements (\tref{cpp17.hash}). \pnum The Boyer-Moore searcher implements the Boyer-Moore search algorithm. @@ -16146,7 +16120,7 @@ \begin{itemdescr} \pnum \requires -The value type of \tcode{RandomAccessIterator1} shall satisfy the \oldconcept{DefaultConstructible} requirements, +The value type of \tcode{RandomAccessIterator1} shall meet the \oldconcept{DefaultConstructible} requirements, the \oldconcept{CopyConstructible} requirements, and the \oldconcept{CopyAssignable} requirements. \pnum @@ -16239,7 +16213,7 @@ \begin{itemdescr} \pnum \requires -The value type of \tcode{RandomAccessIterator1} shall satisfy the \oldconcept{DefaultConstructible}, +The value type of \tcode{RandomAccessIterator1} shall meet the \oldconcept{DefaultConstructible}, \oldconcept{Copy\-Constructible}, and \oldconcept{CopyAssignable} requirements. \pnum @@ -16341,15 +16315,15 @@ \pnum An enabled specialization \tcode{hash} will: \begin{itemize} -\item satisfy the \oldconcept{Hash} requirements (\tref{hash}), +\item meet the \oldconcept{Hash} requirements (\tref{cpp17.hash}), with \tcode{Key} as the function -call argument type, the \oldconcept{Default\-Constructible} requirements (\tref{defaultconstructible}), -the \oldconcept{CopyAssignable} requirements (\tref{copyassignable}), +call argument type, the \oldconcept{Default\-Constructible} requirements (\tref{cpp17.defaultconstructible}), +the \oldconcept{CopyAssignable} requirements (\tref{cpp17.copyassignable}), \item be swappable\iref{swappable.requirements} for lvalues, -\item satisfy the requirement that if \tcode{k1 == k2} is \tcode{true}, \tcode{h(k1) == h(k2)} is +\item meet the requirement that if \tcode{k1 == k2} is \tcode{true}, \tcode{h(k1) == h(k2)} is also \tcode{true}, where \tcode{h} is an object of type \tcode{hash} and \tcode{k1} and \tcode{k2} are objects of type \tcode{Key}; -\item satisfy the requirement that the expression \tcode{h(k)}, where \tcode{h} +\item meet the requirement that the expression \tcode{h(k)}, where \tcode{h} is an object of type \tcode{hash} and \tcode{k} is an object of type \tcode{Key}, shall not throw an exception unless \tcode{hash} is a program-defined specialization that depends on at least one program-defined type. @@ -16910,7 +16884,7 @@ has a \tcode{value} member that evaluates to \tcode{true}. \end{note} -\begin{libreqtab3e}{Primary type category predicates}{tab:type-traits.primary} +\begin{libreqtab3e}{Primary type category predicates}{meta.unary.cat} \\ \topline \lhdr{Template} & \chdr{Condition} & \rhdr{Comments} \\\capsep \endfirsthead @@ -16990,7 +16964,7 @@ For any given type \tcode{T}, the result of applying one of these templates to \tcode{T} and to \cv{}~\tcode{T} shall yield the same result. -\begin{libreqtab3b}{Composite type category predicates}{tab:type-traits.composite} +\begin{libreqtab3b}{Composite type category predicates}{meta.unary.comp} \\ \topline \lhdr{Template} & \chdr{Condition} & \rhdr{Comments} \\ \capsep \endfirsthead @@ -17053,7 +17027,7 @@ in the context of the corresponding definition notwithstanding the restrictions of~\ref{declval}. -\begin{libreqtab3b}{Type property predicates}{tab:type-traits.properties} +\begin{libreqtab3b}{Type property predicates}{meta.unary.prop} \\ \topline \lhdr{Template} & \chdr{Condition} & \rhdr{Preconditions} \\ \capsep \endfirsthead @@ -17532,7 +17506,7 @@ This subclause contains templates that may be used to query properties of types at compile time. -\begin{libreqtab2a}{Type property queries}{tab:type-traits.properties.queries} +\begin{libreqtab2a}{Type property queries}{meta.unary.prop.query} \\ \topline \lhdr{Template} & \rhdr{Value} \\ \capsep \endfirsthead @@ -17607,7 +17581,7 @@ \tcode{true_type} if the corresponding condition is true, otherwise \tcode{false_type}. -\begin{libreqtab3f}{Type relationship predicates}{tab:type-traits.relationship} +\begin{libreqtab3f}{Type relationship predicates}{meta.rel} \\ \topline \lhdr{Template} & \chdr{Condition} & \rhdr{Comments} \\ \capsep \endfirsthead @@ -17753,7 +17727,7 @@ \rSec3[meta.trans.cv]{Const-volatile modifications} -\begin{libreqtab2a}{Const-volatile modifications}{tab:type-traits.const-volatile} +\begin{libreqtab2a}{Const-volatile modifications}{meta.trans.cv} \\ \topline \lhdr{Template} & \rhdr{Comments} \\ \capsep \endfirsthead @@ -17818,7 +17792,7 @@ \rSec3[meta.trans.ref]{Reference modifications} -\begin{libreqtab2a}{Reference modifications}{tab:type-traits.reference} +\begin{libreqtab2a}{Reference modifications}{meta.trans.ref} \\ \topline \lhdr{Template} & \rhdr{Comments} \\ \capsep \endfirsthead @@ -17857,7 +17831,7 @@ \end{libreqtab2a} \rSec3[meta.trans.sign]{Sign modifications} -\begin{libreqtab2a}{Sign modifications}{tab:type-traits.sign} +\begin{libreqtab2a}{Sign modifications}{meta.trans.sign} \\ \topline \lhdr{Template} & \rhdr{Comments} \\ \capsep \endfirsthead @@ -17902,7 +17876,7 @@ \end{libreqtab2a} \rSec3[meta.trans.arr]{Array modifications} -\begin{libreqtab2a}{Array modifications}{tab:type-traits.array} +\begin{libreqtab2a}{Array modifications}{meta.trans.arr} \\ \topline \lhdr{Template} & \rhdr{Comments} \\ \capsep \endfirsthead @@ -17951,7 +17925,7 @@ \end{example} \rSec3[meta.trans.ptr]{Pointer modifications} -\begin{libreqtab2a}{Pointer modifications}{tab:type-traits.pointer} +\begin{libreqtab2a}{Pointer modifications}{meta.trans.ptr} \\ \topline \lhdr{Template} & \rhdr{Comments} \\ \capsep \endfirsthead @@ -17979,7 +17953,7 @@ \rSec3[meta.trans.other]{Other transformations} -\begin{libreqtab2a}{Other transformations}{tab:type-traits.other} +\begin{libreqtab2a}{Other transformations}{meta.trans.other} \\ \topline \lhdr{Template} & \rhdr{Comments} \\ \capsep \endfirsthead @@ -18653,7 +18627,7 @@ program is ill-formed unless the implementation yields correct values of \tcode{U} and \tcode{V}. -\begin{floattable}{Expressions used to perform ratio arithmetic}{tab:ratio.arithmetic} +\begin{floattable}{Expressions used to perform ratio arithmetic}{ratio.arithmetic} {lll} \topline \lhdr{Type} & diff --git a/source/xrefdelta.tex b/source/xrefdelta.tex index 38c0929ec5..f0c29d1565 100644 --- a/source/xrefdelta.tex +++ b/source/xrefdelta.tex @@ -207,7 +207,6 @@ \movedxref{char.traits.specializations.char16_t}{char.traits.specializations.char16.t} \movedxref{char.traits.specializations.char32_t}{char.traits.specializations.char32.t} \movedxref{char.traits.specializations.char8_t}{char.traits.specializations.char8.t} -\movedxref{class.mfct.non-static}{class.mfct.non-static} \movedxref{comparisons.equal_to}{comparisons.equal.to} \movedxref{comparisons.greater_equal}{comparisons.greater.equal} \movedxref{comparisons.less_equal}{comparisons.less.equal} @@ -282,6 +281,9 @@ \movedxref{time.traits.is_fp}{time.traits.is.fp} \movedxref{utility.as_const}{utility.as.const} +% Dissolved subclause. +\movedxref{func.wrap.badcall.const}{func.wrap.badcall} + % Deprecated features. %\deprxref{old.label} (if moved to depr.old.label, otherwise use \movedxref)