Both arithmetic (built-in) and user-defined numeric types require proper
specialization of
The library uses
The default using std::floor ; return floor(s); Therefore, for builtin arithmetic types, the std functions will be used. User defined types should provide overloaded versions of these functions in order to use the default rounder policies. If these overloads are defined within a user namespace argument dependent lookup (ADL) should find them, but if your compiler has a weak ADL you might need to put these functions some place else or write your own rounder policy.
The default Conversion Traits
If a User Defined Type is involved in a conversion, it is assumed
that the UDT has wider
range than any built-in type, and consequently the values of some
The Range Checking
Because User Defined Numeric Types might have peculiar ranges (such as an
unbounded range), this library does not attempt to supply a meaningful range
checking logic when UDTs are involved in a conversion. Therefore, if either
Target or Source are not built-in types, the bundled range checking of the
There are two components of the When both Target and Source are built-in types, the converter class uses an internal range checking logic which is optimized and customized for the combined properties of the types. However, this internal logic is disabled when either type is User Defined. In this case, the user can specify an external range checking policy which will be used in place of the internal code. See UserRangeChecker policy for details.
The converter class performs the actual conversion using a Raw Converter
policy. The default raw converter simply performs a
However, if the a UDT is involved, the |