Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
493bcc8
feat: Add additional concept types for enhanced type classification
FrozenLemonTee Mar 24, 2026
df2056a
refactor: Remove deprecated aliases in traits module for cleaner code
FrozenLemonTee Mar 24, 2026
3e107e3
refactor: Remove legacy primitive traits namespace aliases for cleane…
FrozenLemonTee Mar 24, 2026
6cfafdd
test: Add tests for meta primitive-like concepts and type classificat…
FrozenLemonTee Mar 24, 2026
a0f1bb9
refactor: Reduce dependencies between modules
FrozenLemonTee Mar 24, 2026
dda96c7
feat: Introduce concepts for primitive and underlying operands
FrozenLemonTee Mar 24, 2026
6dae8d1
refactor: Simplify operator templates by removing redundant underlyin…
FrozenLemonTee Mar 24, 2026
0677d7d
feat: Add conversion module with traits and safe numeric casting func…
FrozenLemonTee Mar 24, 2026
b7a68ee
feat: Introduce concepts for integral and numeric types with static c…
FrozenLemonTee Mar 24, 2026
86c460b
refactor: Move to_error_payload function to the main namespace and re…
FrozenLemonTee Mar 24, 2026
e9394d1
refactor: Enhance conversion module with error handling and safe nume…
FrozenLemonTee Mar 24, 2026
38cfbc4
refactor: Introduce custom numeric concepts for enhanced type compati…
FrozenLemonTee Mar 24, 2026
7db3b61
refactor: Enhance numeric casting functions with additional risk asse…
FrozenLemonTee Mar 24, 2026
f92bfc0
refactor: Update numeric conversion functions to improve error handli…
FrozenLemonTee Mar 24, 2026
cb9a995
refactor: Replace safe_numeric_cast with saturating_cast for improved…
FrozenLemonTee Mar 24, 2026
b27c7e4
refactor: Consolidate risk assessment functions into a single numeric…
FrozenLemonTee Mar 25, 2026
3bb88a9
refactor: Simplify conditions in numeric cast functions for clarity
FrozenLemonTee Mar 25, 2026
fe7e657
refactor: Simplify namespace usage
FrozenLemonTee Mar 25, 2026
1157f9b
refactor: Simplify namespace structure for numeric conversion functions
FrozenLemonTee Mar 25, 2026
caf2d13
refactor: Update numeric concepts to use underlying type constraints
FrozenLemonTee Mar 25, 2026
423e8d9
refactor: Remove unnecessary include of <concepts> in underlying.cppm
FrozenLemonTee Mar 25, 2026
67001fe
test: Add unit tests for numeric conversion functions and risk detection
FrozenLemonTee Mar 25, 2026
804dd03
refactor: Refine redundant code
FrozenLemonTee Mar 25, 2026
ae18a81
refactor: Remove irrelevant files
FrozenLemonTee Mar 25, 2026
0e1c01c
chore: Add .vscode to .gitignore
FrozenLemonTee Mar 25, 2026
4faf000
ci: Update Windows CI configuration to extend timeout and improve bui…
FrozenLemonTee Mar 25, 2026
1825132
refactor: Rename 'kind' to 'code' in traits struct for clarity
FrozenLemonTee Mar 25, 2026
77d704a
refactor: Update imports in test files for explicit conversion modules
FrozenLemonTee Mar 25, 2026
60cf921
refactor: Update import statements and add new tests for underlying o…
FrozenLemonTee Mar 25, 2026
8b7d8f8
refactor: Update numeric risk templates to use std_integer and std_fl…
FrozenLemonTee Mar 25, 2026
b548af0
refactor: Enhance test suite configuration for better organization an…
FrozenLemonTee Mar 26, 2026
434aac5
test: Split basic tests trying to resolve issue#17
FrozenLemonTee Mar 26, 2026
ef46808
refactor: Simplify import statements in conversion modules for issue#17
FrozenLemonTee Mar 26, 2026
99240ba
refactor: Trying to resolve issue#17
FrozenLemonTee Mar 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:

build-windows:
runs-on: windows-latest
timeout-minutes: 20
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -96,13 +96,13 @@ jobs:
xmake-version: latest
package-cache: true

- name: Build
- name: Build and test
run: |
xmake f -m release -y -vv
xmake -y -vv -j$env:NUMBER_OF_PROCESSORS
xmake f -m release --ccache=n -y -vv
xmake b -y -vv -j2 primitives_test
xmake run primitives_test

- name: Test
run: xmake run primitives_test

- name: Run examples
run: xmake run basic
- name: Build and run basic example
run: |
xmake b -y -vv -j2 basic
xmake run basic
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ Makefile
# IDE
/.idea
/.cache
/.vscode
6 changes: 6 additions & 0 deletions src/conversion/conversion.cppm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module;

export module mcpplibs.primitives.conversion;

export import mcpplibs.primitives.conversion.traits;
export import mcpplibs.primitives.conversion.underlying;
34 changes: 34 additions & 0 deletions src/conversion/traits.cppm
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module;

#include <expected>
#include <optional>

export module mcpplibs.primitives.conversion.traits;

export namespace mcpplibs::primitives::conversion::risk {

enum class kind : unsigned char {
none = 0,
overflow,
underflow,
domain_error,
precision_loss,
sign_loss,
invalid_type_combination,
};

template <typename Value>
struct traits {
kind code = kind::none;
std::optional<Value> source_value{};
std::optional<Value> converted_value{};
};

} // namespace mcpplibs::primitives::conversion::risk

export namespace mcpplibs::primitives::conversion {

template <typename Value>
using cast_result = std::expected<Value, risk::kind>;

} // namespace mcpplibs::primitives::conversion
Loading
Loading