diff --git a/doc/BOOST_ERROR_INFO.html b/doc/BOOST_ERROR_INFO.html index a83038c..699e8bc 100644 --- a/doc/BOOST_ERROR_INFO.html +++ b/doc/BOOST_ERROR_INFO.html @@ -19,7 +19,8 @@ -

BOOST_ERROR_INFO

+

BOOST_ERROR_INFO

+

#include <boost/exception/info.hpp>

namespace
 boost
@@ -33,11 +34,13 @@ boost
         ::boost::throw_file(__FILE__) <<\
         ::boost::throw_line((int)__LINE__)
     }
-

This macro is designed to be used with operator<< when throwing a boost::exception, to store information about the location of the throw statement. It can be chained with other error_infos in a single throw expression.

-

See also:

+

This macro is designed to be used with operator<< when throwing a boost::exception, to store information about the location of the throw statement. It can be chained with other error_infos in a single throw expression.

+

+

See Also:

Boost Exception
boost/exception/info.hpp
+
diff --git a/doc/boost-exception.html b/doc/boost-exception.html index 3914d22..2ae3f56 100644 --- a/doc/boost-exception.html +++ b/doc/boost-exception.html @@ -3,7 +3,7 @@ - Boost Exception + boost exception @@ -21,13 +21,13 @@

Introduction

The purpose of Boost Exception is to ease the design of exception class hierarchies and to help write exception handling and error reporting code.

-

It supports transporting of arbitrary data to the catch site, which is otherwise tricky due to the no-throw requirements (15.5.1) for exception classes. Data can be added to any exception object, either directly in the throw-expression (15.1), or at a later time as the exception object propagates up the call stack.

+

It supports transporting of arbitrary data to the catch site, which is otherwise tricky due to the no-throw requirements (15.5.1) for exception types. Data can be added to any exception object, either directly in the throw-expression (15.1), or at a later time as the exception object propagates up the call stack.

The ability to add data to exception objects after they have been passed to throw is important, because often some of the information needed to handle an exception is unavailable in the context where the failure is detected.

Boost Exception also supports N2179-style copying of exception objects, implemented non-intrusively and automatically by the boost::throw_exception function.

Contents

  1. Tutorial
    1. Tutorial: Transporting of Arbitrary Data to the Catch Site
    2. Tutorial: Integrating Boost Exception in Existing Exception Class Hierarchies
    3. -
    4. Tutorial: Transporting of Exceptions between Threads
    5. +
    6. Tutorial: Transporting of Exceptions Between Threads
    7. Tutorial: Diagnostic Information
  2. @@ -155,7 +155,8 @@ boost #endif }

    Class exception

    -

    exception

    +

    exception

    +

    #include <boost/exception/exception.hpp>

    namespace
     boost
    @@ -177,7 +178,8 @@ boost
     

    Class boost::exception is designed to be used as a universal base for user-defined exception types.

    An object of any type deriving from boost::exception can store data of arbitrary types, using the error_info wrapper and operator<<.

    To retrieve data from a boost::exception object, use the get_error_info function template.

    -

    exception::exception

    +

    exception::exception

    +
    exception();
     exception( exception const & x );

    Effects:

    @@ -186,22 +188,27 @@ boost

    Throws:

    Nothing.

    -

    exception::~exception

    +

    exception::~exception

    +

    Effects:

    Frees all resources associated with a boost::exception object.

    Throws:

    Nothing.

    -

    exception::diagnostic_information

    +

    exception::diagnostic_information

    +
    virtual char const * diagnostic_information() const throw();

    Returns:

    -

    An string representation of all data stored in the boost::exception object by the operator<< function. See "Tutorial: Diagnostic Information" for details.

    +

    A string representation of all data stored in the boost::exception object by the operator<< function. See "Tutorial: Diagnostic Information" for details.

    Throws:

    Nothing.

    -

    Note:

    -

    The return value remains valid until the exception object from which it is obtained is destroyed or modified.

    +

    Notes:

    +

    Transporting of Arbitrary Data to the Catch Site

    -

    error_info

    +

    error_info

    +

    #include <boost/exception/info.hpp>

    namespace
     boost
    @@ -218,7 +225,7 @@ boost
             };
         }

    Requirements:

    -

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

    +

    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:

    @@ -226,8 +233,9 @@ boost
    #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>.

    -

    operator<<, error_info overload

    +

    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>.

    +

    operator<</exception

    +

    #include <boost/exception/info.hpp> 

    namespace
     boost
    @@ -238,12 +246,34 @@ boost
     

    Requirements:

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

    Effects:

    -

    Stores a copy of v into x. If x already contains data of type error_info<Tag1,T1>, that data is overwritten.

    +

    Stores a copy of v into x. If x already contains data of type error_info<Tag,T>, that data is overwritten.

    Returns:

    x.

    Throws:

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

    -

    get_error_info

    +

    operator<</tuple

    +
    +

    #include <boost/exception/info_tuple.hpp>

    +
    namespace
    +boost
    +    {
    +    template <class E, class Tag1, class T1, ..., class TagN, class TN>
    +    E const & operator<<( E const & x,
    +        tuple<
    +            error_info<Tag1,T1>,
    +            ...,
    +            error_info<TagN,TN> > const & v );
    +    }
    +

    Requirements:

    +

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

    +

    Effects:

    +

    Equivalent to x << v.get<0>() << ... << v.get<N>().

    +

    Returns:

    +

    x.

    +

    Throws:

    +

    std::bad_alloc, or any exception emitted by T1..TN copy constructor.

    +

    get_error_info

    +

    #include <boost/exception/info.hpp>

    namespace
     boost
    @@ -252,12 +282,17 @@ boost
         shared_ptr<typename ErrorInfo::value_type const> get_error_info( E const & x );
         }

    Requirements:

    -

    The type of the x object must derive from boost::exception; ErrorInfo must be an instance of the error_info template.

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

    Returns:

    -

    If x does not store an object of type ErrorInfo, returns an empty shared_ptr; otherwise returns pointer to the stored value. Use operator<< to store values in exception objects.

    +
    • If dynamic_cast<boost::exception const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is an empty shared_ptr.
    • +
    • Otherwise, the returned shared_ptr points to the stored value (use operator<< to store values in exception objects.) The shared_ptr is valid even after x has been destroyed.
    • +

    Throws:

    Nothing.

    -

    enable_error_info

    +

    enable_error_info

    +

    #include <boost/exception/enable_error_info.hpp>

    namespace
     boost
    @@ -266,12 +301,15 @@ boost
         ---unspecified--- enable_error_info( T const & x );
         }

    Requirements:

    -

    T must be a user-defined type with accessible no-throw copy constructor.

    +

    T must be a user-defined type with accessible no-throw copy constructor as per (15.5.1).

    Returns:

    -

    An object of unspecified type with no-throw copy semantics, which derives publicly from both T, and class boost::exception. The T sub-object is initialized from x by the T copy constructor. If T already derives from boost::exception, then the type of the returned object does not derive boost::exception.

    +
    • If T derives from boost::exception, the returned object is of type T and is a copy of x.
    • +
    • Otherwise, the returned object is of an unspecified type that derives publicly from both T and boost::exception. The T sub-object is initialized from x by the T copy constructor.
    • +

    Throws:

    Nothing.

    -

    BOOST_ERROR_INFO

    +

    BOOST_ERROR_INFO

    +

    #include <boost/exception/info.hpp>

    namespace
     boost
    @@ -285,9 +323,10 @@ boost
             ::boost::throw_file(__FILE__) <<\
             ::boost::throw_line((int)__LINE__)
         }
    -

    This macro is designed to be used with operator<< when throwing a boost::exception, to store information about the location of the throw statement. It can be chained with other error_infos in a single throw expression.

    +

    This macro is designed to be used with operator<< when throwing a boost::exception, to store information about the location of the throw statement. It can be chained with other error_infos in a single throw expression.

    Transporting of Exceptions between Threads

    -

    exception_ptr

    +

    exception_ptr

    +

    #include <boost/exception_ptr.hpp>

    namespace
     boost
    @@ -297,9 +336,8 @@ boost
     

    The exception_ptr type can be used to refer to a copy of an exception object. It is Default Constructible, Copy Constructible, Assignable and Equality Comparable; exception_ptr's operations do not throw.

    Two instances of exception_ptr are equivalent and compare equal if and only if they refer to the same exception.

    The default constructor of exception_ptr produces the null value of the type. The null value is equivalent only to itself.

    -

    Note:

    -

    exception_ptr objects are returned by current_exception and copy_exception.

    -

    enable_current_exception

    +

    enable_current_exception

    +

    #include <boost/exception/enable_current_exception.hpp>

    namespace
     boost
    @@ -308,11 +346,11 @@ boost
         ---unspecified--- enable_current_exception( T const & e );
         }

    Requirements:

    -

    T must have an accessible no-throw copy constructor

    +

    T must have an accessible no-throw copy constructor.

    Returns:

    An object of unspecified type which derives publicly from T. That is, the returned object can be intercepted by a catch(T &).

    Description:

    -

    This function is designed to be used directly in a throw-expression to enable the exception_ptr support in Boost Exception. For example:

    +

    This function is designed to be used directly in a throw-expression to enable the exception_ptr support in Boost Exception. For example:

    class
     my_exception:
         public std::exception
    @@ -323,8 +361,9 @@ my_exception:
     throw boost::enable_current_exception(my_exception());

    Unless enable_current_exception is called at the time an exception object is used in a throw-expression, an attempt to copy it using current_exception may return an exception_ptr which refers to an instance of unknown_exception. See current_exception for details.

    Note:

    -

    Instead of using the throw keyword directly, it is preferable to call boost::throw_exception. This is guaranteed to throw an exception that derives from boost::exception and supports exception_ptr functionality.

    -

    current_exception

    +

    Instead of using the throw keyword directly, it is preferable to call boost::throw_exception. This is guaranteed to throw an exception that derives from boost::exception and supports the exception_ptr functionality.

    +

    current_exception

    +

    #include <boost/exception_ptr.hpp>

    namespace
     boost
    @@ -341,9 +380,10 @@ boost
     

    Nothing.

    Notes:

    -

    copy_exception

    +

    copy_exception

    +

    #include <boost/exception_ptr.hpp>

    namespace
     boost
    @@ -353,7 +393,8 @@ boost
         }

    Effects:

    As if try { throw e; } catch( ... ) { return current_exception(); }

    -

    rethrow_exception

    +

    rethrow_exception

    +

    #include <boost/exception_ptr.hpp>

    namespace
     boost
    @@ -364,7 +405,8 @@ boost
     

    ep shall not be null.

    Throws:

    The exception to which ep refers.

    -

    unknown_exception

    +

    unknown_exception

    +

    #include <boost/exception_ptr.hpp>

    namespace
     boost
    @@ -379,7 +421,8 @@ boost
         }

    This type is used by the exception_ptr support in Boost Exception. Please see current_exception.

    Printing Diagnostic Information

    -

    diagnostic_information

    +

    diagnostic_information

    +

    #include <boost/exception/diagnostic_information.hpp>

    namespace
     boost
    @@ -387,9 +430,10 @@ boost
         std::string diagnostic_information( std::exception const & x );
         }

    Returns:

    -

    If dynamic_cast<boost::exception *>(&x) is not null, the returned string is initialized by a call to exception::diagnostic_information; otherwise, the returned string combines the output of x.what() and typeid(x).name().

    +

    If dynamic_cast<boost::exception const *>(&x) is not null, the returned string is initialized by a call to exception::diagnostic_information; otherwise, the returned string combines the output of x.what() and typeid(x).name().

    Throwing Exceptions

    -

    throw_exception

    +

    throw_exception

    +

    #include <boost/throw_exception.hpp>

    namespace
     boost
    @@ -409,7 +453,7 @@ boost
     

    E must derive publicly from std::exception.

    Effects:

    • If BOOST_NO_EXCEPTIONS is not defined, boost::throw_exception(e) is equivalent to throw boost::enable_current_exception(boost::enable_error_info(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::throw_exception(e) is equivalent to throw e;
    • -
    • If BOOST_NO_EXCEPTIONS is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of throw_exception are allowed to assume that the function never returns; therefore, if the user-defined throw_exception returns, the behavior is undefined.
    • +
    • If BOOST_NO_EXCEPTIONS is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of throw_exception are allowed to assume that the function never returns; therefore, if the user-defined throw_exception returns, the behavior is undefined.
    diff --git a/doc/boost_exception_diagnostic_information_hpp.html b/doc/boost_exception_diagnostic_information_hpp.html index 2fe07fd..97c550d 100644 --- a/doc/boost_exception_diagnostic_information_hpp.html +++ b/doc/boost_exception_diagnostic_information_hpp.html @@ -19,7 +19,8 @@ -

    boost/exception/diagnostic_information.hpp

    +

    boost/exception/diagnostic_information.hpp

    +

    Synopsis

    #include <exception>
     
    @@ -28,11 +29,14 @@ boost
         {
         std::string diagnostic_information( std::exception const & x );
         }
    -

    See also:

    +
    diff --git a/doc/copy_exception.html b/doc/copy_exception.html index afc4bd8..ff6f4ea 100644 --- a/doc/copy_exception.html +++ b/doc/copy_exception.html @@ -19,7 +19,8 @@ -

    copy_exception

    +

    copy_exception

    +

    #include <boost/exception_ptr.hpp>

    namespace
     boost
    @@ -29,11 +30,12 @@ boost
         }

    Effects:

    As if try { throw e; } catch( ... ) { return current_exception(); }

    -

    See also:

    +
    diff --git a/doc/current_exception.html b/doc/current_exception.html index 759f47f..43c0fe9 100644 --- a/doc/current_exception.html +++ b/doc/current_exception.html @@ -19,7 +19,8 @@ -

    current_exception

    +

    current_exception

    +

    #include <boost/exception_ptr.hpp>

    namespace
     boost
    @@ -36,16 +37,17 @@ boost
     

    Nothing.

    Notes:

    -

    See also:

    +
    diff --git a/doc/diagnostic_information.html b/doc/diagnostic_information.html index c60ef6f..214e040 100644 --- a/doc/diagnostic_information.html +++ b/doc/diagnostic_information.html @@ -19,7 +19,8 @@ -

    diagnostic_information

    +

    diagnostic_information

    +

    #include <boost/exception/diagnostic_information.hpp>

    namespace
     boost
    @@ -27,11 +28,14 @@ boost
         std::string diagnostic_information( std::exception const & x );
         }

    Returns:

    -

    If dynamic_cast<boost::exception *>(&x) is not null, the returned string is initialized by a call to exception::diagnostic_information; otherwise, the returned string combines the output of x.what() and typeid(x).name().

    -

    See also:

    +

    If dynamic_cast<boost::exception const *>(&x) is not null, the returned string is initialized by a call to exception::diagnostic_information; otherwise, the returned string combines the output of x.what() and typeid(x).name().

    +
    diff --git a/doc/enable_current_exception.html b/doc/enable_current_exception.html index fbcc5fb..13107f4 100644 --- a/doc/enable_current_exception.html +++ b/doc/enable_current_exception.html @@ -19,7 +19,8 @@ -

    enable_current_exception

    +

    enable_current_exception

    +

    #include <boost/exception/enable_current_exception.hpp>

    namespace
     boost
    @@ -28,11 +29,11 @@ boost
         ---unspecified--- enable_current_exception( T const & e );
         }

    Requirements:

    -

    T must have an accessible no-throw copy constructor

    +

    T must have an accessible no-throw copy constructor.

    Returns:

    An object of unspecified type which derives publicly from T. That is, the returned object can be intercepted by a catch(T &).

    Description:

    -

    This function is designed to be used directly in a throw-expression to enable the exception_ptr support in Boost Exception. For example:

    +

    This function is designed to be used directly in a throw-expression to enable the exception_ptr support in Boost Exception. For example:

    class
     my_exception:
         public std::exception
    @@ -43,14 +44,16 @@ my_exception:
     throw boost::enable_current_exception(my_exception());

    Unless enable_current_exception is called at the time an exception object is used in a throw-expression, an attempt to copy it using current_exception may return an exception_ptr which refers to an instance of unknown_exception. See current_exception for details.

    Note:

    -

    Instead of using the throw keyword directly, it is preferable to call boost::throw_exception. This is guaranteed to throw an exception that derives from boost::exception and supports exception_ptr functionality.

    -

    See also:

    +

    Instead of using the throw keyword directly, it is preferable to call boost::throw_exception. This is guaranteed to throw an exception that derives from boost::exception and supports the exception_ptr functionality.

    +
    diff --git a/doc/enable_error_info.html b/doc/enable_error_info.html index 4ea13ef..4fb8c14 100644 --- a/doc/enable_error_info.html +++ b/doc/enable_error_info.html @@ -19,7 +19,8 @@ -

    enable_error_info

    +

    enable_error_info

    +

    #include <boost/exception/enable_error_info.hpp>

    namespace
     boost
    @@ -28,17 +29,21 @@ boost
         ---unspecified--- enable_error_info( T const & x );
         }

    Requirements:

    -

    T must be a user-defined type with accessible no-throw copy constructor.

    +

    T must be a user-defined type with accessible no-throw copy constructor as per (15.5.1).

    Returns:

    -

    An object of unspecified type with no-throw copy semantics, which derives publicly from both T, and class boost::exception. The T sub-object is initialized from x by the T copy constructor. If T already derives from boost::exception, then the type of the returned object does not derive boost::exception.

    +
    • If T derives from boost::exception, the returned object is of type T and is a copy of x.
    • +
    • Otherwise, the returned object is of an unspecified type that derives publicly from both T and boost::exception. The T sub-object is initialized from x by the T copy constructor.
    • +

    Throws:

    Nothing.

    -

    See also:

    +
    diff --git a/doc/error_info.html b/doc/error_info.html index 61f6f00..1776dbd 100644 --- a/doc/error_info.html +++ b/doc/error_info.html @@ -19,7 +19,8 @@ -

    error_info

    +

    error_info

    +

    #include <boost/exception/info.hpp>

    namespace
     boost
    @@ -36,7 +37,7 @@ boost
             };
         }

    Requirements:

    -

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

    +

    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:

    @@ -44,8 +45,9 @@ boost
    #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:

    +

    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>.

    +
    diff --git a/doc/exception.html b/doc/exception.html index fa4f0b8..7d9f5fd 100644 --- a/doc/exception.html +++ b/doc/exception.html @@ -19,7 +19,8 @@ -

    exception

    +

    exception

    +

    #include <boost/exception/exception.hpp>

    namespace
     boost
    @@ -41,7 +42,8 @@ boost
     

    Class boost::exception is designed to be used as a universal base for user-defined exception types.

    An object of any type deriving from boost::exception can store data of arbitrary types, using the error_info wrapper and operator<<.

    To retrieve data from a boost::exception object, use the get_error_info function template.

    -

    exception::exception

    +

    exception::exception

    +
    exception();
     exception( exception const & x );

    Effects:

    @@ -50,21 +52,26 @@ boost

    Throws:

    Nothing.

    -

    exception::~exception

    +

    exception::~exception

    +

    Effects:

    Frees all resources associated with a boost::exception object.

    Throws:

    Nothing.

    -

    exception::diagnostic_information

    +

    exception::diagnostic_information

    +
    virtual char const * diagnostic_information() const throw();

    Returns:

    -

    An string representation of all data stored in the boost::exception object by the operator<< function. See "Tutorial: Diagnostic Information" for details.

    +

    A string representation of all data stored in the boost::exception object by the operator<< function. See "Tutorial: Diagnostic Information" for details.

    Throws:

    Nothing.

    -

    Note:

    -

    The return value remains valid until the exception object from which it is obtained is destroyed or modified.

    -

    See also:

    +

    Notes:

    +
    +

    +

    See Also:

    diff --git a/doc/exception_cloning_hpp.html b/doc/exception_cloning_hpp.html index a712e73..6d8b99b 100644 --- a/doc/exception_cloning_hpp.html +++ b/doc/exception_cloning_hpp.html @@ -19,7 +19,8 @@ -

    boost/exception_ptr.hpp

    +

    boost/exception_ptr.hpp

    +

    Synopsis

    #include <boost/exception/exception.hpp>
     
    @@ -43,7 +44,8 @@ boost
         
         void rethrow_exception( exception_ptr const & ep );
         }
    -

    See also:

    +
    diff --git a/doc/exception_constructors.html b/doc/exception_constructors.html index 447674d..7c7ba4b 100644 --- a/doc/exception_constructors.html +++ b/doc/exception_constructors.html @@ -19,7 +19,8 @@ -

    exception::exception

    +

    exception::exception

    +
    exception();
     exception( exception const & x );

    Effects:

    @@ -28,9 +29,11 @@

    Throws:

    Nothing.

    -

    See also:

    +

    +

    See Also:

    +
    diff --git a/doc/exception_destructor.html b/doc/exception_destructor.html index 785e6f2..f67fed3 100644 --- a/doc/exception_destructor.html +++ b/doc/exception_destructor.html @@ -19,15 +19,18 @@ -

    exception::~exception

    +

    exception::~exception

    +

    Effects:

    Frees all resources associated with a boost::exception object.

    Throws:

    Nothing.

    -

    See also:

    +

    +

    See Also:

    +
    diff --git a/doc/exception_diagnostic_information.html b/doc/exception_diagnostic_information.html index 73c63f6..43291ed 100644 --- a/doc/exception_diagnostic_information.html +++ b/doc/exception_diagnostic_information.html @@ -19,19 +19,24 @@ -

    exception::diagnostic_information

    +

    exception::diagnostic_information

    +
    virtual char const * diagnostic_information() const throw();

    Returns:

    -

    An string representation of all data stored in the boost::exception object by the operator<< function. See "Tutorial: Diagnostic Information" for details.

    +

    A string representation of all data stored in the boost::exception object by the operator<< function. See "Tutorial: Diagnostic Information" for details.

    Throws:

    Nothing.

    -

    Note:

    -

    The return value remains valid until the exception object from which it is obtained is destroyed or modified.

    -

    See also:

    +

    Notes:

    +
    +
    diff --git a/doc/exception_enable_error_info_hpp.html b/doc/exception_enable_error_info_hpp.html index d135d70..5f772ed 100644 --- a/doc/exception_enable_error_info_hpp.html +++ b/doc/exception_enable_error_info_hpp.html @@ -19,7 +19,8 @@ -

    boost/exception/enable_error_info.hpp

    +

    boost/exception/enable_error_info.hpp

    +

    Synopsis

    #include <boost/exception/exception.hpp>
     
    @@ -29,11 +30,13 @@ boost
         template <class T>
         ---unspecified--- enable_error_info( T const & x );
         }
    -

    See also:

    +
    diff --git a/doc/exception_enable_exception_cloning_hpp.html b/doc/exception_enable_exception_cloning_hpp.html index 761c5f1..6f0bdf1 100644 --- a/doc/exception_enable_exception_cloning_hpp.html +++ b/doc/exception_enable_exception_cloning_hpp.html @@ -19,7 +19,8 @@ -

    boost/exception/enable_current_exception.hpp

    +

    boost/exception/enable_current_exception.hpp

    +

    Synopsis

    #include <boost/exception/exception.hpp>
     
    @@ -29,11 +30,13 @@ boost
         template <class T>
         ---unspecified--- enable_current_exception( T const & e );
         }
    -

    See also:

    +
    diff --git a/doc/exception_error_info_group_hpp.html b/doc/exception_error_info_group_hpp.html index 3db6a18..c730980 100644 --- a/doc/exception_error_info_group_hpp.html +++ b/doc/exception_error_info_group_hpp.html @@ -19,7 +19,8 @@ -

    boost/exception/info_tuple.hpp

    +

    boost/exception/info_tuple.hpp

    +

    Synopsis

    #include <boost/tuple/tuple.hpp>
     
    @@ -33,11 +34,13 @@ boost
                 ...,
                 error_info<TagN,TN> > const & v );
         }
    -

    See also:

    +
    diff --git a/doc/exception_error_info_hpp.html b/doc/exception_error_info_hpp.html index 4a72bc4..4f17f3f 100644 --- a/doc/exception_error_info_hpp.html +++ b/doc/exception_error_info_hpp.html @@ -19,7 +19,8 @@ -

    boost/exception/info.hpp

    +

    boost/exception/info.hpp

    +

    Synopsis

    #include <boost/exception/exception.hpp>
     #include <boost/current_function.hpp>
    @@ -54,13 +55,16 @@ boost
         template <class E, class Tag, class T>
         E const & operator<<( E const & x, error_info<Tag,T> const & v );
         }
    -
    diff --git a/doc/exception_error_info_value_hpp.html b/doc/exception_error_info_value_hpp.html index 7cf82a7..d1ec7a8 100644 --- a/doc/exception_error_info_value_hpp.html +++ b/doc/exception_error_info_value_hpp.html @@ -19,18 +19,21 @@ -

    boost/exception/error_info.hpp

    +

    boost/exception/error_info.hpp

    +

    Synopsis

    namespace
     boost
         {
    -    template <class Tag, class T>
    -    class error_info;
    +    template <class Tag,class T>
    +    class error_info;
         }
    -

    See also:

    +

