Files
cppdraft_translate/cppdraft/priqueue/cons/alloc.md
2025-10-25 03:02:53 +03:00

6.4 KiB
Raw Blame History

[priqueue.cons.alloc]

23 Containers library [containers]

23.6 Container adaptors [container.adaptors]

23.6.4 Class template priority_queue [priority.queue]

23.6.4.3 Constructors with allocators [priqueue.cons.alloc]

1

#

If uses_allocator_v<container_type, Alloc> is false the constructors in this subclause shall not participate in overload resolution.

🔗

template<class Alloc> constexpr explicit priority_queue(const Alloc& a);

2

#

Effects: Initializes c with a and value-initializes comp.

🔗

template<class Alloc> constexpr priority_queue(const Compare& compare, const Alloc& a);

3

#

Effects: Initializes c with a and initializes comp with compare.

🔗

template<class Alloc> constexpr priority_queue(const Compare& compare, const Container& cont, const Alloc& a);

4

#

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).

🔗

template<class Alloc> constexpr priority_queue(const Compare& compare, Container&& cont, const Alloc& a);

5

#

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).

🔗

template<class Alloc> constexpr priority_queue(const priority_queue& q, const Alloc& a);

6

#

Effects: Initializes c with q.c as the first argument and a as the second argument, and initializes comp with q.comp.

🔗

template<class Alloc> constexpr priority_queue(priority_queue&& q, const Alloc& a);

7

#

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).

🔗

template<class InputIterator, class Alloc> constexpr priority_queue(InputIterator first, InputIterator last, const Alloc& a);

8

#

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).

🔗

template<class InputIterator, class Alloc> constexpr priority_queue(InputIterator first, InputIterator last, const Compare& compare, const Alloc& a);

9

#

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).

🔗

template<class InputIterator, class Alloc> constexpr priority_queue(InputIterator first, InputIterator last, const Compare& compare, const Container& cont, const Alloc& a);

10

#

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).

🔗

template<class InputIterator, class Alloc> constexpr priority_queue(InputIterator first, InputIterator last, const Compare& compare, Container&& cont, const Alloc& a);

11

#

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).

🔗

template<[container-compatible-range](container.intro.reqmts#concept:container-compatible-range "23.2.2.1Introduction[container.intro.reqmts]")<T> R, class Alloc> constexpr priority_queue(from_range_t, R&& rg, const Compare& compare, const Alloc& a);

12

#

Effects: Initializes comp with compare andc with ranges::to(std::forward(rg), a); calls make_heap(c.begin(), c.end(), comp).

🔗

template<[container-compatible-range](container.intro.reqmts#concept:container-compatible-range "23.2.2.1Introduction[container.intro.reqmts]")<T> R, class Alloc> constexpr priority_queue(from_range_t, R&& rg, const Alloc& a);

13

#

Effects: Initializesc with ranges::to(std::forward(rg), a) and value-initializes comp; calls make_heap(c.begin(), c.end(), comp).