diff --git a/maths.hpp b/maths.hpp index 93eda14f..77b3513d 100644 --- a/maths.hpp +++ b/maths.hpp @@ -573,7 +573,19 @@ namespace cruft { } - //------------------------------------------------------------------------- + ///------------------------------------------------------------------------ + /// Unary maximum provided to simplify application of max to template + /// parameter packs. + /// + /// eg, `max (sizeof (T)...)` will otherwise fail with a single type. + template + constexpr decltype(auto) + max (ValueT &&val) + { + return std::forward (val); + } + + /// Variadic maximum template constexpr std::enable_if_t<