From ecf7eb571586f3a3dcf32db5c927edd48135653f Mon Sep 17 00:00:00 2001 From: MikeDvorskiy Date: Mon, 17 Jun 2024 13:08:42 +0200 Subject: [PATCH] [oneDPL][ranges] + std::invoke for ranges::for_each --- include/oneapi/dpl/pstl/algorithm_ranges_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/oneapi/dpl/pstl/algorithm_ranges_impl.h b/include/oneapi/dpl/pstl/algorithm_ranges_impl.h index ffaf2ff1660..e386da5ab58 100644 --- a/include/oneapi/dpl/pstl/algorithm_ranges_impl.h +++ b/include/oneapi/dpl/pstl/algorithm_ranges_impl.h @@ -40,7 +40,7 @@ __pattern_for_each_impl(_Tag __tag, _ExecutionPolicy&& __exec, _R&& __r, _Fun __ { static_assert(__is_parallel_tag_v<_Tag> || typename _Tag::__is_vector{}); - auto __f_1 = [__f, __proj](auto&& __val) { __f(__proj(__val));}; + auto __f_1 = [__f, __proj](auto&& __val) { std::invoke(__f, std::invoke(__proj, __val));}; oneapi::dpl::__internal::__pattern_walk1(__tag, std::forward<_ExecutionPolicy>(__exec), std::ranges::begin(__r), std::ranges::begin(__r) + __r.size(), __f_1);