boostorg / unordered

Boost.org unordered module
http://boost.org/libs/unordered
Boost Software License 1.0
63 stars 55 forks source link

Feature Request: unordered_flat_map should support transparent operator[]&Co. #180

Closed J-Richter closed 1 year ago

J-Richter commented 1 year ago
unordered_flat_map<string,string> m;
string_view key;
m[key] = "";  // does not work
m.insert_or_assign( key, "" );  // does not work

I'd like to replace our usage of absl::flat_hash_map with boost::unordered_flat_map. But this missing functions cannot be simulated without performance losses.

cmazakas commented 1 year ago

This missing overload was described in P2363 here: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r4.html

We've implemented this here: https://github.com/boostorg/unordered/pull/177

This was, unfortunately, done after the 1.81 release but the code is on the develop/master branch. So, if you can't wait until 1.82, you can safely use the code from develop or master in the interim.

cmazakas commented 1 year ago

This is coming in 1.82. Going to mark as closed now.