+

See Also:

Boost Exception
error_info
+
diff --git a/doc/exception_exception_hpp.html b/doc/exception_exception_hpp.html index 1ab0283..5962f88 100644 --- a/doc/exception_exception_hpp.html +++ b/doc/exception_exception_hpp.html @@ -19,7 +19,8 @@ -

boost/exception/exception.hpp

+

boost/exception/exception.hpp

+

Synopsis

namespace
 boost
@@ -38,7 +39,8 @@ boost
         ~exception();    
         };
     }
-

See also:

+

+

See Also:

Boost Exception
boost/exception/enable_current_exception.hpp
boost/exception/enable_error_info.hpp
@@ -46,6 +48,7 @@ boost
boost/exception_ptr.hpp
exception
+
diff --git a/doc/exception_hpp.html b/doc/exception_hpp.html index 5b32d79..8a281e4 100644 --- a/doc/exception_hpp.html +++ b/doc/exception_hpp.html @@ -19,18 +19,21 @@ -

boost/exception.hpp

-

Synopsis

-
#include <boost/exception/info.hpp>
+

See also:

+#include <boost/throw_exception.hpp>
+

+

See Also:

Boost Exception
Tutorial: Diagnostic Information
Tutorial: Integrating Boost Exception in Existing Exception Class Hierarchies
+
diff --git a/doc/exception_ptr.html b/doc/exception_ptr.html index 50655eb..70bb472 100644 --- a/doc/exception_ptr.html +++ b/doc/exception_ptr.html @@ -19,7 +19,8 @@ -

exception_ptr

+

exception_ptr

+

#include <boost/exception_ptr.hpp>

namespace
 boost
@@ -29,9 +30,8 @@ boost
 

The exception_ptr type can be used to refer to a copy of an exception object. It is Default Constructible, Copy Constructible, Assignable and Equality Comparable; exception_ptr's operations do not throw.

Two instances of exception_ptr are equivalent and compare equal if and only if they refer to the same exception.

The default constructor of exception_ptr produces the null value of the type. The null value is equivalent only to itself.

-

Note:

-

exception_ptr objects are returned by current_exception and copy_exception.

-

See also:

+

+

See Also:

Boost Exception
boost/exception_ptr.hpp
copy_exception
@@ -40,6 +40,7 @@ boost
rethrow_exception
unknown_exception
+
diff --git a/doc/exception_what.html b/doc/exception_what.html deleted file mode 100644 index 2cef231..0000000 --- a/doc/exception_what.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - exception::what - - - -
-
-
-
- -

Boost Exception

-
- - - -

exception::what

-
virtual char const * what() const throw();
-

Returns:

-

The default implementation is equivalent to return exception::diagnostic_information(). The signature of boost::exception::what is identical to the familiar std::exception::what function, so that when an exception type that derives both std::exception and boost::exception overrides the what function, it overrides both std::exception::what and boost::exception::what.

-

Throws:

-

Nothing.

-

Note:

-

The return value remains valid until the exception object from which it is obtained is destroyed or modified.

-

See also:

- - - - - -
-
-
- - diff --git a/doc/get_error_info.html b/doc/get_error_info.html index 47d598e..0d13a23 100644 --- a/doc/get_error_info.html +++ b/doc/get_error_info.html @@ -19,7 +19,8 @@ -

get_error_info

+

get_error_info

+

#include <boost/exception/info.hpp>

namespace
 boost
@@ -28,17 +29,23 @@ boost
     shared_ptr<typename ErrorInfo::value_type const> get_error_info( E const & x );
     }

Requirements:

-

The type of the x object must derive from boost::exception; ErrorInfo must be an instance of the error_info template.

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

Returns:

-

If x does not store an object of type ErrorInfo, returns an empty shared_ptr; otherwise returns pointer to the stored value. Use operator<< to store values in exception objects.

+
  • If dynamic_cast<boost::exception const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is an empty shared_ptr.
  • +
  • Otherwise, the returned shared_ptr points to the stored value (use operator<< to store values in exception objects.) The shared_ptr is valid even after x has been destroyed.
  • +

Throws:

Nothing.

-

See also:

+

+

See Also:

Boost Exception
boost/exception/info.hpp
error_info
exception
+
diff --git a/doc/name_idx.html b/doc/name_idx.html index cff1a2e..f7c08db 100644 --- a/doc/name_idx.html +++ b/doc/name_idx.html @@ -19,7 +19,8 @@ -

Index

+

Index

+

B

BOOST_ERROR_INFO

b

@@ -58,7 +59,7 @@

Tutorial: Diagnostic Information

Tutorial: Integrating Boost Exception in Existing Exception Class Hierarchies

Tutorial: Transporting of Arbitrary Data to the Catch Site

-

Tutorial: Transporting of Exceptions between Threads

+

Tutorial: Transporting of Exceptions Between Threads

t

throw_exception

u

diff --git a/doc/operator_shl_exception.html b/doc/operator_shl_exception.html index b458fb3..766a025 100644 --- a/doc/operator_shl_exception.html +++ b/doc/operator_shl_exception.html @@ -19,7 +19,8 @@ -

operator<<, error_info overload

+

operator<</exception

+

#include <boost/exception/info.hpp> 

namespace
 boost
@@ -30,12 +31,13 @@ boost
 

Requirements:

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

Effects:

-

Stores a copy of v into x. If x already contains data of type error_info<Tag1,T1>, that data is overwritten.

+

Stores a copy of v into x. If x already contains data of type error_info<Tag,T>, that data is overwritten.

Returns:

x.

Throws:

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

-

See also:

+

+

See Also:

BOOST_ERROR_INFO
Boost Exception
boost/exception/info.hpp
@@ -47,6 +49,7 @@ boost
Tutorial: Diagnostic Information
Tutorial: Integrating Boost Exception in Existing Exception Class Hierarchies
+
diff --git a/doc/operator_shl_tuple.html b/doc/operator_shl_tuple.html index 3cbb657..939302c 100644 --- a/doc/operator_shl_tuple.html +++ b/doc/operator_shl_tuple.html @@ -19,7 +19,8 @@ -

operator<<, tuple overload

+

operator<</tuple

+

#include <boost/exception/info_tuple.hpp>

namespace
 boost
@@ -39,10 +40,12 @@ boost
 

x.

Throws:

std::bad_alloc, or any exception emitted by T1..TN copy constructor.

-

See also:

+

+

See Also:

Boost Exception
boost/exception/info_tuple.hpp
+
diff --git a/doc/reno.css b/doc/reno.css index f5650c8..d3c6d4d 100644 --- a/doc/reno.css +++ b/doc/reno.css @@ -87,7 +87,7 @@ pre border-left: 0; border-right: 0; font-size: 10pt; - background-color: #F0F0F0; + background-color: #E5E5E5; padding-top: 5pt; padding-bottom: 5pt; padding-left: 5pt; diff --git a/doc/rethrow_exception.html b/doc/rethrow_exception.html index ea33e37..1b1a027 100644 --- a/doc/rethrow_exception.html +++ b/doc/rethrow_exception.html @@ -19,7 +19,8 @@ -

rethrow_exception

+

rethrow_exception

+

#include <boost/exception_ptr.hpp>

namespace
 boost
@@ -30,10 +31,12 @@ boost
 

ep shall not be null.

Throws:

The exception to which ep refers.

-

See also:

+

+

See Also:

