no_exception_support<NoError, UnInitalized, Overflow, Underflow, Range, Domain>
Description This exception policy can be used in an environment where one cannot or does not want to use exceptions. Parameters are pointers to static functions which are invoked for each kind of error encountered in the library. The function signature of these functions are void function(const char * message) where message is the address of a literal string with information regarding the error.
Template Parameters Function objects to be invoked are specified for each error condition via template parameters. Parameter Type Requirements Description NoError void (*NoError)(const char *) Function to call on when an operation is invoked which COULD throw but does not. UnInitalized void (*UnInitalizized)(const char *) Function to call on when value is uninitialized Overflow void (*Overflow)(const char *) Function to call on overflow error Overflow void (*Overflow)(const char *) Function to call on overflow error Underflow void (*Underflow)(const char *) Function to call on underflow error Range void (*Range)(const char *) Function to call on range error Domain void (*Domain)(const char *) Function to call on domain error
Model of ExceptionPolicy
Header #include <boost/safe_numerics/exception_policy.hpp>
Example of use [A code fragment involving the type.] void no_error(const char * msg); void uninitialize(const char * msg); void overflow(const char * msg); void underflow(const char * msg); void range_error(const char * msg); void domain_error(const char * msg); using ep = ignore_exception< no_error, uninitialized, overflow, underflow, range_error, domain_error >; safe<int, native, ep> st(4);