It is an associative container that store unique elements in no particular order, and which allow for fast retrieval of individual elements based on their value.
DefinitionBelow is definition of std::unordered_set
template < class Key, class Hash = hash<Key>, class Pred = equal_to<Key>, class Alloc = allocator<Key> > class unordered_set;Parameters
Following member types can be used as parameters or return type by member functions.
Member Type Definition Notes key_type It is the first template parameter (Key) value_type It is the first template parameter (Key) The same as key_type hasher It is the second template parameter (Hash) defaults to: hash<key_type> key_equal It is the third template parameter (Pred) defaults to: equal_to<key_type> allocator_type It is the fourth template parameter (Alloc) defaults to: allocator<value_type> reference Alloc::reference const_reference Alloc::const_reference pointer Alloc::pointer for the default allocator: value_type* const_pointer Alloc::const_pointer for the default allocator: const value_type* iterator a forward iterator to const value_type * convertible to const_iterator const_iterator a forward iterator to const value_type * local_iterator a forward iterator to const value_type * convertible to const_local_iterator const_local_iterator a forward iterator to const value_type * size_type an unsigned integral type usually the same as size_t difference_type a signed integral type usually the same as ptrdiff_t Member functionsBelow is list of member functions
Sr.No. Method & DescriptionIt is used to assign the content.
Capacity Sr.No. Capacity & Description 1It is used to test whether container is empty.
2It returns container size.
3It returns maximum size.
Iterators Sr.No. Iterators & Description 1It returns iterator to beginning.
2It returns iterator to end.
3It returns const_iterator to beginning.
4It return const_iterator to end.
Element lookup Sr.No. Element lookup & Description 1It is used to get iterator to element.
2It is used to count elements with a specific key.
3It is used to get range of elements with a specific key.
Modifiers Sr.No. Modifiers & Description 1It is used to construct and insert element.
2It is used to construct and insert element with hint.
3It is used to insert elements.
4It is used to erase elements.
5It is used to clear content.
6It is used to swap content.
Buckets Hash policy Sr.No. Hash policy & Description 1It returns load factor.
2It is used to get or set maximum load factor.
3It is used to set number of buckets.
4It gives a request to capacity chage of backets
Observers Sr.No. Observers & Description 1It is used to get hash function.
2It is used to get key equivalence predicate.
3It is used to get allocator.
Non-member overloaded functions Sr.No. Non-member function overloads & Description 1operator==
Tests whether two maps are equal or not.
2operator!=
Tests whether two maps are equal or not.
3It exchanges contents of two unordered_set containers.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4