It seems odd that he complains about lack of local (modifiable) state while at the same time talking up the advantages of pure functional programming. It's painful to have to explicitly capture state instead of depending on a closure to do it, but you can do it, and somewhat nicely using objects in C++.<p>Also, is it not right that iterators were introduced in C++ largely to allow generic functions across arrays and other data structures?<p>Finally, do iterators necessarily imply statefulness? Doesn't seem like it. Taking + 1 as "successor":
double sum(const double* start, const double* end) {
if (start == end) {
return 0.0;
} else {
return *start + sum(start + 1, end);
}
}