[#bsl-stack-05-2constructor-010]
= xref:bsl.adoc[bsl]::xref:bsl/stack-05.adoc[stack]::stack
:relfileprefix: ../../
:mrdocs:

Constructors

== Synopses

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

Create an empty stack&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:bsl/stack-05/2constructor-0e6.adoc[stack]();
----

[.small]#xref:bsl/stack-05/2constructor-0e6.adoc[_» more&period;&period;&period;_]#

Create a stack having the value of the specified `original`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/stack-05/2constructor-01d.adoc[stack](xref:bsl/stack-05.adoc[stack] const& original);
----

[.small]#xref:bsl/stack-05/2constructor-01d.adoc[_» more&period;&period;&period;_]#

Create a stack by moving from the specified `container`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:bsl/stack-05/2constructor-0e2.adoc[stack](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;CONTAINER&gt;] container);
----

[.small]#xref:bsl/stack-05/2constructor-0e2.adoc[_» more&period;&period;&period;_]#

Create a stack by moving from the specified `original`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/stack-05/2constructor-04e.adoc[stack](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;stack&gt;] original);
----

[.small]#xref:bsl/stack-05/2constructor-04e.adoc[_» more&period;&period;&period;_]#

Create a stack whose underlying container has the value of the specified `container`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:bsl/stack-05/2constructor-03.adoc[stack](CONTAINER const& container);
----

[.small]#xref:bsl/stack-05/2constructor-03.adoc[_» more&period;&period;&period;_]#

Create an empty stack using the specified `basicAllocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
explicit
xref:bsl/stack-05/2constructor-0f.adoc[stack](ALLOCATOR const& basicAllocator)
requires bsl&colon;&colon;uses&lowbar;allocator&lt;CONTAINER, ALLOCATOR&gt;&colon;&colon;value;
----

[.small]#xref:bsl/stack-05/2constructor-0f.adoc[_» more&period;&period;&period;_]#

Create a stack from the range `&lsqb;first, last)&rsqb;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITER&gt;
xref:bsl/stack-05/2constructor-05c.adoc[stack](
    INPUT&lowbar;ITER first,
    INPUT&lowbar;ITER last);
----

[.small]#xref:bsl/stack-05/2constructor-05c.adoc[_» more&period;&period;&period;_]#

Create a stack from the elements of the specified `range`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;RANGE&gt;
xref:bsl/stack-05/2constructor-049.adoc[stack](
    std::from&lowbar;range&lowbar;t tag,
    t&lowbar;RANGE&& range);
----

[.small]#xref:bsl/stack-05/2constructor-049.adoc[_» more&period;&period;&period;_]#

Create a stack by moving from `container` using `basicAllocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
xref:bsl/stack-05/2constructor-050.adoc[stack](
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;CONTAINER&gt;] container,
    ALLOCATOR const& basicAllocator)
requires bsl&colon;&colon;uses&lowbar;allocator&lt;CONTAINER, ALLOCATOR&gt;&colon;&colon;value;
----

[.small]#xref:bsl/stack-05/2constructor-050.adoc[_» more&period;&period;&period;_]#

Create a stack by moving from `original` using `basicAllocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
xref:bsl/stack-05/2constructor-06.adoc[stack](
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;stack&gt;] original,
    ALLOCATOR const& basicAllocator)
requires bsl&colon;&colon;uses&lowbar;allocator&lt;CONTAINER, ALLOCATOR&gt;&colon;&colon;value;
----

[.small]#xref:bsl/stack-05/2constructor-06.adoc[_» more&period;&period;&period;_]#

Create a stack from `container` using `basicAllocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
xref:bsl/stack-05/2constructor-0c.adoc[stack](
    CONTAINER const& container,
    ALLOCATOR const& basicAllocator)
requires bsl&colon;&colon;uses&lowbar;allocator&lt;CONTAINER, ALLOCATOR&gt;&colon;&colon;value;
----

[.small]#xref:bsl/stack-05/2constructor-0c.adoc[_» more&period;&period;&period;_]#

Create a stack from `original` using `basicAllocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
xref:bsl/stack-05/2constructor-043.adoc[stack](
    xref:bsl/stack-05.adoc[stack] const& original,
    ALLOCATOR const& basicAllocator)
requires bsl&colon;&colon;uses&lowbar;allocator&lt;CONTAINER, ALLOCATOR&gt;&colon;&colon;value;
----

[.small]#xref:bsl/stack-05/2constructor-043.adoc[_» more&period;&period;&period;_]#

Same as the related overload above for `stack`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class INPUT&lowbar;ITER,
    class ALLOCATOR&gt;
xref:bsl/stack-05/2constructor-08.adoc[stack](
    INPUT&lowbar;ITER first,
    INPUT&lowbar;ITER last,
    ALLOCATOR const& allocator)
requires bsl&colon;&colon;uses&lowbar;allocator&lt;CONTAINER, ALLOCATOR&gt;&colon;&colon;value;
----

[.small]#xref:bsl/stack-05/2constructor-08.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;RANGE,
    class t&lowbar;ALLOCATOR&gt;
xref:bsl/stack-05/2constructor-015.adoc[stack](
    std::from&lowbar;range&lowbar;t tag,
    t&lowbar;RANGE&& range,
    t&lowbar;ALLOCATOR const& allocator)
requires bsl&colon;&colon;uses&lowbar;allocator&lt;CONTAINER,t&lowbar;ALLOCATOR&gt;&colon;&colon;value;
----

[.small]#xref:bsl/stack-05/2constructor-015.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *original*
| stack whose value is copied
| *container*
| underlying container to move from
| *basicAllocator*
| allocator used to supply memory
| *first*
| beginning of the input range
| *last*
| end of the input range
| *tag*
| disambiguation tag for range construction
| *range*
| range of elements used to initialize this stack
| *allocator*
| allocator used to supply memory
|===


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