Title
Constructors for priority_queue taking allocators should call make_heap
Status
c++17
Section
[priqueue.cons.alloc]
Submitter
Eric Schmidt

Created on 2015-09-19.00:00:00 last changed 82 months ago

Messages

Date: 2015-11-04.18:48:42

Proposed resolution:

This wording is relative to N4527.

  1. Change [priqueue.cons.alloc] as indicated:

    template <class Alloc>
    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>
    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).

Date: 2015-11-04.18:48:42

[ 2015-10, Kona issue prioritization ]

Priority 0, move to Ready

Date: 2015-09-19.00:00:00

priority_queue constructors taking both Container and Alloc arguments should finish by calling make_heap, just as with the constructors that do not have allocator parameters.

The current reading of [priqueue.cons.alloc], if followed strictly, would effectively require calling code to ensure that the container argument is already a heap, which is probably not what was intended.

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2016-03-07 04:11:48adminsetstatus: ready -> wp
2015-11-04 18:48:42adminsetmessages: + msg7621
2015-11-04 18:48:42adminsetstatus: new -> ready
2015-09-21 20:06:59adminsetmessages: + msg7531
2015-09-19 00:00:00admincreate