diff --git a/source/memory.tex b/source/memory.tex index efbf7fee28..34a3b4092b 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -5346,9 +5346,9 @@ operator void**() const noexcept; private: - Smart& s; // \expos - tuple a; // \expos - Pointer p; // \expos + Smart& @\exposid{s}@; // \expos + tuple @\exposid{a}@; // \expos + Pointer @\exposid{p}@; // \expos }; } \end{codeblock} @@ -5382,23 +5382,23 @@ \begin{itemdescr} \pnum \effects -Initializes \tcode{s} with \tcode{smart}, -\tcode{a} with \tcode{std::forward(args)...}, and -value-initializes \tcode{p}. +Initializes \exposid{s} with \tcode{smart}, +\exposid{a} with \tcode{std::forward(args)...}, and +value-initializes \exposid{p}. Then, equivalent to: \begin{itemize} \item % pretend to \item that there is real text here, but undo the vertical spacing \mbox{}\vspace{-\baselineskip}\vspace{-\parskip} \begin{codeblock} -s.reset(); +@\exposid{s}@.reset(); \end{codeblock} -if the expression \tcode{s.reset()} is well-formed; +if the expression \tcode{\exposid{s}.reset()} is well-formed; \item otherwise, \begin{codeblock} -s = Smart(); +@\exposid{s}@ = Smart(); \end{codeblock} if \tcode{is_constructible_v} is \tcode{true}; @@ -5436,20 +5436,20 @@ % pretend to \item that there is real text here, but undo the vertical spacing \mbox{}\vspace{-\baselineskip}\vspace{-\parskip} \begin{codeblock} -if (p) { +if (@\exposid{p}@) { apply([&](auto&&... args) { - s.reset(static_cast(p), std::forward(args)...); }, std::move(a)); + @\exposid{s}@.reset(static_cast(@\exposid{p}@), std::forward(args)...); }, std::move(@\exposid{a}@)); } \end{codeblock} if the expression -\tcode{s.reset(static_cast(p), std::forward(args)...)} +\tcode{\exposid{s}.reset(static_cast(\exposid{p}), std::forward(args)...)} is well-\linebreak formed; \item otherwise, \begin{codeblock} -if (p) { +if (@\exposid{p}@) { apply([&](auto&&... args) { - s = Smart(static_cast(p), std::forward(args)...); }, std::move(a)); + @\exposid{s}@ = Smart(static_cast(@\exposid{p}@), std::forward(args)...); }, std::move(@\exposid{a}@)); } \end{codeblock} if \tcode{is_constructible_v} is \tcode{true}; @@ -5469,7 +5469,7 @@ \pnum \returns -\tcode{addressof(const_cast(p))}. +\tcode{addressof(const_cast(\exposid{p}))}. \end{itemdescr} \begin{itemdecl} @@ -5494,12 +5494,12 @@ A pointer value \tcode{v} such that: \begin{itemize} \item -the initial value \tcode{*v} is equivalent to \tcode{static_cast(p)} and +the initial value \tcode{*v} is equivalent to \tcode{static_cast(\exposid{p})} and \item any modification of \tcode{*v} that is not followed by a subsequent modification of \tcode{*this} -affects the value of \tcode{p} during the destruction of \tcode{*this}, -such that \tcode{static_cast(p) == *v}. +affects the value of \exposid{p} during the destruction of \tcode{*this}, +such that \tcode{static_cast(\exposid{p}) == *v}. \end{itemize} \pnum @@ -5586,9 +5586,9 @@ operator void**() const noexcept; private: - Smart& s; // \expos - tuple a; // \expos - Pointer p; // \expos + Smart& @\exposid{s}@; // \expos + tuple @\exposid{a}@; // \expos + Pointer @\exposid{p}@; // \expos }; } \end{codeblock} @@ -5619,9 +5619,9 @@ \begin{itemdescr} \pnum \effects -Initializes \tcode{s} with \tcode{smart}, -\tcode{a} with \tcode{std::forward(args)...}, and -\tcode{p} to either +Initializes \exposid{s} with \tcode{smart}, +\exposid{a} with \tcode{std::forward(args)...}, and +\exposid{p} to either \begin{itemize} \item \tcode{smart} if \tcode{is_pointer_v} is \tcode{true}, \item otherwise, \tcode{smart.get()}. @@ -5629,7 +5629,7 @@ \pnum \remarks -An implementation can call \tcode{s.release()}. +An implementation can call \tcode{\exposid{s}.release()}. \pnum \begin{note} @@ -5651,8 +5651,8 @@ \tcode{\exposid{POINTER_OF_OR}(Smart, Pointer)}\iref{memory.general}. \pnum -Let \exposid{release-statement} be \tcode{s.release();} -if an implementation does not call \tcode{s.release()} in the constructor. +Let \exposid{release-statement} be \tcode{\exposid{s}.release();} +if an implementation does not call \tcode{\exposid{s}.release()} in the constructor. Otherwise, it is empty. \pnum @@ -5664,28 +5664,28 @@ \mbox{}\vspace{-\baselineskip}\vspace{-\parskip} \begin{codeblock} apply([&](auto&&... args) { - s = Smart(static_cast(p), std::forward(args)...); }, std::move(a)); + @\exposid{s}@ = Smart(static_cast(@\exposid{p}@), std::forward(args)...); }, std::move(@\exposid{a}@)); \end{codeblock} if \tcode{is_pointer_v} is \tcode{true}; \item otherwise, \begin{codeblock} @\exposid{release-statement}@; -if (p) { +if (@\exposid{p}@) { apply([&](auto&&... args) { - s.reset(static_cast(p), std::forward(args)...); }, std::move(a)); + @\exposid{s}@.reset(static_cast(@\exposid{p}@), std::forward(args)...); }, std::move(@\exposid{a}@)); } \end{codeblock} if the expression -\tcode{s.reset(static_cast(p), std::forward(args)...)} +\tcode{\exposid{s}.reset(static_cast(\exposid{p}), std::forward(args)...)} is well-\newline formed; \item otherwise, \begin{codeblock} @\exposid{release-statement}@; -if (p) { +if (@\exposid{p}@) { apply([&](auto&&... args) { - s = Smart(static_cast(p), std::forward(args)...); }, std::move(a)); + @\exposid{s}@ = Smart(static_cast(@\exposid{p}@), std::forward(args)...); }, std::move(@\exposid{a}@)); } \end{codeblock} if \tcode{is_constructible_v} is \tcode{true}; @@ -5705,7 +5705,7 @@ \pnum \returns -\tcode{addressof(const_cast(p))}. +\tcode{addressof(const_cast(\exposid{p}))}. \end{itemdescr} \begin{itemdecl} @@ -5730,12 +5730,12 @@ A pointer value \tcode{v} such that: \begin{itemize} \item -the initial value \tcode{*v} is equivalent to \tcode{static_cast(p)} and +the initial value \tcode{*v} is equivalent to \tcode{static_cast(\exposid{p})} and \item any modification of \tcode{*v} that is not followed by subsequent modification of \tcode{*this} -affects the value of \tcode{p} during the destruction of \tcode{*this}, -such that \tcode{static_cast(p) == *v}. +affects the value of \exposid{p} during the destruction of \tcode{*this}, +such that \tcode{static_cast(\exposid{p}) == *v}. \end{itemize} \pnum @@ -7361,7 +7361,7 @@ \begin{codeblock} namespace std::pmr { class memory_resource { - static constexpr size_t max_align = alignof(max_align_t); // \expos + static constexpr size_t @\exposid{max-align}@ = alignof(max_align_t); // \expos public: memory_resource() = default; @@ -7370,8 +7370,8 @@ memory_resource& operator=(const memory_resource&) = default; - void* allocate(size_t bytes, size_t alignment = max_align); - void deallocate(void* p, size_t bytes, size_t alignment = max_align); + void* allocate(size_t bytes, size_t alignment = @\exposid{max-align}@); + void deallocate(void* p, size_t bytes, size_t alignment = @\exposid{max-align}@); bool is_equal(const memory_resource& other) const noexcept; @@ -7400,7 +7400,7 @@ \indexlibrarymember{allocate}{memory_resource}% \begin{itemdecl} -void* allocate(size_t bytes, size_t alignment = max_align); +void* allocate(size_t bytes, size_t alignment = @\exposid{max-align}@); \end{itemdecl} \begin{itemdescr} @@ -7421,7 +7421,7 @@ \indexlibrarymember{deallocate}{memory_resource}% \begin{itemdecl} -void deallocate(void* p, size_t bytes, size_t alignment = max_align); +void deallocate(void* p, size_t bytes, size_t alignment = @\exposid{max-align}@); \end{itemdecl} \begin{itemdescr} @@ -7543,7 +7543,7 @@ \begin{codeblock} namespace std::pmr { template class polymorphic_allocator { - memory_resource* memory_rsrc; // \expos + memory_resource* @\exposid{memory-rsrc}@; // \expos public: using value_type = Tp; @@ -7599,7 +7599,7 @@ \begin{itemdescr} \pnum \effects -Sets \tcode{memory_rsrc} to \tcode{get_default_resource()}. +Sets \exposid{memory-rsrc} to \tcode{get_default_resource()}. \end{itemdescr} \indexlibraryctor{polymorphic_allocator}% @@ -7614,7 +7614,7 @@ \pnum \effects -Sets \tcode{memory_rsrc} to \tcode{r}. +Sets \exposid{memory-rsrc} to \tcode{r}. \pnum \throws @@ -7634,7 +7634,7 @@ \begin{itemdescr} \pnum \effects -Sets \tcode{memory_rsrc} to \tcode{other.resource()}. +Sets \exposid{memory-rsrc} to \tcode{other.resource()}. \end{itemdescr} @@ -7652,7 +7652,7 @@ throws \tcode{bad_array_new_length}. Otherwise equivalent to: \begin{codeblock} -return static_cast(memory_rsrc->allocate(n * sizeof(Tp), alignof(Tp))); +return static_cast(\exposid{memory-rsrc}->allocate(n * sizeof(Tp), alignof(Tp))); \end{codeblock} \end{itemdescr} @@ -7665,12 +7665,12 @@ \pnum \expects \tcode{p} was allocated from a memory resource \tcode{x}, -equal to \tcode{*memory_rsrc}, +equal to \tcode{*\exposid{memory-rsrc}}, using \tcode{x.allocate(n * sizeof(Tp), alignof(Tp))}. \pnum \effects -Equivalent to \tcode{memory_rsrc->deallocate(p, n * sizeof(Tp), alignof(Tp))}. +Equivalent to \tcode{\exposid{memory-rsrc}->deallocate(p, n * sizeof(Tp), alignof(Tp))}. \pnum \throws @@ -7685,7 +7685,7 @@ \begin{itemdescr} \pnum \effects -Equivalent to: \tcode{return memory_rsrc->allocate(nbytes, alignment);} +Equivalent to: \tcode{return \exposid{memory-rsrc}->allocate(nbytes, alignment);} \pnum \begin{note} @@ -7704,7 +7704,7 @@ \begin{itemdescr} \pnum \effects -Equivalent to \tcode{memory_rsrc->deallocate(p, nbytes, alignment)}. +Equivalent to \tcode{\exposid{memory-rsrc}->deallocate(p, nbytes, alignment)}. \end{itemdescr} \indexlibrarymember{allocate_object}{polymorphic_allocator}% @@ -7852,7 +7852,7 @@ \begin{itemdescr} \pnum \returns -\tcode{memory_rsrc}. +\exposid{memory-rsrc}. \end{itemdescr} \rSec3[mem.poly.allocator.eq]{Equality} @@ -8274,9 +8274,9 @@ \begin{codeblock} namespace std::pmr { class monotonic_buffer_resource : public memory_resource { - memory_resource* upstream_rsrc; // \expos - void* current_buffer; // \expos - size_t next_buffer_size; // \expos + memory_resource* @\exposid{upstream-rsrc}@; // \expos + void* @\exposid{current-buffer}@; // \expos + size_t @\exposid{next-buffer-size}@; // \expos public: explicit monotonic_buffer_resource(memory_resource* upstream); @@ -8324,12 +8324,12 @@ \pnum \effects -Sets \tcode{upstream_rsrc} to \tcode{upstream} and -\tcode{current_buffer} to \keyword{nullptr}. +Sets \exposid{upstream-rsrc} to \tcode{upstream} and +\exposid{current-buffer} to \keyword{nullptr}. If \tcode{initial_size} is specified, -sets \tcode{next_buffer_size} to at least \tcode{initial_size}; -otherwise sets \tcode{next_buffer_size} to an -\impldef{default \tcode{next_buffer_size} for a \tcode{monotonic_buffer_resource}} size. +sets \exposid{next-buffer-size} to at least \tcode{initial_size}; +otherwise sets \exposid{next-buffer-size} to an +\impldef{default \exposid{next-buffer-size} for a \tcode{monotonic_buffer_resource}} size. \end{itemdescr} \indexlibraryctor{monotonic_buffer_resource}% @@ -8345,10 +8345,10 @@ \pnum \effects -Sets \tcode{upstream_rsrc} to \tcode{upstream}, -\tcode{current_buffer} to \tcode{buffer}, and -\tcode{next_buffer_size} to \tcode{buffer_size} (but not less than 1), -then increases \tcode{next_buffer_size} +Sets \exposid{upstream-rsrc} to \tcode{upstream}, +\exposid{current-buffer} to \tcode{buffer}, and +\exposid{next-buffer-size} to \tcode{buffer_size} (but not less than 1), +then increases \exposid{next-buffer-size} by an \impldef{growth factor for \tcode{monotonic_buffer_resource}} growth factor (which need not be integral). \end{itemdescr} @@ -8374,14 +8374,14 @@ \begin{itemdescr} \pnum \effects -Calls \tcode{upstream_rsrc->deallocate()} as necessary +Calls \tcode{\exposid{upstream-rsrc}->deallocate()} as necessary to release all allocated memory. -Resets \tcode{current_buffer} and \tcode{next_buffer_size} +Resets \exposid{current-buffer} and \exposid{next-buffer-size} to their initial values at construction. \pnum \begin{note} -The memory is released back to \tcode{upstream_rsrc} +The memory is released back to \exposid{upstream-rsrc} even if some blocks that were allocated from \tcode{*this} have not been deallocated from \tcode{*this}. \end{note} @@ -8395,7 +8395,7 @@ \begin{itemdescr} \pnum \returns -The value of \tcode{upstream_rsrc}. +The value of \exposid{upstream-rsrc}. \end{itemdescr} \indexlibrarymember{do_allocate}{monotonic_buffer_resource}% @@ -8406,15 +8406,15 @@ \begin{itemdescr} \pnum \effects -If the unused space in \tcode{current_buffer} +If the unused space in \exposid{current-buffer} can fit a block with the specified \tcode{bytes} and \tcode{alignment}, -then allocate the return block from \tcode{current_buffer}; -otherwise set \tcode{current_buffer} to \tcode{upstream_rsrc->allocate(n, m)}, -where \tcode{n} is not less than \tcode{max(bytes, next_buffer_size)} and +then allocate the return block from \exposid{current-buffer}; +otherwise set \exposid{current-buffer} to \tcode{\exposid{upstream-rsrc}->allocate(n, m)}, +where \tcode{n} is not less than \tcode{max(bytes, \exposid{next-buffer-size})} and \tcode{m} is not less than \tcode{alignment}, -and increase \tcode{next_buffer_size} +and increase \exposid{next-buffer-size} by an \impldef{growth factor for \tcode{monotonic_buffer_resource}} growth factor (which need not be integral), -then allocate the return block from the newly-allocated \tcode{current_buffer}. +then allocate the return block from the newly-allocated \exposid{current-buffer}. \pnum \returns @@ -8425,7 +8425,7 @@ \pnum \throws -Nothing unless \tcode{upstream_rsrc->allocate()} throws. +Nothing unless \tcode{\exposid{upstream-rsrc}->allocate()} throws. \end{itemdescr} \indexlibrarymember{do_deallocate}{monotonic_buffer_resource}% @@ -8513,20 +8513,20 @@ template class scoped_allocator_adaptor : public OuterAlloc { private: - using OuterTraits = allocator_traits; // \expos - scoped_allocator_adaptor inner; // \expos + using @\exposid{outer-traits}@ = allocator_traits; // \expos + scoped_allocator_adaptor @\exposid{inner}@; // \expos public: using outer_allocator_type = OuterAlloc; using inner_allocator_type = @\seebelow@; - using value_type = OuterTraits::value_type; - using size_type = OuterTraits::size_type; - using difference_type = OuterTraits::difference_type; - using pointer = OuterTraits::pointer; - using const_pointer = OuterTraits::const_pointer; - using void_pointer = OuterTraits::void_pointer; - using const_void_pointer = OuterTraits::const_void_pointer; + using value_type = @\exposid{outer-traits}@::value_type; + using size_type = @\exposid{outer-traits}@::size_type; + using difference_type = @\exposid{outer-traits}@::difference_type; + using pointer = @\exposid{outer-traits}@::pointer; + using const_pointer = @\exposid{outer-traits}@::const_pointer; + using void_pointer = @\exposid{outer-traits}@::void_pointer; + using const_void_pointer = @\exposid{outer-traits}@::const_void_pointer; using propagate_on_container_copy_assignment = @\seebelow@; using propagate_on_container_move_assignment = @\seebelow@; @@ -8535,7 +8535,7 @@ template struct rebind { using other = scoped_allocator_adaptor< - OuterTraits::template rebind_alloc, InnerAllocs...>; + @\exposid{outer-traits}@::template rebind_alloc, InnerAllocs...>; }; scoped_allocator_adaptor(); @@ -8658,7 +8658,7 @@ \begin{itemdescr} \pnum \effects -Value-initializes the \tcode{OuterAlloc} base class and the \tcode{inner} allocator +Value-initializes the \tcode{OuterAlloc} base class and the \exposid{inner} allocator object. \end{itemdescr} @@ -8676,7 +8676,7 @@ \pnum \effects Initializes the \tcode{OuterAlloc} base class with -\tcode{std::forward(outerAlloc)} and \tcode{inner} with \tcode{innerAllocs...} +\tcode{std::forward(outerAlloc)} and \exposid{inner} with \tcode{innerAllocs...} (hence recursively initializing each allocator within the adaptor with the corresponding allocator from the argument list). \end{itemdescr} @@ -8769,7 +8769,7 @@ \pnum \returns \tcode{*this} if \tcode{sizeof...(InnerAllocs)} is zero; otherwise, -\tcode{inner}. +\exposid{inner}. \end{itemdescr} \indexlibrarymember{outer_allocator}{scoped_allocator_adaptor}%