Enhance algorithms and limits modules with improved functionality and tests#19
Merged
FrozenLemonTee merged 7 commits intomainfrom Mar 26, 2026
Merged
Enhance algorithms and limits modules with improved functionality and tests#19FrozenLemonTee merged 7 commits intomainfrom
FrozenLemonTee merged 7 commits intomainfrom
Conversation
…dependencies for algorithms and conversion layers Signed-off-by: FrozenlemonTee <1115306170@qq.com>
…eval Signed-off-by: FrozenlemonTee <1115306170@qq.com>
Signed-off-by: FrozenlemonTee <1115306170@qq.com>
…mports Signed-off-by: FrozenlemonTee <1115306170@qq.com>
…ionality Signed-off-by: FrozenlemonTee <1115306170@qq.com>
… type limits handling Signed-off-by: FrozenlemonTee <1115306170@qq.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an algorithms module layer (starting with limits and hash) and refactors existing modules to consume this shared “value metadata” API instead of directly using std::numeric_limits, with new basic tests to validate behavior for built-in and custom underlying types.
Changes:
- Add
mcpplibs.primitives.algorithmsmodule withlimitsandhashfacilities. - Refactor
operations::invokerandconversion::underlyingto usealgorithms::{min,max,lowest}_valueandalgorithms::limits. - Add new basic test suites for
algorithms/limitsandalgorithms/hash, and wire them into the basic test CMake.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/basic/algorithms/limits/test_limits.cpp | Adds unit tests for algorithms::limits on builtin + custom underlying types. |
| tests/basic/algorithms/hash/test_hash.cpp | Adds unit tests for algorithms::hash/hash_value on builtin + custom underlying types. |
| tests/basic/CMakeLists.txt | Adds basic_algorithms_tests suite and includes it in basic_tests dependencies. |
| src/primitives.cppm | Re-exports the new mcpplibs.primitives.algorithms module from the umbrella module. |
| src/operations/invoker.cppm | Replaces std::numeric_limits usage with algorithms limit queries for overflow/shift checks. |
| src/conversion/underlying.cppm | Replaces std::numeric_limits usage with algorithms limit queries in risk/cast logic. |
| src/algorithms/limits.cppm | Introduces algorithms::limits and {min,lowest,max,epsilon,infinity,quiet_nan}_value APIs. |
| src/algorithms/hash.cppm | Introduces algorithms::hash, hashable, and hash_value, including an underlying-type adapter. |
| src/algorithms/algorithms.cppm | Adds the mcpplibs.primitives.algorithms aggregator module exporting hash + limits. |
| .agents/docs/plans/implementation-plan.md | Updates internal implementation plan with clarified layering/dependency direction. |
…ed hashing functionality Signed-off-by: FrozenlemonTee <1115306170@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.