wrote:
> But it never goes itside 'do_add' and it just return 0. I expect it
> just 'sum' the FIRST element (since start is 0 and end is 1).
>
> Can you please tell me why is that?
>
> _myList is a type of vector<int>
> float getTotal(int start,int end) {
> vector<int>::iterator beginItr = _myList.begin() + start;
> vector<int>::iterator endItr = _myList.begin() + end;
> return accumulate (beginItr, endItr, 0.0, do_add<int, float>());
This code works fine when I tried it (After adding necessary minimal
definitions and other stuff). Could you please give the complete code
which demonstrates the problem?