Does std::set support any method that returns the number of elements that are lower than a given element?
I know that we have lower_bound that returns the iterator to the lower bound of the given element; but it does not return to me the number of elements before a given element.
I know that I can iterate from the beginning to the lower bound iterator; but this will take O(n) time in the worst case. Do we have a method that does this in O(logn)?