This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++11 status.
981. Unordered container requirements should addinitializer_list
support
Section: 23.2.8 [unord.req] Status: C++11 Submitter: Daniel Krügler Opened: 2009-02-08 Last modified: 2016-01-28
Priority: Not Prioritized
View other active issues in [unord.req].
View all other issues in [unord.req].
View all issues with C++11 status.
Discussion:
Refering to N2800 all container requirements tables (including those for associative containers) provide useful member function overloads accepting std::initializer_list
as argument, the only exception is Table 87. There seems to be no reason for not providing them, because 23.5 [unord] is already initializer_list
-aware. For the sake of library interface consistency and user-expectations corresponding overloads should be added to the table requirements of unordered containers as well.
[ Batavia (2009-05): ]
We agree with the proposed resolution.
Move to Tentatively Ready.
Proposed resolution:
In 23.2.8 [unord.req]/9 insert:
...
[q1, q2)
is a valid range ina
,il
designates an object of typeinitializer_list<value_type>
,t
is a value of typeX::value_type
, ...
In 23.2.8 [unord.req], Table 87 insert:
Table 87 - Unordered associative container requirements (in addition to container) Expression Return type Assertion/note
pre-/post-condition ComplexityX(i, j)
X a(i, j)X
... ...X(il)
X
Same asX(il.begin(), il.end())
. Same asX(il.begin(), il.end())
. ... ... ... ...a = b
X
... ...a = il
X&
a = X(il); return *this;
Same asa = X(il)
. ... ... ... ...a.insert(i, j)
void
... ...a.insert(il)
void
Same asa.insert(il.begin(), il.end())
. Same asa.insert(il.begin(), il.end())
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4