template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>>> constexpr T abs(T n) { if constexpr (std::is_signed_v<T>) { return n >= 0 ? n : -n; } return n; }