You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It can be seen that when the size is too large, it simply does nothing - neither throw an exception nor return a fail code. Is this behavior by design? Given that the _pointer member is protected, there is no way we can know if the skip success after calling it.
The text was updated successfully, but these errors were encountered:
Hmmm... It looks like this is an oversight. I think seeking beyond the end of the buffer should set the position to _blob.length() so that the next read will fail with EOF. Is this a fix you could contribute with a unit test?
I don't think it the right behavior, either. The right behavior in my opinion should be letting caller know there is an error, by either an error code or an exception, instead of behaving unexpectedly - if there is no further call, the caller would never know such an error.
Throwing EOF after setting _pointer would be fine too.
Yes, this is a good choice. I'll seek to contribute to it.
SleepyBag
changed the title
Why there is no error handling on out-bound skip of InputBuffer?
[C++] Why there is no error handling on out-bound skip of InputBuffer?
Jul 15, 2022
Here is the code of
InputBuffer::Skip
:It can be seen that when the size is too large, it simply does nothing - neither throw an exception nor return a fail code. Is this behavior by design? Given that the
_pointer
member is protected, there is no way we can know if the skip success after calling it.The text was updated successfully, but these errors were encountered: