Skip to content

Commit de80974

Browse files
committed
LWG3216 Rebinding the allocator before calling construct/destroy in allocate_shared
1 parent 71b9526 commit de80974

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

source/memory.tex

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3970,15 +3970,15 @@
39703970
\tcode{allocate_shared} shall initialize this (sub)object
39713971
via the expression
39723972
\begin{itemize}
3973-
\item \tcode{allocator_traits<A2>::construct(a2, pv, v)} or
3974-
\item \tcode{allocator_traits<A2>::construct(a2, pv, l...)}
3973+
\item \tcode{allocator_traits<A2>::construct(a2, pu, v)} or
3974+
\item \tcode{allocator_traits<A2>::construct(a2, pu, l...)}
39753975
\end{itemize}
39763976
respectively,
3977-
where \tcode{pv} points to storage
3978-
suitable to hold an object of type \tcode{U} and
3979-
\tcode{a2} of type \tcode{A2} is a rebound copy of
3980-
the allocator \tcode{a} passed to \tcode{allocate_shared}
3981-
such that its \tcode{value_type} is \tcode{remove_cv_t<U>}.
3977+
where \tcode{pu} is a pointer of type \tcode{remove_cv_t<U>*}
3978+
pointing to storage
3979+
suitable to hold an object of type \tcode{remove_cv_t<U>} and
3980+
\tcode{a2} of type \tcode{A2} is a potentially rebound copy of
3981+
the allocator \tcode{a} passed to \tcode{allocate_shared}.
39823982
\item
39833983
When a (sub)object of non-array type \tcode{U} is specified to have
39843984
a default initial value,
@@ -3989,13 +3989,13 @@
39893989
\item
39903990
When a (sub)object of non-array type \tcode{U} is specified to have
39913991
a default initial value,
3992-
\tcode{allocate_shared} shall initialize this (sub)object
3993-
via the expression \tcode{allocator_traits<A2>::construct(a2, pv)},
3994-
where \tcode{pv} points to storage
3995-
suitable to hold an object of type \tcode{U} and
3996-
\tcode{a2} of type \tcode{A2} is a rebound copy of
3997-
the allocator \tcode{a} passed to \tcode{allocate_shared}
3998-
such that its \tcode{value_type} is \tcode{remove_cv_t<U>}.
3992+
\tcode{allocate_shared} initializes this (sub)object
3993+
via the expression \tcode{allocator_traits<A2>::construct(a2, pu)},
3994+
where \tcode{pu} is a pointer of type \tcode{remove_cv_t<U>*}
3995+
pointing to storage
3996+
suitable to hold an object of type \tcode{remove_cv_t<U>} and
3997+
\tcode{a2} of type \tcode{A2} is a potentially rebound copy of
3998+
the allocator \tcode{a} passed to \tcode{allocate_shared}.
39993999
\item
40004000
When a (sub)object of non-array type \tcode{U} is initialized by
40014001
\tcode{make_shared_for_overwrite} or\linebreak % avoid Overfull
@@ -4015,17 +4015,17 @@
40154015
that was initialized by \tcode{make_shared},
40164016
\tcode{make_shared_for_overwrite}, or \tcode{allocate_shared_for_overwrite}
40174017
is to be destroyed,
4018-
it is destroyed via the expression \tcode{pv->\~{}U()} where
4019-
\tcode{pv} points to that object of type \tcode{U}.
4018+
it is destroyed via the expression \tcode{pu->\~{}U()} where
4019+
\tcode{pu} points to that object of type \tcode{U}.
40204020
\item
40214021
When a (sub)object of non-array type \tcode{U}
40224022
that was initialized by \tcode{allocate_shared} is to be destroyed,
40234023
it is destroyed via the expression
4024-
\tcode{allocator_traits<A2>::destroy(a2, pv)} where
4025-
\tcode{pv} points to that object of type \tcode{remove_cv_t<U>} and
4026-
\tcode{a2} of type \tcode{A2} is a rebound copy of
4027-
the allocator \tcode{a} passed to \tcode{allocate_shared}
4028-
such that its \tcode{value_type} is \tcode{remove_cv_t<U>}.
4024+
\tcode{allocator_traits<A2>::destroy(a2, pu)} where
4025+
\tcode{pu} is a pointer of type \tcode{remove_cv_t<U>*}
4026+
pointing to that object of type \tcode{remove_cv_t<U>} and
4027+
\tcode{a2} of type \tcode{A2} is a potentially rebound copy of
4028+
the allocator \tcode{a} passed to \tcode{allocate_shared}.
40294029
\end{itemize}
40304030
\begin{note}
40314031
These functions will typically allocate more memory than \tcode{sizeof(T)} to

0 commit comments

Comments
 (0)