Skip to content

Commit 7b75dc6

Browse files
Dawn Perchikzygoloid
authored andcommitted
LWG2969 polymorphic_allocator::construct() shouldn't pass resource()
1 parent fba347c commit 7b75dc6

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

source/utilities.tex

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11482,7 +11482,7 @@
1148211482
\pnum
1148311483
\requires
1148411484
Uses-allocator construction of \tcode{T}
11485-
with allocator \tcode{resource()} (see~\ref{allocator.uses.construction})
11485+
with allocator \tcode{*this} (see~\ref{allocator.uses.construction})
1148611486
and constructor arguments \tcode{std::forward<Args>(args)...} is well-formed.
1148711487
\begin{note}
1148811488
Uses-allocator construction is always well-formed
@@ -11492,7 +11492,7 @@
1149211492
\effects
1149311493
Construct a \tcode{T} object in the storage
1149411494
whose address is represented by \tcode{p}
11495-
by uses-allocator construction with allocator \tcode{resource()}
11495+
by uses-allocator construction with allocator \tcode{*this}
1149611496
and constructor arguments \tcode{std::forward<Args>(args)...}.
1149711497

1149811498
\pnum
@@ -11522,60 +11522,60 @@
1152211522
constructing a \tcode{pair<T1, T2>} object
1152311523
in the storage whose address is represented by \tcode{p},
1152411524
as if by separate uses-allocator construction
11525-
with allocator \tcode{resource()}\iref{allocator.uses.construction}
11525+
with allocator \tcode{*this}\iref{allocator.uses.construction}
1152611526
of \tcode{p->first} using the elements of \tcode{x}
1152711527
and \tcode{p->second} using the elements of \tcode{y}.
1152811528
\end{note}
1152911529
\begin{itemize}
1153011530
\item
11531-
If \tcode{uses_allocator_v<T1,memory_resource*>} is \tcode{false}
11531+
If \tcode{uses_allocator_v<T1,polymorphic_allocator>} is \tcode{false}
1153211532
\\
1153311533
and
1153411534
\tcode{is_constructible_v<T1,Args1...>} is \tcode{true},
1153511535
\\
1153611536
then \tcode{xprime} is \tcode{x}.
1153711537
\item
11538-
Otherwise, if \tcode{uses_allocator_v<T1,memory_resource*>} is \tcode{true}
11538+
Otherwise, if \tcode{uses_allocator_v<T1,polymorphic_allocator>} is \tcode{true}
1153911539
\\
1154011540
and
11541-
\tcode{is_constructible_v<T1,allocator_arg_t,memory_resource*,Args1...>} is \tcode{true},
11541+
\tcode{is_constructible_v<T1,allocator_arg_t,polymorphic_allocator,Args1...>} is \tcode{true},
1154211542
\\
11543-
then \tcode{xprime} is \tcode{tuple_cat(make_tuple(allocator_arg, resource()), std::move(x))}.
11543+
then \tcode{xprime} is \tcode{tuple_cat(make_tuple(allocator_arg, *this), std::move(x))}.
1154411544
\item
11545-
Otherwise, if \tcode{uses_allocator_v<T1,memory_resource*>} is \tcode{true}
11545+
Otherwise, if \tcode{uses_allocator_v<T1,polymorphic_allocator>} is \tcode{true}
1154611546
\\
1154711547
and
11548-
\tcode{is_constructible_v<T1,Args1...,memory_resource*>} is \tcode{true},
11548+
\tcode{is_constructible_v<T1,Args1...,polymorphic_allocator>} is \tcode{true},
1154911549
\\
11550-
then \tcode{xprime} is \tcode{tuple_cat(std::move(x), make_tuple(resource()))}.
11550+
then \tcode{xprime} is \tcode{tuple_cat(std::move(x), make_tuple(*this))}.
1155111551
\item
1155211552
Otherwise the program is ill formed.
1155311553
\end{itemize}
1155411554
Let \tcode{yprime} be a tuple constructed from \tcode{y}
1155511555
according to the appropriate rule from the following list:
1155611556
\begin{itemize}
1155711557
\item
11558-
If \tcode{uses_allocator_v<T2,memory_resource*>} is \tcode{false}
11558+
If \tcode{uses_allocator_v<T2,polymorphic_allocator>} is \tcode{false}
1155911559
\\
1156011560
and
1156111561
\tcode{is_constructible_v<T2,Args2...>} is \tcode{true},
1156211562
\\
1156311563
then \tcode{yprime} is \tcode{y}.
1156411564
\item
11565-
Otherwise, if \tcode{uses_allocator_v<T2,memory_resource*>} is \tcode{true}
11565+
Otherwise, if \tcode{uses_allocator_v<T2,polymorphic_allocator>} is \tcode{true}
1156611566
\\
1156711567
and
11568-
\tcode{is_constructible_v<T2,allocator_arg_t,memory_resource*,Args2...>} is \tcode{true},
11568+
\tcode{is_constructible_v<T2,allocator_arg_t,polymorphic_allocator,Args2...>} is \tcode{true},
1156911569
\\
11570-
then \tcode{yprime} is \tcode{tuple_cat(make_tuple(allocator_arg, resource()), std::move(y))}.
11570+
then \tcode{yprime} is \tcode{tuple_cat(make_tuple(allocator_arg, *this), std::move(y))}.
1157111571
\item
11572-
Otherwise, if \tcode{uses_allocator_v<T2,memory_resource*>} is \tcode{true}
11572+
Otherwise, if \tcode{uses_allocator_v<T2,polymorphic_allocator>} is \tcode{true}
1157311573
\\
1157411574
and
11575-
\tcode{is_constructible_v<T2,Args2...,memory_resource*>} is \tcode{true},
11575+
\tcode{is_constructible_v<T2,Args2...,polymorphic_allocator>} is \tcode{true},
1157611576
\\
1157711577
then
11578-
\tcode{yprime} is \tcode{tuple_cat(std::move(y), make_tuple(resource()))}.
11578+
\tcode{yprime} is \tcode{tuple_cat(std::move(y), make_tuple(*this))}.
1157911579
\item
1158011580
Otherwise the program is ill formed.
1158111581
\end{itemize}

0 commit comments

Comments
 (0)