diff --git a/utils.hpp b/utils.hpp index e02b4f1..d9a7f93 100644 --- a/utils.hpp +++ b/utils.hpp @@ -5,6 +5,7 @@ #define __STDC_VERSION__ 201112L #endif +#include #include namespace uart { @@ -121,20 +122,20 @@ struct NumericLimits { template <> struct NumericLimits { - template static constexpr float min() { static_assert(always_false_v, "Not implemented"); return 0; } - template static constexpr float max() { static_assert(always_false_v, "Not implemented"); return 0; } + template static constexpr float min() { return FLT_MIN; } + template static constexpr float max() { return FLT_MAX; } }; template <> struct NumericLimits { - template static constexpr double min() { static_assert(always_false_v, "Not implemented"); return 0; } - template static constexpr double max() { static_assert(always_false_v, "Not implemented"); return 0; } + template static constexpr double min() { return DBL_MIN; } + template static constexpr double max() { return DBL_MAX; } }; template <> struct NumericLimits { - template static constexpr long double min() { static_assert(always_false_v, "Not implemented"); return 0; } - template static constexpr long double max() { static_assert(always_false_v, "Not implemented"); return 0; } + template static constexpr long double min() { return LDBL_MIN; } + template static constexpr long double max() { return LDBL_MAX; } }; // clang-format on