#include #include #include //From http://www.richelbilderbeek.nl/CppGetSum.htm template const T::value_type GetSum(const T& v) { return std::accumulate(v.begin(), v.end(), static_cast(0.0)); }