diff --git a/maths.hpp b/maths.hpp index 4562d655..e2520728 100644 --- a/maths.hpp +++ b/maths.hpp @@ -676,6 +676,34 @@ namespace util { } + //------------------------------------------------------------------------- + template + const ValueT& + max (const std::array &vals) + { + return *std::max_element (vals.begin (), vals.end ()); + } + + + template + ValueT& + max (std::array &&) = delete; + + + //------------------------------------------------------------------------- + template + const ValueT& + min (const std::array &vals) + { + return *std::min_element (vals.begin (), vals.end ()); + } + + + template + ValueT& + min (std::array &&) = delete; + + /////////////////////////////////////////////////////////////////////////// // Limiting functions