r/cpp • • 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

33 comments sorted by

View all comments

Show parent comment

2

u/justmebeky May 03 '26

Yep, unordered_set is a very general purpose data structure, you can always do something more optimized if you add a constraint to your problem like dense values, which bitset is specially optimized for