Boost C++ Libraries: Ticket #8195: emplace method broken in boost heaps https://svn.boost.org/trac10/ticket/8195 <p> The emplace operator does not correctly forward arguments to the type contained in the heap. I've attached a simple program that reproduces this bug. Compiling the attached program (on OSX 10.8.2 with gcc-4.7.2) produces the following error: </p> <pre class="wiki">In file included from testpq.cpp:1:0: /opt/local/include/boost/heap/skew_heap.hpp: In instantiation of 'boost::heap::skew_heap&lt;T, A0, A1, A2, A3, A4, A5, A6&gt;::node_pointer boost::heap::skew_heap&lt;T, A0, A1, A2, A3, A4, A5, A6&gt;::emplace_internal(Args&amp;&amp; ...) [with Args = {int, int}; T = thing; A0 = boost::heap::compare&lt;cmpthings&gt;; A1 = boost::parameter::void_; A2 = boost::parameter::void_; A3 = boost::parameter::void_; A4 = boost::parameter::void_; A5 = boost::parameter::void_; A6 = boost::parameter::void_; boost::heap::skew_heap&lt;T, A0, A1, A2, A3, A4, A5, A6&gt;::node_pointer = boost::heap::detail::skew_heap_node&lt;thing, false&gt;*]': /opt/local/include/boost/heap/skew_heap.hpp:769:13: required from 'static void boost::heap::skew_heap&lt;T, A0, A1, A2, A3, A4, A5, A6&gt;::push_void::emplace(boost::heap::skew_heap&lt;T, A0, A1, A2, A3, A4, A5, A6&gt;*, Args&amp;&amp; ...) [with Args = {int, int}; T = thing; A0 = boost::heap::compare&lt;cmpthings&gt;; A1 = boost::parameter::void_; A2 = boost::parameter::void_; A3 = boost::parameter::void_; A4 = boost::parameter::void_; A5 = boost::parameter::void_; A6 = boost::parameter::void_; boost::heap::skew_heap&lt;T, A0, A1, A2, A3, A4, A5, A6&gt; = boost::heap::skew_heap&lt;thing, boost::heap::compare&lt;cmpthings&gt; &gt;]' /opt/local/include/boost/heap/skew_heap.hpp:437:70: required from 'typename boost::mpl::if_c&lt;boost::heap::skew_heap&lt;T, A0, A1, A2, A3, A4, A5, A6&gt;::is_mutable, typename boost::mpl::if_c&lt;boost::heap::skew_heap&lt;T, A0, A1, A2, A3, A4, A5, A6&gt;::is_mutable, typename boost::heap::skew_heap&lt;T, A0, A1, A2, A3, A4, A5, A6&gt;::implementation_defined::handle_type, void*&gt;::type, void&gt;::type boost::heap::skew_heap&lt;T, A0, A1, A2, A3, A4, A5, A6&gt;::emplace(Args&amp;&amp; ...) [with Args = {int, int}; T = thing; A0 = boost::heap::compare&lt;cmpthings&gt;; A1 = boost::parameter::void_; A2 = boost::parameter::void_; A3 = boost::parameter::void_; A4 = boost::parameter::void_; A5 = boost::parameter::void_; A6 = boost::parameter::void_; typename boost::mpl::if_c&lt;boost::heap::skew_heap&lt;T, A0, A1, A2, A3, A4, A5, A6&gt;::is_mutable, typename boost::mpl::if_c&lt;boost::heap::skew_heap&lt;T, A0, A1, A2, A3, A4, A5, A6&gt;::is_mutable, typename boost::heap::skew_heap&lt;T, A0, A1, A2, A3, A4, A5, A6&gt;::implementation_defined::handle_type, void*&gt;::type, void&gt;::type = void]' testpq.cpp:27:20: required from here /opt/local/include/boost/heap/skew_heap.hpp:808:9: error: no matching function for call to 'boost::heap::skew_heap&lt;thing, boost::heap::compare&lt;cmpthings&gt; &gt;::make_node(int, int)' /opt/local/include/boost/heap/skew_heap.hpp:808:9: note: candidates are: In file included from /opt/local/include/boost/heap/skew_heap.hpp:21:0, from testpq.cpp:1: /opt/local/include/boost/heap/detail/stable_heap.hpp:189:19: note: boost::heap::detail::heap_base&lt;T, Cmp, constant_time_size, StabilityCounterType, stable&gt;::internal_type boost::heap::detail::heap_base&lt;T, Cmp, constant_time_size, StabilityCounterType, stable&gt;::make_node(const T&amp;) [with T = thing; Cmp = cmpthings; bool constant_time_size = true; StabilityCounterType = long unsigned int; bool stable = false; boost::heap::detail::heap_base&lt;T, Cmp, constant_time_size, StabilityCounterType, stable&gt;::internal_type = thing] /opt/local/include/boost/heap/detail/stable_heap.hpp:189:19: note: candidate expects 1 argument, 2 provided /opt/local/include/boost/heap/detail/stable_heap.hpp:195:10: note: T&amp;&amp; boost::heap::detail::heap_base&lt;T, Cmp, constant_time_size, StabilityCounterType, stable&gt;::make_node(T&amp;&amp;) [with T = thing; Cmp = cmpthings; bool constant_time_size = true; StabilityCounterType = long unsigned int; bool stable = false] /opt/local/include/boost/heap/detail/stable_heap.hpp:195:10: note: candidate expects 1 argument, 2 provided </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8195 Trac 1.4.3 rob.patro@… Wed, 27 Feb 2013 22:58:48 GMT attachment set https://svn.boost.org/trac10/ticket/8195 https://svn.boost.org/trac10/ticket/8195 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">testpq.cpp</span> </li> </ul> <p> file reproduces bug with heap emplace operation. </p> Ticket timblechmann Sun, 03 Mar 2013 10:54:28 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8195#comment:1 https://svn.boost.org/trac10/ticket/8195#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/83263" title="heap: fix emplace operations fixes #8195">[83263]</a>) heap: fix emplace operations </p> <p> fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8195" title="#8195: Bugs: emplace method broken in boost heaps (closed: fixed)">#8195</a> </p> Ticket