I think most people would categorize that the same as overflow caused by
narrowing conversion and as such should be a run time check like any other
narrowing conversion. As such it should be supported with runtime overflow
check.
On Fri, Mar 10, 2017, 11:11 AM Peter Dimov via Boost
John McFarlane wrote:
Conversion from integers to real numbers is not so much *unsafe* as *lossy*. Users intuitively understand that `int n = 0.5;` will not define a variable with value 0.5 and this is often exactly what they intend, e.g.: [...]
Converting to int a floating-point value that (absent the fractional part) cannot be represented in int is undefined behavior, so it is, in fact, unsafe, in addition to lossy.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost