Boost logo

Boost :

From: Amélie et François Dumont (francois.amelie_at_[hidden])
Date: 2003-02-08 10:01:08


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 ;-)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk