Boost C++ Libraries: Ticket #12968: avl_set: regression when sorting by void* https://svn.boost.org/trac10/ticket/12968 <p> The code below compiles (and works) well with boost-1.58, but failes to compile with boost-1.59 and above: </p> <hr /> <p> In file included from /usr/include/boost/intrusive/bstree.hpp:33:0, </p> <blockquote> <p> from /usr/include/boost/intrusive/avltree.hpp:24, from /usr/include/boost/intrusive/avl_set.hpp:17, from avl_test1.cpp:1: </p> </blockquote> <p> /usr/include/boost/intrusive/detail/key_nodeptr_comp.hpp: In instantiation of 'bool boost::intrusive::detail::key_nodeptr_comp&lt;<a class="missing wiki">KeyTypeKeyCompare</a>, <a class="missing wiki">ValueTraits</a>, <a class="missing wiki">KeyOfValue</a>&gt;::operator()(const T1&amp;, typename boost::move_detail::enable_if_c&lt;boost::intrusive::detail::key_nodeptr_comp&lt;KeyTypeKeyCompare, ValueTraits, KeyOfValue&gt;::is_same_or_nodeptr_convertible&lt;T1&gt;::value&gt;::type*) const [with T1 = boost::intrusive::avltree_node&lt;void*&gt;*; <a class="missing wiki">KeyTypeKeyCompare</a> = EntryType::<a class="missing wiki">KeyCompareById</a>; <a class="missing wiki">ValueTraits</a> = boost::intrusive::mhtraits&lt;<a class="missing wiki">EntryType</a>, boost::intrusive::avl_set_member_hook&lt;&gt;, &amp;EntryType::avl_by_id_hook&gt;; <a class="missing wiki">KeyOfValue</a> = boost::move_detail::identity&lt;<a class="missing wiki">EntryType</a>&gt;; typename boost::move_detail::enable_if_c&lt;boost::intrusive::detail::key_nodeptr_comp&lt;KeyTypeKeyCompare, ValueTraits, KeyOfValue&gt;::is_same_or_nodeptr_convertible&lt;T1&gt;::value&gt;::type = void]': /usr/include/boost/intrusive/bstree_algorithms.hpp:2025:24: required from 'static boost::intrusive::bstree_algorithms&lt;<a class="missing wiki">NodeTraits</a>&gt;::node_ptr boost::intrusive::bstree_algorithms&lt;<a class="missing wiki">NodeTraits</a>&gt;::lower_bound_loop(boost::intrusive::bstree_algorithms&lt;<a class="missing wiki">NodeTraits</a>&gt;::node_ptr, boost::intrusive::bstree_algorithms&lt;<a class="missing wiki">NodeTraits</a>&gt;::node_ptr, const <a class="missing wiki">KeyType</a>&amp;, <a class="missing wiki">KeyNodePtrCompare</a>) [with <a class="missing wiki">KeyType</a> = void*; <a class="missing wiki">KeyNodePtrCompare</a> = boost::intrusive::detail::key_nodeptr_comp&lt;EntryType::KeyCompareById, boost::intrusive::mhtraits&lt;EntryType, boost::intrusive::avl_set_member_hook&lt;&gt;, &amp;EntryType::avl_by_id_hook&gt;, boost::move_detail::identity&lt;<a class="missing wiki">EntryType</a>&gt; &gt;; <a class="missing wiki">NodeTraits</a> = boost::intrusive::avltree_node_traits&lt;void*, false&gt;; boost::intrusive::bstree_algorithms&lt;<a class="missing wiki">NodeTraits</a>&gt;::node_ptr = boost::intrusive::avltree_node&lt;void*&gt;*]' /usr/include/boost/intrusive/bstree_algorithms.hpp:917:96: required from 'static boost::intrusive::bstree_algorithms&lt;<a class="missing wiki">NodeTraits</a>&gt;::node_ptr boost::intrusive::bstree_algorithms&lt;<a class="missing wiki">NodeTraits</a>&gt;::lower_bound(const const_node_ptr&amp;, const <a class="missing wiki">KeyType</a>&amp;, <a class="missing wiki">KeyNodePtrCompare</a>) [with <a class="missing wiki">KeyType</a> = void*; <a class="missing wiki">KeyNodePtrCompare</a> = boost::intrusive::detail::key_nodeptr_comp&lt;EntryType::KeyCompareById, boost::intrusive::mhtraits&lt;EntryType, boost::intrusive::avl_set_member_hook&lt;&gt;, &amp;EntryType::avl_by_id_hook&gt;, boost::move_detail::identity&lt;<a class="missing wiki">EntryType</a>&gt; &gt;; <a class="missing wiki">NodeTraits</a> = boost::intrusive::avltree_node_traits&lt;void*, false&gt;; boost::intrusive::bstree_algorithms&lt;<a class="missing wiki">NodeTraits</a>&gt;::node_ptr = boost::intrusive::avltree_node&lt;void*&gt;*; boost::intrusive::bstree_algorithms&lt;<a class="missing wiki">NodeTraits</a>&gt;::const_node_ptr = const boost::intrusive::avltree_node&lt;void*&gt;*]' /usr/include/boost/intrusive/bstree_algorithms.hpp:751:49: required from 'static boost::intrusive::bstree_algorithms&lt;<a class="missing wiki">NodeTraits</a>&gt;::node_ptr boost::intrusive::bstree_algorithms&lt;<a class="missing wiki">NodeTraits</a>&gt;::find(const const_node_ptr&amp;, const <a class="missing wiki">KeyType</a>&amp;, <a class="missing wiki">KeyNodePtrCompare</a>) [with <a class="missing wiki">KeyType</a> = void*; <a class="missing wiki">KeyNodePtrCompare</a> = boost::intrusive::detail::key_nodeptr_comp&lt;EntryType::KeyCompareById, boost::intrusive::mhtraits&lt;EntryType, boost::intrusive::avl_set_member_hook&lt;&gt;, &amp;EntryType::avl_by_id_hook&gt;, boost::move_detail::identity&lt;<a class="missing wiki">EntryType</a>&gt; &gt;; <a class="missing wiki">NodeTraits</a> = boost::intrusive::avltree_node_traits&lt;void*, false&gt;; boost::intrusive::bstree_algorithms&lt;<a class="missing wiki">NodeTraits</a>&gt;::node_ptr = boost::intrusive::avltree_node&lt;void*&gt;*; boost::intrusive::bstree_algorithms&lt;<a class="missing wiki">NodeTraits</a>&gt;::const_node_ptr = const boost::intrusive::avltree_node&lt;void*&gt;*]' /usr/include/boost/intrusive/bstree.hpp:382:83: required from 'boost::intrusive::bstbase2&lt;<a class="missing wiki">ValueTraits</a>, <a class="missing wiki">VoidOrKeyOfValue</a>, <a class="missing wiki">VoidOrKeyComp</a>, <a class="missing wiki">AlgoType</a>, <a class="missing wiki">HeaderHolder</a>&gt;::iterator boost::intrusive::bstbase2&lt;<a class="missing wiki">ValueTraits</a>, <a class="missing wiki">VoidOrKeyOfValue</a>, <a class="missing wiki">VoidOrKeyComp</a>, <a class="missing wiki">AlgoType</a>, <a class="missing wiki">HeaderHolder</a>&gt;::find(const <a class="missing wiki">KeyType</a>&amp;, <a class="missing wiki">KeyTypeKeyCompare</a>) [with <a class="missing wiki">KeyType</a> = void*; <a class="missing wiki">KeyTypeKeyCompare</a> = EntryType::<a class="missing wiki">KeyCompareById</a>; <a class="missing wiki">ValueTraits</a> = boost::intrusive::mhtraits&lt;<a class="missing wiki">EntryType</a>, boost::intrusive::avl_set_member_hook&lt;&gt;, &amp;EntryType::avl_by_id_hook&gt;; <a class="missing wiki">VoidOrKeyOfValue</a> = void; <a class="missing wiki">VoidOrKeyComp</a> = EntryType::<a class="missing wiki">CompareById</a>; boost::intrusive::algo_types <a class="missing wiki">AlgoType</a> = (boost::intrusive::algo_types)6u; <a class="missing wiki">HeaderHolder</a> = void; boost::intrusive::bstbase2&lt;<a class="missing wiki">ValueTraits</a>, <a class="missing wiki">VoidOrKeyOfValue</a>, <a class="missing wiki">VoidOrKeyComp</a>, <a class="missing wiki">AlgoType</a>, <a class="missing wiki">HeaderHolder</a>&gt;::iterator = boost::intrusive::tree_iterator&lt;boost::intrusive::mhtraits&lt;EntryType, boost::intrusive::avl_set_member_hook&lt;&gt;, &amp;EntryType::avl_by_id_hook&gt;, false&gt;]' avl_test1.cpp:33:39: required from here /usr/include/boost/intrusive/detail/key_nodeptr_comp.hpp:87:69: error: no match for call to '(EntryType::<a class="missing wiki">KeyCompareById</a>) (const <a class="missing wiki">EntryType</a>&amp;)' </p> <blockquote> <p> { return base().get()(key_of_value()(*traits_-&gt;to_value_ptr(t1))); } </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> avl_test1.cpp:14:10: note: candidates are: </p> <blockquote> <p> struct <a class="missing wiki">KeyCompareById</a> { </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> avl_test1.cpp:15:10: note: bool EntryType::KeyCompareById::operator()(void* const&amp;, const <a class="missing wiki">EntryType</a>&amp;) const </p> <blockquote> <p> bool operator()(const Type &amp;id,const <a class="missing wiki">EntryType</a> &amp;b) const </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> avl_test1.cpp:15:10: note: candidate expects 2 arguments, 1 provided avl_test1.cpp:17:10: note: bool EntryType::KeyCompareById::operator()(const <a class="missing wiki">EntryType</a>&amp;, void* const&amp;) const </p> <blockquote> <p> bool operator()(const <a class="missing wiki">EntryType</a> &amp;a,const Type &amp;id) const </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> avl_test1.cpp:17:10: note: candidate expects 2 arguments, 1 provided </p> <hr /> <p> Note: when writing "typedef int *Type;" instead of "typedef void *Type;" it compiles. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12968 Trac 1.4.3 anonymous Thu, 13 Apr 2017 14:19:12 GMT attachment set https://svn.boost.org/trac10/ticket/12968 https://svn.boost.org/trac10/ticket/12968 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">avl_test1.cpp</span> </li> </ul> <p> File that does not compile any more </p> Ticket Ion Gaztañaga Fri, 14 Apr 2017 10:07:38 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/12968#comment:1 https://svn.boost.org/trac10/ticket/12968#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">duplicate</span> </li> </ul> <p> Seems to be duplicate of: </p> <p> <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/12745"><span class="icon">​</span>https://svn.boost.org/trac/boost/ticket/12745</a> </p> <p> which is already fixed for soon to be release Boost 1.64. Your test compiles fine with current master code. In any case, many thanks for the report. </p> Ticket