13 Dec
2010
13 Dec
'10
11:12 a.m.
Hello all, we want to use iround / llround without exception handling. This is possible with the 'user_error' option and override a 'user_rounding_error' function. We want to return numeric_limits<int>::max() or numeric_limits<__int64>::max() if the rounding overflows over the maximum integer domain. This is then problematic since the 'user_rounding_error' has a template argument only for its source type (e.g. float / double), but not for its target type (i.e. int / __int64). We can ofc do the check before calling iround / llround, but this check would then executed be twice for the normal non overflow case. Anyone idea?