Skip to content

Commit 49a6a30

Browse files
committed
[allocator.adaptor.members] Use placeholder macro for OUTERMOST*
pseudo-functions, improve presentation.
1 parent 44491ca commit 49a6a30

File tree

1 file changed

+59
-43
lines changed

1 file changed

+59
-43
lines changed

source/utilities.tex

+59-43
Original file line numberDiff line numberDiff line change
@@ -12312,14 +12312,14 @@
1231212312

1231312313
\pnum
1231412314
In the \tcode{construct} member functions,
12315-
\tcode{\textit{OUTERMOST}(x)} is \tcode{x} if \tcode{x} does not have an
12315+
\tcode{\placeholdernc{OUTERMOST}(x)} is \tcode{x} if \tcode{x} does not have an
1231612316
\tcode{outer_allocator()} member function and
12317-
\tcode{\textit{OUTERMOST}(x.outer_allocator())}
12317+
\tcode{\placeholdernc{OUTERMOST}(x.outer_allocator())}
1231812318
otherwise;
12319-
\tcode{\textit{OUTERMOST_ALLOC_TRAITS}(x)} is \\
12320-
\tcode{allocator_traits<decltype(\textit{OUTERMOST}(x))>}.
12321-
\begin{note} \tcode{\textit{OUTERMOST}(x)} and
12322-
\tcode{\textit{OUTERMOST_ALLOC_TRAITS}(x)} are recursive operations. It
12319+
\tcode{\placeholdernc{OUTERMOST_ALLOC_TRAITS}(x)} is
12320+
\tcode{allocator_traits<decltype(\placeholdernc{OUTERMOST}(x))>}.
12321+
\begin{note} \tcode{\placeholdernc{OUTERMOST}(x)} and
12322+
\tcode{\placeholdernc{OUTERMOST_ALLOC_TRAITS}(x)} are recursive operations. It
1232312323
is incumbent upon the definition of \tcode{outer_allocator()} to ensure that the
1232412324
recursion terminates. It will terminate for all instantiations of
1232512325
\tcode{scoped_allocator_adaptor}. \end{note}
@@ -12406,27 +12406,35 @@
1240612406
\begin{itemdescr}
1240712407
\pnum
1240812408
\effects
12409-
1241012409
\begin{itemize}
12411-
\item If \tcode{uses_allocator_v<T, inner_allocator_type>} is \tcode{false} and\\
12412-
\tcode{is_constructible_v<T, Args...>} is \tcode{true}, calls\\
12413-
\tcode{\textit{OUTERMOST_ALLOC_TRAITS}(*this)::construct(\\
12414-
\textit{OUTERMOST}(*this), p, std::forward<Args>(args)...)}.
12410+
\item If \tcode{uses_allocator_v<T, inner_allocator_type>} is \tcode{false} and
12411+
\tcode{is_constructible_v<T,\\ Args...>} is \tcode{true}, calls:
12412+
\begin{codeblock}
12413+
@\placeholdernc{OUTERMOST_ALLOC_TRAITS}@(*this)::construct(
12414+
@\placeholdernc{OUTERMOST}@(*this), p, std::forward<Args>(args)...)
12415+
\end{codeblock}
1241512416

1241612417
\item Otherwise, if \tcode{uses_allocator_v<T, inner_allocator_type>} is \tcode{true} and
12417-
\tcode{is_construc\-tible_v<T, allocator_arg_t, inner_allocator_type\&, Args...>} is \tcode{true}, calls
12418-
\tcode{\textit{OUTERMOST_ALLOC_TRAITS}(*this)::construct(\textit{OUTERMOST}(*this),
12419-
p, allocator_arg,\\inner_allocator(), std::forward<Args>(args)...)}.
12418+
\tcode{is_constructible_v<T, allocator_arg_t, inner_allocator_type\&, Args...>} is \tcode{true}, calls:
12419+
\begin{codeblock}
12420+
@\placeholdernc{OUTERMOST_ALLOC_TRAITS}@(*this)::construct(
12421+
@\placeholdernc{OUTERMOST}@(*this), p, allocator_arg, inner_allocator(), std::forward<Args>(args)...)
12422+
\end{codeblock}
1242012423

