Re: [Boost-users] Help with function and/or bind libraries
On Sun, 30 Nov 2003 Douglas Paul Gregor
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@alldata.com
participants (1)
-
John.Wismar@alldata.com