This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofC++11 status.
map<>::at()Section: 23.4.3.3[map.access]Status:C++11Submitter: Matt AusternOpened: 2010-11-01Last modified: 2016-01-28
Priority:Not Prioritized
View all otherissues in [map.access].
View all issues withC++11 status.
Discussion:
In [map.access]/9, theReturns clause formap<Key, T>::at(x) says that it returns "a reference to the element whose key is equivalent tox." That can't be right. The signature forat() says that its return type isT, but the elements ofmap<Key, T> have typepair<const K, T>. (I checked [unord.map.elem] and found that its specification ofat() is correct. This is a problem formap only.)
Proposed resolution:
Change the wording in [map.access]/9 so it's identical to what we already say foroperator[], which is unambiguous and correct.
Returns: A reference to the
element whose key is equivalentmapped_typecorresponding toxin*this.