diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/copy.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/copy.hpp index c1eca482f7b..58c7fd756a4 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/copy.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/copy.hpp @@ -616,7 +616,10 @@ namespace hpx::parallel { util::loop_n>(part_begin, part_size, [&dest](zip_iterator it) mutable { if (get<1>(*it)) - *dest++ = get<0>(*it); + { + *dest = get<0>(*it); + dest++; + } }); };