get_error_info

# Boost Exception

### get_error_info

    namespace
    boost
        {
        template <class ErrorInfo,class E>
        typename ErrorInfo::error_info::value_type const * get_error_info( E const & x );

        template <class ErrorInfo,class E>
        typename ErrorInfo::error_info::value_type * get_error_info( E & x );
        }

#### Requirements:

- ErrorInfo must be an instance of the error_info template.
- E must be polymorphic.

#### Returns:

- If dynamic_cast<boost::exception const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is null.
- Otherwise, the returned pointer points to the stored value (use operator<< to store values in exception objects.) When x is destroyed, any pointers returned by get_error_info become invalid.

#### Throws:

Nothing.

#### Note:

The interface of get_error_info may be affected by the build configuration macros.

See also: BOOST_THROW_EXCEPTION | Boost Exception | boost/exception/get_error_info.hpp | Configuration Macros | current_exception | error_info | exception | Motivation