robin_set.h
Go to the documentation of this file.
1 
24 #ifndef TSL_ROBIN_SET_H
25 #define TSL_ROBIN_SET_H
26 
27 #include <cstddef>
28 #include <functional>
29 #include <initializer_list>
30 #include <memory>
31 #include <type_traits>
32 #include <utility>
33 
34 #include "robin_hash.h"
35 
36 namespace tsl {
37 
86 template <class Key, class Hash = std::hash<Key>,
87  class KeyEqual = std::equal_to<Key>,
88  class Allocator = std::allocator<Key>, bool StoreHash = false,
89  class GrowthPolicy = tsl::rh::power_of_two_growth_policy<2>>
90 class robin_set {
91  private:
92  template <typename U>
94 
95  class KeySelect {
96  public:
97  using key_type = Key;
98 
99  const key_type& operator()(const Key& key) const noexcept { return key; }
100 
101  key_type& operator()(Key& key) noexcept { return key; }
102  };
103 
104  using ht = detail_robin_hash::robin_hash<Key, KeySelect, void, Hash, KeyEqual,
105  Allocator, StoreHash, GrowthPolicy>;
106 
107  public:
108  using key_type = typename ht::key_type;
109  using value_type = typename ht::value_type;
110  using size_type = typename ht::size_type;
112  using hasher = typename ht::hasher;
113  using key_equal = typename ht::key_equal;
115  using reference = typename ht::reference;
117  using pointer = typename ht::pointer;
119  using iterator = typename ht::iterator;
121 
122  /*
123  * Constructors
124  */
125  robin_set() : robin_set(ht::DEFAULT_INIT_BUCKETS_SIZE) {}
126 
127  explicit robin_set(size_type bucket_count, const Hash& hash = Hash(),
128  const KeyEqual& equal = KeyEqual(),
129  const Allocator& alloc = Allocator())
130  : m_ht(bucket_count, hash, equal, alloc) {}
131 
132  robin_set(size_type bucket_count, const Allocator& alloc)
133  : robin_set(bucket_count, Hash(), KeyEqual(), alloc) {}
134 
135  robin_set(size_type bucket_count, const Hash& hash, const Allocator& alloc)
136  : robin_set(bucket_count, hash, KeyEqual(), alloc) {}
137 
138  explicit robin_set(const Allocator& alloc)
139  : robin_set(ht::DEFAULT_INIT_BUCKETS_SIZE, alloc) {}
140 
141  template <class InputIt>
142  robin_set(InputIt first, InputIt last,
144  const Hash& hash = Hash(), const KeyEqual& equal = KeyEqual(),
145  const Allocator& alloc = Allocator())
146  : robin_set(bucket_count, hash, equal, alloc) {
147  insert(first, last);
148  }
149 
150  template <class InputIt>
151  robin_set(InputIt first, InputIt last, size_type bucket_count,
152  const Allocator& alloc)
153  : robin_set(first, last, bucket_count, Hash(), KeyEqual(), alloc) {}
154 
155  template <class InputIt>
156  robin_set(InputIt first, InputIt last, size_type bucket_count,
157  const Hash& hash, const Allocator& alloc)
158  : robin_set(first, last, bucket_count, hash, KeyEqual(), alloc) {}
159 
160  robin_set(std::initializer_list<value_type> init,
162  const Hash& hash = Hash(), const KeyEqual& equal = KeyEqual(),
163  const Allocator& alloc = Allocator())
164  : robin_set(init.begin(), init.end(), bucket_count, hash, equal, alloc) {}
165 
166  robin_set(std::initializer_list<value_type> init, size_type bucket_count,
167  const Allocator& alloc)
168  : robin_set(init.begin(), init.end(), bucket_count, Hash(), KeyEqual(),
169  alloc) {}
170 
171  robin_set(std::initializer_list<value_type> init, size_type bucket_count,
172  const Hash& hash, const Allocator& alloc)
173  : robin_set(init.begin(), init.end(), bucket_count, hash, KeyEqual(),
174  alloc) {}
175 
176  robin_set& operator=(std::initializer_list<value_type> ilist) {
177  m_ht.clear();
178 
179  m_ht.reserve(ilist.size());
180  m_ht.insert(ilist.begin(), ilist.end());
181 
182  return *this;
183  }
184 
186 
187  /*
188  * Iterators
189  */
190  iterator begin() noexcept { return m_ht.begin(); }
191  const_iterator begin() const noexcept { return m_ht.begin(); }
192  const_iterator cbegin() const noexcept { return m_ht.cbegin(); }
193 
194  iterator end() noexcept { return m_ht.end(); }
195  const_iterator end() const noexcept { return m_ht.end(); }
196  const_iterator cend() const noexcept { return m_ht.cend(); }
197 
198  /*
199  * Capacity
200  */
201  bool empty() const noexcept { return m_ht.empty(); }
202  size_type size() const noexcept { return m_ht.size(); }
203  size_type max_size() const noexcept { return m_ht.max_size(); }
204 
205  /*
206  * Modifiers
207  */
208  void clear() noexcept { m_ht.clear(); }
209 
210  std::pair<iterator, bool> insert(const value_type& value) {
211  return m_ht.insert(value);
212  }
213 
214  std::pair<iterator, bool> insert(value_type&& value) {
215  return m_ht.insert(std::move(value));
216  }
217 
218  iterator insert(const_iterator hint, const value_type& value) {
219  return m_ht.insert_hint(hint, value);
220  }
221 
223  return m_ht.insert_hint(hint, std::move(value));
224  }
225 
226  template <class InputIt>
227  void insert(InputIt first, InputIt last) {
228  m_ht.insert(first, last);
229  }
230 
231  void insert(std::initializer_list<value_type> ilist) {
232  m_ht.insert(ilist.begin(), ilist.end());
233  }
234 
242  template <class... Args>
243  std::pair<iterator, bool> emplace(Args&&... args) {
244  return m_ht.emplace(std::forward<Args>(args)...);
245  }
246 
254  template <class... Args>
255  iterator emplace_hint(const_iterator hint, Args&&... args) {
256  return m_ht.emplace_hint(hint, std::forward<Args>(args)...);
257  }
258 
259  iterator erase(iterator pos) { return m_ht.erase(pos); }
260  iterator erase(const_iterator pos) { return m_ht.erase(pos); }
262  return m_ht.erase(first, last);
263  }
264  size_type erase(const key_type& key) { return m_ht.erase(key); }
265 
272  void erase_fast(iterator pos) { return m_ht.erase_fast(pos); }
273 
279  size_type erase(const key_type& key, std::size_t precalculated_hash) {
280  return m_ht.erase(key, precalculated_hash);
281  }
282 
288  template <
289  class K, class KE = KeyEqual,
290  typename std::enable_if<has_is_transparent<KE>::value>::type* = nullptr>
291  size_type erase(const K& key) {
292  return m_ht.erase(key);
293  }
294 
302  template <
303  class K, class KE = KeyEqual,
304  typename std::enable_if<has_is_transparent<KE>::value>::type* = nullptr>
305  size_type erase(const K& key, std::size_t precalculated_hash) {
306  return m_ht.erase(key, precalculated_hash);
307  }
308 
309  void swap(robin_set& other) { other.m_ht.swap(m_ht); }
310 
311  /*
312  * Lookup
313  */
314  size_type count(const Key& key) const { return m_ht.count(key); }
315 
321  size_type count(const Key& key, std::size_t precalculated_hash) const {
322  return m_ht.count(key, precalculated_hash);
323  }
324 
330  template <
331  class K, class KE = KeyEqual,
332  typename std::enable_if<has_is_transparent<KE>::value>::type* = nullptr>
333  size_type count(const K& key) const {
334  return m_ht.count(key);
335  }
336 
344  template <
345  class K, class KE = KeyEqual,
346  typename std::enable_if<has_is_transparent<KE>::value>::type* = nullptr>
347  size_type count(const K& key, std::size_t precalculated_hash) const {
348  return m_ht.count(key, precalculated_hash);
349  }
350 
351  iterator find(const Key& key) { return m_ht.find(key); }
352 
358  iterator find(const Key& key, std::size_t precalculated_hash) {
359  return m_ht.find(key, precalculated_hash);
360  }
361 
362  const_iterator find(const Key& key) const { return m_ht.find(key); }
363 
367  const_iterator find(const Key& key, std::size_t precalculated_hash) const {
368  return m_ht.find(key, precalculated_hash);
369  }
370 
376  template <
377  class K, class KE = KeyEqual,
378  typename std::enable_if<has_is_transparent<KE>::value>::type* = nullptr>
379  iterator find(const K& key) {
380  return m_ht.find(key);
381  }
382 
390  template <
391  class K, class KE = KeyEqual,
392  typename std::enable_if<has_is_transparent<KE>::value>::type* = nullptr>
393  iterator find(const K& key, std::size_t precalculated_hash) {
394  return m_ht.find(key, precalculated_hash);
395  }
396 
400  template <
401  class K, class KE = KeyEqual,
402  typename std::enable_if<has_is_transparent<KE>::value>::type* = nullptr>
403  const_iterator find(const K& key) const {
404  return m_ht.find(key);
405  }
406 
414  template <
415  class K, class KE = KeyEqual,
416  typename std::enable_if<has_is_transparent<KE>::value>::type* = nullptr>
417  const_iterator find(const K& key, std::size_t precalculated_hash) const {
418  return m_ht.find(key, precalculated_hash);
419  }
420 
421  bool contains(const Key& key) const { return m_ht.contains(key); }
422 
428  bool contains(const Key& key, std::size_t precalculated_hash) const {
429  return m_ht.contains(key, precalculated_hash);
430  }
431 
437  template <
438  class K, class KE = KeyEqual,
439  typename std::enable_if<has_is_transparent<KE>::value>::type* = nullptr>
440  bool contains(const K& key) const {
441  return m_ht.contains(key);
442  }
443 
451  template <
452  class K, class KE = KeyEqual,
453  typename std::enable_if<has_is_transparent<KE>::value>::type* = nullptr>
454  bool contains(const K& key, std::size_t precalculated_hash) const {
455  return m_ht.contains(key, precalculated_hash);
456  }
457 
458  std::pair<iterator, iterator> equal_range(const Key& key) {
459  return m_ht.equal_range(key);
460  }
461 
467  std::pair<iterator, iterator> equal_range(const Key& key,
468  std::size_t precalculated_hash) {
469  return m_ht.equal_range(key, precalculated_hash);
470  }
471 
472  std::pair<const_iterator, const_iterator> equal_range(const Key& key) const {
473  return m_ht.equal_range(key);
474  }
475 
479  std::pair<const_iterator, const_iterator> equal_range(
480  const Key& key, std::size_t precalculated_hash) const {
481  return m_ht.equal_range(key, precalculated_hash);
482  }
483 
489  template <
490  class K, class KE = KeyEqual,
491  typename std::enable_if<has_is_transparent<KE>::value>::type* = nullptr>
492  std::pair<iterator, iterator> equal_range(const K& key) {
493  return m_ht.equal_range(key);
494  }
495 
503  template <
504  class K, class KE = KeyEqual,
505  typename std::enable_if<has_is_transparent<KE>::value>::type* = nullptr>
506  std::pair<iterator, iterator> equal_range(const K& key,
507  std::size_t precalculated_hash) {
508  return m_ht.equal_range(key, precalculated_hash);
509  }
510 
514  template <
515  class K, class KE = KeyEqual,
516  typename std::enable_if<has_is_transparent<KE>::value>::type* = nullptr>
517  std::pair<const_iterator, const_iterator> equal_range(const K& key) const {
518  return m_ht.equal_range(key);
519  }
520 
524  template <
525  class K, class KE = KeyEqual,
526  typename std::enable_if<has_is_transparent<KE>::value>::type* = nullptr>
527  std::pair<const_iterator, const_iterator> equal_range(
528  const K& key, std::size_t precalculated_hash) const {
529  return m_ht.equal_range(key, precalculated_hash);
530  }
531 
532  /*
533  * Bucket interface
534  */
535  size_type bucket_count() const { return m_ht.bucket_count(); }
537 
538  /*
539  * Hash policy
540  */
541  float load_factor() const { return m_ht.load_factor(); }
542 
543  float min_load_factor() const { return m_ht.min_load_factor(); }
544  float max_load_factor() const { return m_ht.max_load_factor(); }
545 
555  void min_load_factor(float ml) { m_ht.min_load_factor(ml); }
556  void max_load_factor(float ml) { m_ht.max_load_factor(ml); }
557 
558  void rehash(size_type count_) { m_ht.rehash(count_); }
559  void reserve(size_type count_) { m_ht.reserve(count_); }
560 
561  /*
562  * Observers
563  */
564  hasher hash_function() const { return m_ht.hash_function(); }
565  key_equal key_eq() const { return m_ht.key_eq(); }
566 
567  /*
568  * Other
569  */
570 
575  return m_ht.mutable_iterator(pos);
576  }
577 
578  friend bool operator==(const robin_set& lhs, const robin_set& rhs) {
579  if (lhs.size() != rhs.size()) {
580  return false;
581  }
582 
583  for (const auto& element_lhs : lhs) {
584  const auto it_element_rhs = rhs.find(element_lhs);
585  if (it_element_rhs == rhs.cend()) {
586  return false;
587  }
588  }
589 
590  return true;
591  }
592 
606  template <class Serializer>
607  void serialize(Serializer& serializer) const {
609  }
610 
637  template <class Deserializer>
638  static robin_set deserialize(Deserializer& deserializer,
639  bool hash_compatible = false) {
640  robin_set set(0);
641  set.m_ht.deserialize(deserializer, hash_compatible);
642 
643  return set;
644  }
645 
646  friend bool operator!=(const robin_set& lhs, const robin_set& rhs) {
647  return !operator==(lhs, rhs);
648  }
649 
650  friend void swap(robin_set& lhs, robin_set& rhs) { lhs.swap(rhs); }
651 
652  private:
654 };
655 
660 template <class Key, class Hash = std::hash<Key>,
661  class KeyEqual = std::equal_to<Key>,
662  class Allocator = std::allocator<Key>, bool StoreHash = false>
663 using robin_pg_set = robin_set<Key, Hash, KeyEqual, Allocator, StoreHash,
665 
666 } // end namespace tsl
667 
668 #endif
tsl::robin_set::begin
iterator begin() noexcept
Definition: robin_set.h:190
tsl::robin_set::m_ht
ht m_ht
Definition: robin_set.h:653
tsl::robin_set::const_iterator
typename ht::const_iterator const_iterator
Definition: robin_set.h:120
tsl::robin_set::contains
bool contains(const Key &key) const
Definition: robin_set.h:421
tsl::robin_set::find
iterator find(const K &key, std::size_t precalculated_hash)
Definition: robin_set.h:393
tsl::rh::prime_growth_policy
Definition: robin_growth_policy.h:369
tsl
Definition: robin_growth_policy.h:84
tsl::robin_set::contains
bool contains(const K &key, std::size_t precalculated_hash) const
Definition: robin_set.h:454
tsl::detail_robin_hash::robin_hash::erase_fast
void erase_fast(iterator pos)
Definition: robin_hash.h:823
tsl::robin_set::max_load_factor
float max_load_factor() const
Definition: robin_set.h:544
tsl::detail_robin_hash::robin_hash::contains
bool contains(const K &key) const
Definition: robin_hash.h:1018
tsl::detail_robin_hash::robin_hash::const_pointer
const value_type * const_pointer
Definition: robin_hash.h:388
tsl::detail_robin_hash::robin_hash::reserve
void reserve(size_type count_)
Definition: robin_hash.h:1093
tsl::detail_robin_hash::robin_hash::hash_function
hasher hash_function() const
Definition: robin_hash.h:1100
tsl::robin_set::reference
typename ht::reference reference
Definition: robin_set.h:115
tsl::detail_robin_hash::robin_hash::size
size_type size() const noexcept
Definition: robin_hash.h:720
tsl::robin_set::find
const_iterator find(const Key &key) const
Definition: robin_set.h:362
tsl::robin_set::const_pointer
typename ht::const_pointer const_pointer
Definition: robin_set.h:118
tsl::robin_set::erase
size_type erase(const key_type &key, std::size_t precalculated_hash)
Definition: robin_set.h:279
tsl::detail_robin_hash::robin_hash::max_load_factor
float max_load_factor() const
Definition: robin_hash.h:1073
tsl::robin_set::end
iterator end() noexcept
Definition: robin_set.h:194
tsl::robin_set::robin_set
robin_set(size_type bucket_count, const Hash &hash, const Allocator &alloc)
Definition: robin_set.h:135
tsl::detail_robin_hash::robin_hash::emplace
std::pair< iterator, bool > emplace(Args &&... args)
Definition: robin_hash.h:798
tsl::robin_set::contains
bool contains(const Key &key, std::size_t precalculated_hash) const
Definition: robin_set.h:428
tsl::robin_set::equal_range
std::pair< iterator, iterator > equal_range(const Key &key, std::size_t precalculated_hash)
Definition: robin_set.h:467
tsl::robin_set::insert
iterator insert(const_iterator hint, const value_type &value)
Definition: robin_set.h:218
tsl::robin_set::find
const_iterator find(const K &key, std::size_t precalculated_hash) const
Definition: robin_set.h:417
tsl::robin_set::insert
iterator insert(const_iterator hint, value_type &&value)
Definition: robin_set.h:222
tsl::robin_set::const_reference
typename ht::const_reference const_reference
Definition: robin_set.h:116
tsl::robin_set::insert
std::pair< iterator, bool > insert(const value_type &value)
Definition: robin_set.h:210
tsl::robin_set::robin_set
robin_set(InputIt first, InputIt last, size_type bucket_count, const Hash &hash, const Allocator &alloc)
Definition: robin_set.h:156
tsl::robin_set::emplace
std::pair< iterator, bool > emplace(Args &&... args)
Definition: robin_set.h:243
tsl::robin_set
Definition: robin_set.h:90
tsl::robin_set::pointer
typename ht::pointer pointer
Definition: robin_set.h:117
tsl::detail_robin_hash::robin_hash::difference_type
std::ptrdiff_t difference_type
Definition: robin_hash.h:381
tsl::robin_set::deserialize
static robin_set deserialize(Deserializer &deserializer, bool hash_compatible=false)
Definition: robin_set.h:638
tsl::detail_robin_hash::robin_hash::empty
bool empty() const noexcept
Definition: robin_hash.h:718
tsl::detail_robin_hash::robin_hash::size_type
std::size_t size_type
Definition: robin_hash.h:380
tsl::robin_set::robin_set
robin_set(size_type bucket_count, const Hash &hash=Hash(), const KeyEqual &equal=KeyEqual(), const Allocator &alloc=Allocator())
Definition: robin_set.h:127
tsl::robin_set::erase
size_type erase(const key_type &key)
Definition: robin_set.h:264
tsl::detail_robin_hash::robin_hash::serialize
void serialize(Serializer &serializer) const
Definition: robin_hash.h:1112
tsl::robin_set::erase
iterator erase(const_iterator first, const_iterator last)
Definition: robin_set.h:261
tsl::robin_set::size
size_type size() const noexcept
Definition: robin_set.h:202
tsl::robin_set::emplace_hint
iterator emplace_hint(const_iterator hint, Args &&... args)
Definition: robin_set.h:255
tsl::robin_set::cend
const_iterator cend() const noexcept
Definition: robin_set.h:196
tsl::robin_set::KeySelect::operator()
const key_type & operator()(const Key &key) const noexcept
Definition: robin_set.h:99
tsl::detail_robin_hash::robin_hash::pointer
value_type * pointer
Definition: robin_hash.h:387
tsl::robin_set::difference_type
typename ht::difference_type difference_type
Definition: robin_set.h:111
serializer
Definition: robin-map/tests/utils.h:349
tsl::robin_set::hash_function
hasher hash_function() const
Definition: robin_set.h:564
tsl::robin_set::iterator
typename ht::iterator iterator
Definition: robin_set.h:119
tsl::robin_set::equal_range
std::pair< const_iterator, const_iterator > equal_range(const Key &key, std::size_t precalculated_hash) const
Definition: robin_set.h:479
tsl::robin_set::min_load_factor
float min_load_factor() const
Definition: robin_set.h:543
tsl::robin_set::erase
size_type erase(const K &key)
Definition: robin_set.h:291
tsl::robin_set::erase
iterator erase(const_iterator pos)
Definition: robin_set.h:260
tsl::robin_set::find
iterator find(const K &key)
Definition: robin_set.h:379
tsl::detail_robin_hash::robin_hash::max_size
size_type max_size() const noexcept
Definition: robin_hash.h:722
tsl::robin_set::bucket_count
size_type bucket_count() const
Definition: robin_set.h:535
tsl::detail_robin_hash::robin_hash::insert_hint
iterator insert_hint(const_iterator hint, P &&value)
Definition: robin_hash.h:746
tsl::robin_set::max_load_factor
void max_load_factor(float ml)
Definition: robin_set.h:556
tsl::robin_set::empty
bool empty() const noexcept
Definition: robin_set.h:201
tsl::robin_set::equal_range
std::pair< iterator, iterator > equal_range(const K &key, std::size_t precalculated_hash)
Definition: robin_set.h:506
tsl::robin_set::KeySelect::operator()
key_type & operator()(Key &key) noexcept
Definition: robin_set.h:101
tsl::detail_robin_hash::robin_hash::clear
void clear() noexcept
Definition: robin_hash.h:727
tsl::robin_set::key_eq
key_equal key_eq() const
Definition: robin_set.h:565
tsl::robin_set::swap
friend void swap(robin_set &lhs, robin_set &rhs)
Definition: robin_set.h:650
robin_hash.h
tsl::detail_robin_hash::robin_hash::value_type
ValueType value_type
Definition: robin_hash.h:379
tsl::detail_robin_hash::robin_hash::find
iterator find(const K &key)
Definition: robin_hash.h:998
tsl::robin_set::robin_set
robin_set()
Definition: robin_set.h:125
tsl::detail_robin_hash::robin_hash::cbegin
const_iterator cbegin() const noexcept
Definition: robin_hash.h:698
tsl::robin_set::find
const_iterator find(const Key &key, std::size_t precalculated_hash) const
Definition: robin_set.h:367
tsl::detail_robin_hash::robin_hash::rehash
void rehash(size_type count_)
Definition: robin_hash.h:1087
tsl::robin_set::equal_range
std::pair< const_iterator, const_iterator > equal_range(const K &key, std::size_t precalculated_hash) const
Definition: robin_set.h:527
tsl::robin_set::size_type
typename ht::size_type size_type
Definition: robin_set.h:110
tsl::detail_robin_hash::robin_hash::count
size_type count(const K &key) const
Definition: robin_hash.h:984
tsl::robin_set::rehash
void rehash(size_type count_)
Definition: robin_set.h:558
tsl::robin_set::find
const_iterator find(const K &key) const
Definition: robin_set.h:403
tsl::detail_robin_hash::has_is_transparent
Definition: robin_hash.h:55
tsl::detail_robin_hash::robin_hash::DEFAULT_INIT_BUCKETS_SIZE
static const size_type DEFAULT_INIT_BUCKETS_SIZE
Definition: robin_hash.h:1566
tsl::robin_set::robin_set
robin_set(const Allocator &alloc)
Definition: robin_set.h:138
tsl::detail_robin_hash::robin_hash::cend
const_iterator cend() const noexcept
Definition: robin_hash.h:711
tsl::detail_robin_hash::robin_hash::key_equal
KeyEqual key_equal
Definition: robin_hash.h:383
tsl::robin_set::key_equal
typename ht::key_equal key_equal
Definition: robin_set.h:113
tsl::robin_set::count
size_type count(const Key &key) const
Definition: robin_set.h:314
tsl::detail_robin_hash::robin_hash::reference
value_type & reference
Definition: robin_hash.h:385
tsl::detail_robin_hash::robin_hash::hasher
Hash hasher
Definition: robin_hash.h:382
tsl::robin_set::robin_set
robin_set(InputIt first, InputIt last, size_type bucket_count, const Allocator &alloc)
Definition: robin_set.h:151
tsl::detail_robin_hash::robin_hash::erase
iterator erase(iterator pos)
Definition: robin_hash.h:831
tsl::detail_robin_hash::robin_hash
Definition: robin_hash.h:362
tsl::detail_robin_hash::robin_hash::mutable_iterator
iterator mutable_iterator(const_iterator pos)
Definition: robin_hash.h:1107
tsl::robin_set::get_allocator
allocator_type get_allocator() const
Definition: robin_set.h:185
tsl::robin_set::count
size_type count(const K &key) const
Definition: robin_set.h:333
tsl::robin_set::erase
iterator erase(iterator pos)
Definition: robin_set.h:259
tsl::robin_set::contains
bool contains(const K &key) const
Definition: robin_set.h:440
tsl::detail_robin_hash::robin_hash::emplace_hint
iterator emplace_hint(const_iterator hint, Args &&... args)
Definition: robin_hash.h:803
tsl::robin_set::min_load_factor
void min_load_factor(float ml)
Definition: robin_set.h:555
tsl::robin_set::reserve
void reserve(size_type count_)
Definition: robin_set.h:559
tsl::robin_set::key_type
typename ht::key_type key_type
Definition: robin_set.h:108
tsl::robin_set::equal_range
std::pair< const_iterator, const_iterator > equal_range(const Key &key) const
Definition: robin_set.h:472
tsl::robin_set::value_type
typename ht::value_type value_type
Definition: robin_set.h:109
tsl::robin_set::equal_range
std::pair< const_iterator, const_iterator > equal_range(const K &key) const
Definition: robin_set.h:517
tsl::detail_robin_hash::robin_hash::const_iterator
robin_iterator< true > const_iterator
Definition: robin_hash.h:390
tsl::robin_set::KeySelect::key_type
Key key_type
Definition: robin_set.h:97
tsl::detail_robin_hash::robin_hash::swap
void swap(robin_hash &other)
Definition: robin_hash.h:927
tsl::robin_set::erase_fast
void erase_fast(iterator pos)
Definition: robin_set.h:272
set
ROSCPP_DECL void set(const std::string &key, bool b)
tsl::detail_robin_hash::robin_hash::min_load_factor
float min_load_factor() const
Definition: robin_hash.h:1071
tsl::robin_set::allocator_type
typename ht::allocator_type allocator_type
Definition: robin_set.h:114
tsl::robin_set::cbegin
const_iterator cbegin() const noexcept
Definition: robin_set.h:192
tsl::robin_set::equal_range
std::pair< iterator, iterator > equal_range(const Key &key)
Definition: robin_set.h:458
tsl::detail_robin_hash::robin_hash::allocator_type
Allocator allocator_type
Definition: robin_hash.h:384
tsl::robin_set::hasher
typename ht::hasher hasher
Definition: robin_set.h:112
tsl::robin_set::robin_set
robin_set(InputIt first, InputIt last, size_type bucket_count=ht::DEFAULT_INIT_BUCKETS_SIZE, const Hash &hash=Hash(), const KeyEqual &equal=KeyEqual(), const Allocator &alloc=Allocator())
Definition: robin_set.h:142
tsl::robin_set::max_bucket_count
size_type max_bucket_count() const
Definition: robin_set.h:536
tsl::robin_set::operator=
robin_set & operator=(std::initializer_list< value_type > ilist)
Definition: robin_set.h:176
tsl::detail_robin_hash::robin_hash::end
iterator end() noexcept
Definition: robin_hash.h:707
tsl::robin_set::find
iterator find(const Key &key)
Definition: robin_set.h:351
tsl::robin_set::operator!=
friend bool operator!=(const robin_set &lhs, const robin_set &rhs)
Definition: robin_set.h:646
tsl::detail_robin_hash::robin_hash::get_allocator
allocator_type get_allocator() const
Definition: robin_hash.h:680
init
void init(const M_string &remappings)
tsl::robin_set::insert
void insert(std::initializer_list< value_type > ilist)
Definition: robin_set.h:231
tsl::robin_set::find
iterator find(const Key &key, std::size_t precalculated_hash)
Definition: robin_set.h:358
tsl::robin_set::equal_range
std::pair< iterator, iterator > equal_range(const K &key)
Definition: robin_set.h:492
tsl::robin_set::KeySelect
Definition: robin_set.h:95
tsl::detail_robin_hash::robin_hash::max_bucket_count
size_type max_bucket_count() const
Definition: robin_hash.h:1055
tsl::robin_set::count
size_type count(const Key &key, std::size_t precalculated_hash) const
Definition: robin_set.h:321
tsl::robin_set::operator==
friend bool operator==(const robin_set &lhs, const robin_set &rhs)
Definition: robin_set.h:578
tsl::robin_set::insert
void insert(InputIt first, InputIt last)
Definition: robin_set.h:227
tsl::detail_robin_hash::robin_hash::equal_range
std::pair< iterator, iterator > equal_range(const K &key)
Definition: robin_hash.h:1028
tsl::robin_set::ht
detail_robin_hash::robin_hash< Key, KeySelect, void, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy > ht
Definition: robin_set.h:105
tsl::robin_set::robin_set
robin_set(std::initializer_list< value_type > init, size_type bucket_count=ht::DEFAULT_INIT_BUCKETS_SIZE, const Hash &hash=Hash(), const KeyEqual &equal=KeyEqual(), const Allocator &alloc=Allocator())
Definition: robin_set.h:160
tsl::robin_set::erase
size_type erase(const K &key, std::size_t precalculated_hash)
Definition: robin_set.h:305
tsl::robin_set::max_size
size_type max_size() const noexcept
Definition: robin_set.h:203
tsl::robin_set::load_factor
float load_factor() const
Definition: robin_set.h:541
tsl::robin_set::robin_set
robin_set(size_type bucket_count, const Allocator &alloc)
Definition: robin_set.h:132
tsl::detail_robin_hash::robin_hash::key_type
typename KeySelect::key_type key_type
Definition: robin_hash.h:378
tsl::robin_set::end
const_iterator end() const noexcept
Definition: robin_set.h:195
tsl::robin_set::clear
void clear() noexcept
Definition: robin_set.h:208
deserializer
Definition: robin-map/tests/utils.h:387
tsl::detail_robin_hash::robin_hash::bucket_count
size_type bucket_count() const
Definition: robin_hash.h:1053
tsl::detail_robin_hash::robin_hash::begin
iterator begin() noexcept
Definition: robin_hash.h:687
tsl::detail_robin_hash::robin_hash::iterator
robin_iterator< false > iterator
Definition: robin_hash.h:389
tsl::robin_set::count
size_type count(const K &key, std::size_t precalculated_hash) const
Definition: robin_set.h:347
tsl::robin_set::serialize
void serialize(Serializer &serializer) const
Definition: robin_set.h:607
tsl::robin_set::swap
void swap(robin_set &other)
Definition: robin_set.h:309
tsl::detail_robin_hash::robin_hash::key_eq
key_equal key_eq() const
Definition: robin_hash.h:1102
YAML_PM::Key
@ Key
Definition: emittermanip.h:57
tsl::robin_set::robin_set
robin_set(std::initializer_list< value_type > init, size_type bucket_count, const Allocator &alloc)
Definition: robin_set.h:166
tsl::robin_set::insert
std::pair< iterator, bool > insert(value_type &&value)
Definition: robin_set.h:214
tsl::robin_set::mutable_iterator
iterator mutable_iterator(const_iterator pos)
Definition: robin_set.h:574
tsl::robin_set::robin_set
robin_set(std::initializer_list< value_type > init, size_type bucket_count, const Hash &hash, const Allocator &alloc)
Definition: robin_set.h:171
tsl::detail_robin_hash::robin_hash::insert
std::pair< iterator, bool > insert(P &&value)
Definition: robin_hash.h:741
tsl::detail_robin_hash::robin_hash::load_factor
float load_factor() const
Definition: robin_hash.h:1063
tsl::detail_robin_hash::robin_hash::const_reference
const value_type & const_reference
Definition: robin_hash.h:386
tsl::robin_set::begin
const_iterator begin() const noexcept
Definition: robin_set.h:191


mp2p_icp
Author(s): Jose-Luis Blanco-Claraco
autogenerated on Tue Jul 2 2024 02:47:25