+
diff --git a/doc/source/boost-exception.reno b/doc/source/boost-exception.reno index e592912..c5265b2 100644 --- a/doc/source/boost-exception.reno +++ b/doc/source/boost-exception.reno @@ -29,7 +29,7 @@ - 9 + 7 default @@ -53,28 +53,32 @@ - 1 - CAB4D823BD4720B71E1CA5BE482AC95B42A9E07CD5E08671EA23184635F281A2 - 3077708282 - 89 - 323 + 2 + F7633FDCF6615C0199645701EE6E7ACE5CBCD7A7CF6838573791E91ABB3C09F2 + 1668435395 + 1332 + 396 + A1F443AF571973A12005D2F7D4AE09A32AAF686FEEAE272EC21512A65EB943E8 + 3879093659 + 1300 + 26 0 - ../../../../boost/exception/error_info.hpp + ../../../../boost/exception/info_tuple.hpp 0 0 - <string>boost/exception/error_info.hpp</string> + <string>operator<</tuple</string> - exception_error_info_value_hpp + @@ -82,7 +86,7 @@ 1 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + (:include include:) (:auto also:) @@ -93,100 +97,6 @@ reno_context - - - - - - 1 - 49D31376D97691F7C84A134B5D8C7C66EF1ED6901D376CA250D634AE2B38AB5E - 549270010 - 163 - 572 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - - <string>BOOST_ERROR_INFO</string> - - - - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 7 - - reno_context - - - - - - - 2 - C1FAB39F3B09548EC7B197853DC956883AE1C3A29A8A9D2FBDB97D8BEC76CD75 - 173037458 - 6345 - 737 - 65D13C1BB0A16823F69A32BAB56A51CA317075C7FC8B7441EE0D9B57AF5AB2AC - 2592266329 - 712 - 1700 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - - <string>get_error_info</string> - - - - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 8 - - reno_context - @@ -221,7 +131,97 @@ 1 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + (:include include:) (:auto also:) + + + + + 0 + + 7 + + reno_context + + + + + + + 1 + A9C65F105342D728DE9C996079E82DF25408B94A272090039FAAC12D29659F69 + 2378831669 + 94 + 227 + + + + + + 0 + ../../../../boost/exception/enable_current_exception.hpp + 0 + 0 + + + + + <string>boost/exception/enable_current_exception.hpp</string> + + + exception_enable_exception_cloning_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 8 + + reno_context + + + + + + + 1 + 49D31376D97691F7C84A134B5D8C7C66EF1ED6901D376CA250D634AE2B38AB5E + 549270010 + 163 + 572 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>BOOST_ERROR_INFO</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) @@ -232,255 +232,34 @@ reno_context - - - - - - 1 - 9CC0F5ADB1C04555FD571DABD1D7D6775D8B11977ECC8320AD4451FC435E89A1 - 1325628148 - 3147 - 323 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>boost/exception/exception.hpp</string> - - - exception_exception_hpp - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 10 - - reno_context - - - - - - - 1 - CE411E21EE9878B55B5906D033A0FC52574FB59D8A8CECB75405E9B1C9D782DB - 1173443713 - 308 - 302 - - - - - - 0 - ../../example/logging.cpp - 0 - 0 - - - - - <string>Tutorial: Diagnostic Information</string> - - - tutorial_diagnostic_information - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 11 - - reno_context - - - - - - - 1 - D9B8E6AA12A4F33953B1A961FA590C5A3840234B6531CA8C04AC985AD5800835 - 2432554768 - 702 - 408 - - - - - - 0 - ../../example/enable_error_info.cpp - 0 - 0 - - - - - <string>Tutorial: Integrating Boost Exception in Existing Exception Class Hierarchies</string> - - - tutorial_enable_error_info - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 12 - - reno_context - - - - - - - 1 - E444EE9697EEADFDE0767E1D0242FC0E70D98E61FB1F0FFA099648DE509B82F3 - 94503238 - 773 - 374 - - - - - - 0 - ../../example/info_tuple.cpp - 0 - 0 - - - - - <string>Tutorial: Adding Grouped Data to Exceptions</string> - - - grouping_data - - - - - - 0 - - - - - 0 - - 13 - - reno_context - - - - - - - 1 - 187BFD2B78A0DD006717B5B06FFD465E2468F521C32A86FB793F7A68AB5417F3 - 4276724153 - 574 - 382 - - - - - - 0 - ../../example/error_info_1.cpp - 0 - 0 - - - - - <string>Tutorial: Adding of Arbitrary Data at the Point of the Throw</string> - - - adding_data_at_throw - - - - - - 0 - - - - - 0 - - 14 - - reno_context - 2 - 07430F64896197A110C276D8A14CA8A75FBA482DDF50CD40D689A1898C84D054 - 1712604289 - 1296 - 396 - BCCB91D0DCA6EC45F29CB70CB64AEA6AB54F32F8F1D1937C4CB80B059346DC81 - 695614553 - 1264 - 26 + 35F026FF4EC46450D19A8F970D6E39B881DA6B0FC2E95774CCADC5E34C9D57F1 + 1990614462 + 6369 + 737 + 61B57D0AE5F1033900B7DE4401AC1633F4639471A19194D5660F6C43465FCE3D + 1668078447 + 724 + 1712 0 - ../../../../boost/exception/info_tuple.hpp + ../../../../boost/exception/info.hpp 0 0 - <string>operator<</tuple</string> + <string>get_error_info</string> @@ -491,14 +270,14 @@ 1 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + (:include include:) (:auto also:) 0 - 15 + 10 reno_context @@ -548,14 +327,14 @@ 1 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + (:include include:) (:auto also:) 0 - 16 + 11 reno_context @@ -565,9 +344,52 @@ 1 - F19D72C24D904689FEEE070D77ABD19090396E7C7663A5BA80E474F1EDA62861 - 4081508978 - 6759 + 187BFD2B78A0DD006717B5B06FFD465E2468F521C32A86FB793F7A68AB5417F3 + 4276724153 + 574 + 382 + + + + + + 0 + ../../example/error_info_1.cpp + 0 + 0 + + + + + <string>tutorial: adding of arbitrary data at the point of the throw</string> + + + adding_data_at_throw + + + + + + 0 + + + + + 0 + + 12 + + reno_context + + + + + + + 1 + 0C00BEB179039380247D771B12C728884E9A3E5B483AC63CD5789852C7A5CC35 + 2506662970 + 2467 323 @@ -575,17 +397,17 @@ 0 - ../../../../boost/exception/info.hpp + ../../../../boost/exception/enable_error_info.hpp 0 0 - <string>boost/exception/info.hpp</string> + <string>boost/exception/enable_error_info.hpp</string> - exception_error_info_hpp + exception_enable_error_info_hpp @@ -593,100 +415,14 @@ 1 2 - (:include include:) (:pagelist link="backlink" except_tags="noalso":) + (:include include:) (:auto also:) 0 - 17 - - reno_context - - - - - - - 1 - 5373E336DC4892A41D31694BCA1146382FC3137819A04689CA1F9FFAF1CFAB3B - 4050491732 - 466 - 307 - - - - - - 0 - ../../example/cloning_1.cpp - 0 - 0 - - - - - <string>Tutorial: Using enable_current_exception at the Time of the Throw</string> - - - using_enable_cloning - - - - - - 0 - - - - - 0 - - 18 - - reno_context - - - - - - - 1 - FC684D0DD5A9732B4130F2AB3DB6E0491D0F523E14B7FB738B2019EA2C7F8717 - 2229778754 - 631 - 319 - - - - - - 0 - ../../example/cloning_2.cpp - 0 - 0 - - - - - <string>Tutorial: Cloning and Re-throwing an Exception</string> - - - cloning_and_rethrowing - - - - - - 0 - - - - - 0 - - 19 + 13 reno_context @@ -724,52 +460,14 @@ 1 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + (:include include:) (:auto also:) 0 - 20 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Tutorial: Transporting of Arbitrary Data to the Catch Site</string> - - - tutorial_transporting_data - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 21 + 14 reno_context @@ -779,13 +477,105 @@ 1 - CB567E3390BC92DA06F9899E700792C3790D3707C024CA21D15C930D908AD10A - 3422645546 - 5023 + CAB4D823BD4720B71E1CA5BE482AC95B42A9E07CD5E08671EA23184635F281A2 + 3077708282 + 89 323 + + + 0 + ../../../../boost/exception/error_info.hpp + 0 + 0 + + + + + <string>boost/exception/error_info.hpp</string> + + + exception_error_info_value_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 15 + + reno_context + + + + + + + 1 + FC684D0DD5A9732B4130F2AB3DB6E0491D0F523E14B7FB738B2019EA2C7F8717 + 2229778754 + 631 + 319 + + + + + + 0 + ../../example/cloning_2.cpp + 0 + 0 + + + + + <string>tutorial: cloning and re-throwing an exception</string> + + + cloning_and_rethrowing + + + + + + 0 + + + + + 0 + + 16 + + reno_context + + + + + + + 2 + D1AA2FC554CD67A50917905B0E9CCA2EBC1A9BA97368757B36ADF8419756ECF1 + 85276724 + 4917 + 514 + F87D7E0321BDDAE23D5A6667CB12116411468AEC54E3B35FB9C8CA94BFECA41E + 1149388739 + 296 + 4496 + + + 0 @@ -796,10 +586,10 @@ - <string>boost/exception_ptr.hpp</string> + <string>copy_exception</string> - exception_cloning_hpp + @@ -807,14 +597,57 @@ 1 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + (:include include:) (:auto also:) 0 - 22 + 17 + + reno_context + + + + + + + 1 + 5373E336DC4892A41D31694BCA1146382FC3137819A04689CA1F9FFAF1CFAB3B + 4050491732 + 466 + 307 + + + + + + 0 + ../../example/cloning_1.cpp + 0 + 0 + + + + + <string>tutorial: using enable_current_exception at the time of the throw</string> + + + using_enable_cloning + + + + + + 0 + + + + + 0 + + 18 reno_context @@ -841,7 +674,7 @@ - <string>Tutorial: Adding of Arbitrary Data to Active Exception Objects</string> + <string>tutorial: adding of arbitrary data to active exception objects</string> adding_data_later @@ -853,6 +686,183 @@ 0 + + + 0 + + 19 + + reno_context + + + + + + + 1 + CE411E21EE9878B55B5906D033A0FC52574FB59D8A8CECB75405E9B1C9D782DB + 1173443713 + 308 + 302 + + + + + + 0 + ../../example/logging.cpp + 0 + 0 + + + + + <string>tutorial: diagnostic information</string> + + + tutorial_diagnostic_information + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 20 + + reno_context + + + + + + + 2 + 35F026FF4EC46450D19A8F970D6E39B881DA6B0FC2E95774CCADC5E34C9D57F1 + 1990614462 + 6369 + 737 + C5A5927411FB16BB27418CF87226A27D6EC66958BD46DC87F97E571CB492E49D + 2066106304 + 261 + 1449 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>operator<</exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 21 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>tutorial: transporting of arbitrary data to the catch site</string> + + + tutorial_transporting_data + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 22 + + reno_context + + + + + + + 1 + D9B8E6AA12A4F33953B1A961FA590C5A3840234B6531CA8C04AC985AD5800835 + 2432554768 + 702 + 408 + + + + + + 0 + ../../example/enable_error_info.cpp + 0 + 0 + + + + + <string>tutorial: integrating boost exception in existing exception class hierarchies</string> + + + tutorial_enable_error_info + + + + + + 1 + 2 + (:include include:) (:auto also:) + + 0 @@ -861,6 +871,331 @@ reno_context + + + + + + 1 + E444EE9697EEADFDE0767E1D0242FC0E70D98E61FB1F0FFA099648DE509B82F3 + 94503238 + 773 + 374 + + + + + + 0 + ../../example/info_tuple.cpp + 0 + 0 + + + + + <string>tutorial: adding grouped data to exceptions</string> + + + grouping_data + + + + + + 0 + + + + + 0 + + 24 + + reno_context + + + + + + + 2 + D1AA2FC554CD67A50917905B0E9CCA2EBC1A9BA97368757B36ADF8419756ECF1 + 85276724 + 4917 + 514 + 9DEEF8ED70BF74F501A96BA5DE5BFD42FAD16DE333ABE189E512C332586FC465 + 2250569940 + 1893 + 2601 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>current_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 25 + + reno_context + + + + + + + 1 + 749C8E4B47A3FD6A90DD8418BF64C4556537CE6E17ACEB2317D9F81DBEBBB0B0 + 1688004766 + 6783 + 323 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>boost/exception/info.hpp</string> + + + exception_error_info_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 26 + + reno_context + + + + + + + 1 + E312FADF4C02B7A6CB1BE1EC16F05A21C20CBA3282D4EAFC8EBE0BA151F24779 + 2820045995 + 5108 + 323 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>boost/exception_ptr.hpp</string> + + + exception_cloning_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 27 + + reno_context + + + + + + + 1 + 9CC0F5ADB1C04555FD571DABD1D7D6775D8B11977ECC8320AD4451FC435E89A1 + 1325628148 + 3147 + 323 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>boost/exception/exception.hpp</string> + + + exception_exception_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 28 + + reno_context + + + + + + + 2 + D1AA2FC554CD67A50917905B0E9CCA2EBC1A9BA97368757B36ADF8419756ECF1 + 85276724 + 4917 + 514 + ED09F845070FF7D381BE5EFB6B55313FD09FBA16B64B69992410380EFA45519C + 2051939590 + 78 + 433 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>exception_ptr</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 29 + + reno_context + + + + + + + 2 + D1AA2FC554CD67A50917905B0E9CCA2EBC1A9BA97368757B36ADF8419756ECF1 + 85276724 + 4917 + 514 + 156B870761DB092CE4269C1173B479A344A1041BA2B883765AF19A72B371D776 + 3239976720 + 117 + 4794 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>rethrow_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 30 + + reno_context + @@ -899,14 +1234,112 @@ 1 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + (:include include:) (:auto also:) 0 - 24 + 31 + + reno_context + + + + + + + 2 + D1AA2FC554CD67A50917905B0E9CCA2EBC1A9BA97368757B36ADF8419756ECF1 + 85276724 + 4917 + 514 + A098B6FA5BC8E72E0E69C0323195FCC142AE807564C6892FCBD88588F2FBE049 + 2579522516 + 405 + 26 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>unknown_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 32 + + reno_context + + + + + + + 2 + FA5027D9799B8059059C23397F469D6EF6328DC23E92E0BE0FF5BE019A576174 + 1806359597 + 3234 + 506 + DF9EA87B0140AACF4422F1B76F6A6A409C15F32858BBBA85A35981A824C56BA9 + 1137981799 + 192 + 3036 + + + + + + 0 + ../../../../boost/exception/enable_current_exception.hpp + 0 + 0 + + + + + <string>enable_current_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 33 reno_context @@ -926,7 +1359,94 @@ - <string>Tutorial: Transporting of Exceptions between Threads</string> + <string>Index</string> + + + name_idx + + + + + + 1 + 2 + (:auto !:) (:pagelist fmt="index" except_tags="index,noindex" mod="w":) + + + + + 0 + + 34 + + reno_context + + + + + + + 2 + 7ACC4E316D4EDB3EC7AEC35FED3ADB47DDF75D575028D7BCD11C5233E4F4A277 + 4268848542 + 2333 + 457 + 61DE70107961C0B9A65674017F91FF85190CF84B4F3B0CA7AC04A7E16DE80B37 + 3187961206 + 2301 + 26 + + + + + + 0 + ../../../../boost/exception/enable_error_info.hpp + 0 + 0 + + + + + <string>enable_error_info</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 35 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>tutorial: transporting of exceptions between threads</string> tutorial_exception_ptr @@ -937,14 +1457,14 @@ 1 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + (:include include:) (:auto also:) 0 - 25 + 36 reno_context @@ -964,7 +1484,7 @@ - <string>Boost Exception</string> + <string>boost exception</string> boost-exception @@ -973,14 +1493,14 @@ - 111 + 113 2 - !!Introduction The purpose of Boost Exception is to ease the design of exception class hierarchies and to help write exception handling and error reporting code. It supports transporting of arbitrary data to the catch site, which is otherwise tricky due to the no-throw requirements (15.5.1) for exception classes. Data can be added to any exception object, either directly in the throw-expression (15.1), or at a later time as the exception object propagates up the call stack. The ability to add data to exception objects after they have been passed to throw is important, because often some of the information needed to handle an exception is unavailable in the context where the failure is detected. Boost Exception also supports (:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:)-style (:link + !!Introduction The purpose of Boost Exception is to ease the design of exception class hierarchies and to help write exception handling and error reporting code. It supports transporting of arbitrary data to the catch site, which is otherwise tricky due to the no-throw requirements (15.5.1) for exception types. Data can be added to any exception object, either directly in the throw-expression (15.1), or at a later time as the exception object propagates up the call stack. The ability to add data to exception objects after they have been passed to throw is important, because often some of the information needed to handle an exception is unavailable in the context where the failure is detected. Boost Exception also supports (:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:)-style (:link 1 0 - -24 + -35 2 @@ -989,7 +1509,7 @@ 0 - -23 + -30 2 @@ -998,43 +1518,43 @@ 0 - -20 + -21 2 - :) ##(:link + mod="w":) ##(:link 1 0 - -11 + -22 2 - :) ##(:link + mod="w":) ##(:link 1 0 - -24 + -35 2 - :) ##(:link + mod="w":) ##(:link 1 0 - -10 + -19 2 - :) #Documentation ##Class (:link + mod="w":) #Documentation ##Class (:link 1 0 - 26 + 37 reno_context @@ -1079,7 +1599,7 @@ 0 - 27 + 38 reno_context @@ -1089,9 +1609,9 @@ 2 - C1FAB39F3B09548EC7B197853DC956883AE1C3A29A8A9D2FBDB97D8BEC76CD75 - 173037458 - 6345 + 35F026FF4EC46450D19A8F970D6E39B881DA6B0FC2E95774CCADC5E34C9D57F1 + 1990614462 + 6369 737 F839AFD37DC086BB1231B8E87D8EEBD28129649A06FC685AC7DF65595871AE30 2291609923 @@ -1124,43 +1644,7 @@ 0 - 28 - - reno_context - - - - - - - 2 - C1FAB39F3B09548EC7B197853DC956883AE1C3A29A8A9D2FBDB97D8BEC76CD75 - 173037458 - 6345 - 737 - 27AC1164E0A824D548386BEDCDC81DCAC283F3D286B0ECEE05B039BB8C392BFC - 1247954090 - 249 - 1449 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - - <string>operator<</exception</string> - - - - - + -20 2 @@ -1169,7 +1653,7 @@ 0 - -14 + -5 2 @@ -1178,7 +1662,7 @@ 0 - -7 + -9 2 @@ -1187,43 +1671,7 @@ 0 - 29 - - reno_context - - - - - - - 2 - D36D37BED1D119D9CB6040BE4A9694586CC5EFF7A50C30AB59BB06BF70458015 - 993620616 - 2321 - 457 - 248C5047CA4021C30DE8853D6AEBD138D11A76B3571C856A48C0A442D6D040A5 - 1700162144 - 2289 - 26 - - - - - - 0 - ../../../../boost/exception/enable_error_info.hpp - 0 - 0 - - - - - <string>enable_error_info</string> - - - - - + -34 2 @@ -1232,7 +1680,7 @@ 0 - -6 + -8 2 @@ -1241,43 +1689,7 @@ 0 - 30 - - reno_context - - - - - - - 2 - 973F8368D72D56424349CBB81C8F3015CB9F4F0CD7B23A8C62C3DBADDA37CD57 - 3833800883 - 4832 - 514 - ED09F845070FF7D381BE5EFB6B55313FD09FBA16B64B69992410380EFA45519C - 2051939590 - 78 - 409 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>exception_ptr</string> - - - - - + -28 2 @@ -1286,43 +1698,7 @@ 0 - 31 - - reno_context - - - - - - - 2 - 392208A2FD122D1ED27D128A7BF65F9340218FAAD756EA58D26D2205D32681A6 - 729208193 - 3206 - 506 - 8F3B5E1A267CA225679713F4DDF528041F573BC02D1DBCD8FFEF57EF0AA599B9 - 4197332561 - 180 - 3020 - - - - - - 0 - ../../../../boost/exception/enable_current_exception.hpp - 0 - 0 - - - - - <string>enable_current_exception</string> - - - - - + -32 2 @@ -1331,43 +1707,7 @@ 0 - 32 - - reno_context - - - - - - - 2 - 973F8368D72D56424349CBB81C8F3015CB9F4F0CD7B23A8C62C3DBADDA37CD57 - 3833800883 - 4832 - 514 - 9DEEF8ED70BF74F501A96BA5DE5BFD42FAD16DE333ABE189E512C332586FC465 - 2250569940 - 1893 - 2528 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>current_exception</string> - - - - - + -24 2 @@ -1376,43 +1716,7 @@ 0 - 33 - - reno_context - - - - - - - 2 - 973F8368D72D56424349CBB81C8F3015CB9F4F0CD7B23A8C62C3DBADDA37CD57 - 3833800883 - 4832 - 514 - 921FBF6991E17349BFF2AD6F165372F85AA9457DDB28E502ABB6B392BBA6B529 - 3119269037 - 284 - 4423 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>copy_exception</string> - - - - - + -16 2 @@ -1421,43 +1725,7 @@ 0 - 34 - - reno_context - - - - - - - 2 - 973F8368D72D56424349CBB81C8F3015CB9F4F0CD7B23A8C62C3DBADDA37CD57 - 3833800883 - 4832 - 514 - 156B870761DB092CE4269C1173B479A344A1041BA2B883765AF19A72B371D776 - 3239976720 - 117 - 4709 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>rethrow_exception</string> - - - - - + -29 2 @@ -1466,43 +1734,7 @@ 0 - 35 - - reno_context - - - - - - - 2 - 973F8368D72D56424349CBB81C8F3015CB9F4F0CD7B23A8C62C3DBADDA37CD57 - 3833800883 - 4832 - 514 - 9567A192BF523DDF741004FFF5BDB044D715FEB7CE9AEC89ACC25C1C33E48C4E - 2232115228 - 381 - 26 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>unknown_exception</string> - - - - - + -31 2 @@ -1511,7 +1743,7 @@ 0 - 36 + 39 reno_context @@ -1556,7 +1788,7 @@ 0 - -23 + -30 2 @@ -1565,7 +1797,7 @@ 0 - 37 + 40 reno_context @@ -1606,7 +1838,7 @@ 0 - 38 + 41 reno_context @@ -1647,39 +1879,7 @@ 0 - 39 - - reno_context - - - - - - - 1 - A9C65F105342D728DE9C996079E82DF25408B94A272090039FAAC12D29659F69 - 2378831669 - 94 - 227 - - - - - - 0 - ../../../../boost/exception/enable_current_exception.hpp - 0 - 0 - - - - - <string>boost/exception/enable_current_exception.hpp</string> - - - exception_enable_exception_cloning_hpp - - + -7 2 @@ -1688,39 +1888,7 @@ 0 - 40 - - reno_context - - - - - - - 1 - 091CEE4B0BEBD40D864A1BC8288C10A248BEFFD4E472647343F2BEDE0BDE0F10 - 2732630308 - 2455 - 323 - - - - - - 0 - ../../../../boost/exception/enable_error_info.hpp - 0 - 0 - - - - - <string>boost/exception/enable_error_info.hpp</string> - - - exception_enable_error_info_hpp - - + -12 2 @@ -1729,181 +1897,12 @@ 0 - -5 + -14 2 :) ###(:link 1 - - 0 - - -9 - - - 2 - :) ###(:link - 1 - - 0 - - -16 - - - 2 - :) ###(:link - 1 - - 0 - - -19 - - - 2 - :) ###(:link - 1 - - 0 - - -21 - - - 2 - :) ###(:link - 1 - - 0 - - -8 - - - 2 - :) #(:link - 1 - - 0 - - 41 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Index</string> - - - name_idx - - - - - 2 - :) !!Synopsis `#include <(:link - 1 - - 0 - - -37 - - - 2 - :)> [@namespace boost { (:include - 1 - - 0 - - -9 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -16 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -19 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -40 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -38 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -21 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -39 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -8 - - - 2 - decl pre_indent="4":) }@] !!Class exception (:include - 1 - - 0 - - -26 - - - 2 - :) !!Transporting of Arbitrary Data to the Catch Site (:include - 1 0 @@ -1911,34 +1910,34 @@ 2 - :) (:include + :) ###(:link 1 0 - -28 + -25 2 - :) (:include + :) ###(:link 1 0 - -7 + -13 2 - :) (:include + :) ###(:link 1 0 - -29 + -26 2 - :) (:include + :) ###(:link 1 0 @@ -1947,34 +1946,7 @@ 2 - :) !!Transporting of Exceptions between Threads (:include - 1 - - 0 - - -30 - - - 2 - :) (:include - 1 - - 0 - - -31 - - - 2 - :) (:include - 1 - - 0 - - -32 - - - 2 - :) (:include + :) #(:link 1 0 @@ -1983,6 +1955,132 @@ 2 + :) !!Synopsis `#include <(:link + 1 + + 0 + + -40 + + + 2 + :)> [@namespace boost { (:include + 1 + + 0 + + -27 + + + 2 + api pre_indent="4":) (:include + 1 + + 0 + + -25 + + + 2 + api pre_indent="4":) (:include + 1 + + 0 + + -13 + + + 2 + api pre_indent="4":) (:include + 1 + + 0 + + -12 + + + 2 + api pre_indent="4":) (:include + 1 + + 0 + + -41 + + + 2 + api pre_indent="4":) (:include + 1 + + 0 + + -26 + + + 2 + api pre_indent="4":) (:include + 1 + + 0 + + -7 + + + 2 + api pre_indent="4":) (:include + 1 + + 0 + + -6 + + + 2 + api pre_indent="4":) }@] !!Class exception (:include + 1 + + 0 + + -37 + + + 2 + :) !!Transporting of Arbitrary Data to the Catch Site (:include + 1 + + 0 + + -38 + + + 2 + :) (:include + 1 + + 0 + + -20 + + + 2 + :) (:include + 1 + + 0 + + -5 + + + 2 + :) (:include + 1 + + 0 + + -9 + + + 2 :) (:include 1 @@ -1997,7 +2095,61 @@ 0 - -35 + -8 + + + 2 + :) !!Transporting of Exceptions between Threads (:include + 1 + + 0 + + -28 + + + 2 + :) (:include + 1 + + 0 + + -32 + + + 2 + :) (:include + 1 + + 0 + + -24 + + + 2 + :) (:include + 1 + + 0 + + -16 + + + 2 + :) (:include + 1 + + 0 + + -29 + + + 2 + :) (:include + 1 + + 0 + + -31 2 @@ -2006,7 +2158,7 @@ 0 - -36 + -39 2 @@ -2015,156 +2167,13 @@ 0 - -23 + -30 2 :) - - - 0 - - -26 - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso,exception":) - - - - - 0 - - -27 - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - -28 - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - -29 - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - -30 - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - -31 - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - -32 - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - -33 - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - -34 - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - -35 - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - -36 - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - 0 @@ -2175,7 +2184,7 @@ 1 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + (:include include:) ---- !!!See Also: (:pagelist link="backlink" except_tags="exception,member" mod="w":) @@ -2188,7 +2197,7 @@ 1 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + (:include include:) (:auto also:) @@ -2201,7 +2210,7 @@ 1 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + (:include include:) (:auto also:) @@ -2214,7 +2223,7 @@ 1 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + (:include include:) (:auto also:) @@ -2227,7 +2236,7 @@ 1 2 - !Index (:pagelist fmt="index" except_tags="index,noindex":) + (:include include:) (:auto also:) @@ -2280,7 +2289,7 @@ 1 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + (:include include:) (:auto also:) @@ -2333,7 +2342,7 @@ 1 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + (:include include:) (:auto also:) @@ -2341,7 +2350,7 @@ - headers + def 44 @@ -2633,15 +2642,7 @@ - 3 - 2 - [@#include < - 1 - - 1 - - 2 - >@] + 0 @@ -2685,15 +2686,7 @@ - 3 - 2 - [@#include < - 1 - - 1 - - 2 - >@] + 0 @@ -2726,7 +2719,45 @@ - 0 + 9 + 2 + [@class (:link + 1 + + 0 + + -37 + + + 2 + :) { public: (:include + 1 + + 0 + + -42 + + + 2 + decl pre_indent="4":) protected: (:include + 1 + + 0 + + -43 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -10 + + + 2 + decl pre_indent="4":) };@] @@ -2737,7 +2768,18 @@ - 0 + 3 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -38 + + + 2 + :) { public: typedef T value_type; error_info( value_type const & ); };@] @@ -2800,7 +2842,7 @@ - ctors + api 45 @@ -2828,7 +2870,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -30 + + + 2 + decl:)@] @@ -2839,7 +2892,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -32 + + + 2 + decl:)@] @@ -2894,7 +2958,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -34 + + + 2 + decl:)@] @@ -2905,7 +2980,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -5 + + + 2 + decl:)@] @@ -2916,7 +3002,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -38 + + + 2 + decl:)@] @@ -3037,7 +3134,45 @@ - 0 + 9 + 2 + [@(:include + 1 + + 0 + + -38 + + + 2 + def:) (:include + 1 + + 0 + + -9 + + + 2 + decl:) (:include + 1 + + 0 + + -8 + + + 2 + decl:) (:include + 1 + + 0 + + -20 + + + 2 + decl:)@] @@ -3048,7 +3183,54 @@ - 0 + 11 + 2 + [@(:include + 1 + + 0 + + -31 + + + 2 + decl:) (:include + 1 + + 0 + + -28 + + + 2 + decl:) (:include + 1 + + 0 + + -16 + + + 2 + decl:) (:include + 1 + + 0 + + -24 + + + 2 + decl:) (:include + 1 + + 0 + + -29 + + + 2 + decl:)@] @@ -3059,7 +3241,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -37 + + + 2 + def:)@] @@ -3202,7 +3395,54 @@ - 0 + 11 + 2 + [@#include <(:link + 1 + + 0 + + -25 + + + 2 + :)> #include <(:link + 1 + + 0 + + -13 + + + 2 + :)> #include <(:link + 1 + + 0 + + -41 + + + 2 + :)> #include <(:link + 1 + + 0 + + -26 + + + 2 + :)> #include <(:link + 1 + + 0 + + -6 + + + 2 + :)>@] @@ -3213,450 +3453,18 @@ - 0 - - - - - 0 - - -42 - - - - 0 - - - - - 0 - - -43 - - - - 0 - - - - - - - - free - - 46 - - reno_layer - - - - 39 - - - 0 - - -5 - - - - 0 - - - - - 0 - - -6 - - - - 0 - - - - - 0 - - -7 - - - - 0 - - - - - 0 - - -8 - - - - 0 - - - - - 0 - - -9 - - - - 0 - - - - - 0 - - -10 - - - - 0 - - - - - 0 - - -11 - - - - 0 - - - - - 0 - - -12 - - - - 0 - - - - - 0 - - -13 - - - - 0 - - - - - 0 - - -14 - - - - 0 - - - - - 0 - - -15 - - - - 0 - - - - - 0 - - -16 - - - - 0 - - - - - 0 - - -17 - - - - 0 - - - - - 0 - - -18 - - - - 0 - - - - - 0 - - -19 - - - - 0 - - - - - 0 - - -20 - - - - 0 - - - - - 0 - - -21 - - - - 0 - - - - - 0 - - -22 - - - - 0 - - - - - 0 - - -23 - - - - 0 - - - - - 0 - - -24 - - - - 0 - - - - - 0 - - -25 - - - - 0 - - - - - 0 - - -26 - - - - 0 - - - - - 0 - - -27 - - - - 0 - - - - - 0 - - -28 - - - - 0 - - - - - 0 - - -29 - - - - 0 - - - - - 0 - - -30 - - - - 0 - - - - - 0 - - -31 - - - - 0 - - - - - 0 - - -32 - - - - 0 - - - - - 0 - - -33 - - - - 0 - - - - - 0 - - -34 - - - - 0 - - - - - 0 - - -35 - - - - 0 - - - - - 0 - - -36 - - - - 0 - - - - - 0 - - -37 - - - - 0 - - - - - 0 - - -38 - - - - 0 - - - - - 0 - - -39 - - - - 0 - - - - - 0 - - -40 - - - - 0 - - - - - 0 - - -41 - - - - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -39 + + + 2 + decl:)@] @@ -3688,7 +3496,7 @@ decl - 47 + 46 reno_layer @@ -3703,18 +3511,36 @@ - 3 + 7 2 - [@template <class Tag, class T> class (:link + [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link 1 0 - -27 + -5 2 - :);@] + |operator<<:)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link + 1 + + 0 + + -38 + + + 2 + :)<Tag1,T1>, ..., (:link + 1 + + 0 + + -38 + + + 2 + :)<TagN,TN> > const & v );@] @@ -3725,45 +3551,7 @@ - 9 - 2 - [@typedef (:link - 1 - - 0 - - -27 - - - 2 - :)<struct tag_throw_function,char const *> throw_function; typedef (:link - 1 - - 0 - - -27 - - - 2 - :)<struct tag_throw_file,char const *> throw_file; typedef (:link - 1 - - 0 - - -27 - - - 2 - :)<struct tag_throw_line,int> throw_line; #define (:link - 1 - - 0 - - -6 - - - 2 - :)\ ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\ ::boost::throw_file(__FILE__) <<\ ::boost::throw_line((int)__LINE__)@] + 0 @@ -3774,18 +3562,7 @@ - 3 - 2 - [@template <class ErrorInfo,class E> (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:)<typename ErrorInfo::value_type const> (:link - 1 - - 0 - - -7 - - - 2 - :)( E const & x );@] + 0 @@ -3796,18 +3573,45 @@ - 3 + 9 2 - [@(:include + [@typedef (:link 1 0 - -23 + -38 2 - decl:)@] + :)<struct tag_throw_function,char const *> throw_function; typedef (:link + 1 + + 0 + + -38 + + + 2 + :)<struct tag_throw_file,char const *> throw_file; typedef (:link + 1 + + 0 + + -38 + + + 2 + :)<struct tag_throw_line,int> throw_line; #define (:link + 1 + + 0 + + -8 + + + 2 + :)\ ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\ ::boost::throw_file(__FILE__) <<\ ::boost::throw_line((int)__LINE__)@] @@ -3820,16 +3624,16 @@ 3 2 - [@(:include + [@template <class ErrorInfo,class E> (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:)<typename ErrorInfo::value_type const> (:link 1 0 - -26 + -9 2 - decl:)@] + :)( E const & x );@] @@ -3840,7 +3644,18 @@ - 0 + 3 + 2 + [@(:link + 1 + + 0 + + -10 + + + 2 + mod="m":)();@] @@ -3884,36 +3699,7 @@ - 7 - 2 - [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link - 1 - - 0 - - -14 - - - 2 - |operator<<:)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link - 1 - - 0 - - -27 - - - 2 - :)<Tag1,T1>, ..., (:link - 1 - - 0 - - -27 - - - 2 - :)<TagN,TN> > const & v );@] + 0 @@ -3924,18 +3710,7 @@ - 3 - 2 - [@(:link - 1 - - 0 - - -15 - - - 2 - mod="m":)();@] + 0 @@ -3946,36 +3721,9 @@ - 9 + 5 2 - [@(:include - 1 - - 0 - - -27 - - - 2 - decl:) (:include - 1 - - 0 - - -7 - - - 2 - decl:) (:include - 1 - - 0 - - -6 - - - 2 - decl:) (:include + [@template <class T> (:link 1 0 @@ -3984,7 +3732,16 @@ 2 - decl:)@] + :) (:link + 1 + + 0 + + -16 + + + 2 + :)( T const & e );@] @@ -4017,18 +3774,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -14 - - - 2 - decl:)@] + 0 @@ -4039,7 +3785,27 @@ - 0 + 5 + 2 + [@template <class E, class Tag, class T> E const & (:link + 1 + + 0 + + -20 + + + 2 + |operator<<:)( E const & x, (:link + 1 + + 0 + + -38 + + + 2 + :)<Tag,T> const & v );@] @@ -4050,54 +3816,7 @@ - 11 - 2 - [@(:include - 1 - - 0 - - -35 - - - 2 - decl:) (:include - 1 - - 0 - - -30 - - - 2 - decl:) (:include - 1 - - 0 - - -33 - - - 2 - decl:) (:include - 1 - - 0 - - -32 - - - 2 - decl:) (:include - 1 - - 0 - - -34 - - - 2 - decl:)@] + 0 @@ -4119,27 +3838,7 @@ - 5 - 2 - [@#ifdef BOOST_NO_EXCEPTIONS void (:link - 1 - - 0 - - -23 - - - 2 - :)( std::exception const & e ); // user defined #else template <class E> void (:link - 1 - - 0 - - -23 - - - 2 - :)( E const & e ); #endif@] + 0 @@ -4150,7 +3849,27 @@ - 0 + 5 + 2 + [@(:link + 1 + + 0 + + -28 + + + 2 + :) (:link + 1 + + 0 + + -24 + + + 2 + :)();@] @@ -4172,45 +3891,7 @@ - 9 - 2 - [@class (:link - 1 - - 0 - - -26 - - - 2 - :) { public: (:include - 1 - - 0 - - -42 - - - 2 - decl pre_indent="4":) protected: (:include - 1 - - 0 - - -43 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -15 - - - 2 - decl pre_indent="4":) };@] + 0 @@ -4221,18 +3902,7 @@ - 3 - 2 - [@template <class Tag,class T> class (:link - 1 - - 0 - - -27 - - - 2 - :) { public: typedef T value_type; error_info( value_type const & ); };@] + 0 @@ -4242,59 +3912,6 @@ -28 - - 5 - 2 - [@template <class E, class Tag, class T> E const & (:link - 1 - - 0 - - -28 - - - 2 - |operator<<:)( E const & x, (:link - 1 - - 0 - - -27 - - - 2 - :)<Tag,T> const & v );@] - - - - - 0 - - -29 - - - - 3 - 2 - [@template <class T> ---unspecified--- (:link - 1 - - 0 - - -29 - - - 2 - :)( T const & x );@] - - - - - 0 - - -30 - - 3 2 @@ -4303,7 +3920,7 @@ 0 - -30 + -28 2 @@ -4314,91 +3931,7 @@ 0 - -31 - - - - 3 - 2 - [@template <class T> ---unspecified--- (:link - 1 - - 0 - - -31 - - - 2 - :)( T const & e );@] - - - - - 0 - - -32 - - - - 5 - 2 - [@(:link - 1 - - 0 - - -30 - - - 2 - :) (:link - 1 - - 0 - - -32 - - - 2 - :)();@] - - - - - 0 - - -33 - - - - 5 - 2 - [@template <class T> (:link - 1 - - 0 - - -30 - - - 2 - :) (:link - 1 - - 0 - - -33 - - - 2 - :)( T const & e );@] - - - - - 0 - - -34 + -29 @@ -4409,7 +3942,7 @@ 0 - -34 + -29 2 @@ -4418,7 +3951,7 @@ 0 - -30 + -28 2 @@ -4429,7 +3962,38 @@ 0 - -35 + -30 + + + + 5 + 2 + [@#ifdef BOOST_NO_EXCEPTIONS void (:link + 1 + + 0 + + -30 + + + 2 + :)( std::exception const & e ); // user defined #else template <class E> void (:link + 1 + + 0 + + -30 + + + 2 + :)( E const & e ); #endif@] + + + + + 0 + + -31 @@ -4440,7 +4004,7 @@ 0 - -35 + -31 2 @@ -4449,7 +4013,7 @@ 0 - -26 + -37 2 @@ -4460,22 +4024,77 @@ 0 - -36 + -32 3 2 - [@std::string + [@template <class T> ---unspecified--- (:link 1 0 - -36 + -32 2 - ( std::exception const & x );@] + :)( T const & e );@] + + + + + 0 + + -33 + + + + 0 + + + + + 0 + + -34 + + + + 3 + 2 + [@template <class T> ---unspecified--- (:link + 1 + + 0 + + -34 + + + 2 + :)( T const & x );@] + + + + + 0 + + -35 + + + + 0 + + + + + 0 + + -36 + + + + 0 @@ -4486,7 +4105,18 @@ - 0 + 3 + 2 + [@class + 1 + + 0 + + -37 + + + 2 + ;@] @@ -4499,16 +4129,16 @@ 3 2 - [@(:include + [@template <class Tag,class T> class (:link 1 0 - -36 + -38 2 - decl:)@] + :);@] @@ -4521,16 +4151,16 @@ 3 2 - [@(:include + [@std::string 1 0 - -31 + -39 2 - decl:)@] + ( std::exception const & x );@] @@ -4541,18 +4171,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -29 - - - 2 - decl:)@] + 0 @@ -4585,7 +4204,7 @@ 2 - mod="m":)() const throw();@] + mod="m":)() const throw();@] @@ -4607,7 +4226,7 @@ 2 - mod="m":)(); (:link + mod="m":)(); (:link 1 0 @@ -4616,12 +4235,12 @@ 2 - mod="m":)( (:link + mod="m":)( (:link 1 0 - -26 + -37 2 @@ -4634,6 +4253,2008 @@ include + + 47 + + reno_layer + + + + 39 + + + 0 + + -5 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + 1 + + 0 + + -37 + + + 2 + :), or a type that derives (indirectly) from boost::(:link + 1 + + 0 + + -37 + + + 2 + :). !!!!Effects: Equivalent to x << v.(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements|get:)<0>() << ... << v.(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements|get:)<N>(). !!!!Returns: x. (:include throws:) + + + + + 0 + + -6 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -7 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -8 + + + + 7 + 2 + (:auto !!!:) (:include synopsis:) This macro is designed to be used with (:link + 1 + + 0 + + -20 + + + 2 + |operator<<:) when throwing a boost::(:link + 1 + + 0 + + -37 + + + 2 + :), to store information about the location of the throw statement. It can be chained with other (:link + 1 + + 0 + + -38 + + + 2 + mod="p":) in a single throw expression. + + + + + 0 + + -9 + + + + 7 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link + 1 + + 0 + + -38 + + + 2 + :) template. * E must be polymorphic. !!!!Returns: * If dynamic_cast<boost::(:link + 1 + + 0 + + -37 + + + 2 + :) const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is an empty shared_ptr. * Otherwise, the returned shared_ptr points to the stored value (use (:link + 1 + + 0 + + -20 + + + 2 + |operator<<:) to store values in exception objects.) The shared_ptr is valid even after x has been destroyed. !!!!Throws: Nothing. + + + + + 0 + + -10 + + + + 3 + 2 + (:auto !!!:) (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link + 1 + + 0 + + -37 + + + 2 + :) object. !!!!Throws: Nothing. + + + + + 0 + + -11 + + + + 17 + 2 + (:auto !!!:) The following example demonstrates how errno can be stored in exception objects using Boost Exception: [@#include <(:link + 1 + + 0 + + -40 + + + 2 + :)> #include <errno.h> #include <iostream> typedef boost::(:link + 1 + + 0 + + -38 + + + 2 + :)<struct tag_errno,int> errno_info; //(1) class my_error: public boost::(:link + 1 + + 0 + + -37 + + + 2 + :), public std::exception { }; //(2) void f() { throw my_error() << errno_info(errno); //(3) } @] First, we instantiate the (:link + 1 + + 0 + + -38 + + + 2 + :) template using a unique identifier -- tag_errno, and the type of the info it identifies -- int. This provides compile-time type safety for the various values stored in exception objects. Second, we define class my_error, which derives from boost::(:link + 1 + + 0 + + -37 + + + 2 + :). Finally, (3) illustrates how the typedef from (1) can be used with (:link + 1 + + 0 + + -20 + + + 2 + |operator<<:) to store values in exception objects at the point of the throw. The stored errno value can be recovered at a later time like this: [@// ...continued void g() { try { f(); } catch( my_error & x ) { if( boost::shared_ptr<int const> err=boost::(:link + 1 + + 0 + + -9 + + + 2 + :)<errno_info>(x) ) std::cerr << "Error code: " << *err; } }@] The (:link + 1 + + 0 + + -9 + + + 2 + :) function template is instantiated with the typedef from (1), and is passed an exception object of a polymorphic type. If the exception object contains the requested value, the returned (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:) will point to it; otherwise an empty (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:) is returned. + + + + + 0 + + -12 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -13 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -14 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -15 + + + + 37 + 2 + (:auto !!!:) When you catch an exception, you can call (:link + 1 + + 0 + + -24 + + + 2 + :) to get an (:link + 1 + + 0 + + -28 + + + 2 + :) object: [@#include <(:link + 1 + + 0 + + -26 + + + 2 + :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link + 1 + + 0 + + -37 + + + 2 + :)s void worker_thread( boost::(:link + 1 + + 0 + + -28 + + + 2 + :) & error ) { try { do_work(); error = boost::(:link + 1 + + 0 + + -28 + + + 2 + :)(); } catch( ... ) { error = boost::(:link + 1 + + 0 + + -24 + + + 2 + :)(); } }@] In the above example, note that (:link + 1 + + 0 + + -24 + + + 2 + :) captures the original type of the exception object. The exception can be thrown again using the (:link + 1 + + 0 + + -29 + + + 2 + :) function: [@// ...continued void work() { boost::(:link + 1 + + 0 + + -28 + + + 2 + :) error; boost::(:link http://www.boost.org/doc/html/boost/thread.html|thread:) t( boost::(:link http://www.boost.org/libs/bind/bind.html|bind:)(worker_thread,boost::(:link http://www.boost.org/doc/html/ref.html|ref:)(error)) ); t.(:link http://www.boost.org/doc/html/boost/thread.html|join:)(); if( error ) boost::(:link + 1 + + 0 + + -29 + + + 2 + :)(error); }@] Note that (:link + 1 + + 0 + + -24 + + + 2 + :) could fail to copy the original exception object in the following cases: * if there is not enough memory, in which case the returned (:link + 1 + + 0 + + -28 + + + 2 + :) points to an instance of std::bad_alloc, or * if (:link + 1 + + 0 + + -32 + + + 2 + :) was not used in the throw-expression passed to the original throw statement and the current implementation does not have the necessary compiler-specific support to copy the exception automatically, in which case the returned (:link + 1 + + 0 + + -28 + + + 2 + :) points to an instance of (:link + 1 + + 0 + + -31 + + + 2 + :). Regardless, the use of (:link + 1 + + 0 + + -24 + + + 2 + :) and (:link + 1 + + 0 + + -29 + + + 2 + :) in the above examples is well-formed. + + + + + 0 + + -16 + + + + 3 + 2 + (:auto !!!:) (:include synopsis:) !!!!Effects: As if try { throw e; } catch( ... ) { return (:link + 1 + + 0 + + -24 + + + 2 + :)(); } + + + + + 0 + + -17 + + + + 13 + 2 + (:auto !!!:) Here is how cloning can be enabled in a throw-expression (15.1): [@#include <(:link + 1 + + 0 + + -7 + + + 2 + :)> #include <(:link + 1 + + 0 + + -25 + + + 2 + :)> #include <stdio.h> #include <errno.h> typedef boost::error_info<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link + 1 + + 0 + + -37 + + + 2 + :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::(:link + 1 + + 0 + + -32 + + + 2 + :)(file_read_error()) << errno_info(errno); }@] Of course, (:link + 1 + + 0 + + -32 + + + 2 + :) may be used with any exception type; there is no requirement that it should derive from boost::(:link + 1 + + 0 + + -37 + + + 2 + :). + + + + + 0 + + -18 + + + + 21 + 2 + (:auto !!!:) Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Here is an example: [@#include <stdio.h> #include <string> class file_read_error { public: explicit file_read_error( std::string const & fn ): fn_(fn) { }; std::string const & file_name() const { return fn_; } private: std::string fn_; }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error("????"); }@] We have defined an exception class file_read_error which can store a file name, so that when we catch a file_read_error object, we know which file the failure is related to. However, the file_read function does not have the file name at the time of the throw; all it has is a FILE handle. One possible solution is to not use FILE handles directly. We could have our own class file which stores both a FILE handle and a file name, and pass that to file_read. However, this could be problematic if we communicate with 3rd party code that does not use our class file (probably because they have their own similar class.) A better solution is to make class file_read_error derive (possibly indirectly) from boost::(:link + 1 + + 0 + + -37 + + + 2 + :), and free the file_read function from the burden of storing the file name in exceptions it throws: [@#include <(:link + 1 + + 0 + + -40 + + + 2 + :)> #include <stdio.h> #include <errno.h> typedef boost::(:link + 1 + + 0 + + -38 + + + 2 + :)<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link + 1 + + 0 + + -37 + + + 2 + :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error() << errno_info(errno); }@] If file_read detects a failure, it throws an exception which contains the information that is available at the time, namely the errno. Other relevant information, such as the file name, can be added in a context higher up the call stack, where it is known naturally: [@#include <(:link + 1 + + 0 + + -40 + + + 2 + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> typedef boost::(:link + 1 + + 0 + + -38 + + + 2 + :)<struct tag_file_name,std::string> file_name_info; boost::shared_ptr<FILE> file_open( char const * file_name, char const * mode ); void file_read( FILE * f, void * buffer, size_t size ); void parse_file( char const * file_name ) { boost::shared_ptr<FILE> f = file_open(file_name,"rb"); assert(f); try { char buf[1024]; file_read( f.get(), buf, sizeof(buf) ); } catch( boost::(:link + 1 + + 0 + + -37 + + + 2 + :) & e ) { e << file_name_info(file_name); throw; } }@] The above function is (almost) exception-neutral -- if an exception is emitted by any function call within the try block, parse_file does not need to do any real work, but it intercepts any boost::(:link + 1 + + 0 + + -37 + + + 2 + :) object, stores the file name, and re-throws using a throw-expression with no operand (15.1.6). The rationale for catching any boost::(:link + 1 + + 0 + + -37 + + + 2 + :) object is that the file name is relevant to any failure that occurs in parse_file, ''even if the failure is unrelated to file I/O''. As usual, the stored data can be retrieved using (:link + 1 + + 0 + + -9 + + + 2 + :). + + + + + 0 + + -19 + + + + 21 + 2 + (:auto !!:) Class boost::(:link + 1 + + 0 + + -37 + + + 2 + :) provides a virtual member function (:link + 1 + + 0 + + -42 + + + 2 + mod="m":), with a signature similar to the familiar std::exception::what function. The default implementation returns a string value that is not presentable as a friendly user message, but because it is generated automatically, it is useful for debugging or logging purposes. Here is an example: [@#include <(:link + 1 + + 0 + + -40 + + + 2 + :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link + 1 + + 0 + + -37 + + + 2 + :). void g() { try { f(); } catch( boost::(:link + 1 + + 0 + + -37 + + + 2 + :) & e ) { std::cerr << e.(:link + 1 + + 0 + + -42 + + + 2 + mod="m":)(); } }@] The (:link + 1 + + 0 + + -42 + + + 2 + mod="m":) member function iterates over all data objects stored in the boost::(:link + 1 + + 0 + + -37 + + + 2 + :) through (:link + 1 + + 0 + + -20 + + + 2 + |operator<<:). The returned string is constructed by converting each data object to string and then concatenating these strings together. When the (:link + 1 + + 0 + + -38 + + + 2 + :)<Tag,T> template is instantiated, the system attempts overload resolution for an unqualified call to to_string(x), where x is of type T. If this is successful, the to_string overload is expected to return std::string and is used to convert objects of type T to string. Otherwise, the system attempts overload resolution for s << x, where s is a std::ostringstream and x is of type T. If this is successful, the operator<< overload is used to convert objects of type T to string. Otherwise the system is unable to convert objects of type T to string, and an unspecified stub string value is used without issuing a compile error. + + + + + 0 + + -20 + + + + 7 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + 1 + + 0 + + -37 + + + 2 + :), or a type that derives (indirectly) from boost::(:link + 1 + + 0 + + -37 + + + 2 + :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link + 1 + + 0 + + -38 + + + 2 + :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) + + + + + 0 + + -21 + + + + 11 + 2 + (:auto !!:) All exception types that derive from boost::(:link + 1 + + 0 + + -37 + + + 2 + :) can be used as type-safe containers of arbitrary data objects, while complying with the no-throw requirements (15.5.1) of the ANSI C++ standard for exception types. Data can be added to a boost::(:link + 1 + + 0 + + -37 + + + 2 + :) at the time of the throw, or at a later time. (:include + 1 + + 0 + + -11 + + + 2 + :) (:include + 1 + + 0 + + -18 + + + 2 + :) (:include + 1 + + 0 + + -23 + + + 2 + :) + + + + + 0 + + -22 + + + + 27 + 2 + (:auto !!:) Some exception hierarchies can not be modified to make boost::(:link + 1 + + 0 + + -37 + + + 2 + :) a base type. In this case, the (:link + 1 + + 0 + + -34 + + + 2 + :) function template can be used to make exception objects derive from boost::(:link + 1 + + 0 + + -37 + + + 2 + :) anyway. Here is an example: [@#include <(:link + 1 + + 0 + + -40 + + + 2 + :)> #include <stdexcept> typedef boost::(:link + 1 + + 0 + + -38 + + + 2 + :)<struct tag_std_range_min,size_t> std_range_min; typedef boost::(:link + 1 + + 0 + + -38 + + + 2 + :)<struct tag_std_range_max,size_t> std_range_max; typedef boost::(:link + 1 + + 0 + + -38 + + + 2 + :)<struct tag_std_range_index,size_t> std_range_index; template <class T> class my_container { public: size_t size() const; T const & operator[]( size_t i ) const { if( i > size() ) throw boost::(:link + 1 + + 0 + + -34 + + + 2 + :)(std::range_error("Index out of range")) << std_range_min(0) << std_range_max(size()) << std_range_index(i); //.... } }; @] The call to (:link + 1 + + 0 + + -34 + + + 2 + :)<T> gets us an object of ''unspecified type'' which is guaranteed to derive from both boost::(:link + 1 + + 0 + + -37 + + + 2 + :) and T. This makes it possible to use (:link + 1 + + 0 + + -20 + + + 2 + |operator<<:) to store additional information in the exception object. The exception can be intercepted as T &, so existing exception handling will not break. It can also be intercepted as boost::(:link + 1 + + 0 + + -37 + + + 2 + :) &, so that (:link + 1 + + 0 + + -21 + + + 2 + |more information can be added to the exception at a later time:). + + + + + 0 + + -23 + + + + 13 + 2 + (:auto !!!:) The code snippet below demonstrates how boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) can be used to bundle the name of the function that failed, together with the reported errno so that they can be added to exception objects more conveniently together: [@#include <(:link + 1 + + 0 + + -13 + + + 2 + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link + 1 + + 0 + + -38 + + + 2 + :)<struct tag_file_name,std::string> file_name_info; typedef boost::(:link + 1 + + 0 + + -38 + + + 2 + :)<struct tag_function,char const *> function_info; typedef boost::(:link + 1 + + 0 + + -38 + + + 2 + :)<struct tag_errno,int> errno_info; typedef boost::tuple<function_info,errno_info> clib_failure; class file_open_error: public boost::(:link + 1 + + 0 + + -37 + + + 2 + :) { }; boost::shared_ptr<FILE> file_open( char const * name, char const * mode ) { if( FILE * f=fopen(name,mode) ) return boost::shared_ptr<FILE>(f,fclose); else throw file_open_error() << file_name_info(name) << clib_failure("fopen",errno); }@] Note that the members of a boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) are stored separately in exception objects; they can only be retrieved individually, using (:link + 1 + + 0 + + -9 + + + 2 + :). + + + + + 0 + + -24 + + + + 29 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: The (:link + 1 + + 0 + + -24 + + + 2 + :) function must not be called outside of a catch block. !!!!Returns: * An (:link + 1 + + 0 + + -28 + + + 2 + :) that refers to the currently handled exception or a copy of the currently handled exception. * If the function needs to allocate memory and the attempt fails, it returns an (:link + 1 + + 0 + + -28 + + + 2 + :) that refers to an instance of std::bad_alloc. !!!!Throws: Nothing. !!!!Notes: * It is unspecified whether the return values of two successive calls to (:link + 1 + + 0 + + -24 + + + 2 + :) refer to the same exception object. * Correct implementation of (:link + 1 + + 0 + + -24 + + + 2 + :) may require compiler support, unless (:link + 1 + + 0 + + -32 + + + 2 + :) was used at the time the currently handled exception object was passed to throw. If (:link + 1 + + 0 + + -32 + + + 2 + :) was not used, and if the compiler does not provide the necessary support, then (:link + 1 + + 0 + + -24 + + + 2 + :) may return an (:link + 1 + + 0 + + -28 + + + 2 + :) that refers to an instance of (:link + 1 + + 0 + + -31 + + + 2 + :). In this case, if the original exception object derives from boost::(:link + 1 + + 0 + + -37 + + + 2 + :), then the boost::(:link + 1 + + 0 + + -37 + + + 2 + :) sub-object of the (:link + 1 + + 0 + + -31 + + + 2 + :) object is initialized by the boost::(:link + 1 + + 0 + + -37 + + + 2 + :) copy constructor. + + + + + 0 + + -25 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -26 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -27 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -28 + + + + 9 + 2 + (:auto !!!:) (:include synopsis:) The (:link + 1 + + 0 + + -28 + + + 2 + :) type can be used to refer to a copy of an exception object. It is Default Constructible, Copy Constructible, Assignable and Equality Comparable; (:link + 1 + + 0 + + -28 + + + 2 + :)'s operations do not throw. Two instances of (:link + 1 + + 0 + + -28 + + + 2 + :) are equivalent and compare equal if and only if they refer to the same exception. The default constructor of (:link + 1 + + 0 + + -28 + + + 2 + :) produces the null value of the type. The null value is equivalent only to itself. + + + + + 0 + + -29 + + + + 1 + 2 + (:auto !!!:) (:include synopsis:) !!!!Precondition: ep shall not be null. !!!!Throws: The exception to which ep refers. + + + + + 0 + + -30 + + + + 13 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must derive publicly from std::exception. !!!!Effects: * If BOOST_NO_EXCEPTIONS is not defined, boost::(:link + 1 + + 0 + + -30 + + + 2 + :)(e) is equivalent to throw boost::(:link + 1 + + 0 + + -32 + + + 2 + :)(boost::(:link + 1 + + 0 + + -34 + + + 2 + :)(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::(:link + 1 + + 0 + + -30 + + + 2 + :)(e) is equivalent to throw e; * If BOOST_NO_EXCEPTIONS is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of + 1 + + 0 + + -30 + + + 2 + are allowed to assume that the function never returns; therefore, if the user-defined + 1 + + 0 + + -30 + + + 2 + returns, the behavior is undefined. + + + + + 0 + + -31 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) This type is used by the (:link + 1 + + 0 + + -28 + + + 2 + :) support in Boost Exception. Please see (:link + 1 + + 0 + + -24 + + + 2 + :). + + + + + 0 + + -32 + + + + 21 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: T must have an accessible no-throw copy constructor. !!!!Returns: An object of ''unspecified'' type which derives publicly from T. That is, the returned object can be intercepted by a catch(T &). !!!!Description: This function is designed to be used directly in a throw-expression to enable the + 1 + + 0 + + -28 + + + 2 + support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link + 1 + + 0 + + -32 + + + 2 + :)(my_exception());@] Unless (:link + 1 + + 0 + + -32 + + + 2 + :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link + 1 + + 0 + + -24 + + + 2 + :) may return an (:link + 1 + + 0 + + -28 + + + 2 + :) which refers to an instance of (:link + 1 + + 0 + + -31 + + + 2 + :). See (:link + 1 + + 0 + + -24 + + + 2 + :) for details. !!!!Note: Instead of using the throw keyword directly, it is preferable to call boost::(:link + 1 + + 0 + + -30 + + + 2 + :). This is guaranteed to throw an exception that derives from boost::(:link + 1 + + 0 + + -37 + + + 2 + :) and supports the + 1 + + 0 + + -28 + + + 2 + functionality. + + + + + 0 + + -33 + + + + 0 + + + + + 0 + + -34 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: T must be a user-defined type with accessible no-throw copy constructor as per (15.5.1). !!!!Returns: * If T derives from boost:: + 1 + + 0 + + -37 + + + 2 + , the returned object is of type T and is a copy of x. * Otherwise, the returned object is of an unspecified type that derives publicly from both T and boost:: + 1 + + 0 + + -37 + + + 2 + . The T sub-object is initialized from x by the T copy constructor. !!!!Throws: Nothing. + + + + + 0 + + -35 + + + + 11 + 2 + (:auto !!:) Boost Exception supports transporting of exception objects between threads through cloning. This system is similar to (:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:), but because Boost Exception can not rely on language support, the use of (:link + 1 + + 0 + + -32 + + + 2 + :) at the time of the throw is required in order to use cloning. !!!!Note: All exceptions emitted by the familiar function boost::(:link + 1 + + 0 + + -30 + + + 2 + :) are guaranteed to derive from boost::(:link + 1 + + 0 + + -37 + + + 2 + :) and to support cloning. (:include + 1 + + 0 + + -17 + + + 2 + :) (:include + 1 + + 0 + + -15 + + + 2 + :) + + + + + 0 + + -36 + + + + 0 + + + + + 0 + + -37 + + + + 19 + 2 + (:auto !!!:) (:include synopsis:) Class boost::(:link + 1 + + 0 + + -37 + + + 2 + :) is designed to be used as a universal base for user-defined exception types. An object of any type deriving from boost::(:link + 1 + + 0 + + -37 + + + 2 + :) can store data of arbitrary types, using the (:link + 1 + + 0 + + -38 + + + 2 + :) wrapper and (:link + 1 + + 0 + + -20 + + + 2 + |operator<<:). To retrieve data from a boost::(:link + 1 + + 0 + + -37 + + + 2 + :) object, use the (:link + 1 + + 0 + + -9 + + + 2 + :) function template. (:include + 1 + + 0 + + -43 + + + 2 + :) (:include + 1 + + 0 + + -10 + + + 2 + :) (:include + 1 + + 0 + + -42 + + + 2 + :) + + + + + 0 + + -38 + + + + 25 + 2 + (:auto !!!:) (:include synopsis:) !!!!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 (:link + 1 + + 0 + + -38 + + + 2 + :)<Tag,T> can be passed to (:link + 1 + + 0 + + -20 + + + 2 + |operator<<:) to be stored in objects of type boost::(:link + 1 + + 0 + + -37 + + + 2 + :). !!!!Note: The header <(:link + 1 + + 0 + + -14 + + + 2 + :)> provides a declaration of the (:link + 1 + + 0 + + -38 + + + 2 + :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, like this: [@#include <(:link + 1 + + 0 + + -14 + + + 2 + :)> typedef boost::(:link + 1 + + 0 + + -38 + + + 2 + :)<struct tag_errno,int> errno_info;@] Of course, to actually add an (:link + 1 + + 0 + + -38 + + + 2 + :) object to (:link + 1 + + 0 + + -37 + + + 2 + mod="p":) using (:link + 1 + + 0 + + -20 + + + 2 + |operator<<:), or to retrieve it using (:link + 1 + + 0 + + -9 + + + 2 + :), you must first #include <(:link + 1 + + 0 + + -25 + + + 2 + :)>. + + + + + 0 + + -39 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) !!!!Returns: If dynamic_cast<boost::(:link + 1 + + 0 + + -37 + + + 2 + :) const *>(&x) is not null, the returned string is initialized by a call to (:link + 1 + + 0 + + -42 + + + 2 + :); otherwise, the returned string combines the output of x.what() and typeid(x).name(). + + + + + 0 + + -40 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -41 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -42 + + + + 15 + 2 + (:auto !!!:) (:include decl:) !!!!Returns: A string representation of all data stored in the boost::(:link + 1 + + 0 + + -37 + + + 2 + :) object by the (:link + 1 + + 0 + + -20 + + + 2 + |operator<<:) function. See "(:link + 1 + + 0 + + -19 + + + 2 + mod="w":)" for details. !!!!Throws: Nothing. !!!!Notes: *The return value remains valid until the exception object from which it was obtained is destroyed or modified. *The header + 1 + + 0 + + -41 + + + 2 + provides a namespace-scope function + 1 + + 0 + + -39 + + + 2 + which takes a std::exception. It calls + 1 + + 0 + + -42 + + + 2 + if its argument can be converted to boost:: + 1 + + 0 + + -37 + + + 2 + ; otherwise it returns a string that combines the value of std::exception::what and the exception's dynamic type. + + + + + 0 + + -43 + + + + 7 + 2 + (:auto !!!:) (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link + 1 + + 0 + + -37 + + + 2 + :) object. * Copy constructor: initializes a boost::(:link + 1 + + 0 + + -37 + + + 2 + :) object which shares with x all data added through (:link + 1 + + 0 + + -20 + + + 2 + |operator<<:), including data that is added at a future time. !!!!Throws: Nothing. + + + + + + + + throws 48 @@ -4649,2414 +6270,12 @@ -5 - - 1 - 2 - !!boost/exception/error_info.hpp !!!Synopsis (:include synopsis:) - - - - - 0 - - -6 - - - - 7 - 2 - !!!BOOST_ERROR_INFO (:include synopsis:) This macro is designed to be used with (:link - 1 - - 0 - - -28 - - - 2 - |operator<<:) when throwing a boost::(:link - 1 - - 0 - - -26 - - - 2 - :), to store information about the location of the throw statement. It can be chained with other (:link - 1 - - 0 - - -27 - - - 2 - :)s in a single throw expression. - - - - - 0 - - -7 - - - - 7 - 2 - !!!get_error_info (:include synopsis:) !!!!Requirements: The type of the x object must derive from boost::(:link - 1 - - 0 - - -26 - - - 2 - :); ErrorInfo must be an instance of the (:link - 1 - - 0 - - -27 - - - 2 - :) template. !!!!Returns: If x does not store an object of type ErrorInfo, returns an empty (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:); otherwise returns pointer to the stored value. Use (:link - 1 - - 0 - - -28 - - - 2 - |operator<<:) to store values in exception objects. !!!!Throws: Nothing. - - - - - 0 - - -8 - - - - 1 - 2 - !!boost/throw_exception.hpp !!!Synopsis (:include synopsis:) - - - - - 0 - - -9 - - - - 1 - 2 - !!boost/exception/exception.hpp !!!Synopsis (:include synopsis:) - - - - - 0 - - -10 - - - - 21 - 2 - !!Diagnostic Information Class boost::(:link - 1 - - 0 - - -26 - - - 2 - :) provides a virtual member function (:link - 1 - - 0 - - -42 - - - 2 - mod="m":), with a signature similar to the familiar std::exception::what function. The default implementation returns a string value that is not presentable as a friendly user message, but because it is generated automatically, it is useful for debugging or logging purposes. Here is an example: [@#include <(:link - 1 - - 0 - - -37 - - - 2 - :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link - 1 - - 0 - - -26 - - - 2 - :). void g() { try { f(); } catch( boost::(:link - 1 - - 0 - - -26 - - - 2 - :) & e ) { std::cerr << e.(:link - 1 - - 0 - - -42 - - - 2 - mod="m":)(); } }@] The (:link - 1 - - 0 - - -42 - - - 2 - mod="m":) member function iterates over all data objects stored in the boost::(:link - 1 - - 0 - - -26 - - - 2 - :) through (:link - 1 - - 0 - - -28 - - - 2 - |operator<<:). The returned string is constructed by converting each data object to string and then concatenating these strings together. When the (:link - 1 - - 0 - - -27 - - - 2 - :)<Tag,T> template is instantiated, the system attempts overload resolution for an unqualified call to to_string(x), where x is of type T. If this is successful, the to_string overload is used to convert objects of type T to string. Otherwise, the system attempts overload resolution for s << x, where s is a std::ostringstream and x is of type T. If this is successful, the operator<< overload is used to convert objects of type T to string. Otherwise the system is unable to convert objects of type T to string, and an unspecified stub string value is used without issuing a compile error. - - - - - 0 - - -11 - - - - 27 - 2 - !!Integrating Boost Exception in Existing Exception Class Hierarchies Some exception hierarchies can not be modified to make boost::(:link - 1 - - 0 - - -26 - - - 2 - :) a base type. For this case, the (:link - 1 - - 0 - - -29 - - - 2 - :) function template can be used to make exception objects derive from boost::(:link - 1 - - 0 - - -26 - - - 2 - :) anyway. Here is an example: [@#include <(:link - 1 - - 0 - - -37 - - - 2 - :)> #include <stdexcept> typedef boost::(:link - 1 - - 0 - - -27 - - - 2 - :)<struct tag_std_range_min,size_t> std_range_min; typedef boost::(:link - 1 - - 0 - - -27 - - - 2 - :)<struct tag_std_range_max,size_t> std_range_max; typedef boost::(:link - 1 - - 0 - - -27 - - - 2 - :)<struct tag_std_range_index,size_t> std_range_index; template <class T> class my_container { public: size_t size() const; T const & operator[]( size_t i ) const { if( i > size() ) throw boost::(:link - 1 - - 0 - - -29 - - - 2 - :)(std::range_error("Index out of range")) << std_range_min(0) << std_range_max(size()) << std_range_index(i); //.... } }; @] The call to (:link - 1 - - 0 - - -29 - - - 2 - :)<T> gets us an object of ''unspecified type'' which is guaranteed to derive from both boost::(:link - 1 - - 0 - - -26 - - - 2 - :) and T. This makes it possible to use (:link - 1 - - 0 - - -28 - - - 2 - |operator<<:) to store additional information in the exception object. The exception can be intercepted as T &, so existing exception handling will not break. It can also be intercepted as boost::(:link - 1 - - 0 - - -26 - - - 2 - :) &, so that (:link - 1 - - 0 - - -20 - - - 2 - |more information can be added to the exception at a later time:). - - - - - 0 - - -12 - - - - 13 - 2 - !!!Adding Grouped Data to Exceptions The code snippet below demonstrates how boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) can be used to bundle the name of the function that failed, together with the reported errno so that they can be added to exception objects more conveniently together: [@#include <(:link - 1 - - 0 - - -19 - - - 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link - 1 - - 0 - - -27 - - - 2 - :)<struct tag_file_name,std::string> file_name_info; typedef boost::(:link - 1 - - 0 - - -27 - - - 2 - :)<struct tag_function,char const *> function_info; typedef boost::(:link - 1 - - 0 - - -27 - - - 2 - :)<struct tag_errno,int> errno_info; typedef boost::tuple<function_info,errno_info> clib_failure; class file_open_error: public boost::(:link - 1 - - 0 - - -26 - - - 2 - :) { }; boost::shared_ptr<FILE> file_open( char const * name, char const * mode ) { if( FILE * f=fopen(name,mode) ) return boost::shared_ptr<FILE>(f,fclose); else throw file_open_error() << file_name_info(name) << clib_failure("fopen",errno); }@] Note that the members of a boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) are stored separately in exception objects; they can only be retrieved individually, using (:link - 1 - - 0 - - -7 - - - 2 - :). - - - - - 0 - - -13 - - - - 19 - 2 - !!!Adding of Arbitrary Data at the Point of the Throw The following example demonstrates how errno can be stored in exception objects using Boost Exception: [@#include <(:link - 1 - - 0 - - -37 - - - 2 - :)> #include <errno.h> #include <iostream> typedef boost::(:link - 1 - - 0 - - -27 - - - 2 - :)<struct tag_errno,int> errno_info; //(1) class my_error: public boost::(:link - 1 - - 0 - - -26 - - - 2 - :), public std::exception { }; //(2) void f() { throw my_error() << errno_info(errno); //(3) } @] First, we instantiate the (:link - 1 - - 0 - - -27 - - - 2 - :) template using a unique identifier -- tag_errno, and the type of the info it identifies -- int. This provides compile-time type safety for the various values stored in exception objects. Second, we define class my_error, which derives from boost::(:link - 1 - - 0 - - -26 - - - 2 - :). Finally, (3) illustrates how the typedef from (1) can be used with (:link - 1 - - 0 - - -28 - - - 2 - |operator<<:) to store values in exception objects at the point of the throw. The stored errno value can be recovered at a later time like this: [@// ...continued void g() { try { f(); } catch( my_error & x ) { if( boost::shared_ptr<int const> err=boost::(:link - 1 - - 0 - - -7 - - - 2 - :)<errno_info>(x) ) std::cerr << "Error code: " << *err; } }@] The (:link - 1 - - 0 - - -7 - - - 2 - :) function template is instantiated with the typedef from (1), and is passed an exception object of any type that derives publicly from boost::(:link - 1 - - 0 - - -26 - - - 2 - :). If the exception object contains the requested value, the returned (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:) will point to it; otherwise an empty (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:) is returned. - - - - - 0 - - -14 - - - - 5 - 2 - !!!operator<<, tuple overload (:include synopsis:) !!!!Requirements: E must be boost::(:link - 1 - - 0 - - -26 - - - 2 - :), or a type that derives (indirectly) from boost::(:link - 1 - - 0 - - -26 - - - 2 - :). !!!!Effects: Equivalent to x << v.(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements|get:)<0>() << ... << v.(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements|get:)<N>(). !!!!Returns: x. (:include throws:) - - - - - 0 - - -15 - - - - 3 - 2 - !!!exception::~exception (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link - 1 - - 0 - - -26 - - - 2 - :) object. !!!!Throws: Nothing. - - - - - 0 - - -16 - - - - 1 - 2 - !!boost/exception/info.hpp !!!Synopsis (:include synopsis:) - - - - - 0 - - -17 - - - - 13 - 2 - !!!Using enable_current_exception at the Time of the Throw Here is how cloning can be enabled in a throw-expression (15.1): [@#include <(:link - 1 - - 0 - - -39 - - - 2 - :)> #include <(:link - 1 - - 0 - - -16 - - - 2 - :)> #include <stdio.h> #include <errno.h> typedef boost::error_info<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link - 1 - - 0 - - -26 - - - 2 - :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::(:link - 1 - - 0 - - -31 - - - 2 - :)(file_read_error()) << errno_info(errno); }@] Of course, - 1 - - 0 - - -31 - - - 2 - may be used with any exception type; there is no requirement that it should derive from boost:: - 1 - - 0 - - -26 - - - 2 - . - - - - - 0 - - -18 - - - - 37 - 2 - !!!Cloning and Re-throwing an Exception When you catch an exception, you can call (:link - 1 - - 0 - - -32 - - - 2 - :) to get an (:link - 1 - - 0 - - -30 - - - 2 - :) object: [@#include <(:link - 1 - - 0 - - -21 - - - 2 - :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link - 1 - - 0 - - -26 - - - 2 - :)s void worker_thread( boost::(:link - 1 - - 0 - - -30 - - - 2 - :) & error ) { try { do_work(); error = boost::(:link - 1 - - 0 - - -30 - - - 2 - :)(); } catch( ... ) { error = boost::(:link - 1 - - 0 - - -32 - - - 2 - :)(); } }@] In the above example, note that (:link - 1 - - 0 - - -32 - - - 2 - :) captures the original type of the exception object. The exception can be thrown again using the (:link - 1 - - 0 - - -34 - - - 2 - :) function: [@// ...continued void work() { boost::(:link - 1 - - 0 - - -30 - - - 2 - :) error; boost::(:link http://www.boost.org/doc/html/boost/thread.html|thread:) t( boost::(:link http://www.boost.org/libs/bind/bind.html|bind:)(worker_thread,boost::(:link http://www.boost.org/doc/html/ref.html|ref:)(error)) ); t.(:link http://www.boost.org/doc/html/boost/thread.html|join:)(); if( error ) boost::(:link - 1 - - 0 - - -34 - - - 2 - :)(error); }@] Note that (:link - 1 - - 0 - - -32 - - - 2 - :) could fail to copy the original exception object in the following cases:* if there is not enough memory, in which case the returned (:link - 1 - - 0 - - -30 - - - 2 - :) points to an instance of std::bad_alloc, or * if (:link - 1 - - 0 - - -31 - - - 2 - :) was not used in the throw-expression passed to the original throw statement and the current implementation does not have the necessary compiler-specific support to copy the exception automatically, in which case the returned (:link - 1 - - 0 - - -30 - - - 2 - :) points to an instance of (:link - 1 - - 0 - - -35 - - - 2 - :). Regardless, the use of (:link - 1 - - 0 - - -32 - - - 2 - :) and (:link - 1 - - 0 - - -34 - - - 2 - :) in the above examples is well-formed. - - - - - 0 - - -19 - - - - 1 - 2 - !!boost/exception/info_tuple.hpp !!!Synopsis (:include synopsis:) - - - - - 0 - - -20 - - - - 11 - 2 - !!Transporting of Arbitrary Data to the Catch Site All exception types that derive from boost::(:link - 1 - - 0 - - -26 - - - 2 - :) can be used as type-safe containers of arbitrary data objects, while complying with the no-throw requirements (15.5.1) of the ANSI C++ standard for exception types. Data can be added to a boost::(:link - 1 - - 0 - - -26 - - - 2 - :) at the time of the throw, or at a later time. (:include - 1 - - 0 - - -13 - - - 2 - :) (:include - 1 - - 0 - - -22 - - - 2 - :) (:include - 1 - - 0 - - -12 - - - 2 - :) - - - - - 0 - - -21 - - - - 1 - 2 - !!boost/exception_ptr.hpp !!!Synopsis (:include synopsis:) - - - - - 0 - - -22 - - - - 21 - 2 - !!!Adding of Arbitrary Data to Active Exception Objects Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Here is an example: [@#include <stdio.h> #include <string> class file_read_error { public: explicit file_read_error( std::string const & fn ): fn_(fn) { }; std::string const & file_name() const { return fn_; } private: std::string fn_; }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error("????"); }@] We have defined an exception class file_read_error which can store a file name, so that when we catch a file_read_error object, we know which file the failure is related to. However, the file_read function does not have the file name at the time of the throw; all it has is a FILE handle. One possible solution is to not use FILE handles directly. We could have our own class file which stores both a FILE handle and a file name, and pass that to file_read. However, this could be problematic if we communicate with 3rd party code that does not use our class file (probably because they have their own similar class.) A better solution is to make class file_read_error derive (possibly indirectly) from boost::(:link - 1 - - 0 - - -26 - - - 2 - :), and free the file_read function from the burden of storing the file name in exceptions it throws: [@#include <(:link - 1 - - 0 - - -37 - - - 2 - :)> #include <stdio.h> #include <errno.h> typedef boost::(:link - 1 - - 0 - - -27 - - - 2 - :)<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link - 1 - - 0 - - -26 - - - 2 - :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error() << errno_info(errno); }@] If file_read detects a failure, it throws an exception which contains the information that is available at the time, namely the errno. Other relevant information, such as the file name, can be added in a context higher up the call stack, where it is known naturally: [@#include <(:link - 1 - - 0 - - -37 - - - 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> typedef boost::(:link - 1 - - 0 - - -27 - - - 2 - :)<struct tag_file_name,std::string> file_name_info; boost::shared_ptr<FILE> file_open( char const * file_name, char const * mode ); void file_read( FILE * f, void * buffer, size_t size ); void parse_file( char const * file_name ) { boost::shared_ptr<FILE> f = file_open(file_name,"rb"); assert(f); try { char buf[1024]; file_read( f.get(), buf, sizeof(buf) ); } catch( boost::(:link - 1 - - 0 - - -26 - - - 2 - :) & e ) { e << file_name_info(file_name); throw; } }@] The above function is (almost) exception-neutral -- if an exception is emitted by any function call within the try block, parse_file does not need to do any real work, but it intercepts any boost::(:link - 1 - - 0 - - -26 - - - 2 - :) object, stores the file name, and re-throws using a throw-expression with no operand (15.1.6). The rationale for catching any boost::(:link - 1 - - 0 - - -26 - - - 2 - :) object is that the file name is relevant to any failure that occurs in parse_file, ''even if the failure is unrelated to file I/O''. As usual, the stored data can be retrieved using (:link - 1 - - 0 - - -7 - - - 2 - :). - - - - - 0 - - -23 - - - - 9 - 2 - !!!throw_exception (:include synopsis:) !!!!Requirements: E must derive publicly from std::exception. !!!!Effects: * If BOOST_NO_EXCEPTIONS is not defined, boost::(:link - 1 - - 0 - - -23 - - - 2 - :)(e) is equivalent to throw boost::(:link - 1 - - 0 - - -31 - - - 2 - :)(boost::(:link - 1 - - 0 - - -29 - - - 2 - :)(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::(:link - 1 - - 0 - - -23 - - - 2 - :)(e) is equivalent to throw e; * If BOOST_NO_EXCEPTIONS is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of throw_exception are allowed to assume that the function never returns; therefore, if the user-defined throw_exception returns, the behavior is undefined. - - - - - 0 - - -24 - - - - 11 - 2 - !!Transporting of Exceptions between Threads Boost Exception supports transporting of exception objects between threads through cloning. This system is similar to (:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:), but because Boost Exception can not rely on language support, the use of (:link - 1 - - 0 - - -31 - - - 2 - :) at the time of the throw is required in order to use cloning. !!!!Note: All exceptions emitted by the familiar function boost::(:link - 1 - - 0 - - -23 - - - 2 - :) are guaranteed to derive from boost::(:link - 1 - - 0 - - -26 - - - 2 - :) and to support cloning. (:include - 1 - - 0 - - -17 - - - 2 - :) (:include - 1 - - 0 - - -18 - - - 2 - :) - - - - - 0 - - -25 - - - - 0 - - - - - 0 - - -26 - - - - 19 - 2 - !!!exception (:include synopsis:) Class boost::(:link - 1 - - 0 - - -26 - - - 2 - :) is designed to be used as a universal base for user-defined exception types. An object of any type deriving from boost::(:link - 1 - - 0 - - -26 - - - 2 - :) can store data of arbitrary types, using the (:link - 1 - - 0 - - -27 - - - 2 - :) wrapper and (:link - 1 - - 0 - - -28 - - - 2 - |operator<<:). To retrieve data from a boost::(:link - 1 - - 0 - - -26 - - - 2 - :) object, use the (:link - 1 - - 0 - - -7 - - - 2 - :) function template. (:include - 1 - - 0 - - -43 - - - 2 - :) (:include - 1 - - 0 - - -15 - - - 2 - :) (:include - 1 - - 0 - - -42 - - - 2 - :) - - - - - 0 - - -27 - - - - 21 - 2 - !!!error_info (:include synopsis:) !!!!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 (:link - 1 - - 0 - - -27 - - - 2 - :)<Tag,T> can be passed to (:link - 1 - - 0 - - -28 - - - 2 - |operator<<:) to be stored in objects of type boost::(:link - 1 - - 0 - - -26 - - - 2 - :). !!!!Note: The header <(:link - 1 - - 0 - - -5 - - - 2 - :)> provides a declaration of the (:link - 1 - - 0 - - -27 - - - 2 - :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, like this: [@#include <(:link - 1 - - 0 - - -5 - - - 2 - :)> typedef boost::(:link - 1 - - 0 - - -27 - - - 2 - :)<struct tag_errno,int> errno_info;@] Of course, to actually add an errno_info object to exceptions using (:link - 1 - - 0 - - -28 - - - 2 - |operator<<:), or to retrieve it using (:link - 1 - - 0 - - -7 - - - 2 - :), you must first #include <(:link - 1 - - 0 - - -16 - - - 2 - :)>. - - - - - 0 - - -28 - - - - 7 - 2 - !!!operator<<, error_info overload (:include synopsis:) !!!!Requirements: E must be boost::(:link - 1 - - 0 - - -26 - - - 2 - :), or a type that derives (indirectly) from boost::(:link - 1 - - 0 - - -26 - - - 2 - :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link - 1 - - 0 - - -27 - - - 2 - :)<Tag1,T1>, that data is overwritten. !!!!Returns: x. (:include throws:) - - - - - 0 - - -29 - - - - 7 - 2 - !!!enable_error_info (:include synopsis:) !!!!Requirements: T must be a user-defined type with accessible no-throw copy constructor. !!!!Returns: An object of unspecified type with no-throw copy semantics, which derives publicly from both T, and class boost::(:link - 1 - - 0 - - -26 - - - 2 - :). The T sub-object is initialized from x by the T copy constructor. If T already derives from boost::(:link - 1 - - 0 - - -26 - - - 2 - :), then the type of the returned object does not derive boost::(:link - 1 - - 0 - - -26 - - - 2 - :). !!!!Throws: Nothing. - - - - - 0 - - -30 - - - - 15 - 2 - !!!exception_ptr (:include synopsis:) The (:link - 1 - - 0 - - -30 - - - 2 - :) type can be used to refer to a copy of an exception object. It is Default Constructible, Copy Constructible, Assignable and Equality Comparable; (:link - 1 - - 0 - - -30 - - - 2 - :)'s operations do not throw. Two instances of (:link - 1 - - 0 - - -30 - - - 2 - :) are equivalent and compare equal if and only if they refer to the same exception. The default constructor of (:link - 1 - - 0 - - -30 - - - 2 - :) produces the null value of the type. The null value is equivalent only to itself. !!!!Note: (:link - 1 - - 0 - - -30 - - - 2 - :) objects are returned by (:link - 1 - - 0 - - -32 - - - 2 - :) and (:link - 1 - - 0 - - -33 - - - 2 - :). - - - - - 0 - - -31 - - - - 17 - 2 - !!!enable_current_exception (:include synopsis:) !!!!Requirements: T must have an accessible no-throw copy constructor !!!!Returns: An object of ''unspecified'' type which derives publicly from T. That is, the returned object can be intercepted by a catch(T &). !!!!Description: This function is designed to be used directly in a throw-expression to enable the exception_ptr support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link - 1 - - 0 - - -31 - - - 2 - :)(my_exception());@] Unless (:link - 1 - - 0 - - -31 - - - 2 - :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link - 1 - - 0 - - -32 - - - 2 - :) may return an (:link - 1 - - 0 - - -30 - - - 2 - :) which refers to an instance of (:link - 1 - - 0 - - -35 - - - 2 - :). See (:link - 1 - - 0 - - -32 - - - 2 - :) for details. !!!!Note: Instead of using the throw keyword directly, it is preferable to call boost::(:link - 1 - - 0 - - -23 - - - 2 - :). This is guaranteed to throw an exception that derives from boost::(:link - 1 - - 0 - - -26 - - - 2 - :) and supports exception_ptr functionality. - - - - - 0 - - -32 - - - - 29 - 2 - !!!current_exception (:include synopsis:) !!!!Requirements: The (:link - 1 - - 0 - - -32 - - - 2 - :) function must not be called outside of a catch block. !!!!Returns: * An (:link - 1 - - 0 - - -30 - - - 2 - :) that refers to the currently handled exception or a copy of the currently handled exception. * If the function needs to allocate memory and the attempt fails, it returns an (:link - 1 - - 0 - - -30 - - - 2 - :) that refers to an instance of std::bad_alloc. !!!!Throws: Nothing. !!!!Notes: * It is unspecified whether the return values of two successive calls to (:link - 1 - - 0 - - -32 - - - 2 - :) refer to the same exception object. * Correct implementation of (:link - 1 - - 0 - - -32 - - - 2 - :) may require compiler support, unless (:link - 1 - - 0 - - -31 - - - 2 - :) is used at the time the currently handled exception object was passed to throw. If (:link - 1 - - 0 - - -31 - - - 2 - :) is not used, and if the compiler does not provide the necessary support, then (:link - 1 - - 0 - - -32 - - - 2 - :) may return an (:link - 1 - - 0 - - -30 - - - 2 - :) that refers to an instance of (:link - 1 - - 0 - - -35 - - - 2 - :). In this case, if the original exception object derives from boost::(:link - 1 - - 0 - - -26 - - - 2 - :), then the boost::(:link - 1 - - 0 - - -26 - - - 2 - :) sub-object of the (:link - 1 - - 0 - - -35 - - - 2 - :) object is initialized by the boost::(:link - 1 - - 0 - - -26 - - - 2 - :) copy constructor. - - - - - 0 - - -33 - - - - 3 - 2 - !!!copy_exception (:include synopsis:) !!!!Effects: As if try { throw e; } catch( ... ) { return (:link - 1 - - 0 - - -32 - - - 2 - :)(); } - - - - - 0 - - -34 - - - - 1 - 2 - !!!rethrow_exception (:include synopsis:) !!!!Precondition: ep shall not be null. !!!!Throws: The exception to which ep refers. - - - - - 0 - - -35 - - - - 5 - 2 - !!!unknown_exception (:include synopsis:) This type is used by the - 1 - - 0 - - -30 - - - 2 - support in Boost Exception. Please see (:link - 1 - - 0 - - -32 - - - 2 - :). - - - - - 0 - - -36 - - - - 5 - 2 - !!!diagnostic_information (:include synopsis:) !!!!Returns: If dynamic_cast<boost::(:link - 1 - - 0 - - -26 - - - 2 - :) *>(&x) is not null, the returned string is initialized by a call to (:link - 1 - - 0 - - -42 - - - 2 - :); otherwise, the returned string combines the output of x.what() and typeid(x).name(). - - - - - 0 - - -37 - - - - 1 - 2 - !!boost/exception.hpp !!Synopsis (:include synopsis:) - - - - - 0 - - -38 - - - - 1 - 2 - !!boost/exception/diagnostic_information.hpp !!!Synopsis (:include synopsis:) - - - - - 0 - - -39 - - - - 1 - 2 - !!boost/exception/enable_current_exception.hpp !!!Synopsis (:include synopsis:) - - - - - 0 - - -40 - - - - 1 - 2 - !!boost/exception/enable_error_info.hpp !!!Synopsis (:include synopsis:) - - - - - 0 - - -41 - - - - 0 - - - - - 0 - - -42 - - - - 7 - 2 - !!!exception::diagnostic_information (:include decl:) !!!!Returns: An string representation of all data stored in the boost::(:link - 1 - - 0 - - -26 - - - 2 - :) object by the (:link - 1 - - 0 - - -28 - - - 2 - |operator<<:) function. See "(:link - 1 - - 0 - - -10 - - - 2 - :)" for details. !!!!Throws: Nothing. !!!!Note: The return value remains valid until the exception object from which it is obtained is destroyed or modified. - - - - - 0 - - -43 - - - - 7 - 2 - !!!exception::exception (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link - 1 - - 0 - - -26 - - - 2 - :) object. * Copy constructor: initializes a boost::(:link - 1 - - 0 - - -26 - - - 2 - :) object which shares with x all data added through (:link - 1 - - 0 - - -28 - - - 2 - |operator<<:), including data that is added at a future time. !!!!Throws: Nothing. - - - - - - - - throws - - 49 - - reno_layer - - - - 39 - - - 0 - - -5 - - - - 0 - - - - - 0 - - -6 - - - - 0 - - - - - 0 - - -7 - - - - 0 - - - - - 0 - - -8 - - - - 0 - - - - - 0 - - -9 - - - - 0 - - - - - 0 - - -10 - - - - 0 - - - - - 0 - - -11 - - - - 0 - - - - - 0 - - -12 - - - - 0 - - - - - 0 - - -13 - - - - 0 - - - - - 0 - - -14 - - 1 2 !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. - - - 0 - - -15 - - - - 0 - - - - - 0 - - -16 - - - - 0 - - - - - 0 - - -17 - - - - 0 - - - - - 0 - - -18 - - - - 0 - - - - - 0 - - -19 - - - - 0 - - - - - 0 - - -20 - - - - 0 - - - - - 0 - - -21 - - - - 0 - - - - - 0 - - -22 - - - - 0 - - - - - 0 - - -23 - - - - 0 - - - - - 0 - - -24 - - - - 0 - - - - - 0 - - -25 - - - - 0 - - - - - 0 - - -26 - - - - 0 - - - - - 0 - - -27 - - - - 0 - - - - - 0 - - -28 - - - - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. - - - - - 0 - - -29 - - - - 0 - - - - - 0 - - -30 - - - - 0 - - - - - 0 - - -31 - - - - 0 - - - - - 0 - - -32 - - - - 0 - - - - - 0 - - -33 - - - - 0 - - - - - 0 - - -34 - - - - 0 - - - - - 0 - - -35 - - - - 0 - - - - - 0 - - -36 - - - - 0 - - - - - 0 - - -37 - - - - 0 - - - - - 0 - - -38 - - - - 0 - - - - - 0 - - -39 - - - - 0 - - - - - 0 - - -40 - - - - 0 - - - - - 0 - - -41 - - - - 0 - - - - - 0 - - -42 - - - - 0 - - - - - 0 - - -43 - - - - 0 - - - - - - - - members - - 50 - - reno_layer - - - - 39 - - - 0 - - -5 - - - - 0 - - 0 @@ -7219,7 +6438,9 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. @@ -7482,7 +6703,7 @@ synopsis - 51 + 49 reno_layer @@ -7497,9 +6718,27 @@ - 1 + 5 2 - [@namespace boost { (:include decl pre_indent="4":) }@] + `#include <(:link + 1 + + 0 + + -13 + + + 2 + :)> [@namespace boost { (:include + 1 + + 0 + + -5 + + + 2 + decl pre_indent="4":) }@] @@ -7510,18 +6749,27 @@ - 3 + 5 2 - `#include <(:link + [@#include <(:link 1 0 - -16 + -7 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + :)> #include <(:link + 1 + + 0 + + -12 + + + 2 + :)> #include <exception> namespace boost { (:include api pre_indent="4":) }@] @@ -7534,16 +6782,16 @@ 3 2 - `#include <(:link + [@#include <(:link 1 0 - -16 + -27 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + :)> namespace boost { (:include api pre_indent="4":) }@] @@ -7554,27 +6802,18 @@ - 5 + 3 2 - [@#include <(:link + `#include <(:link 1 0 - -39 + -25 2 - :)> #include <(:link - 1 - - 0 - - -40 - - - 2 - :)> #include <exception> namespace boost { (:include decl pre_indent="4":) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7585,9 +6824,18 @@ - 1 + 3 2 - [@namespace boost { (:include decl pre_indent="4":) }@] + `#include <(:link + 1 + + 0 + + -25 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7620,7 +6868,18 @@ - 0 + 3 + 2 + [@#include <(:link + 1 + + 0 + + -27 + + + 2 + :)> namespace boost { (:include api pre_indent="4":) }@] @@ -7631,7 +6890,9 @@ - 0 + 1 + 2 + [@#include <boost/tuple/tuple.hpp> namespace boost { (:include api pre_indent="4":) }@] @@ -7642,27 +6903,9 @@ - 5 + 1 2 - `#include <(:link - 1 - - 0 - - -19 - - - 2 - :)> [@namespace boost { (:include - 1 - - 0 - - -14 - - - 2 - decl pre_indent="4":) }@] + [@namespace boost { (:include api pre_indent="4":) }@] @@ -7686,16 +6929,16 @@ 3 2 - [@#include <(:link + `#include <(:link 1 0 - -9 + -26 2 - :)> #include <boost/current_function.hpp> #include <boost/shared_ptr.hpp> namespace boost { (:include decl pre_indent="4":) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7728,9 +6971,7 @@ - 1 - 2 - [@#include <boost/tuple/tuple.hpp> namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -7741,7 +6982,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -25 + + + 2 + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7752,18 +7004,7 @@ - 3 - 2 - [@#include < - 1 - - 0 - - -9 - - - 2 - > namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -7785,18 +7026,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -8 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -7807,7 +7037,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -26 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7818,7 +7059,18 @@ - 0 + 3 + 2 + [@#include <(:link + 1 + + 0 + + -27 + + + 2 + :)> #include <boost/current_function.hpp> #include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] @@ -7831,16 +7083,16 @@ 3 2 - `#include <(:link + [@#include <(:link 1 0 - -9 + -27 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + :)> namespace boost { (:include api pre_indent="4":) }@] @@ -7851,18 +7103,9 @@ - 3 + 1 2 - `#include <(:link - 1 - - 0 - - -16 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + [@namespace boost { (:include api pre_indent="4":) }@] @@ -7880,11 +7123,11 @@ 0 - -16 + -26 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7902,7 +7145,7 @@ 0 - -40 + -26 2 @@ -7924,7 +7167,7 @@ 0 - -21 + -6 2 @@ -7946,7 +7189,7 @@ 0 - -39 + -26 2 @@ -7968,7 +7211,7 @@ 0 - -21 + -7 2 @@ -7983,18 +7226,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -21 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -8012,7 +7244,7 @@ 0 - -21 + -12 2 @@ -8027,18 +7259,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -21 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -8049,18 +7270,7 @@ - 3 - 2 - `#include < - 1 - - 0 - - -38 - - - 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -8071,54 +7281,18 @@ - 11 + 3 2 - [@#include <(:link + `#include <(:link 1 0 - -16 + -27 2 - :)> #include <(:link - 1 - - 0 - - -19 - - - 2 - :)> #include < - 1 - - 0 - - -38 - - - 2 - > #include <(:link - 1 - - 0 - - -21 - - - 2 - :)> #include <(:link - 1 - - 0 - - -8 - - - 2 - :)>@] + :)> [@namespace boost { (:include def pre_indent="4":) }@] @@ -8129,9 +7303,18 @@ - 1 + 3 2 - [@#include <exception> namespace boost { (:include decl pre_indent="4":) }@] + `#include <(:link + 1 + + 0 + + -25 + + + 2 + :)> [@namespace boost { (:include def pre_indent="4":) }@] @@ -8144,16 +7327,16 @@ 3 2 - [@#include <(:link + `#include <(:link 1 0 - -9 + -41 2 - :)> namespace boost { (:include decl pre_indent="4":) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -8164,18 +7347,9 @@ - 3 + 1 2 - [@#include < - 1 - - 0 - - -9 - - - 2 - > namespace boost { (:include decl pre_indent="4":) }@] + [@(:include api:)@] @@ -8186,7 +7360,9 @@ - 0 + 1 + 2 + [@#include <exception> namespace boost { (:include api pre_indent="4":) }@] @@ -8221,7 +7397,7 @@ - 52 + 50 reno_context_map @@ -8365,7 +7541,7 @@ - -25 + -36 @@ -8382,7 +7558,7 @@ - -24 + -35 @@ -8399,7 +7575,7 @@ - -20 + -21 @@ -8416,7 +7592,7 @@ - -41 + -33 @@ -8440,83 +7616,7 @@ - -8 - - - - - - - 1 - CB567E3390BC92DA06F9899E700792C3790D3707C024CA21D15C930D908AD10A - 3422645546 - 5023 - 323 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - -21 - - - - - - - 1 - 091CEE4B0BEBD40D864A1BC8288C10A248BEFFD4E472647343F2BEDE0BDE0F10 - 2732630308 - 2455 - 323 - - - - - - 0 - ../../../../boost/exception/enable_error_info.hpp - 0 - 0 - - - - -40 - - - - - - - 2 - D36D37BED1D119D9CB6040BE4A9694586CC5EFF7A50C30AB59BB06BF70458015 - 993620616 - 2321 - 457 - 248C5047CA4021C30DE8853D6AEBD138D11A76B3571C856A48C0A442D6D040A5 - 1700162144 - 2289 - 26 - - - - - - 0 - ../../../../boost/exception/enable_error_info.hpp - 0 - 0 - - - - -29 + -6 @@ -8540,7 +7640,7 @@ - -18 + -15 @@ -8564,7 +7664,7 @@ - -38 + -41 @@ -8588,7 +7688,31 @@ - -11 + -22 + + + + + + + 1 + 0C00BEB179039380247D771B12C728884E9A3E5B483AC63CD5789852C7A5CC35 + 2506662970 + 2467 + 323 + + + + + + 0 + ../../../../boost/exception/enable_error_info.hpp + 0 + 0 + + + + -12 @@ -8615,174 +7739,6 @@ -17 - - - - - 2 - 07430F64896197A110C276D8A14CA8A75FBA482DDF50CD40D689A1898C84D054 - 1712604289 - 1296 - 396 - BCCB91D0DCA6EC45F29CB70CB64AEA6AB54F32F8F1D1937C4CB80B059346DC81 - 695614553 - 1264 - 26 - - - - - - 0 - ../../../../boost/exception/info_tuple.hpp - 0 - 0 - - - - -14 - - - - - - - 2 - 973F8368D72D56424349CBB81C8F3015CB9F4F0CD7B23A8C62C3DBADDA37CD57 - 3833800883 - 4832 - 514 - 921FBF6991E17349BFF2AD6F165372F85AA9457DDB28E502ABB6B392BBA6B529 - 3119269037 - 284 - 4423 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - -33 - - - - - - - 2 - 973F8368D72D56424349CBB81C8F3015CB9F4F0CD7B23A8C62C3DBADDA37CD57 - 3833800883 - 4832 - 514 - 9567A192BF523DDF741004FFF5BDB044D715FEB7CE9AEC89ACC25C1C33E48C4E - 2232115228 - 381 - 26 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - -35 - - - - - - - 2 - 973F8368D72D56424349CBB81C8F3015CB9F4F0CD7B23A8C62C3DBADDA37CD57 - 3833800883 - 4832 - 514 - 9DEEF8ED70BF74F501A96BA5DE5BFD42FAD16DE333ABE189E512C332586FC465 - 2250569940 - 1893 - 2528 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - -32 - - - - - - - 2 - 973F8368D72D56424349CBB81C8F3015CB9F4F0CD7B23A8C62C3DBADDA37CD57 - 3833800883 - 4832 - 514 - 156B870761DB092CE4269C1173B479A344A1041BA2B883765AF19A72B371D776 - 3239976720 - 117 - 4709 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - -34 - - - - - - - 2 - 973F8368D72D56424349CBB81C8F3015CB9F4F0CD7B23A8C62C3DBADDA37CD57 - 3833800883 - 4832 - 514 - ED09F845070FF7D381BE5EFB6B55313FD09FBA16B64B69992410380EFA45519C - 2051939590 - 78 - 409 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - -30 - - @@ -8804,31 +7760,7 @@ - -6 - - - - - - - 1 - F19D72C24D904689FEEE070D77ABD19090396E7C7663A5BA80E474F1EDA62861 - 4081508978 - 6759 - 323 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - -16 + -8 @@ -8852,7 +7784,7 @@ - -39 + -7 @@ -8876,7 +7808,7 @@ - -37 + -40 @@ -8884,27 +7816,27 @@ 2 - C1FAB39F3B09548EC7B197853DC956883AE1C3A29A8A9D2FBDB97D8BEC76CD75 - 173037458 - 6345 - 737 - F839AFD37DC086BB1231B8E87D8EEBD28129649A06FC685AC7DF65595871AE30 - 2291609923 - 1204 - 243 + FA5027D9799B8059059C23397F469D6EF6328DC23E92E0BE0FF5BE019A576174 + 1806359597 + 3234 + 506 + DF9EA87B0140AACF4422F1B76F6A6A409C15F32858BBBA85A35981A824C56BA9 + 1137981799 + 192 + 3036 0 - ../../../../boost/exception/info.hpp + ../../../../boost/exception/enable_current_exception.hpp 0 0 - -27 + -32 @@ -8912,55 +7844,51 @@ 2 - C1FAB39F3B09548EC7B197853DC956883AE1C3A29A8A9D2FBDB97D8BEC76CD75 - 173037458 - 6345 - 737 - 65D13C1BB0A16823F69A32BAB56A51CA317075C7FC8B7441EE0D9B57AF5AB2AC - 2592266329 - 712 - 1700 + 7ACC4E316D4EDB3EC7AEC35FED3ADB47DDF75D575028D7BCD11C5233E4F4A277 + 4268848542 + 2333 + 457 + 61DE70107961C0B9A65674017F91FF85190CF84B4F3B0CA7AC04A7E16DE80B37 + 3187961206 + 2301 + 26 0 - ../../../../boost/exception/info.hpp + ../../../../boost/exception/enable_error_info.hpp 0 0 - -7 + -34 - 2 - C1FAB39F3B09548EC7B197853DC956883AE1C3A29A8A9D2FBDB97D8BEC76CD75 - 173037458 - 6345 - 737 - 27AC1164E0A824D548386BEDCDC81DCAC283F3D286B0ECEE05B039BB8C392BFC - 1247954090 - 249 - 1449 + 1 + E312FADF4C02B7A6CB1BE1EC16F05A21C20CBA3282D4EAFC8EBE0BA151F24779 + 2820045995 + 5108 + 323 0 - ../../../../boost/exception/info.hpp + ../../../../boost/exception_ptr.hpp 0 0 - -28 + -26 @@ -8988,7 +7916,7 @@ - -36 + -39 @@ -9016,7 +7944,7 @@ - -23 + -30 @@ -9040,7 +7968,7 @@ - -9 + -27 @@ -9064,35 +7992,31 @@ - -5 + -14 - 2 - 392208A2FD122D1ED27D128A7BF65F9340218FAAD756EA58D26D2205D32681A6 - 729208193 - 3206 - 506 - 8F3B5E1A267CA225679713F4DDF528041F573BC02D1DBCD8FFEF57EF0AA599B9 - 4197332561 - 180 - 3020 + 1 + 749C8E4B47A3FD6A90DD8418BF64C4556537CE6E17ACEB2317D9F81DBEBBB0B0 + 1688004766 + 6783 + 323 0 - ../../../../boost/exception/enable_current_exception.hpp + ../../../../boost/exception/info.hpp 0 0 - -31 + -25 @@ -9116,7 +8040,7 @@ - -19 + -13 @@ -9140,7 +8064,7 @@ - -22 + -18 @@ -9164,7 +8088,259 @@ - -10 + -19 + + + + + + + 2 + 35F026FF4EC46450D19A8F970D6E39B881DA6B0FC2E95774CCADC5E34C9D57F1 + 1990614462 + 6369 + 737 + F839AFD37DC086BB1231B8E87D8EEBD28129649A06FC685AC7DF65595871AE30 + 2291609923 + 1204 + 243 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + -38 + + + + + + + 2 + 35F026FF4EC46450D19A8F970D6E39B881DA6B0FC2E95774CCADC5E34C9D57F1 + 1990614462 + 6369 + 737 + 61B57D0AE5F1033900B7DE4401AC1633F4639471A19194D5660F6C43465FCE3D + 1668078447 + 724 + 1712 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + -9 + + + + + + + 2 + 35F026FF4EC46450D19A8F970D6E39B881DA6B0FC2E95774CCADC5E34C9D57F1 + 1990614462 + 6369 + 737 + C5A5927411FB16BB27418CF87226A27D6EC66958BD46DC87F97E571CB492E49D + 2066106304 + 261 + 1449 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + -20 + + + + + + + 2 + D1AA2FC554CD67A50917905B0E9CCA2EBC1A9BA97368757B36ADF8419756ECF1 + 85276724 + 4917 + 514 + F87D7E0321BDDAE23D5A6667CB12116411468AEC54E3B35FB9C8CA94BFECA41E + 1149388739 + 296 + 4496 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -16 + + + + + + + 2 + D1AA2FC554CD67A50917905B0E9CCA2EBC1A9BA97368757B36ADF8419756ECF1 + 85276724 + 4917 + 514 + A098B6FA5BC8E72E0E69C0323195FCC142AE807564C6892FCBD88588F2FBE049 + 2579522516 + 405 + 26 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -31 + + + + + + + 2 + D1AA2FC554CD67A50917905B0E9CCA2EBC1A9BA97368757B36ADF8419756ECF1 + 85276724 + 4917 + 514 + 9DEEF8ED70BF74F501A96BA5DE5BFD42FAD16DE333ABE189E512C332586FC465 + 2250569940 + 1893 + 2601 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -24 + + + + + + + 2 + D1AA2FC554CD67A50917905B0E9CCA2EBC1A9BA97368757B36ADF8419756ECF1 + 85276724 + 4917 + 514 + 156B870761DB092CE4269C1173B479A344A1041BA2B883765AF19A72B371D776 + 3239976720 + 117 + 4794 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -29 + + + + + + + 2 + D1AA2FC554CD67A50917905B0E9CCA2EBC1A9BA97368757B36ADF8419756ECF1 + 85276724 + 4917 + 514 + ED09F845070FF7D381BE5EFB6B55313FD09FBA16B64B69992410380EFA45519C + 2051939590 + 78 + 433 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -28 + + + + + + + 2 + F7633FDCF6615C0199645701EE6E7ACE5CBCD7A7CF6838573791E91ABB3C09F2 + 1668435395 + 1332 + 396 + A1F443AF571973A12005D2F7D4AE09A32AAF686FEEAE272EC21512A65EB943E8 + 3879093659 + 1300 + 26 + + + + + + 0 + ../../../../boost/exception/info_tuple.hpp + 0 + 0 + + + + -5 @@ -9188,7 +8364,7 @@ - -13 + -11 @@ -9212,7 +8388,7 @@ - -12 + -23 @@ -9240,7 +8416,7 @@ - -26 + -37 @@ -9276,7 +8452,7 @@ - -15 + -10 @@ -9350,7 +8526,7 @@ - 53 + 51 tag_index @@ -9371,7 +8547,7 @@ -5 - boost/exception/error_info.hpp,error_info,header + error_info,free,function,operator<<,operator<</tuple @@ -9380,7 +8556,7 @@ -6 - BOOST_ERROR_INFO,error_info,macro + boost/throw_exception.hpp,header,throw_exception @@ -9389,7 +8565,7 @@ -7 - error_info,free,function,get_error_info + boost/exception/enable_current_exception.hpp,enable_current_exception,exception_ptr,header @@ -9398,7 +8574,7 @@ -8 - boost/throw_exception.hpp,header,throw_exception + BOOST_ERROR_INFO,error_info,macro @@ -9407,7 +8583,7 @@ -9 - boost/exception/exception.hpp,exception,header + error_info,free,function,get_error_info @@ -9416,7 +8592,7 @@ -10 - tutorial + exception,exception::~exception,function,member @@ -9425,7 +8601,7 @@ -11 - tutorial + noalso,noindex,tutorial @@ -9434,7 +8610,7 @@ -12 - noalso,noindex,tutorial + boost/exception/enable_error_info.hpp,enable_error_info,error_info,header @@ -9443,7 +8619,7 @@ -13 - noalso,noindex,tutorial + boost/exception/info_tuple.hpp,error_info,header,info_tuple @@ -9452,7 +8628,7 @@ -14 - error_info,free,function,operator<<,operator<</tuple + boost/exception/error_info.hpp,error_info,header @@ -9461,7 +8637,7 @@ -15 - exception,exception::~exception,function,member + noalso,noindex,tutorial @@ -9470,7 +8646,7 @@ -16 - boost/exception/info.hpp,error_info,header,info + copy_exception,exception_ptr,free,function @@ -9497,7 +8673,7 @@ -19 - boost/exception/info_tuple.hpp,error_info,header,info_tuple + tutorial @@ -9506,7 +8682,7 @@ -20 - tutorial + error_info,free,function,operator<<,operator<</exception @@ -9515,7 +8691,7 @@ -21 - boost/exception_ptr.hpp,exception_ptr,header + tutorial @@ -9524,7 +8700,7 @@ -22 - noalso,noindex,tutorial + tutorial @@ -9533,7 +8709,7 @@ -23 - free,function,throw_exception + noalso,noindex,tutorial @@ -9542,7 +8718,7 @@ -24 - tutorial + current_exception,exception_ptr,free,function @@ -9551,7 +8727,7 @@ -25 - noindex + boost/exception/info.hpp,error_info,header,info @@ -9560,7 +8736,7 @@ -26 - exception,type + boost/exception_ptr.hpp,exception_ptr,header @@ -9569,7 +8745,7 @@ -27 - error_info,free,type + boost/exception/exception.hpp,exception,header @@ -9578,7 +8754,7 @@ -28 - error_info,free,function,operator<<,operator<</exception + exception_ptr,type @@ -9587,7 +8763,7 @@ -29 - enable_error_info,error_info,free,function + exception_ptr,free,function,rethrow_exception @@ -9596,7 +8772,7 @@ -30 - exception_ptr,type + free,function,throw_exception @@ -9605,7 +8781,7 @@ -31 - enable_current_exception,exception_ptr,free,function + exception_ptr,type,unknown_exception @@ -9614,7 +8790,7 @@ -32 - current_exception,exception_ptr,free,function + enable_current_exception,exception_ptr,free,function @@ -9623,7 +8799,7 @@ -33 - copy_exception,exception_ptr,free,function + index,noindex @@ -9632,7 +8808,7 @@ -34 - exception_ptr,free,function,rethrow_exception + enable_error_info,error_info,free,function @@ -9641,7 +8817,7 @@ -35 - exception_ptr,type,unknown_exception + tutorial @@ -9650,7 +8826,7 @@ -36 - diagnostic_information,free,function + noindex @@ -9659,7 +8835,7 @@ -37 - boost/exception.hpp,header + exception,type @@ -9668,7 +8844,7 @@ -38 - boost/exception/diagnostic_information.hpp,diagnostic_information,header + error_info,free,type @@ -9677,7 +8853,7 @@ -39 - boost/exception/enable_current_exception.hpp,enable_current_exception,exception_ptr,header + diagnostic_information,free,function @@ -9686,7 +8862,7 @@ -40 - boost/exception/enable_error_info.hpp,enable_error_info,error_info,header + boost/exception.hpp,header @@ -9695,7 +8871,7 @@ -41 - index,noindex + boost/exception/diagnostic_information.hpp,diagnostic_information,header diff --git a/doc/throw_exception.html b/doc/throw_exception.html index 853c8aa..63861ab 100644 --- a/doc/throw_exception.html +++ b/doc/throw_exception.html @@ -19,7 +19,8 @@ -

throw_exception

+

throw_exception

+

#include <boost/throw_exception.hpp>

namespace
 boost
@@ -39,14 +40,16 @@ boost
 

E must derive publicly from std::exception.

Effects:

  • If BOOST_NO_EXCEPTIONS is not defined, boost::throw_exception(e) is equivalent to throw boost::enable_current_exception(boost::enable_error_info(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::throw_exception(e) is equivalent to throw e;
  • -
  • If BOOST_NO_EXCEPTIONS is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of throw_exception are allowed to assume that the function never returns; therefore, if the user-defined throw_exception returns, the behavior is undefined.
  • +
  • If BOOST_NO_EXCEPTIONS is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of throw_exception are allowed to assume that the function never returns; therefore, if the user-defined throw_exception returns, the behavior is undefined.
-

See also:

+
diff --git a/doc/throw_exception_hpp.html b/doc/throw_exception_hpp.html index 0e0417a..23f286a 100644 --- a/doc/throw_exception_hpp.html +++ b/doc/throw_exception_hpp.html @@ -19,7 +19,8 @@ -

boost/throw_exception.hpp

+

boost/throw_exception.hpp

+

Synopsis

#include <boost/exception/enable_current_exception.hpp>
 #include <boost/exception/enable_error_info.hpp>
@@ -39,11 +40,13 @@ boost
     
     #endif
     }
-

See also:

+
diff --git a/doc/tutorial_diagnostic_information.html b/doc/tutorial_diagnostic_information.html index 6d3d45c..4907207 100644 --- a/doc/tutorial_diagnostic_information.html +++ b/doc/tutorial_diagnostic_information.html @@ -3,7 +3,7 @@ - Tutorial: Diagnostic Information + tutorial: diagnostic information @@ -19,7 +19,8 @@ -

Diagnostic Information

+

Tutorial: Diagnostic Information

+

Class boost::exception provides a virtual member function diagnostic_information, with a signature similar to the familiar std::exception::what function. The default implementation returns a string value that is not presentable as a friendly user message, but because it is generated automatically, it is useful for debugging or logging purposes. Here is an example:

#include <boost/exception.hpp>
 #include <iostream>
@@ -40,13 +41,15 @@ g()
         }
     }

