This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofResolved status.
pair copy-assignment not consistent for referencesSection: 22.3.2[pairs.pair]Status:ResolvedSubmitter: INCITSOpened: 2010-08-25Last modified: 2016-01-28
Priority:Not Prioritized
View otheractive issues in [pairs.pair].
View all otherissues in [pairs.pair].
View all issues withResolved status.
Discussion:
Addresses US-95
Copy-assignment forpair is defaulted and does not workfor pairs with reference members. This is inconsistent withconversion-assignment, which deliberately succeeds evenif one or both elements are reference types, just as fortuple. The copy-assignment operator should beconsistent with the conversion-assignment operator andwithtuple's assignment operators.
[2010-10-24 Daniel adds:]
Acceptingn3140 would provide a superior resolution,because
pairdoes not depend on the semantic requirements ofCopyAssignable.
[2010-11 Batavia]
Resolved by adoptingn3140.
Proposed resolution:
Add topair synopsis:
pair& operator=(const pair& p);
Add before paragraph 9:
pair& operator=(const pair& p);Requires:
T1andT2shall satisfy therequirements ofCopyAssignable.Effects: Assigns
p.firsttofirstandp.secondtosecond.Returns:*this.