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;
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.
Throws: An exception object of type out_of_range if find(k) == end() is true.

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant