diff --git a/include/boost/heap/detail/mutable_heap.hpp b/include/boost/heap/detail/mutable_heap.hpp index f0d2d69..553e214 100644 --- a/include/boost/heap/detail/mutable_heap.hpp +++ b/include/boost/heap/detail/mutable_heap.hpp @@ -360,7 +360,9 @@ class priority_queue_mutable_wrapper template handle_type emplace(Args&&... args) { - objects.push_front(std::make_pair(std::forward(args)..., 0)); + objects.emplace_front(std::piecewise_construct, + std::forward_as_tuple(std::forward(args)...), + std::forward_as_tuple(0)); list_iterator ret = objects.begin(); q_.push(ret); return handle_type(ret); diff --git a/test/d_ary_heap_test.cpp b/test/d_ary_heap_test.cpp index c459f3f..c21010b 100644 --- a/test/d_ary_heap_test.cpp +++ b/test/d_ary_heap_test.cpp @@ -101,6 +101,13 @@ void run_d_ary_heap_mutable_test(void) > stable_pri_queue; run_stable_heap_tests(); } + +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + cmpthings ord; + boost::heap::d_ary_heap, boost::heap::arity, + boost::heap::compare, boost::heap::stable > vpq(ord); + vpq.emplace(5, 6, 7); +#endif } BOOST_AUTO_TEST_CASE( d_ary_heap_mutable_test )