The diagnostic_information member function iterates over all data objects stored in the boost::exception through operator<<. The returned string is constructed by converting each data object to string and then concatenating these strings together.

-

When the error_info<Tag,T> template is instantiated, the system attempts overload resolution for an unqualified call to to_string(x), where x is of type T. If this is successful, the to_string overload is used to convert objects of type T to string.

+

When the error_info<Tag,T> template is instantiated, the system attempts overload resolution for an unqualified call to to_string(x), where x is of type T. If this is successful, the to_string overload is expected to return std::string and is used to convert objects of type T to string.

Otherwise, the system attempts overload resolution for s << x, where s is a std::ostringstream and x is of type T. If this is successful, the operator<< overload is used to convert objects of type T to string.

Otherwise the system is unable to convert objects of type T to string, and an unspecified stub string value is used without issuing a compile error.

-

See also:

+
diff --git a/doc/tutorial_enable_error_info.html b/doc/tutorial_enable_error_info.html index c966995..8eaab4d 100644 --- a/doc/tutorial_enable_error_info.html +++ b/doc/tutorial_enable_error_info.html @@ -3,7 +3,7 @@ - Tutorial: Integrating Boost Exception in Existing Exception Class Hierarchies + tutorial: integrating boost exception in existing exception class hierarchies @@ -19,8 +19,9 @@ -

