You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the unique characteristics of BijectiveDictionary, think about features that would be useful in general-purpose applications and consider which should be added. For example, the bimap crate in Rust (which implements a bijective dictionary) includes an insert method that informs the caller if any existing entry was overwritten during the insertion.
The text was updated successfully, but these errors were encountered:
Agreed. That functionality would be very useful. IdentifiedArray has something similar where it will inform you if the item was successfully inserted or not. It might be worth it to draw inspiration from this API, so that we don't have to reinvent the wheel. (Or there might be an example in the standard library or Swift Collections, that would be better to follow).
Also, part of me would like to be able to declare at the call site, if it is okay to override. If I don't want it to override, and if the element already exists, then it will not insert, and it will let me know the result.
Something like bijectiveDictionary.insert(left: element, override: true)
ladvoc
changed the title
Consider Useful Features
Consider useful features
Sep 8, 2024
Given the unique characteristics of BijectiveDictionary, think about features that would be useful in general-purpose applications and consider which should be added. For example, the bimap crate in Rust (which implements a bijective dictionary) includes an insert method that informs the caller if any existing entry was overwritten during the insertion.
The text was updated successfully, but these errors were encountered: