5 Dec
2012
5 Dec
'12
6:58 p.m.
On Tue, Dec 4, 2012 at 4:48 PM, Nathan Crookston
//bind(b, bind(a));//*1 bind(b, cref(bind(a)));//*2
In short, *1 is evaluating a()
Thank you. This surprises me as I thought boost::bind returned an object of type boost::function. I need to understand this better and am about to go read more on this.
It would be more idiomatic to use protect:
bind(b, boost::protect(bind(a)))
I made the change, thank you. Hopefully when I understand better what boost::bind is doing (i.e. not returning a boost::function) it will be obvious why I need boost::protect. My guess is that boost::protect converts whatever boost::bind does return into a boost::function. Thanks again, Chris