Integrating Boost Exception in Existing Exception Class Hierarchies

-

Some exception hierarchies can not be modified to make boost::exception a base type. For this case, the enable_error_info function template can be used to make exception objects derive from boost::exception anyway. Here is an example:

+

Tutorial: Integrating Boost Exception in Existing Exception Class Hierarchies

+
+

Some exception hierarchies can not be modified to make boost::exception a base type. In this case, the enable_error_info function template can be used to make exception objects derive from boost::exception anyway. Here is an example:

#include <boost/exception.hpp>
 #include <stdexcept>
 
@@ -49,9 +50,11 @@ my_container
     };
 

The call to enable_error_info<T> gets us an object of unspecified type which is guaranteed to derive from both boost::exception and T. This makes it possible to use operator<< to store additional information in the exception object. The exception can be intercepted as T &, so existing exception handling will not break. It can also be intercepted as boost::exception &, so that more information can be added to the exception at a later time.

-

See also:

+

+

See Also:

+
diff --git a/doc/tutorial_exception_ptr.html b/doc/tutorial_exception_ptr.html index 26a7bec..892b951 100644 --- a/doc/tutorial_exception_ptr.html +++ b/doc/tutorial_exception_ptr.html @@ -3,7 +3,7 @@ - Tutorial: Transporting of Exceptions between Threads + tutorial: transporting of exceptions between threads @@ -19,11 +19,13 @@ -