1242112424
\item Otherwise, if \tcode{uses_allocator_v<T, inner_allocator_type>} is \tcode{true} and
12422-
\tcode{is_construct\-ible_v<T, Args..., inner_allocator_type\&>} is \tcode{true}, calls
12423-
\tcode{\textit{OUTERMOST_ALLOC_TRAITS}(*this)::
12424-
construct(\textit{OUTERMOST}(*this), p, std::forward<Args>(args)...,\\inner_allocator())}.
12425+
\tcode{is_constructible_v<T, Args..., inner_allocator_type\&>} is \tcode{true}, calls:
12426+
\begin{codeblock}
12427+
@\placeholdernc{OUTERMOST_ALLOC_TRAITS}@(*this)::construct(
12428+
@\placeholdernc{OUTERMOST}@(*this), p, std::forward<Args>(args)..., inner_allocator())
12429+
\end{codeblock}
1242512430

12426-
\item Otherwise, the program is ill-formed. \begin{note} An error will result if
12431+
\item Otherwise, the program is ill-formed.
12432+
\begin{note}
12433+
An error will result if
1242712434
\tcode{uses_allocator} evaluates to \tcode{true} but the specific constructor does not take an
1242812435
allocator. This definition prevents a silent failure to pass an inner allocator to a
12429-
contained element. \end{note}
12436+
contained element.
12437+
\end{note}
1243012438
\end{itemize}
1243112439
\end{itemdescr}
1243212440

@@ -12445,55 +12453,63 @@
1244512453
\pnum
1244612454
\effects Constructs a \tcode{tuple} object \tcode{xprime} from \tcode{x} by the
1244712455
following rules:
12448-
1244912456
\begin{itemize}
12450-
\item If \tcode{uses_allocator_v<T1, inner_allocator_type>} is \tcode{false} and\\
12451-
\tcode{is_constructible_v<T1, Args1...>} is \tcode{true},
12457+
\item If \tcode{uses_allocator_v<T1, inner_allocator_type>} is \tcode{false} and
12458+
\tcode{is_constructible_v<T1,\\ Args1...>} is \tcode{true},
1245212459
then \tcode{xprime} is \tcode{x}.
1245312460

1245412461
\item Otherwise, if \tcode{uses_allocator_v<T1, inner_allocator_type>} is \tcode{true}
1245512462
and
1245612463
\tcode{is_construct\-ible_v<T1, allocator_arg_t, inner_allocator_type\&, Args1...>}
1245712464
is
12458-
\tcode{true}, then \tcode{xprime} is
12459-
\tcode{tuple_cat(tuple<allocator_arg_t, inner_allocator_type\&>(
12460-
allocator_arg, inner_allocator()), std::move(x))}.
12465+
\tcode{true}, then \tcode{xprime} is:
12466+
\begin{codeblock}
12467+
tuple_cat(
12468+
tuple<allocator_arg_t, inner_allocator_type&>(allocator_arg, inner_allocator()),
12469+
std::move(x))
12470+
\end{codeblock}
1246112471

1246212472
\item Otherwise, if \tcode{uses_allocator_v<T1, inner_allocator_type>} is
1246312473
\tcode{true} and
1246412474
\tcode{is_construct\-ible_v<T1, Args1..., inner_allocator_type\&>} is \tcode{true},
12465-
then \tcode{xprime} is
12466-
\tcode{tuple_cat(std::move(x), tuple<inner_allocator_type\&>(inner_allocator()))}.
12475+
then \tcode{xprime} is:
12476+
\begin{codeblock}
12477+
tuple_cat(std::move(x), tuple<inner_allocator_type&>(inner_allocator()))
12478+
\end{codeblock}
1246712479

