oneAPI-spec icon indicating copy to clipboard operation
oneAPI-spec copied to clipboard

[oneDPL] Mismatch between specified default comparator and algorithm signature

Open dmitriy-sobolev opened this issue 5 months ago • 1 comments

Let's consider lower_bound as an example:

template<typename Policy, typename InputIt1, typename InputIt2, typename OutputIt,
    typename Comparator =
        std::less<typename std::iterator_traits<InputIt>::value_type>>
OutputIt
lower_bound(Policy&& policy, InputIt1 start, InputIt1 end,
    InputIt2 value_first, InputIt2 value_last, OutputIterator result,
    Comparator comp =
        std::less<typename std::iterator_traits<InputIt1>::value_type>());

...
If no comparator is provided, :code:`operator<` is used to determine when the search value is less than an element in the range being searched.

operator< is specified as a default comparator despite having std::less as a default template parameter.

dmitriy-sobolev avatar Sep 02 '24 10:09 dmitriy-sobolev