Skip to content

Add signed types - #368

Open
AmmoniumX wants to merge 14 commits into
chfast:mainfrom
AmmoniumX:add-signed-types
Open

Add signed types#368
AmmoniumX wants to merge 14 commits into
chfast:mainfrom
AmmoniumX:add-signed-types

Conversation

@AmmoniumX

Copy link
Copy Markdown

See #112

This PR aims to add signed variants for custom integers as a wrapper over the unsigned types, using two's complement

@AmmoniumX
AmmoniumX marked this pull request as ready for review April 10, 2026 22:17
@sonarqubecloud

Copy link
Copy Markdown

@AmmoniumX

Copy link
Copy Markdown
Author

@chfast the PR is ready for review. The failed tests are false negatives since Clang warns of using "delete with a message" as a C++26 extension but we are already guarding against that with the INTX_DELETE macro. Let me know if you want any changes :)

@AmmoniumX

Copy link
Copy Markdown
Author

@chfast sorry for the ping, have you been able to take a look at the PR?

@chfast chfast left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Hey, I only did a quite overview. This PR adds too many things at the same time. We need to split these into multiple PRs (e.g. future C++ standards, basic sint type: wrapper + reuse of the compatible two's complement operators, other signed operators).

@AmmoniumX

AmmoniumX commented Jun 14, 2026

Copy link
Copy Markdown
Author

Hey, I only did a quite overview. This PR adds too many things at the same time. We need to split these into multiple PRs (e.g. future C++ standards, basic sint type: wrapper + reuse of the compatible two's complement operators, other signed operators).

I understand, I mainly added the reusable methods to address the automated quality control checks regarding code duplication. Just so I'm clear, do you want me to remove the newer C++ standard features as well as the reusable methods for now, and just focused the PR on making signed integers available, regardless of potential code duplication?

Comment thread include/intx/intx.hpp Outdated
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
4.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@AmmoniumX

AmmoniumX commented Jun 15, 2026

Copy link
Copy Markdown
Author

@chfast I have removed the unrelated changes from this PR so they can be added to a different PR at another time. This PR now focuses solely on adding a signed integer type, "wrapping" over the base unsigned type operators when logical

The failing tests seem unrelated to this PR, besides the code duplication warning (can be solved in a future PR by adding back some of the refactors)

@AmmoniumX

Copy link
Copy Markdown
Author

@chfast let me know what you think about it now, I removed the unrelated changes. The signed type behaves as a "wrapper" using the underlying unsigned type's operators where they make sense to.

@AmmoniumX

Copy link
Copy Markdown
Author

@chfast let me know if you want any further changes to this PR, I'm down to further refine this until you find it satisfactory 👍

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