23 Containers library [containers]

23.5 Unordered associative containers [unord]

23.5.3 Class template unordered_map [unord.map]

23.5.3.3 Element access [unord.map.elem]

constexpr mapped_type& operator[](const key_type& k);
Effects: Equivalent to: return try_emplace(k).first->second;
constexpr mapped_type& operator[](key_type&& k);
Effects: Equivalent to: return try_emplace(std​::​move(k)).first->second;
template<class K> constexpr mapped_type& operator[](K&& k);
Constraints: The qualified-ids Hash​::​is_transparent and Pred​::​is_transparent are valid and denote types.
Effects: Equivalent to: return try_emplace(std​::​forward<K>(k)).first->second;
constexpr mapped_type& at(const key_type& k); constexpr 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.
template<class K> constexpr mapped_type& at(const K& k); template<class K> constexpr const mapped_type& at(const K& k) const;
Constraints: The qualified-ids Hash​::​is_transparent and Pred​::​is_transparent are valid and denote types.
Preconditions: The expression find(k) is well-formed and has well-defined behavior.
Returns: A reference to find(k)->second.
Throws: An exception object of type out_of_range if find(k) == end() is true.
constexpr optional<mapped_type&> lookup(const key_type& k); constexpr optional<const mapped_type&> lookup(const key_type& k) const; template<class K> constexpr optional<mapped_type&> lookup(const K& k); template<class K> constexpr optional<const mapped_type&> lookup(const K& k) const;
Constraints: For the third and fourth overloads, the qualified-ids Hash​::​is_transparent and
Pred​::​is_transparent are valid and denote types.
Preconditions: The expression find(k) is well-formed and has well-defined behavior.
Returns: find(k)->second if contains(k) is true, otherwise nullopt.
Complexity: Average case constant, worst case linear in size().