Subject: [Boost-bugs] [Boost C++ Libraries] #11941: Use of overloaded operator== in BOOST_TEST() is ambiguous
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-01-27 11:50:53
#11941: Use of overloaded operator== in BOOST_TEST() is ambiguous
------------------------------+---------------------
Reporter: kamo.tanabota@⦠| Owner: rogeeff
Type: Bugs | Status: new
Milestone: To Be Determined | Component: test
Version: Boost 1.59.0 | Severity: Problem
Keywords: |
------------------------------+---------------------
I'm unable to compile the following code due to ambiguity of opertor==
overloads.
{{{
#define BOOST_TEST_MODULE mytest
#include <boost/test/included/unit_test.hpp>
struct S {
template <class T>
S(T&&) {}
};
bool operator==(S const&, S const&) { return true; }
template <class T>
bool operator==(T const&, S const&) { return true; }
BOOST_AUTO_TEST_CASE(test1)
{
auto const s = S{"hoge"};
BOOST_TEST(s == 4);
}
}}}
This seems to happen if there is an overload taking a template parameter
for the left operand.
Using boost::iterator_range, instead of the class S, results in same
issue.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11941> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC