29 Jun
2011
29 Jun
'11
4:45 p.m.
void DClient::resolveHandler(int param) { .... }
boost::function
functionPtr; int tempInt = 12; functionPtr = boost::bind(&DClient::resolveHandler, this, tempInt); functionPtr(67);
The final line will call resolveHandler with a parameter of 12, rather than 67? Surely that can't be right?
Correct, the function will be called with 12. You can ensure this with
this small program:
#include <iostream>
#include