This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Resolved status.

482. Swapping pairs

Section: 22.3 [pairs], 22.4 [tuple] Status: Resolved Submitter: Andrew Koenig Opened: 2004-09-14 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [pairs].

View all issues with Resolved status.

Discussion:

(Based on recent comp.std.c++ discussion)

Pair (and tuple) should specialize std::swap to work in terms of std::swap on their components. For example, there's no obvious reason why swapping two objects of type pair<vector<int>, list<double> > should not take O(1).

[Lillehammer: We agree it should be swappable. Howard will provide wording.]

[ Post Oxford: We got swap for pair but accidently missed tuple. tuple::swap is being tracked by 522. ]

Proposed resolution:

Wording provided in N1856.

Rationale:

Recommend NADResolved, fixed by N1856.