microsoft / GSL

Guidelines Support Library
Other
6.13k stars 737 forks source link

Document potentially confusing behavior in gsl::narrow #1073

Closed dmitrykobets-msft closed 1 year ago

dmitrykobets-msft commented 1 year ago

NaN != Nan, so the comparisons used in gsl::narrow will always throw when attempting to cast a NaN value. This may be surprising, so document it.

Resolves https://github.com/microsoft/GSL/issues/1069