-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
<random>
: Fixes subtract_with_carry_engine io
#2088
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - and apologies for the long wait! All of the issues I found were minor, so I'll validate and push changes.
for (int _Jx = 1; _Jx <= _Kx; ++_Jx) { // unpack into _Kx words | ||
unsigned int _Word = static_cast<unsigned int>(_Buf._At(_Ix) >> ((_Kx - _Jx) * 32)); | ||
for (int _Jx = 0; _Jx < _Kx; ++_Jx) { // unpack into _Kx words | ||
const unsigned int _Word = static_cast<unsigned int>(_Buf._At(_Ix) >> (_Jx * 32)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for other reviewers (no change requested): as the runtime behavior here was completely messed up, I am okay with changing the serialized output.
I'm mirroring this to an MSVC-internal PR. Please notify me if any further changes are pushed. |
Thank you for the bug fix! |
Co-authored-by: Stephan T. Lavavej <[email protected]>
tr1::subtract_with_carry
, breaking the state into 32-bit words, but the streaming operators should be consistent now.subtract_with_carry_engine
streaming operators hiddenfriend
s.tr1
classes continue to go through a free function taking an_Swc_base&
.subtract_with_carry_engine
streaming operators [tab:rand.req.eng], specifically the handling of the stream's flags and leaving the state unchanged if reading fails.