Title
swap circular definition
Status
c++11
Section
[containers]
Submitter
Alisdair Meredith

Created on 2008-09-10.00:00:00 last changed 161 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

In table 80 in section [container.requirements.general], replace the postcondition of a.swap(b) with the following:

Table 80 -- Container requirements
Expression Return type Operational semantics Assertion/note pre-/post-conidtion Complexity
... ... ... ... ...
a.swap(b); void   swap(a,b) Exchange the contents of a and b. (Note A)

Remove the reference to swap from the paragraph following the table.

Notes: the algorithms swap(), equal() and lexicographical_compare() are defined in Clause 25. ...

Date: 2010-10-21.18:28:33

[ 2009-07 Frankfurt ]

Moved to Ready with minor edits (which have been made).

Date: 2010-10-21.18:28:33

[ Post Summit Anthony Williams provided proposed wording. ]

Date: 2010-10-21.18:28:33

[ San Francisco: ]

Robert to propose a resolution along the lines of "Postcondition: "a = b, b = a" This will be a little tricky for the hash containers, since they don't have operator==.

Date: 2008-09-10.00:00:00

Note in particular that Table 90 "Container Requirements" gives semantics of a.swap(b) as swap(a,b), yet for all containers we define swap(a,b) to call a.swap(b) - a circular definition.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-21 18:28:33adminsetmessages: + msg4183
2010-10-21 18:28:33adminsetmessages: + msg4182
2010-10-21 18:28:33adminsetmessages: + msg4181
2010-10-21 18:28:33adminsetmessages: + msg4180
2008-09-10 00:00:00admincreate