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

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Boost Exception

exception/operator<<

#include <boost/exception/info.hpp> 

namespace
boost
    {
    template <class E, class Tag, class T>
    E const & operator<<( E const & x, error_info<Tag,T> const & v );
    }

Requirements:

E must be boost::exception, or a type that derives (indirectly) from boost::exception.

Postcondition:

A copy of v is stored into x. If x already contains data of type error_info<Tag,T>, that data is overwritten. Basic exception safety guarantee.

Returns:

x.

Throws:

std::bad_alloc, or any exception emitted by the T copy constructor.