Title
Unordered container requirements should add initializer_list support
Status
c++11
Section
[unord.req]
Submitter
Daniel Krügler

Created on 2009-02-08.00:00:00 last changed 162 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

In [unord.req]/9 insert:

... [q1, q2) is a valid range in a, il designates an object of type initializer_list<value_type>, t is a value of type X::value_type, ...

In [unord.req], Table 87 insert:

Table 87 - Unordered associative container requirements (in addition to container)
Expression Return type Assertion/note
pre-/post-condition
Complexity
X(i, j)
X a(i, j)
X ... ...
X(il) X Same as X(il.begin(), il.end()). Same as X(il.begin(), il.end()).
... ... ... ...
a = b X ... ...
a = il X& a = X(il); return *this; Same as a = X(il).
... ... ... ...
a.insert(i, j) void ... ...
a.insert(il) void Same as a.insert(il.begin(), il.end()). Same as a.insert(il.begin(), il.end()).
Date: 2010-10-21.18:28:33

[ Batavia (2009-05): ]

We agree with the proposed resolution.

Move to Tentatively Ready.

Date: 2009-02-08.00:00:00

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 [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.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-21 18:28:33adminsetmessages: + msg4672
2010-10-21 18:28:33adminsetmessages: + msg4671
2009-02-08 00:00:00admincreate