Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle filter window reaching end of source #108

Merged
merged 1 commit into from
Aug 9, 2017

Conversation

jakirkham
Copy link
Member

Previously the rank filter relied on not explicitly supported behavior of libstdc++ and libc++, which was not guaranteed in the C++ standard. Namely that a negative index could be permissible and could retrieve values that had already been popped from the deque. However this isn't a good thing to rely on given the C++ standard does not provide for this. Further some C++ libraries like VC++ actually don't support this behavior and error instead.

To fix this issue, we explicitly store the previously stored value dropped from the window into the next value for this case. This explicitly provides the same behavior that libstdc++ and libc++, but without relying on undefined behavior of deque. Thus this should work well with VC++ and generally be a more robust strategy for handling this case going forward.

Previously the rank filter relied on not explicitly supported behavior
of libstdc++ and libc++, which was not guaranteed in the C++ standard.
Namely that a negative index could be permissible and could retrieve
values that had already been popped from the deque. However this isn't a
good thing to rely on given the C++ standard does not provide for this.
Further some C++ libraries like VC++ actually don't support this
behavior and error instead.

To fix this issue, we explicitly store the previously stored value
dropped from the window into the next value for this case. This
explicitly provides the same behavior that libstdc++ and libc++, but
without relying on undefined behavior of deque. Thus this should work
well with VC++ and generally be a more robust strategy for handling this
case going forward.
@jakirkham jakirkham merged commit 97b6721 into nanshe-org:master Aug 9, 2017
@jakirkham jakirkham deleted the fix_hdling_filt_end branch August 9, 2017 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant