-
Notifications
You must be signed in to change notification settings - Fork 4
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
Support multiway_union, etc., with iterators of different types #7
Comments
With this macro (and the stuff above):
Uses can do this:
|
[I updated the previous comment to simplify the macro and fix the example] |
Isn't DynSortedByItem basically Is the output of multiway_union strictly sorted, or just sorted? |
I tried to extend examples/set.rs to work with just Box, but can't get it to work: doesn't compile
The current code in sorted_iterators.rs says:
|
By the way, I mention sorted-iter as an inspiration in an article about Rust data structures: |
After a few days of puzzling over this, I think I have a solution to union over multiple types. Here is an example of it working:
It works by using a DynamicSortedByItem struct (modeled on AssumeSortedByItem):
If you like this, let me know if you'd like to finish the 'todos' and submit it as a pull request or if you'd rather do it.
Thanks!
Carl
The text was updated successfully, but these errors were encountered: