Skip to content

Commit 17191ec

Browse files
jensmaurerzygoloid
authored andcommitted
[any.class] Rephrase small-object optimization
1 parent 05675f7 commit 17191ec

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

source/utilities.tex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5114,11 +5114,12 @@
51145114

51155115
\pnum
51165116
Implementations should avoid the use of dynamically allocated memory for a small contained value.
5117+
However, any such small-object optimization shall only be applied to types \tcode{T} for which
5118+
\tcode{is_nothrow_move_constructible_v<T>} is \tcode{true}.
51175119
\begin{example}
5118-
where the object constructed is holding only an \tcode{int}.
5120+
A contained value of type \tcode{int} could be stored in an internal buffer,
5121+
not in separately-allocated memory.
51195122
\end{example}
5120-
Such small-object optimization shall only be applied to types \tcode{T} for which
5121-
\tcode{is_nothrow_move_constructible_v<T>} is \tcode{true}.
51225123

51235124
\rSec3[any.cons]{Construction and destruction}
51245125

0 commit comments

Comments
 (0)