# Boost Exception

### error_info

#include <boost/exception/info.hpp>

    namespace
    boost
        {
        template <class Tag,class T>
        class
        error_info
            {
            public:

            typedef T value_type;

            error_info( value_type const & );
            };
        }

#### Requirements:

T must have accessible copy constructor and must not be a reference (there is no requirement that T's copy constructor does not throw.)

#### Description:

This class template is used to associate a Tag type with a value type T. Objects of type error_info<Tag,T> can be passed to operator<< to be stored in objects of type boost::exception.

#### Note:

The header <boost/exception/error_info.hpp> provides a declaration of the error_info template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, like this:

    #include <boost/exception/error_info.hpp>

    typedef boost::error_info<struct tag_errno,int> errno_info;

Of course, to actually add an error_info object to exceptions using operator<<, or to retrieve it using get_error_info, you must first #include <boost/exception/info.hpp>.

### See Also:

Boost Exception
boost/exception/error_info.hpp
boost/exception/exception.hpp
boost/exception/info.hpp
diagnostic_information
exception
exception/operator<<
get_error_info
Integrating Boost Exception in Existing Exception Class Hierarchies
tuple/operator<<