-
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
Suppress narrowing warnings in piecewise_constant_distribution::densities
#3107
Conversation
This didn't actually suppress the warnings... |
TFWU commit the tests but not the bugfix. 🤦 |
…ties This function converts a `vector` of `double` to a `vector` of `_Ty`, which is a narrowing conversion when `Ty` is `float`. It's silly to warn about this when the Standard makes it clear that the narrowing will occur, and the user has asked for such explicitly by calling `piecewise_constant_distrubution<float>::densities`. Fixes microsoft#3105.
I'll rebase onto the updated |
c19243e
to
feaed49
Compare
@CaseyCarter @strega-nil-ms I have doubled the size of this PR 😹 🛠️ and converted the test to compile-only. ✅ No modules impact - the push-disable-pops are outside the member functions which is good. |
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
piecewise_constant_distrubution::densities
piecewise_constant_distribution::densities
Thanks for investigating and fixing these spurious warnings! |
…ities` (microsoft#3107) Co-authored-by: Stephan T. Lavavej <[email protected]>
This function converts a
vector
ofdouble
to avector
of_Ty
, which is a narrowing conversion whenTy
isfloat
. It's silly to warn about this when the Standard makes it clear that the narrowing will occur, and the user has asked for such explicitly by callingpiecewise_constant_distrubution<float>::densities
.Fixes #3105.