Refactor tests and add unary/binary operations with error handling#13
Merged
FrozenLemonTee merged 8 commits intomainfrom Mar 22, 2026
Merged
Refactor tests and add unary/binary operations with error handling#13FrozenLemonTee merged 8 commits intomainfrom
FrozenLemonTee merged 8 commits intomainfrom
Conversation
….cpp for clarity Signed-off-by: FrozenlemonTee <1115306170@qq.com>
…ations Signed-off-by: FrozenlemonTee <1115306170@qq.com>
… bitwise operations, and unary operations Signed-off-by: FrozenlemonTee <1115306170@qq.com>
…tions Signed-off-by: FrozenlemonTee <1115306170@qq.com>
…signments and error reporting Signed-off-by: FrozenlemonTee <1115306170@qq.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the primitives operations framework to support additional unary and binary operators (with policy-based error handling) and adds/reshapes tests around underlying traits and operations dispatch.
Changes:
- Added unary operations (++, --, unary +/-, ~) and additional binary/compound operators (%, <<, >>, &, |, ^) wired through the dispatcher.
- Extended the value-policy invoker to implement checked/unchecked/saturating behavior for the new operations.
- Added a new underlying/traits-focused test suite and extended operations tests for the new operators and error paths.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/basic/test_underlying.cpp | New test suite for underlying traits, custom reps, and common-rep negotiation behavior. |
| tests/basic/test_operations.cpp | Adds tests verifying unary/binary operator overloads and expected error reporting for modulus/shift. |
| src/operations/operators.cppm | Adds public operations APIs and C++ operator overloads for new unary/binary/assignment operators. |
| src/operations/invoker.cppm | Implements checked/unchecked/saturating runtime bindings for newly introduced operations. |
| src/operations/impl.cppm | Defines new operation tags and their trait metadata (arity/capability). |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… compatibility Signed-off-by: FrozenlemonTee <1115306170@qq.com>
… apply function 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.