[#BloombergLP-bslstl-Optional_Base-05-2constructor-0f]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Optional_Base-05.adoc[Optional&lowbar;Base]::Optional&lowbar;Base
:relfileprefix: ../../../
:mrdocs:

Constructors

== Synopses

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

Create a disengaged `Optional&lowbar;Base` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-0e.adoc[Optional&lowbar;Base]();
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-0e.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object having the value of the specified `original` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-01a.adoc[Optional&lowbar;Base](xref:BloombergLP/bslstl/Optional_Base-05.adoc[Optional&lowbar;Base] const& original);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-01a.adoc[_» more&period;&period;&period;_]#

Create a disengaged `Optional&lowbar;Base` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-014.adoc[Optional&lowbar;Base](xref:bsl/nullopt_t.adoc[bsl::nullopt&lowbar;t] nullopt);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-014.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-0a8.adoc[Optional&lowbar;Base](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;Optional&lowbar;Base&gt;] original) noexcept(&sol;&ast; see-below &ast;&sol;);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-0a8.adoc[_» more&period;&period;&period;_]#

Create a disengaged `Optional&lowbar;Base` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-088.adoc[Optional&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Optional_Base-05/allocator_type.adoc[allocator&lowbar;type] allocator);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-088.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-078.adoc[Optional&lowbar;Base](
    xref:BloombergLP/bslstl/Optional_ConstructFromForwardRef.adoc[BloombergLP::bslstl::Optional&lowbar;ConstructFromForwardRef] tag,
    t&lowbar;ANY&lowbar;TYPE&& value);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-078.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-0b9b0.adoc[Optional&lowbar;Base](
    xref:BloombergLP/bslstl/Optional_CopyConstructFromOtherOptional.adoc[BloombergLP::bslstl::Optional&lowbar;CopyConstructFromOtherOptional] tag,
    xref:BloombergLP/bslstl/Optional_Base-05.adoc[Optional&lowbar;Base&lt;t&lowbar;ANY&lowbar;TYPE&gt;] const& original);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-0b9b0.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-0bf2.adoc[Optional&lowbar;Base](
    xref:BloombergLP/bslstl/Optional_CopyConstructFromStdOptional.adoc[BloombergLP::bslstl::Optional&lowbar;CopyConstructFromStdOptional] tag,
    std::optional&lt;t&lowbar;ANY&lowbar;TYPE&gt; const& original);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-0bf2.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-05.adoc[Optional&lowbar;Base](
    xref:BloombergLP/bslstl/Optional_MoveConstructFromOtherOptional.adoc[BloombergLP::bslstl::Optional&lowbar;MoveConstructFromOtherOptional] tag,
    xref:BloombergLP/bslmf/MovableRef_Deduced.adoc[BloombergLP::bslmf::MovableRef&lowbar;Deduced&lt;Optional&lowbar;Base&lt;t&lowbar;ANY&lowbar;TYPE&gt;&gt;] original);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-05.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-08d.adoc[Optional&lowbar;Base](
    xref:BloombergLP/bslstl/Optional_MoveConstructFromOtherOptional.adoc[BloombergLP::bslstl::Optional&lowbar;MoveConstructFromOtherOptional] tag,
    xref:BloombergLP/bslmf/MovableRef_Deduced.adoc[BloombergLP::bslmf::MovableRef&lowbar;Deduced&lt;Optional&lowbar;Base&lt;t&lowbar;ANY&lowbar;TYPE&gt;&gt;] original);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-08d.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-031.adoc[Optional&lowbar;Base](
    xref:BloombergLP/bslstl/Optional_MoveConstructFromStdOptional.adoc[BloombergLP::bslstl::Optional&lowbar;MoveConstructFromStdOptional] tag,
    std::optional&lt;t&lowbar;ANY&lowbar;TYPE&gt;&& original);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-031.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; t&lowbar;ARGS&gt;
