Boost C++ Libraries: Ticket #11941: Use of overloaded operator== in BOOST_TEST() is ambiguous https://svn.boost.org/trac10/ticket/11941 <p> I'm unable to compile the following code due to ambiguity of opertor== overloads. </p> <pre class="wiki">#define BOOST_TEST_MODULE mytest #include &lt;boost/test/included/unit_test.hpp&gt; struct S { template &lt;class T&gt; S(T&amp;&amp;) {} }; bool operator==(S const&amp;, S const&amp;) { return true; } template &lt;class T&gt; bool operator==(T const&amp;, S const&amp;) { return true; } BOOST_AUTO_TEST_CASE(test1) { auto const s = S{"hoge"}; BOOST_TEST(s == 4); } </pre><p> This seems to happen if there is an overload taking a template parameter for the left operand. </p> <p> Using boost::iterator_range, instead of the class S, results in same issue. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11941 Trac 1.4.3 anonymous Tue, 02 Feb 2016 02:39:48 GMT <link>https://svn.boost.org/trac10/ticket/11941#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11941#comment:1</guid> <description> <p> I do not think we can do anything about this. Templated operator== will always conflict with my templated operator== method. </p> <p> You can alway work around the issue with pair of extra (). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Sun, 15 Dec 2019 19:22:08 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11941#comment:2 https://svn.boost.org/trac10/ticket/11941#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">wontfix</span> </li> </ul> <p> Workaround mentioned in the documentation of <code>BOOST_TEST</code> </p> Ticket