From 555cd0f4ee0a505d4fcc6e3ee40113067749f126 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Sun, 20 Oct 2024 18:45:29 +0200 Subject: [PATCH] [func.wrap.func.con], [func.wrap.move.class], [func.wrap.copy.class], [any.class.general] Reword avoidance of 'dynamically allocated memory' as 'nesting an object within' --- source/utilities.tex | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index 2f66d7d65f..2ceae1912b 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -6550,7 +6550,8 @@ The non-member \tcode{any_cast} functions provide type-safe access to the contained value. \pnum -Implementations should avoid the use of dynamically allocated memory for a small contained value. +Implementations should nest an object within\iref{intro.object} +an object of type \tcode{any} for a small contained value. However, any such small-object optimization shall only be applied to types \tcode{T} for which \tcode{is_nothrow_move_constructible_v} is \tcode{true}. \begin{example} @@ -13181,8 +13182,9 @@ \pnum \recommended -Implementations should avoid the use of -dynamically allocated memory for small callable objects, for example, where +Implementations should nest an object within\iref{intro.object} +a \tcode{function} for small callable objects, +for example, where \tcode{f}'s target is an object holding only a pointer or reference to an object and a member function pointer. \end{itemdescr} @@ -13202,8 +13204,9 @@ \pnum \recommended -Implementations should avoid the use of -dynamically allocated memory for small callable objects, for example, +Implementations should nest an object within\iref{intro.object} +a \tcode{function} for small callable objects, +for example, where \tcode{f}'s target is an object holding only a pointer or reference to an object and a member function pointer. \end{itemdescr} @@ -13265,8 +13268,9 @@ \pnum \recommended -Implementations should avoid the use of -dynamically allocated memory for small callable objects, for example, +Implementations should nest an object within\iref{intro.object} +a \tcode{function} for small callable objects, +for example, where \tcode{f} refers to an object holding only a pointer or reference to an object and a member function pointer. \end{itemdescr} @@ -13583,8 +13587,8 @@ \pnum \recommended -Implementations should avoid the use of dynamically allocated memory -for a small contained value. +Implementations should nest an object within\iref{intro.object} +a \tcode{move_only_function} for a small contained value. \begin{note} Such small-object optimization can only be applied to a type \tcode{T} for which \tcode{is_nothrow_move_constructible_v} is \tcode{true}. @@ -13978,8 +13982,8 @@ \pnum \recommended -Implementations should avoid the use of dynamically allocated memory -for a small contained value. +Implementations should nest an object within\iref{intro.object} +a \tcode{copyable_function} for a small contained value. \begin{note} Such small-object optimization can only be applied to a type \tcode{T} for which \tcode{is_nothrow_move_constructible_v} is \tcode{true}.