I do not know the specific ones, since they will depend on your implementation of std::set , however, two comparisons are required to determine the equality of two elements, since it is based on the fact that not (x < y) and not (y < x) implies x == y .
Depending on how the tree is optimized, you can thus make the first comparison to determine whether it should go left or right, and then two comparisons to check whether it is equal or not.
The standard has no requirement, except that the number of comparisons is O (log N), where N is the number of elements already in set . Constant factors are the quality of the implementation problem.
source share