Boost C++ Libraries: Ticket #12645: error: no match for call to ‘(const hash) (const boost::recursive_variant_&)’ https://svn.boost.org/trac10/ticket/12645 <p> Since boost 1.62 the recursive variant is not able to find the hash function.<br /> Same for boost 1.63 beta.<br /> Compiler stops with error: no match for call to ‘(const hash) (const boost::recursive_variant_&amp;)’ </p> <p> code: </p> <pre class="wiki">#include &lt;boost/variant.hpp&gt; #include &lt;unordered_set&gt; struct hash; using int_t = int; template &lt;typename T&gt; using basic_set_t = std::unordered_set&lt;T, hash&gt;; using value_t = boost::make_recursive_variant&lt; int_t, basic_set_t&lt;boost::recursive_variant_&gt; &gt;::type; using set_t = basic_set_t&lt;value_t&gt;; struct hash { // since boost 1.62 ... error: no match for call to ‘(const hash) (const boost::recursive_variant_&amp;)’ size_t operator()(const value_t&amp; value) const { return 0; } }; int main() { set_t s; int_t i = 3; value_t v = i; s.emplace(v); // raises error above v = s; return 0; } </pre><p> gcc 6.2.0 on Linux<br /> clang 7.0.2 on Mac </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12645 Trac 1.4.3 mike.gresens@… Sat, 03 Dec 2016 17:26:34 GMT <link>https://svn.boost.org/trac10/ticket/12645#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12645#comment:1</guid> <description> <p> Workaround for boost &gt;= 1.62. Not sure what changed since 1.61... </p> <p> code: </p> <pre class="wiki">#include &lt;boost/variant.hpp&gt; #include &lt;unordered_set&gt; struct hash; using int_t = int; template &lt;typename T&gt; using basic_set_t = std::unordered_set&lt;T, hash&gt;; using value_t = boost::make_recursive_variant&lt; int_t, basic_set_t&lt;boost::recursive_variant_&gt; &gt;::type; using set_t = basic_set_t&lt;value_t&gt;; struct hash { boost::recursive_variant_&amp;)’ size_t operator()(const value_t&amp; value) const { return 0; } }; // This helps for boost &gt;= 1.62 namespace std { template &lt;&gt; struct __is_fast_hash&lt;::hash&gt; : std::false_type { }; } int main() { set_t s; int_t i = 3; value_t v = i; s.emplace(v); v = s; return 0; } </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Mon, 02 Jan 2017 09:50:09 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/12645#comment:2 https://svn.boost.org/trac10/ticket/12645#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">ebf</span> to <span class="trac-author">Antony Polukhin</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> Fixed by Mikhail Maximov in <a class="ext-link" href="https://github.com/boostorg/variant/commit/e0b65c01a8d21feb45f4d47b753bc4b796bb6372"><span class="icon">​</span>e0b65c01</a>. Fix will appear in Boost 1.64 </p> Ticket Antony Polukhin Wed, 18 Jan 2017 19:36:58 GMT milestone changed https://svn.boost.org/trac10/ticket/12645#comment:3 https://svn.boost.org/trac10/ticket/12645#comment:3 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.64.0</span> </li> </ul> Ticket Antony Polukhin Sat, 22 Apr 2017 06:01:33 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/12645#comment:4 https://svn.boost.org/trac10/ticket/12645#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket