|
31 | 31 | \end{libsumtab}
|
32 | 32 |
|
33 | 33 |
|
34 |
| -\rSec1[container.requirements]{Container requirements}% |
| 34 | +\rSec1[container.requirements]{Requirements}% |
35 | 35 | \indextext{requirements!container}
|
36 | 36 |
|
37 |
| -\rSec2[container.requirements.general]{General container requirements} |
| 37 | +\rSec2[container.requirements.pre]{Preamble} |
38 | 38 |
|
39 | 39 | \pnum
|
40 | 40 | Containers are objects that store other objects.
|
|
54 | 54 | \end{example}
|
55 | 55 |
|
56 | 56 | \pnum
|
57 |
| -Allocator-aware containers (\tref{container.alloc.req}) |
| 57 | +Allocator-aware containers\iref{container.alloc.reqmts} |
58 | 58 | other than \tcode{basic_string} construct elements using the function
|
59 | 59 | \tcode{allocator_traits<allocator_type>::rebind_traits<U>::\brk{}construct}
|
60 | 60 | and destroy elements using the function
|
|
69 | 69 | aligned buffers and call \tcode{construct} to place the element into the buffer.
|
70 | 70 | \end{note}
|
71 | 71 |
|
| 72 | +\rSec2[container.gen.reqmts]{General containers} |
| 73 | + |
| 74 | +\rSec3[container.requirements.general]{General} |
| 75 | + |
72 | 76 | \pnum
|
73 |
| -In this subclause, |
| 77 | +In subclause \ref{container.gen.reqmts}, |
74 | 78 | \begin{itemize}
|
75 | 79 | \item
|
76 | 80 | \tcode{X} denotes a container class containing objects of type \tcode{T},
|
|
86 | 90 | \tcode{rv} denotes a non-const rvalue of type \tcode{X}.
|
87 | 91 | \end{itemize}
|
88 | 92 |
|
| 93 | +\rSec3[container.reqmts]{Containers} |
| 94 | + |
89 | 95 | % Local command to index names as members of all containers.
|
90 | 96 | \newcommand{\indexcont}[1]{%
|
91 | 97 | \indexlibrarymisc{#1}{containers}%
|
|
620 | 626 | with value \tcode{a.end()} before the swap will have value \tcode{b.end()} after the
|
621 | 627 | swap.
|
622 | 628 |
|
| 629 | +\rSec3[container.rev.reqmts]{Reversible container requirements} |
| 630 | + |
623 | 631 | % Local command to index names as members of all containers.
|
624 | 632 | \renewcommand{\indexcont}[1]{%
|
625 | 633 | \indexlibrarymisc{#1}{reversible containers}%
|
|
807 | 815 | \oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators} and
|
808 | 816 | model \libconcept{contiguous_iterator}\iref{iterator.concept.contiguous}.
|
809 | 817 |
|
| 818 | +\rSec3[container.opt.reqmts]{Optional container requirements} |
| 819 | + |
810 | 820 | \pnum
|
811 | 821 | The following operations are provided
|
812 | 822 | for some types of containers but not others. Those containers for which the
|
|
846 | 856 | Linear.
|
847 | 857 | \end{itemdescr}
|
848 | 858 |
|
| 859 | +\rSec3[container.alloc.reqmts]{Allocator-aware containers} |
| 860 | + |
849 | 861 | \pnum
|
850 | 862 | All of the containers defined in \ref{containers} and in~\ref{basic.string} except \tcode{array}
|
851 | 863 | meet the additional requirements of an \defnadj{allocator-aware}{container},
|
|
2087 | 2099 | template<@\unspecnc@>
|
2088 | 2100 | class @\placeholder{node-handle}@ {
|
2089 | 2101 | public:
|
2090 |
| - // These type declarations are described in Tables \ref{tab:container.assoc.req} and \ref{tab:container.hash.req}. |
| 2102 | + // These type declarations are described in \ref{associative.reqmts} and \ref{unord.req}. |
2091 | 2103 | using value_type = @\seebelownc{}@; // not present for map containers
|
2092 | 2104 | using key_type = @\seebelownc{}@; // not present for set containers
|
2093 | 2105 | using mapped_type = @\seebelownc{}@; // not present for set containers
|
|
2522 | 2534 | have the specified semantics,
|
2523 | 2535 | except that for
|
2524 | 2536 | \tcode{map} and \tcode{multimap}, the requirements placed on \tcode{value_type}
|
2525 |
| -in \tref{container.alloc.req} apply instead to \tcode{key_type} |
| 2537 | +in \ref{container.alloc.reqmts} apply instead to \tcode{key_type} |
2526 | 2538 | and \tcode{mapped_type}.
|
2527 | 2539 | \begin{note}
|
2528 | 2540 | For example, in some cases \tcode{key_type} and \tcode{mapped_type}
|
|
3943 | 3955 | the following types, statements, and expressions are well-formed and
|
3944 | 3956 | have the specified semantics,
|
3945 | 3957 | except that for \tcode{unordered_map} and \tcode{unordered_multimap},
|
3946 |
| -the requirements placed on \tcode{value_type} in \tref{container.alloc.req} |
| 3958 | +the requirements placed on \tcode{value_type} in \ref{container.alloc.reqmts} |
3947 | 3959 | apply instead to \tcode{key_type} and \tcode{mapped_type}.
|
3948 | 3960 | \begin{note}
|
3949 | 3961 | For example, \tcode{key_type} and \tcode{mapped_type}
|
|
5773 | 5785 |
|
5774 | 5786 | \pnum
|
5775 | 5787 | \indextext{requirements!container}%
|
5776 |
| -An \tcode{array} meets all of the requirements of a container and |
5777 |
| -of a reversible container\iref{container.requirements}, except that a default |
| 5788 | +An \tcode{array} meets all of the requirements |
| 5789 | +of a container\iref{container.reqmts} and |
| 5790 | +of a reversible container\iref{container.rev.reqmts}, |
| 5791 | +except that a default |
5778 | 5792 | constructed \tcode{array} object is not empty and that \tcode{swap} does not have constant
|
5779 | 5793 | complexity. An \tcode{array} meets some of the requirements of a sequence
|
5780 | 5794 | container\iref{sequence.reqmts}.
|
|
6088 | 6102 | Storage management is handled automatically.
|
6089 | 6103 |
|
6090 | 6104 | \pnum
|
6091 |
| -A |
6092 |
| -\tcode{deque} |
6093 |
| -meets all of the requirements of a container, of a reversible container |
6094 |
| -(given in tables in~\ref{container.requirements}), of a sequence container, |
6095 |
| -including the optional sequence container requirements\iref{sequence.reqmts}, and of an allocator-aware container (\tref{container.alloc.req}). |
| 6105 | +A \tcode{deque} meets all of the requirements |
| 6106 | +of a container\iref{container.reqmts}, |
| 6107 | +of a reversible container\iref{container.rev.reqmts}, |
| 6108 | +of an allocator-aware container\iref{container.alloc.reqmts}, and |
| 6109 | +of a sequence container, |
| 6110 | +including the optional sequence container requirements\iref{sequence.reqmts}. |
6096 | 6111 | Descriptions are provided here only for operations on
|
6097 | 6112 | \tcode{deque}
|
6098 | 6113 | that are not described in one of these tables
|
|
6504 | 6519 | \end{note}
|
6505 | 6520 |
|
6506 | 6521 | \pnum
|
6507 |
| -A \tcode{forward_list} meets all of the requirements of a container\iref{container.requirements.general}, except that the \tcode{size()} |
6508 |
| -member function is not provided and \tcode{operator==} has linear complexity. |
6509 |
| -A \tcode{forward_list} also meets all of the requirements for an allocator-aware |
6510 |
| -container (\tref{container.alloc.req}). In addition, a \tcode{forward_list} |
6511 |
| -provides the \tcode{assign} member functions |
6512 |
| -(\tref{container.seq.req}) and several of the optional |
6513 |
| -container requirements (\tref{container.seq.opt}). |
| 6522 | +A \tcode{forward_list} meets all of the requirements |
| 6523 | +of a container\iref{container.reqmts}, |
| 6524 | +except that the \tcode{size()} member function is not provided and |
| 6525 | +\tcode{operator==} has linear complexity, |
| 6526 | +A \tcode{forward_list} also meets all of the requirements |
| 6527 | +for an allocator-aware container\iref{container.alloc.reqmts}. |
| 6528 | +In addition, a \tcode{forward_list} |
| 6529 | +provides the \tcode{assign} member functions and |
| 6530 | +several of the optional sequence container requirements\iref{sequence.reqmts}. |
6514 | 6531 | Descriptions are provided here only for operations on
|
6515 | 6532 | \tcode{forward_list} that are not described in that table or for operations where there
|
6516 | 6533 | is additional semantic information.
|
|
7304 | 7321 | algorithms only need sequential access anyway.
|
7305 | 7322 |
|
7306 | 7323 | \pnum
|
7307 |
| -A \tcode{list} meets all of the requirements of a container, of |
7308 |
| -a reversible container (given in two tables in |
7309 |
| -\ref{container.requirements}), of a sequence container, |
| 7324 | +A \tcode{list} meets all of the requirements |
| 7325 | +of a container\iref{container.reqmts}, |
| 7326 | +of a reversible container\iref{container.rev.reqmts}, |
| 7327 | +of an allocator-aware container\iref{container.alloc.reqmts}, and |
| 7328 | +of a sequence container, |
7310 | 7329 | including most of the optional sequence container
|
7311 |
| -requirements\iref{sequence.reqmts}, and of an allocator-aware container |
7312 |
| -(\tref{container.alloc.req}). |
| 7330 | +requirements\iref{sequence.reqmts}. |
7313 | 7331 | The exceptions are the
|
7314 | 7332 | \tcode{operator[]}
|
7315 | 7333 | and
|
|
8016 | 8034 | to improve efficiency.
|
8017 | 8035 |
|
8018 | 8036 | \pnum
|
8019 |
| -A \tcode{vector} meets all of the requirements of a container and of a |
8020 |
| -reversible container (given in two tables in~\ref{container.requirements}), of a |
8021 |
| -sequence container, including most of the optional sequence container |
8022 |
| -requirements\iref{sequence.reqmts}, of an allocator-aware container |
8023 |
| -(\tref{container.alloc.req}), |
| 8037 | +A \tcode{vector} meets all of the requirements |
| 8038 | +of a container\iref{container.reqmts}, |
| 8039 | +of a reversible container\iref{container.rev.reqmts}, |
| 8040 | +of an allocator-aware container\iref{container.alloc.reqmts}, |
| 8041 | +of a sequence container, including most of the optional sequence container |
| 8042 | +requirements\iref{sequence.reqmts}, |
8024 | 8043 | and, for an element type other than \tcode{bool},
|
8025 | 8044 | of a contiguous container\iref{container.requirements.general}.
|
8026 | 8045 | The exceptions are the
|
|
8895 | 8914 | on the keys. The \tcode{map} class supports bidirectional iterators.
|
8896 | 8915 |
|
8897 | 8916 | \pnum
|
8898 |
| -A |
8899 |
| -\tcode{map} |
8900 |
| -meets all of the requirements of a container, of a reversible container\iref{container.requirements}, of |
8901 |
| -an associative container\iref{associative.reqmts}, and of an allocator-aware container (\tref{container.alloc.req}). |
| 8917 | +A \tcode{map} meets all of the requirements of |
| 8918 | +a container\iref{container.reqmts}, |
| 8919 | +of a reversible container\iref{container.rev.reqmts}, |
| 8920 | +of an allocator-aware container\iref{container.alloc.reqmts}. and |
| 8921 | +of an associative container\iref{associative.reqmts}. |
8902 | 8922 | A
|
8903 | 8923 | \tcode{map}
|
8904 | 8924 | also provides most operations described in~\ref{associative.reqmts}
|
|
9442 | 9462 | supports bidirectional iterators.
|
9443 | 9463 |
|
9444 | 9464 | \pnum
|
9445 |
| -A |
9446 |
| -\tcode{multimap} meets all of the requirements of a container and of a |
9447 |
| -reversible container\iref{container.requirements}, of an associative |
9448 |
| -container\iref{associative.reqmts}, and of an allocator-aware container |
9449 |
| -(\tref{container.alloc.req}). |
| 9465 | +A \tcode{multimap} meets all of the requirements |
| 9466 | +of a container\iref{container.reqmts}, |
| 9467 | +of a reversible container\iref{container.rev.reqmts}, |
| 9468 | +of an allocator-aware container\iref{container.alloc.reqmts}, and |
| 9469 | +of an associative container\iref{associative.reqmts}. |
9450 | 9470 | A
|
9451 | 9471 | \tcode{multimap}
|
9452 | 9472 | also provides most operations described in~\ref{associative.reqmts}
|
|
9763 | 9783 | supports bidirectional iterators.
|
9764 | 9784 |
|
9765 | 9785 | \pnum
|
9766 |
| -A \tcode{set} meets all of the requirements of a container, of a reversible |
9767 |
| -container\iref{container.requirements}, of an associative |
9768 |
| -container\iref{associative.reqmts}, and of an allocator-aware container |
9769 |
| -(\tref{container.alloc.req}). |
| 9786 | +A \tcode{set} meets all of the requirements |
| 9787 | +of a container\iref{container.reqmts}, |
| 9788 | +of a reversible container\iref{container.rev.reqmts}, |
| 9789 | +of an allocator-aware container\iref{container.alloc.reqmts}. and |
| 9790 | +of an associative container\iref{associative.reqmts}. |
9770 | 9791 | A
|
9771 | 9792 | \tcode{set}
|
9772 | 9793 | also provides most operations described in~\ref{associative.reqmts}
|
@@ -10041,10 +10062,11 @@
|
10041 | 10062 | supports bidirectional iterators.
|
10042 | 10063 |
|
10043 | 10064 | \pnum
|
10044 |
| -A \tcode{multiset} meets all of the requirements of a container, of a |
10045 |
| -reversible container\iref{container.requirements}, of an associative |
10046 |
| -container\iref{associative.reqmts}, and of an allocator-aware container |
10047 |
| -(\tref{container.alloc.req}). |
| 10065 | +A \tcode{multiset} meets all of the requirements |
| 10066 | +of a container\iref{container.reqmts}, |
| 10067 | +of a reversible container\iref{container.rev.reqmts}, |
| 10068 | +of an allocator-aware container\iref{container.alloc.reqmts}, |
| 10069 | +of an associative container\iref{associative.reqmts}. |
10048 | 10070 | \tcode{multiset}
|
10049 | 10071 | also provides most operations described in~\ref{associative.reqmts}
|
10050 | 10072 | for duplicate keys.
|
|
10472 | 10494 | supports forward iterators.
|
10473 | 10495 |
|
10474 | 10496 | \pnum
|
10475 |
| -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<Key, T>} the \tcode{key type} is \tcode{Key}, the mapped type is \tcode{T}, and the value type is \tcode{pair<const Key, T>}. |
| 10497 | +An \tcode{unordered_map} meets all of the requirements |
| 10498 | +of a container\iref{container.reqmts}, |
| 10499 | +of an allocator-aware container\iref{container.alloc.reqmts}, and |
| 10500 | +of an unordered associative container\iref{unord.req}. |
| 10501 | +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<Key, T>} the \tcode{key type} is \tcode{Key}, the mapped type is \tcode{T}, and the value type is \tcode{pair<const Key, T>}. |
10476 | 10502 |
|
10477 | 10503 | \pnum
|
10478 | 10504 | Subclause~\ref{unord.map} only describes operations on \tcode{unordered_map} that
|
|
11064 | 11090 | supports forward iterators.
|
11065 | 11091 |
|
11066 | 11092 | \pnum
|
11067 |
| -An \tcode{unordered_multimap} meets all of the requirements of a container, of an |
11068 |
| -unordered associative container, and of an allocator-aware container |
11069 |
| -(\tref{container.alloc.req}). It provides the operations described in the |
| 11093 | +An \tcode{unordered_multimap} meets all of the requirements |
| 11094 | +of a container\iref{container.reqmts}, |
| 11095 | +of an allocator-aware container\iref{container.alloc.reqmts}, and |
| 11096 | +of an unordered associative container\iref{unord.req}. |
| 11097 | +It provides the operations described in the |
11070 | 11098 | preceding requirements table for equivalent keys; that is, an \tcode{unordered_multimap}
|
11071 | 11099 | supports the \tcode{a_eq} operations in that table, not the \tcode{a_uniq} operations.
|
11072 | 11100 | For an \tcode{unordered_multimap<Key, T>} the \tcode{key type} is \tcode{Key}, the
|
|
11440 | 11468 | supports forward iterators.
|
11441 | 11469 |
|
11442 | 11470 | \pnum
|
11443 |
| -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<Key>} 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. |
| 11471 | +An \tcode{unordered_set} meets all of the requirements |
| 11472 | +of a container\iref{container.reqmts}, |
| 11473 | +of an allocator-aware container\iref{container.alloc.reqmts}, |
| 11474 | +of an unordered associative container\iref{unord.req}. |
| 11475 | +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<Key>} 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. |
11444 | 11476 |
|
11445 | 11477 | \pnum
|
11446 | 11478 | Subclause~\ref{unord.set} only describes operations on \tcode{unordered_set} that
|
|
11761 | 11793 | supports forward iterators.
|
11762 | 11794 |
|
11763 | 11795 | \pnum
|
11764 |
| -An \tcode{unordered_multiset} meets all of the requirements of a container, of an |
11765 |
| -unordered associative container, and of an allocator-aware container |
11766 |
| -(\tref{container.alloc.req}). It provides the operations described in the |
| 11796 | +An \tcode{unordered_multiset} meets all of the requirements |
| 11797 | +of a container\iref{container.reqmts}, |
| 11798 | +of an allocator-aware container\iref{container.alloc.reqmts}, and |
| 11799 | +of an unordered associative container\iref{unord.req}. |
| 11800 | +It provides the operations described in the |
11767 | 11801 | preceding requirements table for equivalent keys; that is, an \tcode{unordered_multiset}
|
11768 | 11802 | supports the \tcode{a_eq} operations in that table, not the \tcode{a_uniq} operations.
|
11769 | 11803 | For an \tcode{unordered_multiset<Key>} the \tcode{key type} and the value type are
|
|
0 commit comments