From 58ce187269462416d9e145884b955cf0c5ca4c1f Mon Sep 17 00:00:00 2001 From: konard Date: Thu, 11 Sep 2025 14:47:52 +0300 Subject: [PATCH 1/3] Initial commit with task details for issue #76 Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: https://github.com/linksplatform/Ranges/issues/76 --- CLAUDE.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..a56d4d3 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,5 @@ +Issue to solve: https://github.com/linksplatform/Ranges/issues/76 +Your prepared branch: issue-76-88af9c31 +Your prepared working directory: /tmp/gh-issue-solver-1757591268935 + +Proceed. \ No newline at end of file From e3d93ed82840cca4b50ccd6abefb80eeb8610886 Mon Sep 17 00:00:00 2001 From: konard Date: Thu, 11 Sep 2025 14:48:11 +0300 Subject: [PATCH 2/3] Remove CLAUDE.md - PR created successfully --- CLAUDE.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index a56d4d3..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1,5 +0,0 @@ -Issue to solve: https://github.com/linksplatform/Ranges/issues/76 -Your prepared branch: issue-76-88af9c31 -Your prepared working directory: /tmp/gh-issue-solver-1757591268935 - -Proceed. \ No newline at end of file From d639b187dfb64738ba40209c6f23115f9313c75e Mon Sep 17 00:00:00 2001 From: konard Date: Thu, 11 Sep 2025 14:51:14 +0300 Subject: [PATCH 3/3] Replace LIMIT_AS_RANGE macro with constexpr function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replaced the LIMIT_AS_RANGE macro with a template constexpr function FullRange() - Added the function to Internal namespace to avoid polluting the public API - Maintains the same functionality while providing type safety and better debugging - Eliminates macro pollution and follows modern C++ best practices Fixes #76 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- cpp/Platform.Ranges/Range.h | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) 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(); }