I want to implement the logic of std::set in c++, for example (example is different from the std::set) in the sort function you can pass additional parameter which is a boolean function name, the function decides on which base to sort the array/vector/etc...
Internally, the elements in a set are always sorted following a specific strict weak ordering criterion indicated by its internal comparison object (of type Compare).