[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<container_type, Alloc> is false the constructors in this subclause shall not participate in overload resolution[.](#1.sentence-1)

[ð](#lib:stack,constructor)

`template<class Alloc> 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<class Alloc> 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<class Alloc> 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<class Alloc> 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<class Alloc> 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<class InputIterator, class Alloc>
  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]")<T> 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<Container>(std​::​forward<R>(rg), a)[.](#8.sentence-1)
