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

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

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
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;
----

== Description

Create a stack having the value of the specified `original` (on entry) that uses `basicAllocator` to supply memory by using the allocator&hyphen;extended moved constructor of `CONTAINER`&period; `original` is left in a valid but unspecified state&period; Note that a `bslma&colon;&colon;Allocator &ast;` can be supplied for `basicAllocator` if the (template parameter) `ALLOCATOR` is `bsl&colon;&colon;allocator` (the default)&period; Also note that this method assumes that `CONTAINER` has a move constructor&period; Also note that if `CONTAINER&colon;&colon;allocator&lowbar;type` does not exist, this constructor may not be used&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *original*
| stack to move from
| *basicAllocator*
| allocator used to supply memory
|===


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