-
Notifications
You must be signed in to change notification settings - Fork 272
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
roaring64: Add add_range, remove_range, contains_range, and flip #568
Conversation
These are the open versions of `roaring64_bitmap_add_range_closed` and `roaring64_bitmap_remove_range_closed`.
d90f216
to
79184a2
Compare
We are getting failures under Visual Studio. I could have a look if you cannot figure it out. |
It's only failing on win32, I think I'm probably missing a size specifier somewhere. If you could take a look that sounds great. |
The problem is with (Practically, |
That seems to have done it, thanks! |
Ooof, that seems like a pretty big footgun. Thoughts on something like #define roaring64_bitmap_of(n_args, ...) \
roaring64_bitmap_of_ptr((n_args), (const uint64_t[]){__VA_ARGS__}) |
Oh, or better: #define roaring64_bitmap_of(...) \
roaring64_bitmap_of_ptr((sizeof((const uint64_t[]){__VA_ARGS__}) / sizeof(uint64_t)), (const uint64_t[]){__VA_ARGS__}) No need to pass a number of args at all. And while |
This sounds great (and easier to use), though it's a departure from the 32-bit API which could result in accidental misuse. Given that the 32-bit version is as it is, it would be better to keep them uniform IMO. Your initial proposal sounds good to me, happy to do that in a separate PR. |
I agree, we can't have the 64 bit and 32 bit one different, and even with a major version bump, we can't change the behavior in such a way that would still compile but do something very different. I can't even come up with a good name for the automatic sizing one, if we wanted to include it too, |
@Dr-Emann |
I can do the PR for adding |
This implements the following new functions:
roaring64_bitmap_add_range
roaring64_bitmap_remove_range
roaring64_bitmap_contains_range
roaring64_bitmap_flip
roaring64_bitmap_flip_inplace
roaring64_bitmap_flip_closed
roaring64_bitmap_flip_closed_inplace