Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Click here to view the latest version of this page.

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.