Say I have
std::set<classtype> set;
class classtype {
bool operator==(const classtype& ct) {
//..
}
};
//..
std::set<classtype>::iterator it = set.find(element);
Find does use the == operator from the class correct?
Also my reference says it has log(n) worst case runtime where n is the number of elements in the set. How is this realized internally? I understand that the key is that the elements in the set have a order (so insertion takes long to create that order), for integer sets it is clear what order means but for random classes not so much.