-
Notifications
You must be signed in to change notification settings - Fork 5
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
BitwiseNot issue #10
Comments
@clemexjeap That is what bitwise not is supposed to do. You should get the equivalent of |
Sorry, I accidentally sent that too early. You are interested in a non-bitwise operation. It would be possible to add that as a new feature. |
That would be nice. The idea is just to "NOT" all the flags |
Convenience to invert all flags on an enum. Fixes arogozine#10.
So, one way to do that is to have an “All” flag like you have and do a bitwise exclusive OR against that. Many flags enums do not have such an All member and there’s no way to really correctly automatically determine what this is. So the strategy my PR uses is to OR all of the flags together and then to AND that with the NOT of your enum. Maybe I should have just fixed that to use XOR… But, anyway, it’s a start and at least works for your use case. |
Sounds good to me. One other nice to have: // Determine if multiple flags are set |
@clemexjeap I do not understand how that would be helpful. Did you actually mean to pass two arguments to Please open a new issue with a description of what that is and what utility it has. We can discuss it further and, if it seems useful to me, I could prototype an implementation. P.S., as it is, I am not sure if this library is even going to accept my PR or if a new release will be published to NuGet for my PR. This library has two purposes:
On the new dotnet core framework, the method used by this library to attain high performance actually results in lower performance. So the library author has less motivation to continue updating it. I personally think that having the type-safe wrapper for enum manipulation is useful, even if high performance cannot be achieved. But, yeah, this just isn’t as active anymore. @arogozine Do you have an idea of if you can check these things out someday? ;-) |
Thanks for your comment @binki. For the IsCombinedFlag() thing. I would like to know if multiple flags (bits) are set. Sorry my previous example was wrong |
Convenience to invert all flags on an enum. Fixes arogozine#10.
I have an enum like this:
if I do:
I would expect "notResult" to be AxesMask.X | AxesMask.Z;
but instead I get -11 ???
Is that a known issue?
Is there a work around?
The text was updated successfully, but these errors were encountered: