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 & );

        private:

        ---unspecified---
        };
    }

Requirements:

T must have accessible copy constructor and must not be a reference.

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 errno_info object to exceptions using operator<<(), or to retrieve it using get_error_info(), you must first #include <boost/exception/info.hpp>.

See also: