Skip to content

Commit d2b6fb6

Browse files
jwakelyzygoloid
authored andcommitted
[containers] Rephrase deduction guide constraints
Replace "is called with" wording that doesn't apply to deduction guides. Move rules about qualifying as input iterators or allocators to [container.requirements.general].
1 parent 6974561 commit d2b6fb6

File tree

2 files changed

+34
-32
lines changed

2 files changed

+34
-32
lines changed

source/containers.tex

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,24 @@
700700

701701
\end{libreqtab4a}
702702

703+
\pnum
704+
The behavior of certain container member functions and deduction guides
705+
depends on whether types qualify as input iterators or allocators.
706+
The extent to which an implementation determines that a type cannot be an input
707+
iterator is unspecified, except that as a minimum integral types shall not qualify
708+
as input iterators.
709+
Likewise, the extent to which an implementation determines that a type cannot be
710+
an allocator is unspecified, except that as a minimum a type \tcode{A} shall not qualify
711+
as an allocator unless it satisfies both of the following conditions:
712+
713+
\begin{itemize}
714+
\item The \grammarterm{qualified-id} \tcode{A::value_type}
715+
is valid and denotes a type~(\ref{temp.deduct}).
716+
717+
\item The expression \tcode{declval<A\&>().allocate(size_t\{\})}
718+
is well-formed when treated as an unevaluated operand.
719+
\end{itemize}
720+
703721
\rSec2[container.requirements.dataraces]{Container data races}
704722

705723
\pnum
@@ -1002,26 +1020,10 @@
10021020
shall not participate in overload resolution.
10031021

10041022
\item A deduction guide for a sequence container shall not participate in overload resolution
1005-
if it has an \tcode{InputIterator} template parameter that is called with a type that does not
1006-
qualify as an input iterator,
1007-
or if it has an \tcode{Allocator} template parameter that is called with a type that does not
1008-
qualify as an allocator.
1009-
\end{itemize}
1010-
1011-
\pnum
1012-
The extent to which an implementation determines that a type cannot be an input
1013-
iterator is unspecified, except that as a minimum integral types shall not qualify
1014-
as input iterators.
1015-
Likewise, the extent to which an implementation determines that a type cannot be
1016-
an allocator is unspecified, except that as a minimum a type \tcode{A} not satisfying
1017-
both of the following conditions shall not qualify as an allocator:
1018-
1019-
\begin{itemize}
1020-
\item The \grammarterm{qualified-id} \tcode{A::value_type}
1021-
is valid and denotes a type~(\ref{temp.deduct}).
1022-
1023-
\item The expression \tcode{declval<A\&>().allocate(size_t\{\})}
1024-
is well-formed when treated as an unevaluated operand.
1023+
if it has an \tcode{InputIterator} template parameter and a type that does not
1024+
qualify as an input iterator is deduced for that parameter,
1025+
or if it has an \tcode{Allocator} template parameter and a type that does not
1026+
qualify as an allocator is deduced for that parameter.
10251027
\end{itemize}
10261028

10271029
\pnum
@@ -2038,13 +2040,13 @@
20382040
if any of the following are true:
20392041
\begin{itemize}
20402042
\item It has an \tcode{InputIterator} template parameter
2041-
that is called with a type that does not qualify as an input iterator.
2043+
and a type that does not qualify as an input iterator is deduced for that parameter.
20422044

20432045
\item It has an \tcode{Allocator} template parameter
2044-
that is called with a type that does not qualify as an allocator.
2046+
and a type that does not qualify as an allocator is deduced for that parameter.
20452047

20462048
\item It has a \tcode{Compare} template parameter
2047-
that is called with a type that qualifies as an allocator.
2049+
and a type that qualifies as an allocator is deduced for that parameter.
20482050
\end{itemize}
20492051

20502052
\indextext{associative containers!exception safety}%
@@ -2871,16 +2873,16 @@
28712873
if any of the following are true:
28722874
\begin{itemize}
28732875
\item It has an \tcode{InputIterator} template parameter
2874-
that is called with a type that does not qualify as an input iterator.
2876+
and a type that does not qualify as an input iterator is deduced for that parameter.
28752877

28762878
\item It has an \tcode{Allocator} template parameter
2877-
that is called with a type that does not qualify as an allocator.
2879+
and a type that does not qualify as an allocator is deduced for that parameter.
28782880

28792881
\item It has a \tcode{Hash} template parameter
2880-
that is called with an integral type or a type that qualifies as an allocator.
2882+
and an integral type or a type that qualifies as an allocator is deduced for that parameter.
28812883

28822884
\item It has a \tcode{Pred} template parameter
2883-
that is called with a type that qualifies as an allocator.
2885+
and a type that qualifies as an allocator is deduced for that parameter.
28842886
\end{itemize}
28852887

28862888
\rSec3[unord.req.except]{Exception safety guarantees}
@@ -9164,10 +9166,10 @@
91649166
\pnum
91659167
A deduction guide for a container adaptor shall not participate in overload resolution if any of the following are true:
91669168
\begin{itemize}
9167-
\item It has an \tcode{InputIterator} template parameter that is called with a type that does not qualify as an input iterator.
9168-
\item It has a \tcode{Compare} template parameter that is called with a type that qualifies as an allocator.
9169-
\item It has a \tcode{Container} template parameter that is called with a type that qualifies as an allocator.
9170-
\item It has an \tcode{Allocator} template parameter that is called with a type that does not qualify as an allocator.
9169+
\item It has an \tcode{InputIterator} template parameter and a type that does not qualify as an input iterator is deduced for that parameter.
9170+
\item It has a \tcode{Compare} template parameter and a type that qualifies as an allocator is deduced for that parameter.
9171+
\item It has a \tcode{Container} template parameter and a type that qualifies as an allocator is deduced for that parameter.
9172+
\item It has an \tcode{Allocator} template parameter and a type that does not qualify as an allocator is deduced for that parameter.
91719173
\item It has both \tcode{Container} and \tcode{Allocator} template parameters, and \tcode{uses_allocator_v<Container, Allocator>} is \tcode{false}.
91729174
\end{itemize}
91739175

source/strings.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@
14921492
\pnum
14931493
\remarks Shall not participate in overload resolution if
14941494
\tcode{InputIterator} is a type that does not qualify as an input iterator,
1495-
or if \tcode{Allocator} is a type that does not qualify as an allocator~(\ref{sequence.reqmts}).
1495+
or if \tcode{Allocator} is a type that does not qualify as an allocator~(\ref{container.requirements.general}).
14961496
\end{itemdescr}
14971497

14981498
\indexlibrarymember{operator=}{basic_string}%

0 commit comments

Comments
 (0)