The following code fails to compile but works as expected if I use iota() instead of generate()
// auto v = views::iota(10,20);
auto v = views::generate(
[i=10u] () mutable {
return i++;
}) | views::take(10);
auto r = v | views::chunk_by(
[](auto a, auto) {
return a == 15;
})
Is this to be expected?
How can I use views::chunk_by with views::generate ?