microsoft-gsl

Tag

Cards List
#microsoft-gsl

C++ float-to-int conversion can be undefined behavior

Lobsters Hottest · 15h ago Cached

A blog post highlights that C++ float-to-int conversion is undefined behavior when the value doesn't fit, and points out that Microsoft's GSL library's safe narrowing function 'gsl::narrow' also suffers from this UB, contrary to its documentation.

0 favorites 0 likes
← Back to home

Submit Feedback