Element access#
at#
value_type& at( const key_type& key ); const value_type& at( const key_type& key ) const;Returns: a reference to
item.second, whereitemis the element with the key equivalent tokey.Throws:
std::out_of_rangeexception if the element with the key equivalent tokeyis not present in the container.
operator[]#
value_type& operator[]( const key_type& key );If the element with the key equivalent to
keyis not present in the container, inserts a new element constructed in-place fromstd::piecewise_construct, std::forward_as_tuple(key), std::tuple<>().Requirements: the type
value_typemust meet theEmplaceConstructiblerequirements from the [container.requirements] ISO C++ section.Returns: a reference to
item.second, whereitemis the element with the key equivalent tokey.
value_type& operator[]( key_type&& key );If the element with the key equivalent to
keyis not present in the container, inserts a new element, constructed in-place fromstd::piecewise_construct, std::forward_as_tuple(std::move(key)), std::tuple<>().Requirements: the type
value_typemust meet theEmplaceConstructiblerequirements from the [container.requirements] ISO C++ section.Returns: a reference to
item.second, whereitemis the element with the key equivalent tokey.