explicit
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-0b9bd.adoc[Optional&lowbar;Base](
    std::in&lowbar;place&lowbar;t inPlace,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-0b9bd.adoc[_» more&period;&period;&period;_]#

Create a disengaged `Optional&lowbar;Base` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-00.adoc[Optional&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Optional_Base-05/allocator_type.adoc[allocator&lowbar;type] allocator,
    xref:bsl/nullopt_t.adoc[bsl::nullopt&lowbar;t] nullopt);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-00.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-074.adoc[Optional&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Optional_Base-05/allocator_type.adoc[allocator&lowbar;type] allocator,
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;Optional&lowbar;Base&gt;] original);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-074.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-096.adoc[Optional&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Optional_Base-05/allocator_type.adoc[allocator&lowbar;type] allocator,
    xref:BloombergLP/bslstl/Optional_Base-05.adoc[Optional&lowbar;Base] const& original);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-096.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object, which contains the result of invocation of the specified `invocable` with the specified `arg`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;INVOCABLE,
    class t&lowbar;ARG&gt;
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-02.adoc[Optional&lowbar;Base](
    xref:BloombergLP/bslstl/Optional_InvokeConstructorTag.adoc[Optional&lowbar;InvokeConstructorTag] tag,
    t&lowbar;INVOCABLE&& invocable,
    t&lowbar;ARG&& arg);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-02.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;INIT&lowbar;LIST&lowbar;TYPE,
    class&period;&period;&period; t&lowbar;ARGS&gt;
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-087.adoc[Optional&lowbar;Base](
    std::in&lowbar;place&lowbar;t inPlace,
    std::initializer&lowbar;list&lt;t&lowbar;INIT&lowbar;LIST&lowbar;TYPE&gt; il,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-087.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object whose contained value is initialized by forwarding from the specified `value`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-0d.adoc[Optional&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Optional_Base-05/allocator_type.adoc[allocator&lowbar;type] allocator,
    xref:BloombergLP/bslstl/Optional_ConstructFromForwardRef.adoc[BloombergLP::bslstl::Optional&lowbar;ConstructFromForwardRef] tag,
    t&lowbar;ANY&lowbar;TYPE&& value);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-0d.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-09f.adoc[Optional&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Optional_Base-05/allocator_type.adoc[allocator&lowbar;type] allocator,
    xref:BloombergLP/bslstl/Optional_CopyConstructFromOtherOptional.adoc[BloombergLP::bslstl::Optional&lowbar;CopyConstructFromOtherOptional] tag,
    xref:BloombergLP/bslstl/Optional_Base-05.adoc[Optional&lowbar;Base&lt;t&lowbar;ANY&lowbar;TYPE&gt;] const& original);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-09f.adoc[_» more&period;&period;&period;_]#

Create an optional from `original` using `allocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-04.adoc[Optional&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Optional_Base-05/allocator_type.adoc[allocator&lowbar;type] allocator,
    xref:BloombergLP/bslstl/Optional_CopyConstructFromStdOptional.adoc[BloombergLP::bslstl::Optional&lowbar;CopyConstructFromStdOptional] tag,
    std::optional&lt;t&lowbar;ANY&lowbar;TYPE&gt; const& original);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-04.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-0bf9.adoc[Optional&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Optional_Base-05/allocator_type.adoc[allocator&lowbar;type] allocator,
    xref:BloombergLP/bslstl/Optional_MoveConstructFromOtherOptional.adoc[BloombergLP::bslstl::Optional&lowbar;MoveConstructFromOtherOptional] tag,
    xref:BloombergLP/bslmf/MovableRef_Deduced.adoc[BloombergLP::bslmf::MovableRef&lowbar;Deduced&lt;Optional&lowbar;Base&lt;t&lowbar;ANY&lowbar;TYPE&gt;&gt;] original);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-0bf9.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-03a.adoc[Optional&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Optional_Base-05/allocator_type.adoc[allocator&lowbar;type] allocator,
    xref:BloombergLP/bslstl/Optional_MoveConstructFromStdOptional.adoc[BloombergLP::bslstl::Optional&lowbar;MoveConstructFromStdOptional] tag,
    std::optional&lt;t&lowbar;ANY&lowbar;TYPE&gt;&& original);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-03a.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object whose contained value is initialized from the specified `args`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; t&lowbar;ARGS&gt;
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-0aa.adoc[Optional&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Optional_Base-05/allocator_type.adoc[allocator&lowbar;type] allocator,
    std::in&lowbar;place&lowbar;t inPlace,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-0aa.adoc[_» more&period;&period;&period;_]#

Create an `Optional&lowbar;Base` object whose contained value is initialized from the specified `il` and `args`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;INIT&lowbar;LIST&lowbar;TYPE,
    class&period;&period;&period; t&lowbar;ARGS&gt;
xref:BloombergLP/bslstl/Optional_Base-05/2constructor-09b.adoc[Optional&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Optional_Base-05/allocator_type.adoc[allocator&lowbar;type] allocator,
    std::in&lowbar;place&lowbar;t inPlace,
    std::initializer&lowbar;list&lt;t&lowbar;INIT&lowbar;LIST&lowbar;TYPE&gt; il,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/2constructor-09b.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *original*
| source optional used to initialize this object
| *nullopt*
| disengaged&hyphen;optional tag&semi; value is unused
| *allocatorArg*
| tag selecting the allocator&hyphen;extended constructor
| *allocator*
| allocator used to supply memory
| *tag*
| tag selecting this constructor overload
| *value*
| value compared with or used to initialize the optional
| *inPlace*
| tag selecting in&hyphen;place construction of the contained value
| *args*
| arguments forwarded to construct the contained value
| *invocable*
| callable invoked to produce the contained value
| *arg*
| argument forwarded to construct the contained value
| *il*
| initializer list forwarded to construct the contained value
|===


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