Skip to content

Fix merger rules of policies group issue#12

Merged
FrozenLemonTee merged 28 commits intomainfrom
fix-merger-rules-of-policies-group
Mar 22, 2026
Merged

Fix merger rules of policies group issue#12
FrozenLemonTee merged 28 commits intomainfrom
fix-merger-rules-of-policies-group

Conversation

@FrozenLemonTee
Copy link
Member

PR changes:

…g type strategies for the rules of underlying negotiation in double primitive types
Copilot AI review requested due to automatic review settings March 22, 2026 03:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the primitives framework’s policy resolution/negotiation rules and expands the operations surface to support mixed primitive/underlying operands, adding ThreeWayCompare and compound-assignment support alongside additional compile-time consistency checks.

Changes:

  • Enforce “policy group” consistency after default completion (value/type/error/concurrency) and tighten type negotiation rules (non-void common_rep, compatible requires same underlying category).
  • Add mixed operand overloads for operations (primitive ↔ underlying), add ThreeWayCompare, and implement compound assignment operators via dispatcher-based apply_assign.
  • Add cross-underlying constructors/assignments/store/CAS for primitive, and refactor exported trait APIs (traitsmeta, primitive_traitsmeta::traits).

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/basic/test_templates.cpp Adds custom underlying/common-rep test cases, including a void common-rep scenario.
tests/basic/test_operations.cpp Adds tests for cross-underlying construction/store/CAS, mixed operand operations, three-way compare, and compound assignment.
src/primitive/traits.cppm Refactors exported primitive traits into mcpplibs::primitives::meta.
src/primitive/impl.cppm Implements cross-underlying primitive constructors/assignments/store/CAS and adds an explicit disabled underlying::traits specialization for primitive.
src/policy/utility.cppm Centralizes resolve_policy_t with “at most one policy per category” enforcement.
src/policy/impl.cppm Tightens type-policy checks (same category for compatible, non-void common rep) and adds integral narrowing helper.
src/operations/operators.cppm Adds mixed operand overloads, three-way compare API, and compound-assignment implementation.
src/operations/invoker.cppm Implements three-way compare evaluation and binds it for all value policies.
src/operations/impl.cppm Introduces the ThreeWayCompare operation tag and traits.
src/operations/dispatcher.cppm Switches to meta::traits, enforces policy-group consistency, and asserts non-void common rep when allowed.
.github/prompts/plan-policyBehaviorProtocol.prompt.md Updates the design/plan document to match the new constraints and overload goals.
.github/copilot-instructions.md Minor documentation update referencing the prompts directory.

…nversions

Signed-off-by: FrozenlemonTee <1115306170@qq.com>
…fety

Signed-off-by: FrozenlemonTee <1115306170@qq.com>
Signed-off-by: FrozenlemonTee <1115306170@qq.com>
…imitive types

Signed-off-by: FrozenlemonTee <1115306170@qq.com>
… and ensure legacy aliases remain available

Signed-off-by: FrozenlemonTee <1115306170@qq.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 8 comments.

@FrozenLemonTee FrozenLemonTee merged commit 99f3f2a into main Mar 22, 2026
7 checks passed
@FrozenLemonTee FrozenLemonTee deleted the fix-merger-rules-of-policies-group branch March 22, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants