std::unordered_map::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_map::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_map::empty

bool empty() const; (since C++11) Checks if the container has no elements, i.e. whether begin() == end(). Parameters (none). Return value true if the container is empty, false otherwise. Exceptions noexcept specification: noexcept Complexity Constant. Example The following code uses empty to check if a std::unordered_map<int,int> contains any elements: #include <unordered_map> #include <iostream> #include <utility> int main() { std::unorde

std::unordered_map::begin(int)

local_iterator begin( size_type n ); (since C++11) const_local_iterator begin( size_type n ) const; (since C++11) const_local_iterator cbegin( size_type n ) const; (since C++11) Returns an iterator to the first element of the bucket with index pos. Parameters n - the index of the bucket to access Return value Iterator to the first element. Complexity Constant. See also end(int) cend(int) returns an iterator to the end of the specified bucket (public m

std::unordered_map::bucket

size_type bucket( const Key& key ) const; (since C++11) Returns the index of the bucket for key key. Elements (if any) with keys equivalent to key are always found in this bucket. The returned value is valid only for instances of the container for which bucket_count() returns the same value. The behavior is undefined if bucket_count() is zero. Parameters key - the value of the key to examine Return value Bucket index for the key key. Complexity Constant. See also

std::unordered_map::count

size_type count( const Key& key ) const; (1) (since C++11) Returns the number of elements with key key. Parameters key - key value of the elements to count Return value Number of elements with key key. Complexity Constant on average, worst case linear in the size of the container. See also find finds element with specific key (public member function) equal_range returns range of elements matching a specific key (public member function)

std::unordered_map::bucket_size

size_type bucket_size( size_type n ) const; (since C++11) Returns the number of elements in the bucket with index n. Parameters n - the index of the bucket to examine Return value The number of elements in the bucket n. Complexity Constant. See also bucket_count returns the number of buckets (public member function)

std::unordered_map::clear

void clear(); (since C++11) Removes all elements from the container. Invalidates any references, pointers, or iterators referring to contained elements. May invalidate any past-the-end iterators. Parameters (none). Return value (none). Exceptions noexcept specification: noexcept Complexity Linear in the size of the container. See also erase erases elements (public member function)

std::unordered_map::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_map::at

T& at( const Key& key ); (1) (since C++11) const T& at( const Key& key ) const; (2) (since C++11) Returns a reference to the mapped value of the element with key equivalent to key. If no such element exists, an exception of type std::out_of_range is thrown. Parameters key - the key of the element to find Return value Reference to the mapped value of the requested element. Exceptions std::out_of_range if the container does not have an element with t