23 Containers library [containers]

23.5 Unordered associative containers [unord]

23.5.4 Class template unordered_map [unord.map]

23.5.4.3 unordered_map element access [unord.map.elem]

mapped_type& operator[](const key_type& k); mapped_type& operator[](key_type&& k);

Requires: mapped_type shall be DefaultConstructible. For the first operator, key_type shall be CopyConstructible. For the second operator, key_type shall be MoveConstructible.

Effects: If the unordered_map does not already contain an element whose key is equivalent to k, the first operator inserts the value value_type(k, mapped_type()) and the second operator inserts the value value_type(std::move(k), mapped_type()).

Returns: A reference to x.second, where x is the (unique) element whose key is equivalent to k.

Complexity: Average case Ο(1), worst case Ο(size()).

mapped_type& at(const key_type& k); const mapped_type& at(const key_type& k) const;

Returns: A reference to x.second, where x is the (unique) element whose key is equivalent to k.

Throws: An exception object of type out_of_range if no such element is present.