Skip to content

Commit

Permalink
unweave: Fix for MSVC 2022 ARM Preview probable compiler bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom authored and Dobiasd committed Jun 11, 2024
1 parent ec0fb00 commit 34c88e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion include/fplus/container_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1278,10 +1278,11 @@ std::pair<Container, Container> unweave(const Container& xs)
auto it_odd = internal::get_back_inserter<Container>(result.second);
std::size_t counter = 0;
for (const auto& x : xs) {
if (counter++ % 2 == 0)
if (counter % 2 == 0)
*it_even = x;
else
*it_odd = x;
counter++;
}
return result;
}
Expand Down
3 changes: 2 additions & 1 deletion include_all_in_one/include/fplus/fplus.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4373,10 +4373,11 @@ std::pair<Container, Container> unweave(const Container& xs)
auto it_odd = internal::get_back_inserter<Container>(result.second);
std::size_t counter = 0;
for (const auto& x : xs) {
if (counter++ % 2 == 0)
if (counter % 2 == 0)
*it_even = x;
else
*it_odd = x;
counter++;
}
return result;
}
Expand Down

0 comments on commit 34c88e3

Please sign in to comment.