Michael Marcin wrote:
I have a windows compiler that is a derivative of cw 9.4 that is complaining when trying to compile the following
#include
struct a { void foo(int) {} void foo() {} };
void bar() { boost::bind( &a::foo, _1 ); }
...
Changing the definition to
struct a { void foo() {} void foo(int) {} };
lets it compile but this is not a general solution as this fails to compile: void bar() { boost::bind( &a::foo, _1, 0 ); }
Sounds like a compiler bug. boost::bind tries to do its best to resolve ambiguous overloads, but this is not possible in general, even without compiler limitations getting in the way. You'd need to pick the right overload manually: void bar() { void (a::*pmf)( int ) = &a::foo; boost::bind( pmf, _1, 0 ); }