[#bsl-stack-05-2constructor-010] = xref:bsl.adoc[bsl]::xref:bsl/stack-05.adoc[stack]::stack :relfileprefix: ../../ :mrdocs: Constructors == Synopses Declared in `<bslstl_stack.h>` Create an empty stack. [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..._]# Create a stack having the value of the specified `original`. [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..._]# Create a stack by moving from the specified `container`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/stack-05/2constructor-0e2.adoc[stack](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<CONTAINER>] container); ---- [.small]#xref:bsl/stack-05/2constructor-0e2.adoc[_» more..._]# Create a stack by moving from the specified `original`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/stack-05/2constructor-04e.adoc[stack](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<stack>] original); ---- [.small]#xref:bsl/stack-05/2constructor-04e.adoc[_» more..._]# Create a stack whose underlying container has the value of the specified `container`. [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..._]# Create an empty stack using the specified `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> explicit xref:bsl/stack-05/2constructor-0f.adoc[stack](ALLOCATOR const& basicAllocator) requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value; ---- [.small]#xref:bsl/stack-05/2constructor-0f.adoc[_» more..._]# Create a stack from the range `[first, last)]`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITER> xref:bsl/stack-05/2constructor-05c.adoc[stack]( INPUT_ITER first, INPUT_ITER last); ---- [.small]#xref:bsl/stack-05/2constructor-05c.adoc[_» more..._]# Create a stack from the elements of the specified `range`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_RANGE> xref:bsl/stack-05/2constructor-049.adoc[stack]( std::from_range_t tag, t_RANGE&& range); ---- [.small]#xref:bsl/stack-05/2constructor-049.adoc[_» more..._]# Create a stack by moving from `container` using `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> xref:bsl/stack-05/2constructor-050.adoc[stack]( xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<CONTAINER>] container, ALLOCATOR const& basicAllocator) requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value; ---- [.small]#xref:bsl/stack-05/2constructor-050.adoc[_» more..._]# Create a stack by moving from `original` using `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> xref:bsl/stack-05/2constructor-06.adoc[stack]( xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<stack>] original, ALLOCATOR const& basicAllocator) requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value; ---- [.small]#xref:bsl/stack-05/2constructor-06.adoc[_» more..._]# Create a stack from `container` using `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> xref:bsl/stack-05/2constructor-0c.adoc[stack]( CONTAINER const& container, ALLOCATOR const& basicAllocator) requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value; ---- [.small]#xref:bsl/stack-05/2constructor-0c.adoc[_» more..._]# Create a stack from `original` using `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> xref:bsl/stack-05/2constructor-043.adoc[stack]( xref:bsl/stack-05.adoc[stack] const& original, ALLOCATOR const& basicAllocator) requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value; ---- [.small]#xref:bsl/stack-05/2constructor-043.adoc[_» more..._]# Same as the related overload above for `stack`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class INPUT_ITER, class ALLOCATOR> xref:bsl/stack-05/2constructor-08.adoc[stack]( INPUT_ITER first, INPUT_ITER last, ALLOCATOR const& allocator) requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value; ---- [.small]#xref:bsl/stack-05/2constructor-08.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_RANGE, class t_ALLOCATOR> xref:bsl/stack-05/2constructor-015.adoc[stack]( std::from_range_t tag, t_RANGE&& range, t_ALLOCATOR const& allocator) requires bsl::uses_allocator<CONTAINER,t_ALLOCATOR>::value; ---- [.small]#xref:bsl/stack-05/2constructor-015.adoc[_» more..._]# == 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]#