Skip to content

Commit ae8ec6f

Browse files
AlisdairMtkoeppe
authored andcommitted
[container.reqmts] Fix cross-references to contiguous container
This edit deserves describing in detail, to establish that it is purely editorial. As part of the mission to clean up tables in the standard, the general container requirements were split into 5 more focused leaf nodes. Due to its location in the original text, the definition for a contiguous container fell into the subclause for reversible containers, to which it is entirely unrelated. There is no requirement that a contiguous container be reversible, only that it has the correct category for its iterators. Meanwhile, all 3 of the existing cross-references point to the wrong leaf node, that simply provides a key to the identifiers used throughout the specification of this clause. The fix has two parts. First move the definition of contiguous container, and a container with special iterators, into the [container.reqmts] clause where it best belongs. This move is appended to the end so that there can be no ambiguity that any existing text could be confused with requirements only on contiguous containers after the edit. The other part is to fix up the three cross-references to point to [container.reqmts] rather than its sibling that has no information on contiguous containers. A grep of the .tex source files confirms that these three references (array,basic_string, and vector) are the only current uses of contiguous container, even though basic_stacktrace would also meet the requirements.
1 parent 22a3b44 commit ae8ec6f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

source/containers.tex

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,14 @@
628628
with value \tcode{a.end()} before the swap will have value \tcode{b.end()} after the
629629
swap.
630630

631+
\pnum
632+
A \defnadj{contiguous}{container}
633+
is a container
634+
whose member types \tcode{iterator} and \tcode{const_iterator}
635+
meet the
636+
\oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators} and
637+
model \libconcept{contiguous_iterator}\iref{iterator.concept.contiguous}.
638+
631639
\rSec3[container.rev.reqmts]{Reversible container requirements}
632640

633641
% Local command to index names as members of all containers.
@@ -809,14 +817,6 @@
809817
shall not invalidate iterators to, or change the values of, objects
810818
within that container.
811819

812-
\pnum
813-
A \defnadj{contiguous}{container}
814-
is a container
815-
whose member types \tcode{iterator} and \tcode{const_iterator}
816-
meet the
817-
\oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators} and
818-
model \libconcept{contiguous_iterator}\iref{iterator.concept.contiguous}.
819-
820820
\rSec3[container.opt.reqmts]{Optional container requirements}
821821

822822
\pnum
@@ -6149,7 +6149,7 @@
61496149
\indextext{\idxcode{array}!contiguous storage}%
61506150
The header \libheader{array} defines a class template for storing fixed-size
61516151
sequences of objects.
6152-
An \tcode{array} is a contiguous container\iref{container.requirements.general}.
6152+
An \tcode{array} is a contiguous container\iref{container.reqmts}.
61536153
An instance of \tcode{array<T, N>} stores \tcode{N} elements of type \tcode{T},
61546154
so that \tcode{size() == N} is an invariant.
61556155

@@ -8590,7 +8590,7 @@
85908590
of a sequence container, including most of the optional sequence container
85918591
requirements\iref{sequence.reqmts},
85928592
and, for an element type other than \tcode{bool},
8593-
of a contiguous container\iref{container.requirements.general}.
8593+
of a contiguous container\iref{container.reqmts}.
85948594
The exceptions are the
85958595
\tcode{push_front}, \tcode{prepend_range}, \tcode{pop_front}, and \tcode{emplace_front} member functions, which are not
85968596
provided. Descriptions are provided here only for operations on \tcode{vector}

source/strings.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2006,7 +2006,7 @@
20062006
is designated by \tcode{charT}.
20072007

20082008
\pnum
2009-
A specialization of \tcode{basic_string} is a contiguous container\iref{container.requirements.general}.
2009+
A specialization of \tcode{basic_string} is a contiguous container\iref{container.reqmts}.
20102010

20112011
\pnum
20122012
In all cases,

0 commit comments

Comments
 (0)