boost 泛函数比较问题
VC2005, boost1.33.1
代码:
#include <boost/function.hpp>
typedef boost::function<void (int)> bf_t;
int main()
{
bf_t first = 0;
bf_t second = 0;
first == second;
}
错误:
d:\workhome\testproj\thoo\thoo\thoo.cpp(43) : error C2666: 'operator ==' : 4 overloads have similar conversions
d:\workhome\thirdparty\include\boost\function\function_template.hpp(583): could be 'void boost::operator ==<R,T0,Allocator>(const boost::function1<R,T0,Allocator> &,const boost::function1<R,T0,Allocator> &)' [found using argument-dependent lookup]
with
[
R=void,
T0=int,
Allocator=std::allocator<void>
]
d:\workhome\thirdparty\include\boost\function\function_base.hpp(609): or 'bool boost::operator ==<bf_t>(Functor,const boost::function_base &)' [found using argument-dependent lookup]
with
[
Functor=bf_t
]
d:\workhome\thirdparty\include\boost\function\function_base.hpp(600): or 'bool boost::operator ==<bf_t>(const boost::function_base &,Functor)' [found using argument-dependent lookup]
with
[
Functor=bf_t
]
or 'built-in C++ operator==(void (__thiscall boost::function1<R,T0,Allocator>::dummy::* )(void), void (__thiscall boost::function1<R,T0,Allocator>::dummy::* )(void))'
with
[
R=void,
T0=int,
Allocator=std::allocator<void>
]
while trying to match the argument list '(bf_t, bf_t)'
难道 boost 的 function 是不能比较的?