diff options
Diffstat (limited to 'libstdc++-v3/include/bits/stl_queue.h')
-rw-r--r-- | libstdc++-v3/include/bits/stl_queue.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libstdc++-v3/include/bits/stl_queue.h b/libstdc++-v3/include/bits/stl_queue.h index 60116c1b49a..f6828def591 100644 --- a/libstdc++-v3/include/bits/stl_queue.h +++ b/libstdc++-v3/include/bits/stl_queue.h @@ -504,14 +504,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION priority_queue(const _Compare& __x, const _Alloc& __a) : c(__a), comp(__x) { } + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 2537. Constructors [...] taking allocators should call make_heap template<typename _Alloc, typename _Requires = _Uses<_Alloc>> priority_queue(const _Compare& __x, const _Sequence& __c, const _Alloc& __a) - : c(__c, __a), comp(__x) { } + : c(__c, __a), comp(__x) + { std::make_heap(c.begin(), c.end(), comp); } template<typename _Alloc, typename _Requires = _Uses<_Alloc>> priority_queue(const _Compare& __x, _Sequence&& __c, const _Alloc& __a) - : c(std::move(__c), __a), comp(__x) { } + : c(std::move(__c), __a), comp(__x) + { std::make_heap(c.begin(), c.end(), comp); } template<typename _Alloc, typename _Requires = _Uses<_Alloc>> priority_queue(const priority_queue& __q, const _Alloc& __a) |