C++ sets (i.e. std::set
) are usually implemented as red-black trees. They are self balancing.
However it is implemented, your suggestion that the set would become more like a list cannot happen, because the standard makes complexity guarantees which cannot be fulfilled by a list.