# overflow

## Synopsis

This function is invoked by the library whenever it is not possible to produce a result for an arithmetic operation.

    void overflow(char const * const msg);

## Description

If environment supports C++ exceptions, this function throws the exception .

If the environment does not support C++ exceptions, the user should implement this function and expect it to be called when appropriate.

`boost/config.hpp` defines BOOST_NO_EXCEPTIONS when the environment doesn't support exceptions. It is by checking for the definition of this macro that the system determines whether or not exceptions are supported.

## Header

`#include <boost/safe_numerics/overflow.hpp>`

## Example of use

    #include <cstdio>

    void overflow(char const * const msg){
        std::fputs("safe_numerics overflow error:, std::stderr);
        std::fputs(msg, std::stderr);
        std::fputc('\n', std::stderr);
    }

## See Also

See rationale for more information on this function