3 ms·
It’s unfortunately not just ABI, but also API. The standard specifies that you can get iterations to specific buckets in O(1)[1], and also specifies bucket_coun
by alexhutcheson 7y ago
It’s unfortunately not just ABI, but also API. The standard specifies that you can get iterations to specific buckets in O(1)[1], and also specifies bucket_count(), max_bucket_count(), bucket_size() (which is specified to be O(n)), and bucket(). Those functions and their specified performance make it effectively impossible to implement a standards-compliant std::unordered_map without using separate chaining.
[1] https://en.cppreference.com/w/cpp/container/unordered_map/begin2 https://en.cppreference.com/w/cpp/container/unordered_map/be...
- SamReidHughes 7y agoYou can just remove those functions. The real problem is that the API break would invalidate iterators and create undefined behavior.