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
Is your feature request related to a problem? Please describe.
Sometimes we want to insert/find key types that may be different from the static_map::key_type. To support that today, we allow specifying a custom and independent key_equal and hash operations for insert and find. This is potentially quite problematic as it allows passing in different and conflicting notions of hashing and equality that could be incompatible and lead to undefined behavior.
A cleaner way to support the usecase of doing insert/find operations with different key types is via "heterogenous lookup".
In this way, the KeyEqual and Hash types would be specified only once as part of the static_map class template types, but it would allow those function's operators to be templates. This should require explicit user opt-in using the is_transparent trait.
Is your feature request related to a problem? Please describe.
Sometimes we want to insert/find key types that may be different from the
static_map::key_type
. To support that today, we allow specifying a custom and independentkey_equal
andhash
operations forinsert
andfind
. This is potentially quite problematic as it allows passing in different and conflicting notions of hashing and equality that could be incompatible and lead to undefined behavior.Describe the solution you'd like
A cleaner way to support the usecase of doing insert/find operations with different key types is via "heterogenous lookup".
In this way, the
KeyEqual
andHash
types would be specified only once as part of thestatic_map
class template types, but it would allow those function's operators to be templates. This should require explicit user opt-in using theis_transparent
trait.#26 (comment)
The text was updated successfully, but these errors were encountered: