| 79 | class ValueTypeContainer = std::deque<Key, Allocator>, |
| 80 | class IndexType = std::uint_least32_t> |
| 81 | class ordered_set { |
| 82 | private: |
| 83 | template <typename U> |
| 84 | using has_is_transparent = tsl::detail_ordered_hash::has_is_transparent<U>; |
| 85 | |
| 86 | class KeySelect { |
| 87 | public: |
| 88 | using key_type = Key; |
| 89 | |
| 90 | const key_type& operator()(const Key& key) const noexcept { return key; } |
| 91 | |
| 92 | key_type& operator()(Key& key) noexcept { return key; } |
| 93 | }; |
| 94 | |
| 95 | using ht = detail_ordered_hash::ordered_hash<Key, KeySelect, void, Hash, |
| 96 | KeyEqual, Allocator, |
| 97 | ValueTypeContainer, IndexType>; |
| 98 | |
| 99 | public: |
| 100 | using key_type = typename ht::key_type; |
| 101 | using value_type = typename ht::value_type; |
| 102 | using size_type = typename ht::size_type; |
| 103 | using difference_type = typename ht::difference_type; |
| 104 | using hasher = typename ht::hasher; |
| 105 | using key_equal = typename ht::key_equal; |
| 106 | using allocator_type = typename ht::allocator_type; |
| 107 | using reference = typename ht::reference; |
| 108 | using const_reference = typename ht::const_reference; |
| 109 | using pointer = typename ht::pointer; |
| 110 | using const_pointer = typename ht::const_pointer; |
| 111 | using iterator = typename ht::iterator; |
| 112 | using const_iterator = typename ht::const_iterator; |
| 113 | using reverse_iterator = typename ht::reverse_iterator; |
| 114 | using const_reverse_iterator = typename ht::const_reverse_iterator; |
| 115 | |
| 116 | using values_container_type = typename ht::values_container_type; |
| 117 | |
| 118 | /* |
| 119 | * Constructors |
| 120 | */ |
| 121 | ordered_set() : ordered_set(ht::DEFAULT_INIT_BUCKETS_SIZE) {} |
| 122 | |
| 123 | explicit ordered_set(size_type bucket_count, const Hash& hash = Hash(), |
| 124 | const KeyEqual& equal = KeyEqual(), |
| 125 | const Allocator& alloc = Allocator()) |
| 126 | : m_ht(bucket_count, hash, equal, alloc, ht::DEFAULT_MAX_LOAD_FACTOR) {} |
| 127 | |
| 128 | ordered_set(size_type bucket_count, const Allocator& alloc) |
| 129 | : ordered_set(bucket_count, Hash(), KeyEqual(), alloc) {} |
| 130 | |
| 131 | ordered_set(size_type bucket_count, const Hash& hash, const Allocator& alloc) |
| 132 | : ordered_set(bucket_count, hash, KeyEqual(), alloc) {} |
| 133 | |
| 134 | explicit ordered_set(const Allocator& alloc) |
| 135 | : ordered_set(ht::DEFAULT_INIT_BUCKETS_SIZE, alloc) {} |
| 136 | |
| 137 | template <class InputIt> |
| 138 | ordered_set(InputIt first, InputIt last, |