#pragma once #ifndef ORDERED_SET_H #define ORDERED_SET_H #include #include template class OrderedSet : public std::set { using std::set::set; public: // Not introduced to std::set until C++20 #if __cplusplus < 202002L bool contains(const T& value) const { return this->find(value) != this->end(); } #endif QSet toQSet() const { return QSet(this->begin(), this->end()); } static QSet fromQSet(const QSet& set) { return OrderedSet(set.begin(), set.end()); } bool isEmpty() const { return this->empty(); } }; #endif // ORDERED_SET_H