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
{{ message }}
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.
This is decidedly non-standard C++ but important given our deviation in peek behavior
Since our peek is never blocking, things like cin >> ws are less useful. Therefore, make a feature flag which enables a timeoutable peek mode.
Upon doing this we might revisit the code deviation for sgetc behavior and make it blocking again (respecting the timeout) and perhaps implement a new non-standard speekc to feed our istream::peek. This retains the desired deviant behavior but very slightly closes the standards deviation gap itself.
Consider also adding an istream::inspect which I contend is a more invasive act than a peek, suggesting we retain non-standard non-blocking peek behavior and introduce inspect as the blocking version. Alternatively, come up with a verb even less invasive than peek (like maybe anticipate or nonblock_peek or something) and switch peek back to standard behavior
The text was updated successfully, but these errors were encountered:
Timeout-blocking (non standard, but unlikely to break standard code run against it)
Timeout-blocking mode is enabled via FEATURE_IOS_TIMEOUT compiler define, and set it specifically to
the numeric value of milliseconds for the system level timeout. Though a compile-time timeout is somewhat restrictive, it should cover (with the addition of the nonstandard peek(timeout_ms) call) the use cases we're interested in.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This is decidedly non-standard C++ but important given our deviation in peek behavior
Since our peek is never blocking, things like
cin >> ws
are less useful. Therefore, make a feature flag which enables a timeoutable peek mode.Upon doing this we might revisit the code deviation for
sgetc
behavior and make it blocking again (respecting the timeout) and perhaps implement a new non-standardspeekc
to feed ouristream::peek
. This retains the desired deviant behavior but very slightly closes the standards deviation gap itself.Consider also adding an
istream::inspect
which I contend is a more invasive act than a peek, suggesting we retain non-standard non-blocking peek behavior and introduce inspect as the blocking version. Alternatively, come up with a verb even less invasive than peek (like maybe anticipate or nonblock_peek or something) and switch peek back to standard behaviorThe text was updated successfully, but these errors were encountered: