Title
Associative(initializer_list, stuff) constructors are underspecified
Status
c++14
Section
[associative.reqmts] [unord.req]
Submitter
Stephan T. Lavavej

Created on 2013-09-21.00:00:00 last changed 123 months ago

Messages

Date: 2014-02-13.05:17:52

Proposed resolution:

This wording is relative to N3691.

  1. Edit [associative.reqmts], Table 102 — "Associative container requirements", as indicated:

    Table 102 — Associative container requirements (in addition to container) (continued)
    Expression Return type Assertion/note pre-/post-condition Complexity
    X(il); Same as X(il.begin(), il.end()). sSame as X(il.begin(), il.end()).
    X(il, c);   Same as X(il.begin(), il.end(), c). Same as X(il.begin(), il.end(), c).
  2. Edit [unord.req], Table 103 "Unordered associative container requirements", as indicated:

    Table 103 — Unordered associative container requirements (in addition to container)
    Expression Return type Assertion/note pre-/post-condition Complexity
    X(il) X Same as X(il.begin(), il.end()). Same as X(il.begin(), il.end()).
    X(il, n) X Same as X(il.begin(), il.end(), n). Same as X(il.begin(), il.end(), n).
    X(il, n, hf) X Same as X(il.begin(), il.end(), n, hf). Same as X(il.begin(), il.end(), n, hf).
    X(il, n, hf, eq) X Same as X(il.begin(), il.end(), n, hf, eq). Same as X(il.begin(), il.end(), n, hf, eq).
Date: 2014-02-13.05:17:52

[ Issaquah 2014-02-11: Move to Immediate ]

Date: 2013-09-21.00:00:00

[associative.reqmts] specifies both X(i,j) and X(i,j,c), but only X(il). [map.overview] declares "map(initializer_list<value_type>, const Compare& = Compare(), const Allocator& = Allocator());" but [map.cons] intentionally doesn't explain it, relying on the big table's requirements. As a result, map(il, c)'s behavior is not actually specified by the Standard. (All of the other ordered associative containers also provide such constructors.)

The unordered associative containers are similarly affected, although they have more arguments. (Again, the actual containers are correctly depicted with the desired constructors, their behavior just isn't specified.)

History
Date User Action Args
2014-02-27 17:03:20adminsetstatus: wp -> c++14
2014-02-20 13:52:38adminsetstatus: immediate -> wp
2014-02-13 05:17:52adminsetmessages: + msg6832
2014-02-13 05:17:52adminsetstatus: new -> immediate
2013-10-11 20:20:29adminsetmessages: + msg6712
2013-09-21 00:00:00admincreate