Boost C++ Libraries: Ticket #12432: Forced KeyOfValue creation when using custom compare on insert_check https://svn.boost.org/trac10/ticket/12432 <p> Introducing key_of_value in 1.59 seems to have broken the custom compare feature (including subsequent versions): </p> <pre class="wiki"> int first; explicit MyClass(int i) : first(i){} </pre><p> <em>Compr</em> defines strict ordering between <a class="missing wiki">MyClass</a> and int. </p> <pre class="wiki"> typedef set&lt; MyClass, compare&lt;MyClass::Compr&gt; &gt; OrderedMap; ... int i = 1; auto ret = omap.insert_check(i, omap.value_comp(), commit_data); </pre><p> triggers the following error: </p> <p> boost_1_59_0/boost/intrusive/detail/tree_value_compare.hpp:64:26: error: no match for call to ‘(boost::move_detail::identity&lt;<a class="missing wiki">MyClass</a>&gt;) (const int&amp;)’ </p> <blockquote> <p> { return <a class="missing wiki">KeyOfValue</a>()(key); } </p> </blockquote> <p> using gcc-5.4 </p> <p> Full snippet attached </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12432 Trac 1.4.3 kiril.dimitroff@… Fri, 02 Sep 2016 13:22:17 GMT attachment set https://svn.boost.org/trac10/ticket/12432 https://svn.boost.org/trac10/ticket/12432 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">intrusive_key_error.cpp</span> </li> </ul> <p> full code snippet </p> Ticket Ion Gaztañaga Fri, 02 Sep 2016 22:06:15 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/12432#comment:1 https://svn.boost.org/trac10/ticket/12432#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> Thanks for the report and the test case. Fixed in commit: </p> <p> <a class="ext-link" href="https://github.com/boostorg/intrusive/commit/9ac060a6aeb9dfd1a0bc0c70639d13dcc30258de"><span class="icon">​</span>https://github.com/boostorg/intrusive/commit/9ac060a6aeb9dfd1a0bc0c70639d13dcc30258de</a> </p> <p> hopefully will be ready for Boost 1.62. </p> Ticket