diff --git a/test/parallel_api/ranges/std_ranges_copy_if.pass.cpp b/test/parallel_api/ranges/std_ranges_copy_if.pass.cpp index ec4bed91780..4447b98ce74 100644 --- a/test/parallel_api/ranges/std_ranges_copy_if.pass.cpp +++ b/test/parallel_api/ranges/std_ranges_copy_if.pass.cpp @@ -23,14 +23,22 @@ main() namespace dpl_ranges = oneapi::dpl::ranges; auto copy_if_checker = [](std::ranges::random_access_range auto&& r_in, - std::ranges::random_access_range auto&& r_out, auto&&... args) + std::ranges::random_access_range auto&& r_out, auto pred, auto proj, auto&&... args) { - auto res = std::ranges::copy_if(std::forward(r_in), std::ranges::begin(r_out), - std::forward(args)...); - using ret_type = std::ranges::copy_if_result, std::ranges::borrowed_iterator_t>; - return ret_type{res.in, res.out}; + + auto it_in = std::ranges::begin(r_in); + auto it_out = std::ranges::begin(r_out); + for(; it_in != std::ranges::end(r_in) && it_out != std::ranges::end(r_out); ++it_in) + { + if (std::invoke(pred, std::invoke(proj, *it_in))) + { + *it_out = *it_in; + ++it_out; + } + } + return ret_type{it_in, it_out}; }; test_range_algo<0, int, data_in_out>{}(dpl_ranges::copy_if, copy_if_checker, pred);