Title
map<Key, T>::value_type does not satisfy the assignable requirement
Status
nad editorial
Section
[map]
Submitter
Mark Mitchell

Created on 1999-04-14.00:00:00 last changed 164 months ago

Messages

Date: 2010-10-21.18:28:33

Rationale:

The LWG believes that the standard is inconsistent, but that this is a design problem rather than a strict defect. May wish to reconsider for the next standard.

Date: 2010-10-21.18:28:33

[ See issue 103 for the slightly related issue of modification of set keys. ]

Date: 1999-04-14.00:00:00

[container.requirements]

expression         return type      pre/post-condition
-------------     -----------      -------------------
X::value_type    T                    T is assignable

[map]

A map satisfies all the requirements of a container.

For a map<Key, T> ... the value_type is pair<const Key, T>.

There's a contradiction here. In particular, `pair<const Key, T>' is not assignable; the `const Key' cannot be assigned to. So,  map<Key, T>::value_type does not satisfy the assignable requirement imposed by a container.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg1663
2010-10-21 18:28:33adminsetmessages: + msg1662
1999-04-14 00:00:00admincreate