This exception is thrown when the to template is unable to perform a conversion at run-time. This typically occurs when the source value cannot be represented in the destination type. This exception is also thrown when the conversion would cause an over- or underflow.
Attempts to perform a value-preserving conversion of the given value from type S to type D. If the conversion cannot be performed in any context, a compile-time error will be issued describing the types involved. If the conversion fails at run-time because the destination type could not represent the value being converted, a ConversionException will be thrown.
This module provides a templated function that performs value-preserving conversions between arbitrary types. This function's behaviour can be extended for user-defined types as needed.