1246812480
\item Otherwise, the program is ill-formed.
1246912481
\end{itemize}
12470-
1247112482
and constructs a \tcode{tuple} object \tcode{yprime} from \tcode{y} by the following rules:
12472-
1247312483
\begin{itemize}
12474-
\item If \tcode{uses_allocator_v<T2, inner_allocator_type>} is \tcode{false} and\\
12475-
\tcode{is_constructible_v<T2,
12476-
Args2...>} is \tcode{true}, then \tcode{yprime} is \tcode{y}.
12484+
\item If \tcode{uses_allocator_v<T2, inner_allocator_type>} is \tcode{false} and
12485+
\tcode{is_constructible_v<T2,\\ Args2...>} is \tcode{true}, then \tcode{yprime} is \tcode{y}.
1247712486

1247812487
\item Otherwise, if \tcode{uses_allocator_v<T2, inner_allocator_type>} is \tcode{true}
1247912488
and
12480-
\tcode{is_construct\-ible_v<T2, allocator_arg_t, inner_allocator_type\&, Args2...>}
12489+
\tcode{is_constructible_v<T2, allocator_arg_t, inner_allocator_type\&, Args2...>}
1248112490
is
12482-
\tcode{true}, then \tcode{yprime} is
12483-
\tcode{tuple_cat(tuple<allocator_arg_t, inner_allocator_type\&>(
12484-
allocator_arg, inner_allocator()), std::move(y))}.
12491+
\tcode{true}, then \tcode{yprime} is:
12492+
\begin{codeblock}
12493+
tuple_cat(
12494+
tuple<allocator_arg_t, inner_allocator_type&>(allocator_arg, inner_allocator()),
12495+
std::move(y))
12496+
\end{codeblock}
1248512497

1248612498
\item Otherwise, if \tcode{uses_allocator_v<T2, inner_allocator_type>} is
1248712499
\tcode{true} and
12488-
\tcode{is_construct\-ible_v<T2, Args2..., inner_allocator_type\&>} is \tcode{true},
12489-
then \tcode{yprime} is
12490-
\tcode{tuple_cat(std::move(y), tuple<inner_allocator_type\&>(inner_allocator()))}.
12500+
\tcode{is_constructible_v<T2, Args2..., inner_allocator_type\&>} is \tcode{true},
12501+
then \tcode{yprime} is:
12502+
\begin{codeblock}
12503+
tuple_cat(std::move(y), tuple<inner_allocator_type&>(inner_allocator()))
12504+
\end{codeblock}
1249112505

1249212506
\item Otherwise, the program is ill-formed.
1249312507
\end{itemize}
12494-
12495-
then calls \tcode{\textit{OUTERMOST_ALLOC_TRAITS}(*this)::construct(\textit{OUTERMOST}(*this), p,\\
12496-
piecewise_construct, std::move(xprime), std::move(yprime))}.
12508+
then calls:
12509+
\begin{codeblock}
12510+
@\placeholdernc{OUTERMOST_ALLOC_TRAITS}@(*this)::construct(
12511+
@\placeholdernc{OUTERMOST}@(*this), p, piecewise_construct, std::move(xprime), std::move(yprime))
12512+
\end{codeblock}
1249712513
\end{itemdescr}
1249812514

1249912515
\indexlibrarymember{construct}{scoped_allocator_adaptor}%
@@ -12566,7 +12582,7 @@
1256612582

1256712583
\begin{itemdescr}
1256812584
\pnum
12569-
\effects Calls \tcode{\textit{OUTERMOST_ALLOC_TRAITS}(*this)::destroy(\textit{OUTERMOST}(*this), p)}.
12585+
\effects Calls \tcode{\placeholdernc{OUTERMOST_ALLOC_TRAITS}(*this)::destroy(\placeholdernc{OUTERMOST}(*this), p)}.
1257012586
\end{itemdescr}
1257112587

1257212588
\indexlibrarymember{select_on_container_copy_construction}{scoped_allocator_adaptor}%

0 commit comments

Comments
 (0)