std::unordered_multimap::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_multimap::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_multimap: #include <unordered_map> #include <iostream> int main() { std::unordered_multimap<int,cha

std::unordered_multimap::swap

void swap( unordered_multimap& 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_multimap::unordered_multimap

(1) explicit unordered_multimap( 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_multimap() : unordered_multimap( size_type(/*implementation-defined*/) {} explicit unordered_multimap( size_type bucket_count, const Has

std::unordered_multimap::insert

iterator insert( const value_type& value ); (1) (since C++11) template< class P > iterator insert( P&& value ); (2) (since C++11) iterator insert( value_type&& value ); (2) (since C++17) iterator insert( const_iterator hint, const value_type& value ); (3) (since C++11) template< class P > iterator insert( const_iterator hint, P&& value ); (4) (since C++11) iterator insert( const_iterator hint, value_type&& value

std::unordered_multimap::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_multimap::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_multimap::max_size

size_type max_size() const; (since C++11) Returns the maximum number of elements the container is able to hold due to system or library implementation limitations, i.e. std::distance(begin(), end()) for the largest container. Parameters (none). Return value Maximum number of elements. Exceptions noexcept specification: noexcept Complexity Constant. Notes This value is typically equal to std::numeric_limits<size_type>::max(), and reflects the theoretical limit on t

std::unordered_multimap::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_multimap::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)