
10 Dec
2006
10 Dec
'06
3:24 a.m.
Steven Watanabe wrote:
Even that isn't enough. You need: win->on_mouse_move.connect( boost::bind<bool>( unlambda((
'unlambda' would be necessary with boost::lambda::bind, but it isn't needed for boost::bind. The following works for me. #include <boost/lambda/lambda.hpp> #include <boost/bind.hpp> #include <boost/function.hpp> #include <iostream> int main() { int x = 0, y = 0; boost::function< bool( int, int, bool, int ) > on_mouse_move; namespace l = boost::lambda; on_mouse_move = boost::bind<bool>( (l::var(x) = l::_1, l::var(y) = l::_2, true), _1, _2 ); on_mouse_move( 1, 2, true, 4 ); std::cout << x << ' ' << y << std::endl; }