Closed justusranvier closed 1 year ago
Thanks for this patch! I try to stick to std::
api for frozen, and to my knowledge, invert_unordered_map
is not a standard function and it probably makes sense to keep it in client code.
If more functions like this are contributed, we could imagine a frozen_extra
repo?
Inverting a map is a common operation and it doesn't make sense to me that everybody who needs to do it should have to write their own function for it.
If it's not something you want in your repo though it's not the end of the world.
If more functions like this are contributed, we could imagine a frozen_extra repo?
Would you accept an updated version of this pull request if the function was placed in a new header frozen/contrib/invert.h
?
The contrib directory could allow for other functions to be added in the future which are not part of the official api but still get packaged together for ease of testing and distribution.
Creates a (value, key) map from an existing (key, value) map.