916. Redundant move-assignment operator of pair should be removed

Section: 23.4 [pairs] Status: NAD Submitter: Daniel Krügler Opened: 2008-10-04 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [pairs].

View all issues with NAD status.

Discussion:

see also 917.

The current WP provides the following assignment operators for pair in 23.4 [pairs]/1:

  1. template<class U , class V>
    requires HasAssign<T1, const U&> && HasAssign<T2, const V&>
    pair& operator=(const pair<U , V>& p);
    
  2. requires MoveAssignable<T1> && MoveAssignable<T2> pair& operator=(pair&& p );
    
  3. template<class U , class V>
    requires HasAssign<T1, RvalueOf<U>::type> && HasAssign<T2, RvalueOf<V>::type>
    pair& operator=(pair<U , V>&& p);
    

It seems that the functionality of (2) is completely covered by (3), therefore (2) should be removed.

[ Batavia (2009-05): ]

Bill believes the extra assignment operators are necessary for resolving ambiguities, but that does not mean it needs to be part of the specification.

Move to Open. We recommend this be looked at in the context of the ongoing work related to the pair templates.

[ 2009-07 Frankfurt: ]

Leave this open pending the removal of concepts from the WD.

[ 2009-10 Santa Cruz: ]

Mark as NAD, see issue 801.

Proposed resolution:

  1. In 23.4 [pairs] p. 1, class pair and just before p. 13 remove the declaration:

    requires MoveAssignable<T1> && MoveAssignable<T2> pair& operator=(pair&& p );
    
  2. Remove p.13+p.14