-
-
Notifications
You must be signed in to change notification settings - Fork 97
Description
Is your feature request related to a problem? Please describe.
I have a map that is parsed from a string that contains a few dozen key->value pairs. The data isn't fixed, so some keys may be there, or may not. However the keys I'm interested in are always the same, I just use string literals for them. Computing a fresh hash on every lookup feels expensive. Would be nice to have a way to do something like
set.find(precomputed_hash,key)
and
map.find(precomputed_hash,key)
Describe the solution you'd like
Ideally something that's syntactically nice, but I'd be happy to be able to just have a precomputed const hash at startup and use it for the lookup. Maybe the integrated ankerl std::string hash could be made constexpr as well? But that's not so important.
Describe alternatives you've considered
Idk
Additional context