Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[oneDPL] Mismatch between specified default comparator and algorithm signature #573

Open
dmitriy-sobolev opened this issue Sep 2, 2024 · 1 comment
Labels

Comments

@dmitriy-sobolev
Copy link
Contributor

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.

@akukanov akukanov added the DPL label Sep 23, 2024
@akukanov
Copy link
Contributor

Well, std::less is defined in the standard to use operator<, and no customization mechanism is described. So the wording is not wrong, though perhaps confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants