[flat.map.access] (original) (raw)

23 Containers library [containers]

23.6 Container adaptors [container.adaptors]

23.6.8 Class template flat_map [flat.map]

23.6.8.6 Access [flat.map.access]

constexpr mapped_type& operator[](const key_type& x);

Effects: Equivalent to: return try_emplace(x).first->second;

constexpr mapped_type& operator[](key_type&& x);

Effects: Equivalent to: return try_emplace(std​::​move(x)).first->second;

template<class K> constexpr mapped_type& operator[](K&& x);

Constraints: The qualified-id Compare​::​is_transparent is valid and denotes a type.

Effects: Equivalent to: return try_emplace(std​::​forward<K>(x)).first->second;

constexpr mapped_type& at(const key_type& x);constexpr const mapped_type& at(const key_type& x) const;

Returns: A reference to the mapped_type corresponding to x in *this.

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

template<class K> constexpr mapped_type& at(const K& x);template<class K> constexpr const mapped_type& at(const K& x) const;

Constraints: The qualified-id Compare​::​is_transparentis valid and denotes a type.

Preconditions: The expression find(x) is well-formed and has well-defined behavior.

Returns: A reference to the mapped_type corresponding tox in *this.

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