Add a value to BiHashMap
Opened this issue · 0 comments
alexkazik commented
I've created a version which is able to store a value (in addition to the two keys):
https://github.com/alexkazik/bimap-rs/tree/set-and-map
This approach renames BiHashMap to BiHashSet (since it contains no value) and adds a BiHashMap (sorry for the confusion).
The map has functions like:
- get_value_by_left()
- get_mut_value_by_left()
- get_key_value_by_left()
- iter_mut()
And all insert and similar functions are now accept a value in addition to the keys.
As a followup commit the set instance is based on the map (with value ()), like HashSet.
All existing tests, and the doc-tests for map are working (no full test-suite for map).
I don't know if basing Set on Map will have any performance or other issues.
Unfortunately I won't be using it in my project so I don't know if I'll continue working on this approach.
Feel free to use as much as you want.