Boost logo

Boost :

From: Darren Cook (darren_at_[hidden])
Date: 2004-11-24 22:15:17


>> It looks interesting. I've only read the Starter Kit page so far. You
>> went from this (without using the library):
>> find_if(c.begin(), c.end(), &is_odd)
>>
>> To:
>> find_if(c.begin(), c.end(), is_odd(arg1));
>
>
> Actually, it's this:
>
> bool
> is_odd(int arg1)
> {
> return arg1 % 2 == 1;
> }
>
> find_if(c.begin(), c.end(), &is_odd)
>
> to this:
>
> find_if(c.begin(), c.end(), arg1 % 2 == 1)

That seemed to be an intermediate stage as you then took it further and made
a functor. If you'd stopped the tutorial at the above line I'd have had no
complaint :-).

Darren


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