Added a recursive max function

This commit is contained in:
Paul Ferrand 2020-01-20 19:09:40 +01:00
parent 65f172a02e
commit bc567c5e7b

View file

@ -35,6 +35,18 @@
#include <cassert>
#include <random>
template<class T>
constexpr T max(T op1, T op2)
{
return std::max(op1, op2);
}
template<class T, class... Args>
constexpr T max(T op1, Args... rest)
{
return std::max(op1, max(rest...));
}
template<class T>
constexpr T min(T op1, T op2)
{