5 Oct
2005
5 Oct
'05
5:41 p.m.
BRIDGES Dick wrote:
BRIDGES Dick wrote:
class Bar { typedef void (*pf)(bool);
If you make this
typedef boost::function
pf; [snip]
then
Bar bar_( boost::bind(&X::f, &x) );
should work. But you can't get an oridnary function pointer from boost::bind; a function pointer doesn't have enough state to represent &X::f + &x.
[...] I omitted too much of the context, sorry ;-) For struct X { void f(bool b) {} } the correct thing would be to use boost::bind(&X::f, &x, _1) so that the bool argument from pf (the first input argument is _1 in bind notation) can be passed to X::f.