-
Notifications
You must be signed in to change notification settings - Fork 115
Apply std::invoke to comparator function calls
#2509
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the codebase by systematically applying std::invoke to all comparator function calls, ensuring consistent and standards-compliant invocation of comparison operations throughout the library. This change improves support for callable objects including function pointers, member function pointers, and functors.
- Wraps all direct comparator calls with
std::invokefor proper callable object handling - Adds necessary
#include <functional>headers wherestd::invokeis used - Updates comment documentation to reflect the new std::invoke usage
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/support/utils.h | Added functional header for std::invoke support |
| test/parallel_api/algorithm/alg.sorting/alg.set.operations/set_common.h | Applied std::invoke to comparator in comp_select_first operator |
| test/parallel_api/algorithm/alg.nonmodifying/nth_element.pass.cpp | Applied std::invoke to comparator in lambda for nth_element test |
| test/general/sycl_iterator/sycl_iterator_sort.pass.cpp | Applied std::invoke to comparator in nth_element test lambda |
| test/general/implementation_details/balanced_path_unit_tests.pass.cpp | Applied std::invoke to comparator calls in path intersection functions |
| include/oneapi/dpl/pstl/utils.h | Applied std::invoke to comparator calls in iterator comparison and lower_bound functions |
| include/oneapi/dpl/pstl/unseq_backend_simd.h | Applied std::invoke throughout SIMD backend for min/max element operations |
| include/oneapi/dpl/pstl/parallel_impl.h | Added functional header and applied std::invoke in parallel find implementation |
| include/oneapi/dpl/pstl/parallel_backend_utils.h | Updated comment and applied std::invoke in serial merge operation |
| include/oneapi/dpl/pstl/parallel_backend_tbb.h | Added functional header and applied std::invoke in merge function |
| include/oneapi/dpl/pstl/hetero/utils_hetero.h | Applied std::invoke to comparator calls in minmax element reduce functions |
| include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge_sort.h | Applied std::invoke in subgroup bubble sorter |
| include/oneapi/dpl/pstl/hetero/algorithm_impl_hetero.h | Applied std::invoke in lexicographical compare transform function |
| include/oneapi/dpl/pstl/algorithm_impl.h | Updated comment and applied std::invoke extensively across sorting, heap, and comparison algorithms |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
std::invoke to comparator callsstd::invoke to comparator function calls
efc8eca to
1e0d0f5
Compare
…nvoke for comparators
….h - apply std::invoke for comparators
… - apply std::invoke for comparators
…nvoke for comparators
….h - apply std::invoke for comparators
…pply std::invoke for comparators
1e0d0f5 to
add7f22
Compare
…evert extra changes
… - revert extra changes
This PR enhances the codebase by systematically applying
std::invoketo all comparator function calls, ensuring consistent and standards-compliant invocation of comparison operations throughout the library. This change improves support for callable objects including function pointers, member function pointers, and functors.std::invokefor proper callable object handling#include <functional>headers wherestd::invokeis used