Be more generic for template specialization on fundamental type
Add missing import for std::accumulate