Dear all,
We all waited for the operator==. Unfortunately it does not compile on VC++
7.1. What do I wrong:
namespace Tstb
{
int f0 ();
int f1 (int a);
int f2 (int a, int b);
int f3 (int a, int b, int c);
}
void Test
{
boost::function fc1 = &Tstb::f0;
boost::function fc2 = &Tstb::f0;
boost::function fc3 = boost::bind(&Tstb::f1, 2);
bool b = false;
b = (fc1 == fc2);
b = (fc1 == fc3);
b = (fc2 == fc3);
}
It gives:
c:\Work\Test\Testmfc\Testboost\Testfunction.cpp(164) : error
C2666: 'operator`=='' : 4 overloads have similar conversions
c:\Work Sdk\Boost\boost\function\function_base.hpp(562): could
be 'boost::enable_if_c::type boost::operator
==(const boost::function_base &,Functor)' [found
using argument-dependent lookup]
with
[
B=true,
T=bool,
Signature=int (void),
Functor=boost::function
]
c:\Work Sdk\Boost\boost\function\function_template.hpp(594):
or 'void boost::operator ==(const
boost::function0 &,const boost::function0 &)' [found
using argument-dependent lookup]
with
[
R=int,
Allocator=std::allocator<void>
]
c:\Work Sdk\Boost\boost\function\function_base.hpp(571):
or 'boost::enable_if_c::type boost::operator
==(Functor,const boost::function_base &)' [found
using argument-dependent lookup]
with
[
B=true,
T=bool,
Signature=int (void),
Functor=boost::function
]
or 'built-in C++ operator==
(boost::function0::safe_bool,
boost::function0::safe_bool)'
with
[
R=int,
Allocator=std::allocator<void>
]
and
[
R=int,
Allocator=std::allocator<void>
]
while trying to match the argument list '(boost::function<Signature>,
boost::function<Signature>)'
with
[
Signature=int (void)
]
and
[
Signature=int (void)
]
etc.
Wkr,
me