
"jbd"
Peter Dimov wrote: It isn't clear why do you need to bind bar2 at all, instead of just using boost::function < void (int) > f3( &bar2 ) ;
To make a long story short, i'd like people always use the same mecanism (syntax), not a boost::bind here and nothing there.
I would disagree with this approach. First it introduces unnecessary runtime and compile time performance overhead. More importantly, as great as boost::bind is, it is just a mechanism for making function objects. There are other mechanisms, like, for example, STL binders and adapters, boost::lambda or writing your own function object. A function pointer can be used directly, since function objects are modeled after it in the first place. Using boost::bind when it is not required might produce the code that is more difficult to understand and maintain. Regards, Arkadiy