[#BloombergLP-bslstl-Optional_Data-0c] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::Optional_Data :relfileprefix: ../../ :mrdocs: Component‐private storage that destroys a non‐trivial contained value. == Synopsis Declared in `<bslstl_optional.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_TYPE, bool t_IS_TRIVIALLY_DESTRUCTIBLE = bslstl::Optional_IsTriviallyDestructible<t_TYPE>::value> struct Optional_Data : xref:BloombergLP/bslstl/Optional_DataImp.adoc[Optional_DataImp<t_TYPE>] ---- == Description This component‐private `struct` manages a `value_type` object in `Optional_Base` by inheriting from `Optional_DataImp`. In addition, this primary template properly destroys the owned instance of `t_TYPE` in its destructor. == Base Classes [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/bslstl/Optional_DataImp.adoc[Optional_DataImp<t_TYPE>]` | Component‐private buffer managing an optional's contained value. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/Optional_Data-0c/2destructor.adoc[`~Optional_Data`] [.small]#[destructor]# | Destroy the managed `value_type` object, if it exists. | xref:BloombergLP/bslstl/Optional_DataImp/emplace-09.adoc[`emplace`] | Destroy any contained value and construct a new one in place. | xref:BloombergLP/bslstl/Optional_DataImp/hasValue.adoc[`hasValue`] | Return `true` if this objects has a value, and `false` otherwise. | xref:BloombergLP/bslstl/Optional_DataImp/reset.adoc[`reset`] | Destroy the `value_type` object in `d_buffer`, if any. | xref:BloombergLP/bslstl/Optional_DataImp/value-0c.adoc[`value`] | `value` overloads |=== == Using Declarations [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/Optional_Data-0c/_10using.adoc[`Unnamed using`] | Inherit `Optional_DataImp` constructors from the base class. |=== == Specializations [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/Optional_Data-09.adoc[`Optional_Data<t_TYPE, true>`] | Partial specialization for a trivially destructible contained value. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#