Transporting of Exceptions between Threads

+

Tutorial: Transporting of Exceptions Between Threads

+

Boost Exception supports transporting of exception objects between threads through cloning. This system is similar to N2179, but because Boost Exception can not rely on language support, the use of enable_current_exception at the time of the throw is required in order to use cloning.

Note:

All exceptions emitted by the familiar function boost::throw_exception are guaranteed to derive from boost::exception and to support cloning.

-

Using enable_current_exception at the Time of the Throw

+

Tutorial: Using enable_current_exception at the Time of the Throw

+

Here is how cloning can be enabled in a throw-expression (15.1):

#include <boost/exception/enable_current_exception.hpp>
 #include <boost/exception/info.hpp>
@@ -42,7 +44,8 @@ file_read( FILE * f, void * buffer, size_t size )
             errno_info(errno);
     }

Of course, enable_current_exception may be used with any exception type; there is no requirement that it should derive from boost::exception.

-

Cloning and Re-throwing an Exception

+

Tutorial: Cloning and Re-Throwing an Exception

+

When you catch an exception, you can call current_exception to get an exception_ptr object:

#include <boost/exception_ptr.hpp>
 #include <boost/thread.hpp>
@@ -76,13 +79,16 @@ work()
     if( error )
         boost::rethrow_exception(error);
     }
