Boost logo

Boost Users :

From: John.Wismar_at_[hidden]
Date: 2003-11-30 18:32:34


On Sun, 30 Nov 2003 Douglas Paul Gregor <gregod_at_[hidden]> wrote:

> You can replace the body of get_total with:
>
> return std::accumulate(myVec.begin(), myVec.end(), 0,
> boost::bind(std::plus<int>(), //bind 1
> _1,
> boost::bind(&B::stretch_it, //bind 2
> this,
> boost::bind(&A::size,
//bind 3
> _2))));
>
> You can decide whether that's better than the hand-coded loop or not :)

>From a maintainability standpoint, I don't think I'll make that switch. ;
-)

Thanks for the reply, though! (Now I just have to try to figure out what
it's doing!)

---------------------
John Wismar -- RPI '90
john.wismar_at_[hidden]


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net