diff --git a/source/memory.tex b/source/memory.tex index 8ad74c9351..54d2db6347 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -5472,9 +5472,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} @@ -5508,23 +5508,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}@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}; @@ -5562,20 +5562,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}; @@ -5595,7 +5595,7 @@ \pnum \returns -\tcode{addressof(const_cast(p))}. +\tcode{addressof(const_cast(\exposid{p}))}. \end{itemdescr} \begin{itemdecl} @@ -5620,12 +5620,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 @@ -5712,9 +5712,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} @@ -5745,9 +5745,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()}. @@ -5755,7 +5755,7 @@ \pnum \remarks -An implementation can call \tcode{s.release()}. +An implementation can call \tcode{\exposid{s}.release()}. \pnum \begin{note} @@ -5777,8 +5777,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 @@ -5790,28 +5790,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}; @@ -5831,7 +5831,7 @@ \pnum \returns -\tcode{addressof(const_cast(p))}. +\tcode{addressof(const_cast(\exposid{p}))}. \end{itemdescr} \begin{itemdecl} @@ -5856,12 +5856,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 @@ -7491,7 +7491,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; @@ -7500,8 +7500,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; @@ -7530,7 +7530,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} @@ -7551,7 +7551,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} @@ -7673,7 +7673,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; @@ -7729,7 +7729,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}% @@ -7744,7 +7744,7 @@ \pnum \effects -Sets \tcode{memory_rsrc} to \tcode{r}. +Sets \exposid{memory-rsrc} to \tcode{r}. \pnum \throws @@ -7764,7 +7764,7 @@ \begin{itemdescr} \pnum \effects -Sets \tcode{memory_rsrc} to \tcode{other.resource()}. +Sets \exposid{memory-rsrc} to \tcode{other.resource()}. \end{itemdescr} @@ -7782,7 +7782,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} @@ -7795,12 +7795,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 @@ -7815,7 +7815,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} @@ -7834,7 +7834,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}% @@ -7982,7 +7982,7 @@ \begin{itemdescr} \pnum \returns -\tcode{memory_rsrc}. +\exposid{memory-rsrc}. \end{itemdescr} \rSec3[mem.poly.allocator.eq]{Equality} @@ -8404,9 +8404,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); @@ -8454,12 +8454,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}% @@ -8475,10 +8475,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} @@ -8504,14 +8504,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} @@ -8525,7 +8525,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}% @@ -8536,15 +8536,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 @@ -8555,7 +8555,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}% @@ -8643,20 +8643,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 = typename OuterTraits::value_type; - using size_type = typename OuterTraits::size_type; - using difference_type = typename OuterTraits::difference_type; - using pointer = typename OuterTraits::pointer; - using const_pointer = typename OuterTraits::const_pointer; - using void_pointer = typename OuterTraits::void_pointer; - using const_void_pointer = typename OuterTraits::const_void_pointer; + using value_type = typename @\exposid{outer-traits}@::value_type; + using size_type = typename @\exposid{outer-traits}@::size_type; + using difference_type = typename @\exposid{outer-traits}@::difference_type; + using pointer = typename @\exposid{outer-traits}@::pointer; + using const_pointer = typename @\exposid{outer-traits}@::const_pointer; + using void_pointer = typename @\exposid{outer-traits}@::void_pointer; + using const_void_pointer = typename @\exposid{outer-traits}@::const_void_pointer; using propagate_on_container_copy_assignment = @\seebelow@; using propagate_on_container_move_assignment = @\seebelow@; @@ -8665,7 +8665,7 @@ template struct rebind { using other = scoped_allocator_adaptor< - OuterTraits::template rebind_alloc, InnerAllocs...>; + @\exposid{outer-traits}@::template rebind_alloc, InnerAllocs...>; }; scoped_allocator_adaptor(); @@ -8788,7 +8788,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} @@ -8806,7 +8806,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} @@ -8899,7 +8899,7 @@ \pnum \returns \tcode{*this} if \tcode{sizeof...(InnerAllocs)} is zero; otherwise, -\tcode{inner}. +\exposid{inner}. \end{itemdescr} \indexlibrarymember{outer_allocator}{scoped_allocator_adaptor}%