Skip to content

Conversation

@SergeyKopienko
Copy link
Contributor

@SergeyKopienko SergeyKopienko commented Nov 7, 2025

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::invoke for proper callable object handling
  • Adds necessary #include <functional> headers where std::invoke is used
  • Updates comment documentation to reflect the new std::invoke usage

Copy link
Contributor

Copilot AI left a 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::invoke for proper callable object handling
  • Adds necessary #include <functional> headers where std::invoke is 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.

@SergeyKopienko SergeyKopienko changed the title Apply std::invoke to comparator calls Apply std::invoke to comparator function calls Nov 7, 2025
@SergeyKopienko SergeyKopienko force-pushed the dev/skopienko/apply_invoke branch from efc8eca to 1e0d0f5 Compare November 12, 2025 14:08
@SergeyKopienko SergeyKopienko force-pushed the dev/skopienko/apply_invoke branch from 1e0d0f5 to add7f22 Compare November 12, 2025 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant