Boost C++ Libraries: Ticket #12745: key_nodeptr_comp broken if the key type is void* https://svn.boost.org/trac10/ticket/12745 <p> This is a regression since 1.60. <code>boost::intrusive::set::insert_check()</code> fails to compile if called with a key that has type <code>void*</code>. The error is as follows: </p> <pre class="wiki">/home/lastique/src/boost-xcoder/boost/intrusive/detail/key_nodeptr_comp.hpp:87: error: no match for call to ‘(MediaBufferBase::callback_list::callback_reference::order_by_key) (const MediaBufferBase::callback_list::callback_reference&amp;)’ { return base().get()(key_of_value()(*traits_-&gt;to_value_ptr(t1))); } ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ </pre><p> The problem is in <code>key_nodeptr_comp</code> implementation, which has an overload of <code>operator()</code> whith two formal parameters, the second one being used for <code>enable_if_c</code> and having the type <code>void*</code>. This operator calls user's ordering predicate with only one argument, which is naturally not expected. </p> <p> The suggested solution is to use SFINAE on the return type of the operators or use a more distinct type for the hidden argument of the operators. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12745 Trac 1.4.3 Andrey Semashev Tue, 10 Jan 2017 19:59:03 GMT <link>https://svn.boost.org/trac10/ticket/12745#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12745#comment:1</guid> <description> <p> Here is a fix: <a class="ext-link" href="https://github.com/boostorg/intrusive/pull/21"><span class="icon">​</span>https://github.com/boostorg/intrusive/pull/21</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Mon, 16 Jan 2017 11:23:21 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/12745#comment:2 https://svn.boost.org/trac10/ticket/12745#comment:2 <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> Ticket