
10 Oct
2009
10 Oct
'09
4:22 p.m.
Ryan McConnehey wrote:
Steven Watanabe wrote:
Check you parentheses. The two uses of bind/mem_fun are not the same. Sorry, the line should read as follows.
*itor = bus(new unsigned short(startValue++), boost::bind(boost::mem_fun(&CTNGenerator::makeCTNAvailable), this));
You need boost::bind( &CTNGenerator::makeCTNAvailable, this, _1 ). bind will automatically insert the mem_fn for you. Being a member function, makeCTNAvailable takes two arguments: the hidden 'this' and 'ctn'. _1 routes the pointer argument of the deleter into its proper position as 'ctn'.