Title
pair copy-assignment not consistent for references
Status
resolved
Section
[pairs.pair]
Submitter
INCITS

Created on 2010-08-25.00:00:00 last changed 170 months ago

Messages

Date: 2011-05-09.23:20:35

Proposed resolution:

Add to pair synopsis:

pair& operator=(const pair& p);

Add before paragraph 9:

pair& operator=(const pair& p);

Requires: T1 and T2 shall satisfy the requirements of CopyAssignable.

Effects: Assigns p.first to first and p.second to second. Returns: *this.

Date: 2010-11-18.14:01:09

[ 2010-11 Batavia ]

Resolved by adopting n3140.

Date: 2010-10-24.00:00:00

[ 2010-10-24 Daniel adds: ]

Accepting n3140 would provide a superior resolution, because pair does not depend on the semantic requirements of CopyAssignable.

Date: 2010-10-24.10:50:39

Addresses US-95

Copy-assignment for pair is defaulted and does not work for pairs with reference members. This is inconsistent with conversion-assignment, which deliberately succeeds even if one or both elements are reference types, just as for tuple. The copy-assignment operator should be consistent with the conversion-assignment operator and with tuple's assignment operators.

History
Date User Action Args
2010-11-18 14:01:09adminsetmessages: + msg5391
2010-11-18 14:01:09adminsetstatus: nad editorial -> resolved
2010-11-11 03:10:11adminsetstatus: open -> nad editorial
2010-10-24 23:23:18adminsetmessages: + msg5088
2010-10-24 10:50:39adminsetmessages: + msg4998
2010-08-25 00:00:00admincreate