Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitwise assignment operators + tests #72

Closed
wants to merge 3 commits into from

Conversation

GNL10
Copy link

@GNL10 GNL10 commented Mar 19, 2023

This PR uses the code implemented here and added tests to it.

arenbecl and others added 3 commits December 15, 2020 18:12
This pull adds the assignment operators for the bitwise operators open feature request, as well as my own take on the base operators.
Removed from the end of 13 various functions
{
throw std::invalid_argument("Operator '~' is undefined on negative operand");
}
else if(*this == 0)
Copy link
Author

Choose a reason for hiding this comment

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

This was a quick fix, but in reality when we want to do ~0, we need to know how many bits we are working with, since
~0x0000 = 0xFFFF or ~0x0 =0xF.
So it seems that we have an undefined behavior here. How should I proceed?
Maybe this should case should also yield an exception.

@GNL10
Copy link
Author

GNL10 commented May 7, 2023

Closing for lack of response.

@GNL10 GNL10 closed this May 7, 2023
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