diff --git a/cpp/Platform.Ranges/Range.h b/cpp/Platform.Ranges/Range.h index c3b59c4..a1d514a 100644 --- a/cpp/Platform.Ranges/Range.h +++ b/cpp/Platform.Ranges/Range.h @@ -1,26 +1,31 @@ namespace Platform::Ranges { - #define LIMIT_AS_RANGE(type) std::numeric_limits::lowest(), std::numeric_limits::max() + namespace Internal + { + template + constexpr Range FullRange() noexcept + { + return Range(std::numeric_limits::lowest(), std::numeric_limits::max()); + } + } - constexpr auto SByte = Range(LIMIT_AS_RANGE(std::int8_t)); + constexpr auto SByte = Internal::FullRange(); - constexpr auto Int16 = Range(LIMIT_AS_RANGE(std::int16_t)); + constexpr auto Int16 = Internal::FullRange(); - constexpr auto Int32 = Range(LIMIT_AS_RANGE(std::int32_t)); + constexpr auto Int32 = Internal::FullRange(); - constexpr auto Int64 = Range(LIMIT_AS_RANGE(std::int64_t)); + constexpr auto Int64 = Internal::FullRange(); - constexpr auto Byte = Range(LIMIT_AS_RANGE(std::uint8_t)); + constexpr auto Byte = Internal::FullRange(); - constexpr auto UInt16 = Range(LIMIT_AS_RANGE(std::uint16_t)); + constexpr auto UInt16 = Internal::FullRange(); - constexpr auto UInt32 = Range(LIMIT_AS_RANGE(std::uint32_t)); + constexpr auto UInt32 = Internal::FullRange(); - constexpr auto UInt64 = Range(LIMIT_AS_RANGE(std::uint64_t)); + constexpr auto UInt64 = Internal::FullRange(); - constexpr auto Single = Range(LIMIT_AS_RANGE(std::float_t)); + constexpr auto Single = Internal::FullRange(); - constexpr auto Double = Range(LIMIT_AS_RANGE(std::double_t)); - - #undef LIMIT_AS_RANGE + constexpr auto Double = Internal::FullRange(); }