strange output, [[2]] instead of []
andrey-budko opened this issue · 2 comments
andrey-budko commented
https://flux.godbolt.org/z/MhGqKPjnr
#include <flux.hpp>
#include <iostream>
int main(){
flux::iota(1,4)
.drop(2)
.reverse().drop(5).reverse()
.filter([](int i) { return i&1; })
.chunk(4)
.write_to(std::cout);
// [[2]]
}tcbrindle commented
Hi @andrey-budko, thanks for the bug report. This is definitely a strange one!
Playing with the example, there are several interesting things:
- If we remove the
chunk()adaptor, it prints an empty sequence as expected - If we remove the
filter(), we get an empty sequence - If we remove the second
reverse(), we get an empty sequence - If we move the
filterso that it's the first adaptor in the pipeline (directly after theiota), we get an empty sequence - If we swap the
filterwith the secondreverse, then we get an empty sequence
There's definitely a bug... somewhere... but it looks like it's only exposed with a particular combination of adaptors.
tcbrindle commented
Hi @andrey-budko, this should now be fixed: https://flux.godbolt.org/z/o47dE8qbx
Thanks for the bug report, this was a fun one to track down! If you find any more Flux issues please do file them as well