-

Note that current_exception could fail to copy the original exception object in the following cases:* if there is not enough memory, in which case the returned exception_ptr points to an instance of std::bad_alloc, or

-
  • if enable_current_exception was not used in the throw-expression passed to the original throw statement and the current implementation does not have the necessary compiler-specific support to copy the exception automatically, in which case the returned exception_ptr points to an instance of unknown_exception.
  • +

    Note that current_exception could fail to copy the original exception object in the following cases:

    +
    • if there is not enough memory, in which case the returned exception_ptr points to an instance of std::bad_alloc, or
    • +
    • if enable_current_exception was not used in the throw-expression passed to the original throw statement and the current implementation does not have the necessary compiler-specific support to copy the exception automatically, in which case the returned exception_ptr points to an instance of unknown_exception.

    Regardless, the use of current_exception and rethrow_exception in the above examples is well-formed.

    -

See also:

+

+

See Also:

+
diff --git a/doc/tutorial_transporting_data.html b/doc/tutorial_transporting_data.html index e1bb3c3..a8e5689 100644 --- a/doc/tutorial_transporting_data.html +++ b/doc/tutorial_transporting_data.html @@ -3,7 +3,7 @@ - Tutorial: Transporting of Arbitrary Data to the Catch Site + tutorial: transporting of arbitrary data to the catch site @@ -19,9 +19,11 @@ -

