Iteration over the elements in a std::set goes in sorted order, as specified by std::less or the optional comparison predicate template parameter, according to the C++ standard.
(Also, according to the C++ standard, insertion, lookup, and deletion all take at most O(lg n) time, therefore balanced search trees are presently the only possible implementation choice for std::set, even if the usage of red-black trees is not required.)