Movatterモバイル変換


[0]ホーム

URL:



This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofC++11 status.

2007. Incorrect specification of return value formap<>::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 theelement whose key is equivalentmapped_type corresponding tox in*this.


[8]ページ先頭

©2009-2026 Movatter.jp