Closed lrita closed 2 months ago
We can use values() API to get the finally underlying vector in some efficient scenes:
auto map = map_t(); for (...) map.emplace(...); auto vec = std::move(map).values(); std::sort(vec.begin(), vec.end(), [](...) { ... }); if (vec.size() > topn) vec.resize(topn); for (auto &v : vec) ...;
There is already std::move(map).extract():
std::move(map).extract()
https://github.com/martinus/unordered_dense/blob/d911053e390816ecc5dedd5a9d6b4bb5ed92b4c9/include/ankerl/unordered_dense.h#L1411-L1415
We can use values() API to get the finally underlying vector in some efficient scenes: