
2 Aug
2007
2 Aug
'07
5:55 p.m.
David Abrahams wrote:
on Wed Aug 01 2007, Lewis Hyatt <lhyatt-AT-princeton.edu> wrote:
I think it's because std::iterator_traits didn't exist when the STL was first designed. It's similar with accumulate(), you have to pass in the starting value so it can grab the type.
You pass the starting value to accumulate so it can grab the value, not the type.
Supplying a wider type to avoid overflow can be useful.