Open geiseri opened 4 years ago
Yes. A new window is created when the old window closes and then the end of the input sequence is signaled and the empty window is emitted. This is expected. Adding a filter after the window can be used to prevent any windows with less than 6 items.
Aha, that was not obvious to me. Is there a sane way to check for the end of the stream before closing the window? Or if there is an end with an empty window drop it? In my case I do not care if it is less than 6, I just care it's not 0
True a filter can address that though, it just seems a bit odd.
I have the following code:
What I expected to see:
What I do see is:
and then a segmentation fault on the
std::next(v.begin(),6)
part.If I have an
in
of size 30 though I see my expected result of: