Hi,
Take this code:
#include <string>
#include
struct A {};
bool operator==(A, A) { return true; }
int main()
{
using namespace boost;
tuple t1(std::string("same?"), 2, A());
tuple t2(std::string("same?"), 2, A());
tuple t3(std::string("different"), 3, A());
t1 == t2; // error: no match for operator==
t1 == t3; // error: no match for operator==
}
This is similar to the example shown in Boost.Tuple docs. However the
compiler(*) refuses to compile it.
I tried it with versions 1.33.0 and 1.33.1 (Beta)
Any ideas?
Compiler outputs below:
MSC C/C++ Compiler 13.10;3077
cl /GR /EHsc /IE:\projects\libraries\boost_1_33_1 tuple_error.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
tuple_error.cpp
tuple_error.cpp(17) : error C2678: binary '==' : no operator found which takes a
left-hand operand of type 'boost::tuples::tuple' (or there is no acce
ptable conversion)
with
[
T0=std::string,
T1=int,
T2=A
]
tuple_error.cpp(18) : error C2678: binary '==' : no operator found which takes a
left-hand operand of type 'boost::tuples::tuple' (or there is no acce
ptable conversion)
with
[
T0=std::string,
T1=int,
T2=A
]
gcc 3.4.4
g++ -I E:\projects\libraries\boost_1_33_1 tuple_error.cpp -o
tuple_error_gcc.exe
tuple_error.cpp: In function `int main()':
tuple_error.cpp:17: error: no match for 'operator==' in 't1 == t2'
tuple_error.cpp:7: note: candidates are: bool operator==(A, A)
tuple_error.cpp:18: error: no match for 'operator==' in 't1 == t3'
tuple_error.cpp:7: note: candidates are: bool operator==(A, A)
Regards,
Josue