maths: add sum helper for containers

This commit is contained in:
Danny Robson 2023-07-21 14:21:18 +10:00
parent 1fa4eba5d3
commit 5ca101acf3

View File

@ -544,6 +544,13 @@ namespace cruft {
return sum; return sum;
} }
template <concepts::named::container ContainerT>
typename ContainerT::value_type
sum (ContainerT const &src)
{
return sum (src.begin (), src.end ());
}
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
template <typename InputT> template <typename InputT>