std::unordered_set::hash_function

hasher hash_function() const; (since C++11) Returns the function that hashes the keys. Parameters (none). Return value The hash function. Complexity Constant. See also key_eq returns the function used to compare keys for equality (public member function)

std::unordered_set::max_bucket_count

size_type max_bucket_count() const; (since C++11) Returns the maximum number of buckets the container is able to hold due to system or library implementation limitations. Parameters (none). Return value Maximum number of buckets. Complexity Constant. See also bucket_count returns the number of buckets (public member function)

std::unordered_set::max_load_factor

float max_load_factor() const; (1) (since C++11) void max_load_factor( float ml ); (2) (since C++11) Manages the maximum load factor (number of elements per bucket). The container automatically increases the number of buckets if the load factor exceeds this threshold. 1) Returns current maximum load factor. 2) Sets the maximum load factor to ml. Parameters ml - new maximum load factor setting Return value 1) current maximum load factor. 2) none. Complexity Constan

std::unordered_set::insert

std::pair<iterator,bool> insert( const value_type& value ); (1) (since C++11) std::pair<iterator,bool> insert( value_type&& value ); (2) (since C++11) iterator insert( const_iterator hint, const value_type& value ); (3) (since C++11) iterator insert( const_iterator hint, value_type&& value ); (4) (since C++11) template< class InputIt > void insert( InputIt first, InputIt last ); (5) (since C++11) void insert( std::initiali

std::unordered_set::end(int)

local_iterator end( size_type n ); (since C++11) const_local_iterator end( size_type n ) const; (since C++11) const_local_iterator cend( size_type n ) const; (since C++11) Returns an iterator to the element following the last element of the bucket with index n. . This element acts as a placeholder, attempting to access it results in undefined behavior. Parameters n - the index of the bucket to access Return value iterator to the element following the last eleme

std::unordered_set::erase

iterator erase( const_iterator pos ); (1) (since C++11) iterator erase( const_iterator first, const_iterator last ); (2) (since C++11) size_type erase( const key_type& key ); (3) (since C++11) Removes specified elements from the container. 1) Removes the element at pos. 2) Removes the elements in the range [first; last), which must be a valid range in *this. 3) Removes the element (if one exists) with the key equivalent to key. References and iterators to the erased e

std::unordered_set::end

iterator end(); (since C++11) const_iterator end() const; (since C++11) const_iterator cend() const; (since C++11) Returns an iterator to the element following the last element of the container. This element acts as a placeholder; attempting to access it results in undefined behavior. Parameters (none). Return value Iterator to the element following the last element. Exceptions noexcept specification: noexcept Complexity Constant. See also begin cbegin

std::unordered_set::get_allocator

allocator_type get_allocator() const; (since C++11) Returns the allocator associated with the container. Parameters (none). Return value The associated allocator. Complexity Constant.

std::unordered_set::equal_range

std::pair<iterator,iterator> equal_range( const Key& key ); (since C++11) std::pair<const_iterator,const_iterator> equal_range( const Key& key ) const; (since C++11) Returns a range containing all elements with key key in the container. The range is defined by two iterators, the first pointing to the first element of the wanted range and the second pointing past the last element of the range. Parameters key - key value to compare the elements to Re

std::unordered_set::find

iterator find( const Key& key ); (1) const_iterator find( const Key& key ) const; (2) 1,2) Finds an element with key equivalent to key. Parameters key - key value of the element to search for Return value Iterator to an element with key equivalent to key. If no such element is found, past-the-end (see end()) iterator is returned. Complexity Constant on average, worst case linear in the size of the container. Example #include <iostream> #includ