This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Ready status.
unordered_map::atSection: 23.5.3.3 [unord.map.elem] Status: Ready Submitter: Pablo Halpern Opened: 2026-06-09 Last modified: 2026-06-15
Priority: Not Prioritized
View all other issues in [unord.map.elem].
View all issues with Ready status.
Discussion:
During review of P3091R5 Pablo pointed out that there is
no Complexity: element for unordered_map::at.
[Brno 2026-06-12; Status changed: New → Ready.]
Proposed resolution:
This wording is relative to N5046.
Modify 23.5.3.3 [unord.map.elem] as indicated:
constexpr mapped_type& at(const key_type& k); constexpr const mapped_type& at(const key_type& k) const;-5- Returns: A reference to
x.second, wherex is the (unique) element whose key is equivalent tok`.-6- Throws: An exception object of type
out_of_rangeif no such element is present.-?- Complexity: Average case constant, worst case linear in
size().template<class K> constexpr mapped_type& at(const K& k); template<class K> constexpr const mapped_type& at(const K& k) const;-7- Constraints: The qualified-ids
Hash::is_transparentandPred::is_transparentare valid and denote types.-8- Preconditions: The expression
find(k)is well-formed and has well-defined behavior.-9- Returns: A reference to
find(k)->second.-10- Throws: An exception object of type
out_of_rangeiffind(k) == end()istrue.-?- Complexity: Average case constant, worst case linear in
size().