This has nothing to do with your Comparator , and anything related to std::set that does not meet the requirements of the SequenceContainer , you can use vector or deque or write your own SequenceContainer , making sure front , push_back and pop_back , and iterator implemented, which are RandomAccessIterator
source share