map.h 944 B

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "fwd.h"
  3. #include "mapfindptr.h"
  4. #include <util/str_stl.h>
  5. #include <util/memory/alloc.h>
  6. #include <utility>
  7. #include <initializer_list>
  8. #include <map>
  9. #include <memory>
  10. template <class K, class V, class Less, class A>
  11. class TMap: public std::map<K, V, Less, TReboundAllocator<A, std::pair<const K, V>>>, public TMapOps<TMap<K, V, Less, A>> {
  12. using TBase = std::map<K, V, Less, TReboundAllocator<A, std::pair<const K, V>>>;
  13. public:
  14. using TBase::TBase;
  15. inline explicit operator bool() const noexcept {
  16. return !this->empty();
  17. }
  18. };
  19. template <class K, class V, class Less, class A>
  20. class TMultiMap: public std::multimap<K, V, Less, TReboundAllocator<A, std::pair<const K, V>>> {
  21. using TBase = std::multimap<K, V, Less, TReboundAllocator<A, std::pair<const K, V>>>;
  22. public:
  23. using TBase::TBase;
  24. inline explicit operator bool() const noexcept {
  25. return !this->empty();
  26. }
  27. };