This is just a cool problem to solve that I want to solve at some point.
Interface
eve::algo::fill_with_pattern(R1&& output, R2&& pattern)
similar to std::fill or eve::algo::fill.
It should do an equivalent of
void fill_with_patter(std::span<T> out, std::span<const T> pattern) {
EVE_ASSERT(!pattern.empty());
auto out_it = out.begin();
while(true) {
for (const auto& x : pattern) {
if (out_it == out.end()) return;
*out_it++ = x;
}
}
}
This is a surprisingly cute problem to do efficiently for small patterns.
And needs at least some thinking for bigger patterns.
This is just a cool problem to solve that I want to solve at some point.
Interface
similar to std::fill or eve::algo::fill.
It should do an equivalent of
This is a surprisingly cute problem to do efficiently for small patterns.
And needs at least some thinking for bigger patterns.