|
6550 | 6550 | The non-member \tcode{any_cast} functions provide type-safe access to the contained value. |
6551 | 6551 |
|
6552 | 6552 | \pnum |
6553 | | -Implementations should avoid the use of dynamically allocated memory for a small contained value. |
| 6553 | +Implementations should nest an object within\iref{intro.object} |
| 6554 | +an object of type \tcode{any} for a small contained value. |
6554 | 6555 | However, any such small-object optimization shall only be applied to types \tcode{T} for which |
6555 | 6556 | \tcode{is_nothrow_move_constructible_v<T>} is \tcode{true}. |
6556 | 6557 | \begin{example} |
|
13181 | 13182 |
|
13182 | 13183 | \pnum |
13183 | 13184 | \recommended |
13184 | | -Implementations should avoid the use of |
13185 | | -dynamically allocated memory for small callable objects, for example, where |
| 13185 | +Implementations should nest an object within\iref{intro.object} |
| 13186 | +a \tcode{function} for small callable objects, |
| 13187 | +for example, where |
13186 | 13188 | \tcode{f}'s target is an object holding only a pointer or reference |
13187 | 13189 | to an object and a member function pointer. |
13188 | 13190 | \end{itemdescr} |
|
13202 | 13204 |
|
13203 | 13205 | \pnum |
13204 | 13206 | \recommended |
13205 | | -Implementations should avoid the use of |
13206 | | -dynamically allocated memory for small callable objects, for example, |
| 13207 | +Implementations should nest an object within\iref{intro.object} |
| 13208 | +a \tcode{function} for small callable objects, |
| 13209 | +for example, |
13207 | 13210 | where \tcode{f}'s target is an object holding only a pointer or reference |
13208 | 13211 | to an object and a member function pointer. |
13209 | 13212 | \end{itemdescr} |
|
13265 | 13268 |
|
13266 | 13269 | \pnum |
13267 | 13270 | \recommended |
13268 | | -Implementations should avoid the use of |
13269 | | -dynamically allocated memory for small callable objects, for example, |
| 13271 | +Implementations should nest an object within\iref{intro.object} |
| 13272 | +a \tcode{function} for small callable objects, |
| 13273 | +for example, |
13270 | 13274 | where \tcode{f} refers to an object holding only a pointer or |
13271 | 13275 | reference to an object and a member function pointer. |
13272 | 13276 | \end{itemdescr} |
|
13583 | 13587 |
|
13584 | 13588 | \pnum |
13585 | 13589 | \recommended |
13586 | | -Implementations should avoid the use of dynamically allocated memory |
13587 | | -for a small contained value. |
| 13590 | +Implementations should nest an object within\iref{intro.object} |
| 13591 | +a \tcode{move_only_function} for a small contained value. |
13588 | 13592 | \begin{note} |
13589 | 13593 | Such small-object optimization can only be applied to a type \tcode{T} |
13590 | 13594 | for which \tcode{is_nothrow_move_constructible_v<T>} is \tcode{true}. |
|
13978 | 13982 |
|
13979 | 13983 | \pnum |
13980 | 13984 | \recommended |
13981 | | -Implementations should avoid the use of dynamically allocated memory |
13982 | | -for a small contained value. |
| 13985 | +Implementations should nest an object within\iref{intro.object} |
| 13986 | +a \tcode{copyable_function} for a small contained value. |
13983 | 13987 | \begin{note} |
13984 | 13988 | Such small-object optimization can only be applied to a type \tcode{T} |
13985 | 13989 | for which \tcode{is_nothrow_move_constructible_v<T>} is \tcode{true}. |
|
0 commit comments