[#BloombergLP-bslstl-Function_SmallObjectOptimization-SooFuncSize]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Function_SmallObjectOptimization.adoc[Function&lowbar;SmallObjectOptimization]::SooFuncSize
:relfileprefix: ../../../
:mrdocs:

This class template provides a metafunction that `bsl&colon;&colon;function` uses to determine the size of an object, and whether to store it using the small&hyphen;object optimization (SOO) or not&period; The `value` member of this class encodes the size of the specified `TP` type as follows&colon;

== Synopsis

Declared in `&lt;bslstl&lowbar;function&lowbar;smallobjectoptimization&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TP&gt;
class SooFuncSize;
----

== Description

1&period; If `TP` is larger than `InplaceBuffer`, then `value &equals;&equals; sizeof(TP)`&period; 2&period; Otherwise, if `TP` has a non&hyphen;throwing destructive move (i&period;e&period;, it is bitwise movable or has a `noexcept` move constructor), then `value &equals;&equals; sizeof(TP)`&period; 3&period; Otherwise, `value &equals;&equals; sizeof(TP) &plus; k&lowbar;NON&lowbar;SOO&lowbar;SMALL&lowbar;SIZE`&period; 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`&period;

Note that the `Soo` prefix is used to indicate that an identifier uses the above protocol&period; 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&period;

== 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&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
