Movatterモバイル変換


[0]ホーム

URL:



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

1379.pair copy-assignment not consistent for references

Section: 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,becausepair does 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:T1 andT2 shall satisfy therequirements ofCopyAssignable.

Effects: Assignsp.first tofirst andp.second tosecond.Returns:*this.


[8]ページ先頭

©2009-2026 Movatter.jp