Hello
I'm wondering why the attached code which is using nested boost::bind()
does not compile on GCC ( I have tried 4.1 and 4.3). According to the
"bind" package documentation nested bind() calls are allowed.
To make it compile (and work!) it's necessary to add explicit cast to the
result of the nested bind() call, like:
boost::function f =
boost::bind( wrapper, a, (boost::function)boost::bind( cb, p ), b );
But that is something which I don't like.
Any ideas?
Cheers,
Sergei
#include
#include
typedef bool (*Callback)( void * );
void wrapper( int , boost::function , int ) { }
bool callback( void * ) { }
void test( Callback c, void * p ) {
int a,b;
boost::function f =
boost::bind( wrapper, a, boost::bind( c, p ), b );
}
int main() {
test( callback, 0 );
return 0;
}