[#BloombergLP-bslstl-Optional_Base-08-2constructor-01]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Optional_Base-08.adoc[Optional&lowbar;Base&lt;t&lowbar;TYPE, false&gt;]::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"]
----
constexpr
xref:BloombergLP/bslstl/Optional_Base-08/2constructor-0d4.adoc[Optional&lowbar;Base]();
----

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

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


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

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

These allocator&hyphen;extended constructors cannot be called, and are provided only to prevent compilation errors when &apos;optional&apos; is explicitly instantiated&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Optional_Base-08/2constructor-04f.adoc[Optional&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t,
    xref:BloombergLP/bslstl/Optional_Base-08/AllocType.adoc[AllocType]);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-08/2constructor-04f.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;
constexpr
xref:BloombergLP/bslstl/Optional_Base-08/2constructor-0de.adoc[Optional&lowbar;Base](
    xref:BloombergLP/bslstl/Optional_ConstructFromForwardRef.adoc[BloombergLP::bslstl::Optional&lowbar;ConstructFromForwardRef],
    t&lowbar;ANY&lowbar;TYPE&& value);
----

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

Create a disengaged `Optional&lowbar;Base` object if the specified `original` object is disengaged, and an `Optional&lowbar;Base` object with the value of `original&period;value()` (of `t&lowbar;ANY&lowbar;TYPE`) converted to `t&lowbar;TYPE` otherwise&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
constexpr
xref:BloombergLP/bslstl/Optional_Base-08/2constructor-078.adoc[Optional&lowbar;Base](
    xref:BloombergLP/bslstl/Optional_CopyConstructFromOtherOptional.adoc[BloombergLP::bslstl::Optional&lowbar;CopyConstructFromOtherOptional],
    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-08/2constructor-078.adoc[_» more&period;&period;&period;_]#


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

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

Create a disengaged `Optional&lowbar;Base` object if the specified `original` object is disengaged, and an `Optional&lowbar;Base` object with the value of `original&period;value()` (of `t&lowbar;ANY&lowbar;TYPE`) converted to `t&lowbar;TYPE` otherwise&period; `original` is left in a valid but unspecified state&period;


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

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


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

[.small]#xref:BloombergLP/bslstl/Optional_Base-08/2constructor-04e.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;
constexpr
explicit
xref:BloombergLP/bslstl/Optional_Base-08/2constructor-02d.adoc[Optional&lowbar;Base](
    std::in&lowbar;place&lowbar;t,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

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


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

[.small]#xref:BloombergLP/bslstl/Optional_Base-08/2constructor-0db.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-08/2constructor-0c.adoc[Optional&lowbar;Base](
    xref:BloombergLP/bslstl/Optional_InvokeConstructorTag.adoc[Optional&lowbar;InvokeConstructorTag],
    t&lowbar;INVOCABLE&& invocable,
    t&lowbar;ARG&& arg);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-08/2constructor-0c.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;
constexpr
xref:BloombergLP/bslstl/Optional_Base-08/2constructor-03c.adoc[Optional&lowbar;Base](
    std::in&lowbar;place&lowbar;t,
    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-08/2constructor-03c.adoc[_» more&period;&period;&period;_]#


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

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


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

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


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

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
xref:BloombergLP/bslstl/Optional_Base-08/2constructor-071.adoc[Optional&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t,
    xref:BloombergLP/bslstl/Optional_Base-08/AllocType.adoc[AllocType],
    xref:BloombergLP/bslstl/Optional_MoveConstructFromOtherOptional.adoc[BloombergLP::bslstl::Optional&lowbar;MoveConstructFromOtherOptional],
    xref:BloombergLP/bslstl/Optional_Base-05.adoc[Optional&lowbar;Base&lt;t&lowbar;ANY&lowbar;TYPE&gt;]&&);
----

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


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

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


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

[.small]#xref:BloombergLP/bslstl/Optional_Base-08/2constructor-05b.adoc[_» more&period;&period;&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-08/2constructor-02b.adoc[Optional&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t,
    xref:BloombergLP/bslstl/Optional_Base-08/AllocType.adoc[AllocType],
    std::in&lowbar;place&lowbar;t,
    std::initializer&lowbar;list&lt;t&lowbar;INIT&lowbar;LIST&lowbar;TYPE&gt;,
    t&lowbar;ARGS&&&period;&period;&period;);
----

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


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