[priqueue.cons.alloc] # 23 Containers library [[containers]](./#containers) ## 23.6 Container adaptors [[container.adaptors]](container.adaptors#priqueue.cons.alloc) ### 23.6.4 Class template priority_queue [[priority.queue]](priority.queue#priqueue.cons.alloc) #### 23.6.4.3 Constructors with allocators [priqueue.cons.alloc] [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16224) If uses_allocator_v is false the constructors in this subclause shall not participate in overload resolution[.](#1.sentence-1) [🔗](#lib:priority_queue,constructor) `template constexpr explicit priority_queue(const Alloc& a); ` [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16234) *Effects*: Initializes c with a and value-initializes comp[.](#2.sentence-1) [🔗](#lib:priority_queue,constructor_) `template constexpr priority_queue(const Compare& compare, const Alloc& a); ` [3](#3) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16245) *Effects*: Initializes c with a and initializes comp with compare[.](#3.sentence-1) [🔗](#lib:priority_queue,constructor__) `template constexpr priority_queue(const Compare& compare, const Container& cont, const Alloc& a); ` [4](#4) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16257) *Effects*: Initializes c with cont as the first argument and a as the second argument, and initializes comp with compare; calls make_heap(c.begin(), c.end(), comp)[.](#4.sentence-1) [🔗](#lib:priority_queue,constructor___) `template constexpr priority_queue(const Compare& compare, Container&& cont, const Alloc& a); ` [5](#5) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16271) *Effects*: Initializes c with std​::​move(cont) as the first argument and a as the second argument, and initializes comp with compare; calls make_heap(c.begin(), c.end(), comp)[.](#5.sentence-1) [🔗](#lib:priority_queue,constructor____) `template constexpr priority_queue(const priority_queue& q, const Alloc& a); ` [6](#6) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16284) *Effects*: Initializes c with q.c as the first argument and a as the second argument, and initializes comp with q.comp[.](#6.sentence-1) [🔗](#lib:priority_queue,constructor_____) `template constexpr priority_queue(priority_queue&& q, const Alloc& a); ` [7](#7) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16296) *Effects*: Initializes c with std​::​move(q.c) as the first argument and a as the second argument, and initializes comp with std​::​move(q.comp)[.](#7.sentence-1) [🔗](#lib:priority_queue,constructor______) `template constexpr priority_queue(InputIterator first, InputIterator last, const Alloc& a); ` [8](#8) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16309) *Effects*: Initializes c withfirst as the first argument,last as the second argument, anda as the third argument, and value-initializes comp; calls make_heap(c.begin(), c.end(), comp)[.](#8.sentence-1) [🔗](#lib:priority_queue,constructor_______) `template constexpr priority_queue(InputIterator first, InputIterator last, const Compare& compare, const Alloc& a); ` [9](#9) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16327) *Effects*: Initializes c withfirst as the first argument,last as the second argument, anda as the third argument, and initializes comp with compare; calls make_heap(c.begin(), c.end(), comp)[.](#9.sentence-1) [🔗](#lib:priority_queue,constructor________) `template constexpr priority_queue(InputIterator first, InputIterator last, const Compare& compare, const Container& cont, const Alloc& a); ` [10](#10) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16345) *Effects*: Initializes c withcont as the first argument and a as the second argument, and initializes comp with compare; calls c.insert(c.end(), first, last); and finally calls make_heap(c.begin(), c.end(), comp)[.](#10.sentence-1) [🔗](#lib:priority_queue,constructor_________) `template constexpr priority_queue(InputIterator first, InputIterator last, const Compare& compare, Container&& cont, const Alloc& a); ` [11](#11) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16362) *Effects*: Initializes c withstd​::​move(cont) as the first argument anda as the second argument, and initializes comp with compare; calls c.insert(c.end(), first, last); and finally calls make_heap(c.begin(), c.end(), comp)[.](#11.sentence-1) [🔗](#lib:priority_queue,constructor__________) `template<[container-compatible-range](container.intro.reqmts#concept:container-compatible-range "23.2.2.1 Introduction [container.intro.reqmts]") R, class Alloc> constexpr priority_queue(from_range_t, R&& rg, const Compare& compare, const Alloc& a); ` [12](#12) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16379) *Effects*: Initializes comp with compare andc with ranges​::​to(std​::​forward(rg), a); calls make_heap(c.begin(), c.end(), comp)[.](#12.sentence-1) [🔗](#lib:priority_queue,constructor___________) `template<[container-compatible-range](container.intro.reqmts#concept:container-compatible-range "23.2.2.1 Introduction [container.intro.reqmts]") R, class Alloc> constexpr priority_queue(from_range_t, R&& rg, const Alloc& a); ` [13](#13) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16393) *Effects*: Initializesc with ranges​::​to(std​::​forward(rg), a) and value-initializes comp; calls make_heap(c.begin(), c.end(), comp)[.](#13.sentence-1)