Is there a way of using ptr_fun on a method (class instance's function) ? It can come in very useful
-----Original Message----- From: Amélie et François Dumont [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 08, 2003 5:01 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [boost] Re: binding Just a little remark about the code that has nothing to do with the bug that has been elucidated by Graig Henderson. When Greg Dehaas wrote: > I have a namespace GenAlg with this inside: > -------------------------------------------------------------------- > namespace GenAlg > { > template <class TController, class TFitness> > unsigned long RouletteWheel(TController *oController) > { > ... > } > } > -------------------------------------------------------------------- > > elsewhere I have a > -------------------------------------------------------------------- > boost::function1<unsigned long, CGAController *> fncSelection; > -------------------------------------------------------------------- > > I try to set fncSelection to RouletteWheel like so: > -------------------------------------------------------------------- > fncSelection = boost::bind(GenAlg::RouletteWheel<CGAController, unsigned > long>,_1); > -------------------------------------------------------------------- > It seems to me that it would have been more accurate to write: fncSelection = boost::ptr_fun(GenAlg::RouletteWheel<CGAController, unsigned long>); there is no use for the boost::bind function even if the result is finally the same ;-) _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost