Skip to content

Add literal operators, factory functions, and tests for primitives#20

Merged
FrozenLemonTee merged 14 commits intomainfrom
refactor-alias-factory-literals
Mar 27, 2026
Merged

Add literal operators, factory functions, and tests for primitives#20
FrozenLemonTee merged 14 commits intomainfrom
refactor-alias-factory-literals

Conversation

@FrozenLemonTee
Copy link
Copy Markdown
Member

No description provided.

…h range checks

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

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

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

Signed-off-by: FrozenlemonTee <1115306170@qq.com>
Signed-off-by: FrozenlemonTee <1115306170@qq.com>
Signed-off-by: FrozenlemonTee <1115306170@qq.com>
Signed-off-by: FrozenlemonTee <1115306170@qq.com>
Copilot AI review requested due to automatic review settings March 27, 2026 03:27
Copy link
Copy Markdown
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 adds user-defined literal operators for common underlying types and introduces with(...) factory helpers plus Size/Diff primitive aliases, with basic tests to validate the new APIs.

Changes:

  • Add mcpplibs::primitives::literals user-defined literals for integral, floating, and character underlying types.
  • Add with(...) primitive factory functions (including a policies-tuple overload) and types::Size / types::Diff aliases.
  • Add basic test coverage for both literals and the with(...) factory behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/basic/underlying/literals/test_literals.cpp Adds tests validating literal operator return types and values.
tests/basic/primitive/factory/test_make_primitive.cpp Adds tests for with(...) factory helpers, default policies, tuple-policies overload, and new Size/Diff aliases.
src/underlying/impl.cppm Implements exported literal operators and compile-time range checks for casts.
src/primitive/traits.cppm Refactors make_primitive into meta::details and keeps make_primitive_t as the exported alias.
src/primitive/impl.cppm Adds with(...) factory functions and types::Size / types::Diff primitive aliases.

…terals module

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

Signed-off-by: FrozenlemonTee <1115306170@qq.com>
…nd precision validation

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

Signed-off-by: FrozenlemonTee <1115306170@qq.com>
@FrozenLemonTee FrozenLemonTee requested a review from Copilot March 27, 2026 04:30
@FrozenLemonTee FrozenLemonTee merged commit 4d89252 into main Mar 27, 2026
3 checks passed
@FrozenLemonTee FrozenLemonTee deleted the refactor-alias-factory-literals branch March 27, 2026 05:01
Copy link
Copy Markdown
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 7 out of 7 changed files in this pull request and generated 1 comment.

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