-
Notifications
You must be signed in to change notification settings - Fork 775
[containers] Rephrase deduction guide constraints #1548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -700,6 +700,31 @@ | |
|
||
\end{libreqtab4a} | ||
|
||
\pnum | ||
In this Clause the behavior of certain member functions and deduction guides | ||
depends on whether types qualify as input iterators or allocators. | ||
The extent to which an implementation determines that a type cannot be an input | ||
iterator is unspecified, except that as a minimum integral types shall not qualify | ||
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: | ||
|
||
\begin{itemize} | ||
\item The \grammarterm{qualified-id} \tcode{A::value_type} | ||
is valid and denotes a type~(\ref{temp.deduct}). | ||
|
||
\item The expression \tcode{declval<A\&>().allocate(size_t\{\})} | ||
is well-formed when treated as an unevaluated operand. | ||
\end{itemize} | ||
|
||
\pnum | ||
\begin{note} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like this note as-written: it suggests that implementations can impose unbounded constraints on the types in questions, rather than merely constraints that are derivable from the allocator or input iterator requirements. I'm inclined to merge this without the new note. |
||
Implementations may impose additional conditions which must be satisfied | ||
to qualify as an input iterator or an allocator. | ||
\end{note} | ||
|
||
|
||
\rSec2[container.requirements.dataraces]{Container data races} | ||
|
||
\pnum | ||
|
@@ -1002,26 +1027,10 @@ | |
shall not participate in overload resolution. | ||
|
||
\item A deduction guide for a sequence container shall not participate in overload resolution | ||
if it has an \tcode{InputIterator} template parameter that is called with a type that does not | ||
qualify as an input iterator, | ||
or if it has an \tcode{Allocator} template parameter that is called with a type that does not | ||
qualify as an allocator. | ||
\end{itemize} | ||
|
||
\pnum | ||
The extent to which an implementation determines that a type cannot be an input | ||
iterator is unspecified, except that as a minimum integral types shall not qualify | ||
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} not satisfying | ||
both of the following conditions shall not qualify as an allocator: | ||
|
||
\begin{itemize} | ||
\item The \grammarterm{qualified-id} \tcode{A::value_type} | ||
is valid and denotes a type~(\ref{temp.deduct}). | ||
|
||
\item The expression \tcode{declval<A\&>().allocate(size_t\{\})} | ||
is well-formed when treated as an unevaluated operand. | ||
if it has an \tcode{InputIterator} template parameter and a type that does not | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, does |
||
qualify as an input iterator is deduced for that parameter, | ||
or if it has an \tcode{Allocator} template parameter and a type that does not | ||
qualify as an allocator is deduced for that parameter. | ||
\end{itemize} | ||
|
||
\pnum | ||
|
@@ -2038,13 +2047,13 @@ | |
if any of the following are true: | ||
\begin{itemize} | ||
\item It has an \tcode{InputIterator} template parameter | ||
that is called with a type that does not qualify as an input iterator. | ||
and a type that does not qualify as an input iterator is deduced for that parameter. | ||
|
||
\item It has an \tcode{Allocator} template parameter | ||
that is called with a type that does not qualify as an allocator. | ||
and a type that does not qualify as an allocator is deduced for that parameter. | ||
|
||
\item It has a \tcode{Compare} template parameter | ||
that is called with a type that qualifies as an allocator. | ||
and a type that qualifies as an allocator is deduced for that parameter. | ||
\end{itemize} | ||
|
||
\indextext{associative containers!exception safety}% | ||
|
@@ -2871,16 +2880,16 @@ | |
if any of the following are true: | ||
\begin{itemize} | ||
\item It has an \tcode{InputIterator} template parameter | ||
that is called with a type that does not qualify as an input iterator. | ||
and a type that does not qualify as an input iterator is deduced for that parameter. | ||
|
||
\item It has an \tcode{Allocator} template parameter | ||
that is called with a type that does not qualify as an allocator. | ||
and a type that does not qualify as an allocator is deduced for that parameter. | ||
|
||
\item It has a \tcode{Hash} template parameter | ||
that is called with an integral type or a type that qualifies as an allocator. | ||
and an integral type or a type that qualifies as an allocator is deduced for that parameter. | ||
|
||
\item It has a \tcode{Pred} template parameter | ||
that is called with a type that qualifies as an allocator. | ||
and a type that qualifies as an allocator is deduced for that parameter. | ||
\end{itemize} | ||
|
||
\rSec3[unord.req.except]{Exception safety guarantees} | ||
|
@@ -9164,10 +9173,10 @@ | |
\pnum | ||
A deduction guide for a container adaptor shall not participate in overload resolution if any of the following are true: | ||
\begin{itemize} | ||
\item It has an \tcode{InputIterator} template parameter that is called with a type that does not qualify as an input iterator. | ||
\item It has a \tcode{Compare} template parameter that is called with a type that qualifies as an allocator. | ||
\item It has a \tcode{Container} template parameter that is called with a type that qualifies as an allocator. | ||
\item It has an \tcode{Allocator} template parameter that is called with a type that does not qualify as an allocator. | ||
\item It has an \tcode{InputIterator} template parameter and a type that does not qualify as an input iterator is deduced for that parameter. | ||
\item It has a \tcode{Compare} template parameter and a type that qualifies as an allocator is deduced for that parameter. | ||
\item It has a \tcode{Container} template parameter and a type that qualifies as an allocator is deduced for that parameter. | ||
\item It has an \tcode{Allocator} template parameter and a type that does not qualify as an allocator is deduced for that parameter. | ||
\item It has both \tcode{Container} and \tcode{Allocator} template parameters, and \tcode{uses_allocator_v<Container, Allocator>} is \tcode{false}. | ||
\end{itemize} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...
and Clause~\ref{strings}
. Also need to update the cross reference in [string.cons] after the move.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we are in the vicinity,
basic_string
's deduction guide specification is missing a\pnum
.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The missing \pnum is fixed.