27 Jun
2002
27 Jun
'02
3:51 p.m.
Douglas Gregor wrote:
Hi Bill, It's just a typo that's causing your problem: not_ok is declared like this:
int not_ok(const D *d, int j) { return d->d() + j; }
But the call to bind swaps the order of the 'const D*' and 'int' arguments:
Foo f2 = boost::bind(&B::not_ok, b, _1, d);
You want:
Foo f2 = boost::bind(&B::not_ok, b, d, _1);
Doh! It's not a typo, it's a major misunderstanding of the role of the _1. *Now* I get it.... Thanks!