Title
partial_sort_copy underspecified for ranges of two different types
Status
new
Section
[partial.sort.copy]
Submitter
Matt Austern

Created on 2013-06-26.00:00:00 last changed 139 months ago

Messages

Date: 2013-06-26.00:00:00

The signature of this function is:

template<class InputIterator, class RandomAccessIterator>
RandomAccessIterator
partial_sort_copy(InputIterator first, InputIterator last,
                  RandomAccessIterator result_first,
                  RandomAccessIterator result_last);

(and the usual overload for an explicitly provided comparison function). The standard says nothing about requirements in the case where the input type (iterator_traits<InputIterator>::value_type) and the output type (iterator_traits<RandomAccessIterator>::value_type) are different.

Presumably the input type must be convertible to the output type. What's less clear is what the requirements are on the comparison operator. Does the algorithm only perform comparisons on two values of the output type, or does it also perform comparisons on values of the input type, or might it even perform heterogeneous comparisons?

History
Date User Action Args
2013-06-26 00:00:00admincreate