When should I choose one over the other? Are there any pointers that you would recommend for using the right STL containers?
stl::set
is implemented as a binary search tree.
hashset
is implemented as a hash table.
The main issue here is that many people use stl::set
thinking it is a hash table with look-up of O(1), which it isn't, and doesn't have. It really has O(log(n)) for look-ups. Other than that, read about binary trees vs hash tables to get a better idea of the data structures.