std::unordered_set::bucket_count

size_type bucket_count() const; (since C++11) Returns the number of buckets in the container. Parameters (none). Return value The number of buckets in the container. Complexity Constant. See also bucket_size returns the number of elements in specific bucket (public member function) max_bucket_count returns the maximum number of buckets (public member function)

std::unordered_multiset::unordered_multiset

(1) explicit unordered_multiset( size_type bucket_count = /*implementation-defined*/, const Hash& hash = Hash(), const KeyEqual& equal = KeyEqual(), const Allocator& alloc = Allocator() ); (since C++11) (until C++14) unordered_multiset() : unordered_multiset( size_type(/*implementation-defined*/) {} explicit unordered_multiset( size_type bucket_count, const Has

std::unordered_multiset::swap

void swap( unordered_multiset& other ); (since C++11) Exchanges the contents of the container with those of other. Does not invoke any move, copy, or swap operations on individual elements. All iterators and references remain valid. The past-the-end iterator is invalidated. The Hash and KeyEqual objects must be Swappable, and they are exchanged using unqualified calls to non-member swap. If std::allocator_traits<allocator_type>::propagate_on_container_swap::value is true, the

std::unordered_multiset::reserve

void reserve( size_type count ); (since C++11) Sets the number of buckets to the number needed to accomodate at least count elements without exceeding maximum load factor and rehashes the container, i.e. puts the elements into appropriate buckets considering that total number of buckets has changed. Effectively calls rehash(std::ceil(count / max_load_factor())). Parameters count - new capacity of the container Return value (none). Complexity Average case linear in the s

std::unordered_multiset::size

size_type size() const; (since C++11) Returns the number of elements in the container, i.e. std::distance(begin(), end()). Parameters (none). Return value The number of elements in the container. Exceptions noexcept specification: noexcept Complexity Constant. Example The following code uses size to display the number of elements in a std::unordered_multiset<int>: #include <unordered_set> #include <iostream> int main() { std::unordered_multiset

std::unordered_multiset::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_multiset::insert

iterator insert( const value_type& value ); (1) (since C++11) iterator 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::initializer_list<value_type> ilist ); (6)

std::unordered_multiset::key_eq

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

std::unordered_multiset::rehash

void rehash( size_type count ); (since C++11) Sets the number of buckets to count and rehashes the container, i.e. puts the elements into appropriate buckets considering that total number of buckets has changed. If the new number of buckets makes load factor more than maximum load factor (count < size() / max_load_factor()), then the new number of buckets is at least size() / max_load_factor(). Parameters count - new number of buckets Return value (none). Complexity

std::unordered_multiset::load_factor

float load_factor() const; (since C++11) Returns the average number of elements per bucket. Parameters (none). Return value Average number of elements per bucket. Complexity Constant. See also max_load_factor manages maximum average number of elements per bucket (public member function)