[#BloombergLP-bslstl-Function_SmallObjectOptimization-SooFuncSize] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Function_SmallObjectOptimization.adoc[Function_SmallObjectOptimization]::SooFuncSize :relfileprefix: ../../../ :mrdocs: This class template provides a metafunction that `bsl::function` uses to determine the size of an object, and whether to store it using the small‐object optimization (SOO) or not. The `value` member of this class encodes the size of the specified `TP` type as follows: == Synopsis Declared in `<bslstl_function_smallobjectoptimization.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TP> class SooFuncSize; ---- == Description 1. If `TP` is larger than `InplaceBuffer`, then `value == sizeof(TP)`. 2. Otherwise, if `TP` has a non‐throwing destructive move (i.e., it is bitwise movable or has a `noexcept` move constructor), then `value == sizeof(TP)`. 3. Otherwise, `value == sizeof(TP) + k_NON_SOO_SMALL_SIZE`. This encoding indicates that move might throw and, therefore, `TP` should not be allocated in place even though it would fit in the footprint of an `InplaceBuffer`. Note that the `Soo` prefix is used to indicate that an identifier uses the above protocol. Thus, a variable called `SooSize` is assumed to be encoded as above, whereas a variable called `size` can generally be assumed not to be encoded that way. == Static Data Members [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/Function_SmallObjectOptimization/SooFuncSize/value.adoc[`value`] | `value` encodes the size of the `TP` type using the algorithm defined in the documentation for this class. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#