
On Friday 30 January 2004 10:54 am, Peter Dimov wrote:
Douglas Gregor wrote:
On the main branch, I've implemented operator== and operator!= for Boost.Function (but not in the form you expect).
I am getting a C4800 warning from MSVC 7.1 ('int' forced to true/false) in function_template.hpp:299: [snip]
This is a regression. The fix is trivial:
return BOOST_FUNCTION_COMPARE_TYPE_ID(typeid(Functor), *type)? functor_ptr: make_any_pointer(reinterpret_cast<void*>(0));
Fixed.
The definition of BOOST_FUNCTION_COMPARE_TYPE_ID is:
# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) (X==Y)
It should be:
# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X) == (Y))
Fixed.
Also, I'm not really sure whether we should pre-emptively "fix" type_info::operator= like this. Bugfixes should be in response to actual bug reports.
type_info::operator== doesn't work across shared libraries with GCC's new ABI, and this is the accepted way to fix it. I grabbed the fix out of the Python lib (where presumably they've already had this bug report). Nobody's submitted a bug report about operator== not working on MSVC 6.0, but I tried to support that anyway :) Doug