1101. unique requirements

Section: 27.7.9 [alg.unique] Status: NAD Editorial Submitter: Howard Hinnant Opened: 2009-04-25 Last modified: 2016-01-28 10:19:27 UTC

Priority: Not Prioritized

View all other issues in [alg.unique].

View all issues with NAD Editorial status.


From Message c++std-core-14160 Howard wrote:

It was the intent of the rvalue reference proposal for unique to only require MoveAssignable: N1860.

And Pete replied:

That was overridden by the subsequent changes made for concepts in N2573, which reimposed the C++03 requirements.

My impression is that this overwrite was a simple (unintentional) mistake. Wording below to correct it.

[ Batavia (2009-05): ]

Howard notes this issue resolves a discrepancy between the synopsis and the description.

Move to NAD Editorial.

Proposed resolution:

Change 27.7.9 [alg.unique]:

template<ForwardIterator Iter> 
  requires OutputIterator<Iter, RvalueOf<Iter::reference>::type> 
        && EqualityComparable<Iter::value_type> 
  Iter unique(Iter first, Iter last); 

template<ForwardIterator Iter, EquivalenceRelation<auto, Iter::value_type> Pred> 
  requires OutputIterator<Iter, RvalueOf<Iter::reference>::type> 
        && CopyConstructible<Pred> 
  Iter unique(Iter first, Iter last, Pred pred);

Note that the synopsis in [algorithms.syn] is already correct.