From f440b626d7624440522da8f7625243305def0710 Mon Sep 17 00:00:00 2001 From: MikeDvorskiy Date: Tue, 6 Aug 2024 19:53:43 +0200 Subject: [PATCH] Update segments_tools.hpp --- .../internal/distributed_ranges_impl/detail/segments_tools.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/oneapi/dpl/internal/distributed_ranges_impl/detail/segments_tools.hpp b/include/oneapi/dpl/internal/distributed_ranges_impl/detail/segments_tools.hpp index 13673d9ccd2..d25b17b2107 100644 --- a/include/oneapi/dpl/internal/distributed_ranges_impl/detail/segments_tools.hpp +++ b/include/oneapi/dpl/internal/distributed_ranges_impl/detail/segments_tools.hpp @@ -31,7 +31,8 @@ auto make_enumerate(R&& r) { using W = std::size_t; - return __ranges::make_zip_view(stdrng::views::iota(W{0}, W{stdrng::size(r)}), std::forward(r)); + auto __r = std::ranges::subrange(r.begin(), r.end()); + return __ranges::make_zip_view(stdrng::views::iota(W{0}, W{stdrng::size(r)}), std::move(__r)); } // Take all elements up to and including segment `segment_id` at index