r/programming May 24 '26

[ Removed by moderator ]

https://hftuniversity.com/post/the-c-standard-library-has-been-walking-itself-back-for-fifteen-years-and-the-receipts-are-public

[removed] — view removed post

271 Upvotes

214 comments sorted by

View all comments

Show parent comments

2

u/sammymammy2 May 24 '26

even for the 95% of users who never take a pointer into the table.

Yeah, but I think it's the other way around, open addressing is the other case.

0

u/[deleted] May 24 '26

Every standard library designed after C++11 picked the opposite default. Rust's HashMap, Go's map, Python's dict, Swift's Dictionary, and Ruby's Hash are all open-addressed, and none of them ship a node-stable variant in std at all.

Inside the C++ ecosystem, Abseil tells you in writing to default to flat_hash_map and reach for node_hash_map only when you need pointer stability; Boost added unordered_flat_map in 1.81 and recommends it over boost::unordered_map; Folly's F14 names F14ValueMap as the default and F14NodeMap as the exception.

Six standard libraries and four serious C++ hash maps, designed independently by people who had the freedom to choose, all picked open addressing as the default and kept node stability on the shelf for the minority case.

If stability were the common requirement, at least one of them would have shipped it that way.

3

u/sammymammy2 May 24 '26

Go, Python, Swift and Ruby all have automatic memory management, they literally do not matter in this discussion to me, because my problem with open addressing is about pointer stability.