You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A quick test on Godbolt showed that the latest ICC compiler (v19.0.1) does not recognize that char can always be converted to long long int without loss of precision with the current implementation of narrow: https://godbolt.org/z/73zPhG
I suggest wrapping the current implementation of narrow in a compile-time check on types, to see if there is any reason to check the values. Ideas:
One suggestion from stackoverflow I haven't tested is this:
if constexpr( !std::is_same<T, typename std::common_type<T,U>::type>::value )
A quick test on Godbolt showed that the latest ICC compiler (v19.0.1) does not recognize that
char
can always be converted tolong long int
without loss of precision with the current implementation ofnarrow
:https://godbolt.org/z/73zPhG
I suggest wrapping the current implementation of
narrow
in a compile-time check on types, to see if there is any reason to check the values. Ideas:is_narrowing_conversion
definition from https://riccibruno.github.io/2018/04/27/c++_is_narrowing_conversion_type_trait/.The text was updated successfully, but these errors were encountered: