r/cpp • u/BgA_stan • May 03 '26
When to actually use a set
https://dubeykartikay.com/posts/why-never-use-std-unordered-set/reposted with a different title, as i got feedback the previous title was clickbait
21
Upvotes
View all comments
Show parent comment
-23
u/BgA_stan May 03 '26
Fair point, the title is intentionally punchy. The actual rule I’m arguing for is: don’t reach for
std::unordered_setby default just because the abstraction is “a set.” (which is no joke what i was taught in class). I tried to supplement that with real numbers showing exactly when you actually should