[stack.cons.alloc] # 23 Containers library [[containers]](./#containers) ## 23.6 Container adaptors [[container.adaptors]](container.adaptors#stack.cons.alloc) ### 23.6.6 Class template stack [[stack]](stack#cons.alloc) #### 23.6.6.4 Constructors with allocators [stack.cons.alloc] [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16689) If uses_allocator_v is false the constructors in this subclause shall not participate in overload resolution[.](#1.sentence-1) [🔗](#lib:stack,constructor) `template constexpr explicit stack(const Alloc& a); ` [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16699) *Effects*: Initializes c with a[.](#2.sentence-1) [🔗](#lib:stack,constructor_) `template constexpr stack(const container_type& cont, const Alloc& a); ` [3](#3) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16710) *Effects*: Initializes c with cont as the first argument and a as the second argument[.](#3.sentence-1) [🔗](#lib:stack,constructor__) `template constexpr stack(container_type&& cont, const Alloc& a); ` [4](#4) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16722) *Effects*: Initializes c with std​::​move(cont) as the first argument and a as the second argument[.](#4.sentence-1) [🔗](#lib:stack,constructor___) `template constexpr stack(const stack& s, const Alloc& a); ` [5](#5) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16734) *Effects*: Initializes c with s.c as the first argument and a as the second argument[.](#5.sentence-1) [🔗](#lib:stack,constructor____) `template constexpr stack(stack&& s, const Alloc& a); ` [6](#6) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16746) *Effects*: Initializes c with std​::​move(s.c) as the first argument and a as the second argument[.](#6.sentence-1) [🔗](#lib:stack,constructor_____) `template constexpr stack(InputIterator first, InputIterator last, const Alloc& alloc); ` [7](#7) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16759) *Effects*: Initializes c withfirst as the first argument,last as the second argument, andalloc as the third argument[.](#7.sentence-1) [🔗](#lib:stack,constructor______) `template<[container-compatible-range](container.intro.reqmts#concept:container-compatible-range "23.2.2.1 Introduction [container.intro.reqmts]") R, class Alloc> constexpr stack(from_range_t, R&& rg, const Alloc& a); ` [8](#8) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16774) *Effects*: Initializesc with ranges​::​to(std​::​forward(rg), a)[.](#8.sentence-1)