Fix std::iterator inheritance (first parameter has to be a category)
Be more generic for template specialization on fundamental type
Add missing import for std::accumulate