[#BloombergLP-bslstl-Optional_DataImp]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::Optional&lowbar;DataImp
:relfileprefix: ../../
:mrdocs:

Component&hyphen;private buffer managing an optional&apos;s contained value&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;optional&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;TYPE&gt;
struct Optional&lowbar;DataImp;
----

== Description

This component&hyphen;private `struct` manages a `value&lowbar;type` object in an `Optional&lowbar;Base` object&period; This class provides an abstraction for `const` value type&period; An `Optional&lowbar;Base` object may contain an object of `const` type&period; An assignment to such an `Optional&lowbar;Base` object should not succeed&period; However, unless the `Optional&lowbar;Base` object itself is `const`, it should be possible to change the value of the `Optional&lowbar;Base` object using `emplace`&period; In order to allow for that, this class manages a non&hyphen;const object of `value&lowbar;type`, but all the accessors return a `const` adjusted reference to the managed object&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/Optional_DataImp/2constructor-02.adoc[`Optional&lowbar;DataImp`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bslstl/Optional_DataImp/emplace-09.adoc[`emplace`] 
| Destroy any contained value and construct a new one in place&period;
| xref:BloombergLP/bslstl/Optional_DataImp/hasValue.adoc[`hasValue`] 
| Return `true` if this objects has a value, and `false` otherwise&period;
| xref:BloombergLP/bslstl/Optional_DataImp/reset.adoc[`reset`] 
| Destroy the `value&lowbar;type` object in `d&lowbar;buffer`, if any&period;
| xref:BloombergLP/bslstl/Optional_DataImp/value-0c.adoc[`value`] 
| `value` overloads
|===


== Derived Classes

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/Optional_Data-09.adoc[`Optional&lowbar;Data&lt;t&lowbar;TYPE, true&gt;`] 
| Partial specialization for a trivially destructible contained value&period;
| xref:BloombergLP/bslstl/Optional_Data-0c.adoc[`Optional&lowbar;Data`] 
| Component&hyphen;private storage that destroys a non&hyphen;trivial contained value&period;
|===


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