Boost logo

Boost :

From: Alexander Belopolsky (belopols_at_[hidden])
Date: 2001-08-09 14:41:16


--- In boost_at_y..., farrow_at_t... wrote:
>
>
> REDUCE: applies a binary operator where the first argument is the
> current intermediate result and the second is each value in the
> sequence. The result of each function application becomes the new
> result.
>
> Example:
>
> vector<int> nums; //contains { 1, 2, 3 }
> int result = reduce(nums.begin(), nums.end(), plus<int>(), 0);
> //result = 6

Your reduce looks like the second form of accumulate algorithm.
See [lib.accumulate] 26.4.1


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