Daily bit(e) of C++ | Ordered containers: std::(multi_)map, std::(multi_)set
Daily bit(e) of C++ #372, Containers that maintain the elements ordered based on strict-weak ordering: std::(multi_)map, std::(multi_)set.
The ordered containers std::(multi_)set and std::(multi_)map are node-based containers that offer log(n) operation complexity for lookup, insertion and removal.
As with other node-based containers, we pay for the reference and iterator stability with performance.
Due to a relatively low constant overhead, ordered containers can sometimes outperform unordered containers.