set.h 734 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include "fwd.h"
  3. #include <util/str_stl.h>
  4. #include <util/memory/alloc.h>
  5. #include <initializer_list>
  6. #include <memory>
  7. #include <set>
  8. template <class K, class L, class A>
  9. class TSet: public std::set<K, L, TReboundAllocator<A, K>> {
  10. public:
  11. using TBase = std::set<K, L, TReboundAllocator<A, K>>;
  12. using TBase::TBase;
  13. inline explicit operator bool() const noexcept {
  14. return !this->empty();
  15. }
  16. };
  17. template <class K, class L, class A>
  18. class TMultiSet: public std::multiset<K, L, TReboundAllocator<A, K>> {
  19. public:
  20. using TBase = std::multiset<K, L, TReboundAllocator<A, K>>;
  21. using TBase::TBase;
  22. inline explicit operator bool() const noexcept {
  23. return !this->empty();
  24. }
  25. };