8#ifndef INCLUDED_BSLSTP_HASHSET
9#define INCLUDED_BSLSTP_HASHSET
108#ifdef BDE_OPENSOURCE_PUBLICATION
109#error "bslstp_hashset is not for publication"
125template <
class _Value,
127 typename ::BloombergLP::bslstp::HashSelector<_Value>::Type,
133 typedef hashtable<_Value, _Value, _HashFcn,
134 ::BloombergLP::bslstp::Identity<_Value>,
135 _EqualKey, _Alloc>
_Ht;
182 : _M_ht(__n, __hf, __eql, __a) {}
184 template <
class _InputIterator>
187 { _M_ht.insert_unique(__f, __l); }
188 template <
class _InputIterator>
191 { _M_ht.insert_unique(__f, __l); }
192 template <
class _InputIterator>
196 { _M_ht.insert_unique(__f, __l); }
199 template <
class _InputIterator>
202 { _M_ht.insert_unique(__f, __l); }
203 template <
class _InputIterator>
206 { _M_ht.insert_unique(__f, __l); }
207 template <
class _InputIterator>
211 { _M_ht.insert_unique(__f, __l); }
213 template <
class _InputIterator>
217 : _M_ht(__n, __hf, __eql, __a)
218 { _M_ht.insert_unique(__f, __l); }
223 : _M_ht(__x._M_ht, __a) { }
228 bool empty()
const {
return _M_ht.empty(); }
240 template <
class _InputIterator>
241 void insert(_InputIterator __f, _InputIterator __l)
242 { _M_ht.insert_unique(__f,__l); }
246 _M_ht.insert_unique_noresize(__obj);
255 {
return _M_ht.equal_range(__key); }
267 {
return _M_ht.elems_in_bucket(__n); }
275template <
class _Value,
class _HashFcn,
class _EqualKey,
class _Alloc>
283template <
class _Value,
285 typename ::BloombergLP::bslstp::HashSelector<_Value>::Type,
291 typedef hashtable<_Value, _Value, _HashFcn,
292 ::BloombergLP::bslstp::Identity<_Value>,
293 _EqualKey, _Alloc>
_Ht;
342 : _M_ht(__n, __hf, __eql, __a) {}
344 template <
class _InputIterator>
347 { _M_ht.insert_equal(__f, __l); }
348 template <
class _InputIterator>
351 { _M_ht.insert_equal(__f, __l); }
352 template <
class _InputIterator>
356 { _M_ht.insert_equal(__f, __l); }
359 template <
class _InputIterator>
363 { _M_ht.insert_equal(__f, __l); }
364 template <
class _InputIterator>
368 { _M_ht.insert_equal(__f, __l); }
369 template <
class _InputIterator>
373 { _M_ht.insert_equal(__f, __l); }
375 template <
class _InputIterator>
379 : _M_ht(__n, __hf, __eql, __a)
380 { _M_ht.insert_equal(__f, __l); }
385 : _M_ht(__x._M_ht, __a) { }
390 bool empty()
const {
return _M_ht.empty(); }
398 {
return _M_ht.insert_equal(__obj); }
399 template <
class _InputIterator>
400 void insert(_InputIterator __f, _InputIterator __l)
401 { _M_ht.insert_equal(__f,__l); }
403 {
return _M_ht.insert_equal_noresize(__obj); }
411 {
return _M_ht.equal_range(__key); }
423 {
return _M_ht.elems_in_bucket(__n); }
429template <
class _Value,
class _HashFcn,
class _EqualKey,
class _Alloc>
437template <
class _Value,
class _HashFcn,
class _EqualKey,
class _Alloc>
445template <
class _Value,
class _HashFcn,
class _EqualKey,
class _Alloc>
449 return !(__hm1 == __hm2);
452template <
class _Value,
class _HashFcn,
class _EqualKey,
class _Alloc>
460template <
class _Value,
class _HashFcn,
class _EqualKey,
class _Alloc>
464 return !(__hm1 == __hm2);
474template <
class _Value,
class _HashFcn,
class _EqualKey,
class _Alloc>
475class insert_iterator<
bsl::hash_set<_Value, _HashFcn, _EqualKey, _Alloc> > {
490 insert_iterator<_Container>&
495 insert_iterator<_Container>&
operator*() {
return *
this; }
497 insert_iterator<_Container>&
operator++(
int) {
return *
this; }
500template <
class _Value,
class _HashFcn,
class _EqualKey,
class _Alloc>
501class insert_iterator<
bsl::hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc> > {
517 insert_iterator<_Container>&
522 insert_iterator<_Container>&
operator*() {
return *
this; }
524 insert_iterator<_Container>&
operator++(
int) {
return *
this; }
542template <
class _Value,
550template <
class _Value,
562template <
class _Value,
570template <
class _Value,
Definition bslma_bslallocator.h:580
Definition bslstp_hashset.h:289
_Ht::allocator_type allocator_type
Definition bslstp_hashset.h:313
hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n, const hasher &__hf)
Definition bslstp_hashset.h:353
hash_multiset(const _Self &__x, const allocator_type &__a)
Definition bslstp_hashset.h:384
hash_multiset(_InputIterator __f, _InputIterator __l)
Definition bslstp_hashset.h:345
hash_multiset(size_type __n, const hasher &__hf)
Definition bslstp_hashset.h:327
hash_multiset(size_type __n, const hasher &__hf, const allocator_type &__a)
Definition bslstp_hashset.h:335
iterator end() const
Definition bslstp_hashset.h:394
allocator_type get_allocator() const
Definition bslstp_hashset.h:317
hash_multiset(const allocator_type &__a)
Definition bslstp_hashset.h:331
_Ht::const_iterator const_iterator
Definition bslstp_hashset.h:309
iterator find(const _KT &__key) const
Definition bslstp_hashset.h:406
pair< iterator, iterator > equal_range(const key_type &__key) const
Definition bslstp_hashset.h:410
size_type size() const
Definition bslstp_hashset.h:388
void erase(iterator __f, iterator __l)
Definition bslstp_hashset.h:415
_Ht::reference reference
Definition bslstp_hashset.h:306
iterator begin() const
Definition bslstp_hashset.h:393
_Ht::size_type size_type
Definition bslstp_hashset.h:302
iterator insert(const value_type &__obj)
Definition bslstp_hashset.h:397
_Ht::difference_type difference_type
Definition bslstp_hashset.h:303
_Ht::value_type value_type
Definition bslstp_hashset.h:298
size_type count(const key_type &__key) const
Definition bslstp_hashset.h:408
hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n)
Definition bslstp_hashset.h:349
size_type max_size() const
Definition bslstp_hashset.h:389
const_iterator iterator
Definition bslstp_hashset.h:311
hash_multiset(size_type __n, const allocator_type &__a)
Definition bslstp_hashset.h:333
hasher hash_funct() const
Definition bslstp_hashset.h:315
hash_multiset()
Definition bslstp_hashset.h:323
size_type max_bucket_count() const
Definition bslstp_hashset.h:421
static bool _M_equal(const _Self &__x, const _Self &__y)
Definition bslstp_hashset.h:424
iterator insert_noresize(const value_type &__obj)
Definition bslstp_hashset.h:402
_Ht::const_pointer const_pointer
Definition bslstp_hashset.h:305
size_type erase(const key_type &__key)
Definition bslstp_hashset.h:413
_Ht::const_reference const_reference
Definition bslstp_hashset.h:307
void swap(_Self &hs)
Definition bslstp_hashset.h:391
bool empty() const
Definition bslstp_hashset.h:390
void resize(size_type __hint)
Definition bslstp_hashset.h:419
_Ht::key_equal key_equal
Definition bslstp_hashset.h:300
key_equal key_eq() const
Definition bslstp_hashset.h:316
void clear()
Definition bslstp_hashset.h:416
hash_multiset(size_type __n, const hasher &__hf, const key_equal &__eql)
Definition bslstp_hashset.h:338
hash_multiset(_InputIterator __f, _InputIterator __l, const allocator_type &__a)
Definition bslstp_hashset.h:360
void insert(_InputIterator __f, _InputIterator __l)
Definition bslstp_hashset.h:400
_Ht::key_type key_type
Definition bslstp_hashset.h:297
hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n, const allocator_type &__a)
Definition bslstp_hashset.h:365
size_type bucket_count() const
Definition bslstp_hashset.h:420
hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n, const hasher &__hf, const key_equal &__eql, const allocator_type &__a=allocator_type())
Definition bslstp_hashset.h:376
size_type elems_in_bucket(size_type __n) const
Definition bslstp_hashset.h:422
hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n, const hasher &__hf, const allocator_type &__a)
Definition bslstp_hashset.h:370
void erase(iterator __it)
Definition bslstp_hashset.h:414
hash_multiset(size_type __n)
Definition bslstp_hashset.h:325
_Ht::pointer pointer
Definition bslstp_hashset.h:304
_Ht::hasher hasher
Definition bslstp_hashset.h:299
hash_multiset(size_type __n, const hasher &__hf, const key_equal &__eql, const allocator_type &__a)
Definition bslstp_hashset.h:340
Definition bslstp_hashset.h:131
size_type size() const
Definition bslstp_hashset.h:226
hash_set(_InputIterator __f, _InputIterator __l)
Definition bslstp_hashset.h:185
_Ht::value_type value_type
Definition bslstp_hashset.h:140
iterator begin() const
Definition bslstp_hashset.h:231
void insert(_InputIterator __f, _InputIterator __l)
Definition bslstp_hashset.h:241
_Ht::const_reference const_reference
Definition bslstp_hashset.h:149
_Ht::reference reference
Definition bslstp_hashset.h:148
hash_set(size_type __n, const hasher &__hf)
Definition bslstp_hashset.h:169
void erase(iterator __it)
Definition bslstp_hashset.h:258
hash_set(size_type __n, const hasher &__hf, const allocator_type &__a)
Definition bslstp_hashset.h:177
iterator end() const
Definition bslstp_hashset.h:232
pair< iterator, iterator > equal_range(const key_type &__key) const
Definition bslstp_hashset.h:254
_Ht::key_type key_type
Definition bslstp_hashset.h:139
_Ht::difference_type difference_type
Definition bslstp_hashset.h:145
hash_set(size_type __n, const allocator_type &__a)
Definition bslstp_hashset.h:175
hasher hash_funct() const
Definition bslstp_hashset.h:157
size_type max_size() const
Definition bslstp_hashset.h:227
bool empty() const
Definition bslstp_hashset.h:228
hash_set(size_type __n)
Definition bslstp_hashset.h:167
_Ht::pointer pointer
Definition bslstp_hashset.h:146
size_type max_bucket_count() const
Definition bslstp_hashset.h:265
pair< iterator, bool > insert(const value_type &__obj)
Definition bslstp_hashset.h:235
_Ht::hasher hasher
Definition bslstp_hashset.h:141
_Ht::const_iterator const_iterator
Definition bslstp_hashset.h:152
size_type elems_in_bucket(size_type __n) const
Definition bslstp_hashset.h:266
hash_set(_InputIterator __f, _InputIterator __l, const allocator_type &__a)
Definition bslstp_hashset.h:200
hash_set(size_type __n, const hasher &__hf, const key_equal &__eql, const allocator_type &__a=allocator_type())
Definition bslstp_hashset.h:180
size_type erase(const key_type &__key)
Definition bslstp_hashset.h:257
_Ht::key_equal key_equal
Definition bslstp_hashset.h:142
allocator_type get_allocator() const
Definition bslstp_hashset.h:159
void resize(size_type __hint)
Definition bslstp_hashset.h:263
static bool _M_equal(const _Self &__x, const _Self &__y)
Definition bslstp_hashset.h:269
size_type count(const key_type &__key) const
Definition bslstp_hashset.h:252
_Ht::const_pointer const_pointer
Definition bslstp_hashset.h:147
hash_set(const _Self &__x, const allocator_type &__a)
Definition bslstp_hashset.h:222
hash_set(_InputIterator __f, _InputIterator __l, size_type __n, const hasher &__hf)
Definition bslstp_hashset.h:193
void swap(_Self &__hs)
Definition bslstp_hashset.h:229
hash_set(_InputIterator __f, _InputIterator __l, size_type __n, const hasher &__hf, const key_equal &__eql, const allocator_type &__a=allocator_type())
Definition bslstp_hashset.h:214
void clear()
Definition bslstp_hashset.h:260
key_equal key_eq() const
Definition bslstp_hashset.h:158
hash_set(_InputIterator __f, _InputIterator __l, size_type __n, const allocator_type &__a)
Definition bslstp_hashset.h:204
hash_set(const allocator_type &__a)
Definition bslstp_hashset.h:173
hash_set(_InputIterator __f, _InputIterator __l, size_type __n, const hasher &__hf, const allocator_type &__a)
Definition bslstp_hashset.h:208
_Ht::size_type size_type
Definition bslstp_hashset.h:144
size_type bucket_count() const
Definition bslstp_hashset.h:264
pair< iterator, bool > insert_noresize(const value_type &__obj)
Definition bslstp_hashset.h:243
void erase(iterator __f, iterator __l)
Definition bslstp_hashset.h:259
iterator find(const _KT &__key) const
Definition bslstp_hashset.h:251
hash_set()
Definition bslstp_hashset.h:165
_Ht::allocator_type allocator_type
Definition bslstp_hashset.h:155
const_iterator iterator
Definition bslstp_hashset.h:153
hash_set(_InputIterator __f, _InputIterator __l, size_type __n)
Definition bslstp_hashset.h:189
Definition bslstp_hashtable.h:230
hasher hash_funct() const
Definition bslstp_hashtable.h:247
_HF hasher
Definition bslstp_hashtable.h:236
value_type & reference
Definition bslstp_hashtable.h:243
ptrdiff_t difference_type
Definition bslstp_hashtable.h:240
allocator_type get_allocator() const
Definition bslstp_hashtable.h:281
_Key key_type
Definition bslstp_hashtable.h:234
static bool _M_equal(const hashtable< _Val, _Key, _HF, _ExK, _EqK, _All > &, const hashtable< _Val, _Key, _HF, _ExK, _EqK, _All > &)
Definition bslstp_hashtable.h:703
key_equal key_eq() const
Definition bslstp_hashtable.h:248
value_type * pointer
Definition bslstp_hashtable.h:241
const value_type & const_reference
Definition bslstp_hashtable.h:244
_EqK key_equal
Definition bslstp_hashtable.h:237
_Val value_type
Definition bslstp_hashtable.h:235
const value_type * const_pointer
Definition bslstp_hashtable.h:242
size_t size_type
Definition bslstp_hashtable.h:239
_Alloc_traits< _Val, _All >::allocator_type allocator_type
Definition bslstp_hashtable.h:280
Definition bslstl_pair.h:1210
insert_iterator< _Container > & operator++()
Definition bslstp_hashset.h:523
insert_iterator(_Container &__x)
Definition bslstp_hashset.h:514
insert_iterator< _Container > & operator=(const typename _Container::value_type &__val)
Definition bslstp_hashset.h:518
insert_iterator< _Container > & operator++(int)
Definition bslstp_hashset.h:524
_Container * container
Definition bslstp_hashset.h:504
void reference
Definition bslstp_hashset.h:512
insert_iterator< _Container > & operator*()
Definition bslstp_hashset.h:522
bsl::hash_multiset< _Value, _HashFcn, _EqualKey, _Alloc > _Container
Definition bslstp_hashset.h:503
void difference_type
Definition bslstp_hashset.h:510
insert_iterator(_Container &__x, typename _Container::iterator)
Definition bslstp_hashset.h:515
_Container container_type
Definition bslstp_hashset.h:507
_Container::iterator iter
Definition bslstp_hashset.h:505
output_iterator_tag iterator_category
Definition bslstp_hashset.h:508
void pointer
Definition bslstp_hashset.h:511
void value_type
Definition bslstp_hashset.h:509
void difference_type
Definition bslstp_hashset.h:483
void pointer
Definition bslstp_hashset.h:484
insert_iterator< _Container > & operator++()
Definition bslstp_hashset.h:496
_Container * container
Definition bslstp_hashset.h:478
bsl::hash_set< _Value, _HashFcn, _EqualKey, _Alloc > _Container
Definition bslstp_hashset.h:477
insert_iterator(_Container &__x)
Definition bslstp_hashset.h:487
_Container container_type
Definition bslstp_hashset.h:480
void value_type
Definition bslstp_hashset.h:482
insert_iterator< _Container > & operator=(const typename _Container::value_type &__val)
Definition bslstp_hashset.h:491
insert_iterator< _Container > & operator*()
Definition bslstp_hashset.h:495
void reference
Definition bslstp_hashset.h:485
output_iterator_tag iterator_category
Definition bslstp_hashset.h:481
insert_iterator(_Container &__x, typename _Container::iterator)
Definition bslstp_hashset.h:488
insert_iterator< _Container > & operator++(int)
Definition bslstp_hashset.h:497
Definition bdlb_printmethods.h:283
Definition bdlc_flathashmap.h:1805
Definition balxml_encoderoptions.h:68
Definition bdldfp_decimal.h:5188
TYPE first
Definition bslstl_pair.h:605
TYPE second
Definition bslstl_pair.h:908
Definition bslstp_hashtable.h:146
Definition bslstl_equalto.h:311
Definition bslmf_isconvertible.h:867
Definition bslalg_hasstliterators.h:99
Definition bslma_usesbslmaallocator.h:343