Transporting of Arbitrary Data to the Catch Site

+

Tutorial: Transporting of Arbitrary Data to the Catch Site

+

All exception types that derive from boost::exception can be used as type-safe containers of arbitrary data objects, while complying with the no-throw requirements (15.5.1) of the ANSI C++ standard for exception types. Data can be added to a boost::exception at the time of the throw, or at a later time.

-

Adding of Arbitrary Data at the Point of the Throw

+

Tutorial: Adding of Arbitrary Data at the Point of the Throw

+

The following example demonstrates how errno can be stored in exception objects using Boost Exception:

#include <boost/exception.hpp>
 #include <errno.h>
@@ -57,8 +59,9 @@ g()
             std::cerr << "Error code: " << *err;
         }
     }
-

The get_error_info function template is instantiated with the typedef from (1), and is passed an exception object of any type that derives publicly from boost::exception. If the exception object contains the requested value, the returned shared_ptr will point to it; otherwise an empty shared_ptr is returned.

-

Adding of Arbitrary Data to Active Exception Objects

+

The get_error_info function template is instantiated with the typedef from (1), and is passed an exception object of a polymorphic type. If the exception object contains the requested value, the returned shared_ptr will point to it; otherwise an empty shared_ptr is returned.

+

Tutorial: Adding of Arbitrary Data to Active Exception Objects

+

Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Here is an example:

#include <stdio.h>
 #include <string>
@@ -138,7 +141,8 @@ parse_file( char const * file_name )
     }

The above function is (almost) exception-neutral -- if an exception is emitted by any function call within the try block, parse_file does not need to do any real work, but it intercepts any boost::exception object, stores the file name, and re-throws using a throw-expression with no operand (15.1.6). The rationale for catching any boost::exception object is that the file name is relevant to any failure that occurs in parse_file, even if the failure is unrelated to file I/O.

As usual, the stored data can be retrieved using get_error_info.

-

Adding Grouped Data to Exceptions

+

Tutorial: Adding Grouped Data to Exceptions

+

The code snippet below demonstrates how boost::tuple can be used to bundle the name of the function that failed, together with the reported errno so that they can be added to exception objects more conveniently together:

#include <boost/exception/info_tuple.hpp>
 #include <boost/shared_ptr.hpp>
@@ -164,10 +168,12 @@ file_open( char const * name, char const * mode )
             clib_failure("fopen",errno);
     }

Note that the members of a boost::tuple are stored separately in exception objects; they can only be retrieved individually, using get_error_info.

-

See also:

+
diff --git a/doc/unknown_exception.html b/doc/unknown_exception.html index 74f3ffb..593ebfc 100644 --- a/doc/unknown_exception.html +++ b/doc/unknown_exception.html @@ -19,7 +19,8 @@ -

unknown_exception

+

unknown_exception

+

#include <boost/exception_ptr.hpp>

namespace
 boost
@@ -33,12 +34,14 @@ boost
         };
     }

This type is used by the exception_ptr support in Boost Exception. Please see current_exception.

-

See also:

+
diff --git a/example/Jamfile b/example/Jamfile index a5f4e8c..54037a1 100644 --- a/example/Jamfile +++ b/example/Jamfile @@ -9,7 +9,7 @@ exe example_io : example_io.cpp ; obj error_info_1 : error_info_1.cpp ; obj error_info_2 : error_info_2.cpp ; obj cloning_1 : cloning_1.cpp ; -obj cloning_2 : cloning_2.cpp ; +obj cloning_2 : cloning_2.cpp : multi ; obj info_tuple : info_tuple.cpp ; obj enable_error_info : enable_error_info.cpp ; obj logging : logging.cpp ; diff --git a/include/boost/exception/detail/object_hex_dump.hpp b/include/boost/exception/detail/object_hex_dump.hpp index 24128f4..be728d2 100644 --- a/include/boost/exception/detail/object_hex_dump.hpp +++ b/include/boost/exception/detail/object_hex_dump.hpp @@ -19,7 +19,7 @@ boost exception_detail { template - inline + inline std::string object_hex_dump( T const & x, size_t max_size=16 ) { diff --git a/include/boost/exception/enable_current_exception.hpp b/include/boost/exception/enable_current_exception.hpp index 0094269..751fe73 100644 --- a/include/boost/exception/enable_current_exception.hpp +++ b/include/boost/exception/enable_current_exception.hpp @@ -121,7 +121,7 @@ boost }; template - inline + inline clone_base * make_clone( T const & x ) { @@ -145,7 +145,7 @@ boost } template - inline + inline exception_detail::clone_impl enable_current_exception( T const & x ) { diff --git a/include/boost/exception/enable_error_info.hpp b/include/boost/exception/enable_error_info.hpp index fbcfba3..fe1e5ad 100644 --- a/include/boost/exception/enable_error_info.hpp +++ b/include/boost/exception/enable_error_info.hpp @@ -88,7 +88,7 @@ boost } template - inline + inline #if !BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x582)) typename #endif diff --git a/include/boost/exception/info.hpp b/include/boost/exception/info.hpp index f43f2ee..819a595 100644 --- a/include/boost/exception/info.hpp +++ b/include/boost/exception/info.hpp @@ -86,7 +86,7 @@ virtual //Disable bogus GCC warning. }; template - inline + inline E const & operator<<( E const & x, error_info const & v ) { @@ -96,7 +96,7 @@ virtual //Disable bogus GCC warning. } template - inline + inline shared_ptr get_error_info( E const & some_exception ) { diff --git a/include/boost/exception/info_tuple.hpp b/include/boost/exception/info_tuple.hpp index eef40c3..3c8197a 100644 --- a/include/boost/exception/info_tuple.hpp +++ b/include/boost/exception/info_tuple.hpp @@ -16,7 +16,7 @@ boost class E, class Tag1,class T1, class Tag2,class T2 > - inline + inline E const & operator<<( E const & x, @@ -32,7 +32,7 @@ boost class Tag1,class T1, class Tag2,class T2, class Tag3,class T3 > - inline + inline E const & operator<<( E const & x, @@ -50,7 +50,7 @@ boost class Tag2,class T2, class Tag3,class T3, class Tag4,class T4 > - inline + inline E const & operator<<( E const & x, diff --git a/include/boost/exception/to_string.hpp b/include/boost/exception/to_string.hpp index 11afd1b..e10cbfd 100644 --- a/include/boost/exception/to_string.hpp +++ b/include/boost/exception/to_string.hpp @@ -39,7 +39,7 @@ boost } template - inline + inline typename enable_if,std::string>::type to_string( T const & x ) { @@ -56,7 +56,7 @@ boost }; template - inline + inline std::string to_string( std::pair const & x ) { diff --git a/include/boost/exception/to_string_stub.hpp b/include/boost/exception/to_string_stub.hpp index c8e686e..1cd08bb 100644 --- a/include/boost/exception/to_string_stub.hpp +++ b/include/boost/exception/to_string_stub.hpp @@ -63,7 +63,7 @@ boost to_string_dispatch { template - inline + inline std::string dispatch( T const & x, Stub s ) { @@ -72,7 +72,7 @@ boost } template - inline + inline std::string string_stub_dump( T const & x ) { @@ -81,7 +81,7 @@ boost } template - inline + inline std::string to_string_stub( T const & x ) { @@ -89,7 +89,7 @@ boost } template - inline + inline std::string to_string_stub( T const & x, Stub s ) { diff --git a/include/boost/exception_ptr.hpp b/include/boost/exception_ptr.hpp index db6a774..f7f73bd 100644 --- a/include/boost/exception_ptr.hpp +++ b/include/boost/exception_ptr.hpp @@ -32,9 +32,9 @@ boost { } - ~unknown_exception() throw() - { - } + ~unknown_exception() throw() + { + } }; typedef intrusive_ptr exception_ptr; @@ -62,13 +62,13 @@ boost { } - ~current_exception_std_exception_wrapper() throw() - { - } + ~current_exception_std_exception_wrapper() throw() + { + } }; template - inline + inline exception_ptr current_exception_std_exception( T const & e1 ) { @@ -171,7 +171,7 @@ boost } template - inline + inline exception_ptr copy_exception( T const & e ) { diff --git a/test/diagnostic_information_test.cpp b/test/diagnostic_information_test.cpp index 51fefa5..3dc1279 100644 --- a/test/diagnostic_information_test.cpp +++ b/test/diagnostic_information_test.cpp @@ -50,14 +50,14 @@ main() using namespace boost; { error1 x; - BOOST_TEST(x.what()==std::string("error1")); + BOOST_TEST(x.what()==std::string("error1")); std::string di=get_diagnostic_information(x); BOOST_TEST(di.find("type:")!=std::string::npos); BOOST_TEST(di.find("error1")!=std::string::npos); } { error2 x; x << tag_int(42); - BOOST_TEST(x.what()==std::string("error2")); + BOOST_TEST(x.what()==std::string("error2")); std::string di=get_diagnostic_information(x); BOOST_TEST(di.find("type:")!=std::string::npos); BOOST_TEST(di.find("error2")!=std::string::npos);