diff --git a/doc/BOOST_ERROR_INFO.html b/doc/BOOST_ERROR_INFO.html index 7abbb7f..a83038c 100644 --- a/doc/BOOST_ERROR_INFO.html +++ b/doc/BOOST_ERROR_INFO.html @@ -20,22 +20,23 @@

BOOST_ERROR_INFO

-

#include <boost/exception/info.hpp>

+

#include <boost/exception/info.hpp>

namespace
 boost
     {
     typedef error_info<struct tag_throw_function,char const *> throw_function;
     typedef error_info<struct tag_throw_file,char const *> throw_file;
     typedef error_info<struct tag_throw_line,int> throw_line;
-
+    
     #define BOOST_ERROR_INFO\
         ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\
         ::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.

See also:

Boost Exception
+
boost/exception/info.hpp
diff --git a/doc/boost-exception.html b/doc/boost-exception.html index 600bf6c..4ba3d6e 100644 --- a/doc/boost-exception.html +++ b/doc/boost-exception.html @@ -19,46 +19,49 @@ -

Abstract

+

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 cloning of exception objects, implemented non-intrusively and automatically by the boost::throw_exception() function.

+

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.

Note:

Boost Exception was accepted as a Boost library on November 7 2007, however it has not yet been part of an official Boost release. Current version can be downloaded from Boost SVN.

Contents

-
  1. Tutorial
    1. Tutorial: Transporting of Arbitrary Data to the Catch Site
    2. -
    3. Tutorial: Integrating Boost Exception in Existing Exception Class Hierarchies
    4. -
    5. Tutorial: Transporting of Exceptions between Threads
    6. -
    7. Tutorial: Logging of boost::exception Objects
    8. +
      1. Tutorial
      2. -
      3. Documentation
        1. Class exception
        2. -
        3. Transporting of Arbitrary Data to the Catch Site
          1. error_info
          2. -
          3. operator<<()
          4. -
          5. get_error_info()
          6. -
          7. enable_error_info()
          8. -
          9. BOOST_ERROR_INFO
          10. +
          11. Documentation
            1. Class exception
            2. +
            3. Transporting of Arbitrary Data to the Catch Site
            4. -
            5. Transporting of Exceptions between Threads
              1. exception_ptr
              2. -
              3. enable_current_exception()
              4. -
              5. current_exception()
              6. -
              7. copy_exception()
              8. -
              9. rethrow_exception()
              10. -
              11. unknown_exception
              12. +
              13. N2179 Transporting of Exceptions between Threads
              14. -
              15. throw_exception()
              16. -
              17. Headers @@ -66,95 +69,97 @@
              18. Index

              Synopsis

              -

              #include <boost/exception.hpp>

              +

              #include <boost/exception.hpp>

              namespace
               boost
                   {
              -    class
              +    class
                   exception
                       {
                       public:
              -
              -        virtual char const * what() const throw();
              -
              +    
              +        virtual char const * diagnostic_information() const throw();    
              +        virtual char const * what() const throw();    
              +    
                       protected:
              +    
              +        exception();
              +        exception( exception const & x );    
              +        ~exception();    
              +        };
               
              -        exception();
              -        exception( exception const & x );
              -        ~exception();
              -
              -        private:
              -
              -        ---unspecified---
              -        };
              -
              -    template <class Tag,class T>
              +    template <class Tag,class T>
                   class
                   error_info
                       {
                       public:
              -
              +    
                       typedef T value_type;
              -
              +    
                       error_info( value_type const & );
              -
              -        private:
              -
              -        ---unspecified---
              -        };
              -
              -    template <class E, class Tag1, class T1>
              -    E const & operator<<( E const & x, error_info<Tag1,T1> const & v );
              -
              -    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 );
              -
              -    template <class ErrorInfo,class E>
              -    shared_ptr<typename ErrorInfo::value_type const> get_error_info( E const & x );
              -
              -    template <class T>
              -    ---unspecified--- enable_error_info( T const & x );
              -
              -    typedef error_info<struct tag_throw_function,char const *> throw_function;
              +        };    
              +    
              +    template <class ErrorInfo,class E>
              +    shared_ptr<typename ErrorInfo::value_type const> get_error_info( E const & x );    
              +    
              +    typedef error_info<struct tag_throw_function,char const *> throw_function;
                   typedef error_info<struct tag_throw_file,char const *> throw_file;
                   typedef error_info<struct tag_throw_line,int> throw_line;
              -
              +    
                   #define BOOST_ERROR_INFO\
                       ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\
                       ::boost::throw_file(__FILE__) <<\
              -        ::boost::throw_line((int)__LINE__)
              +        ::boost::throw_line((int)__LINE__)    
              +    
              +    template <class E, class Tag, class T>
              +    E const & operator<<( E const & x, error_info<Tag,T> const & v );
               
              -    typedef ---unspecified--- exception_ptr;
              +    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 );
               
              -    template <class T>
              -    ---unspecified--- enable_current_exception( T const & e );
              +    template <class T>
              +    ---unspecified--- enable_error_info( T const & x );
               
              -    exception_ptr current_exception();
              -    template <class T>
              -    exception_ptr copy_exception( T const & e );
              -    void rethrow_exception( exception_ptr const & ep );
              +    std::string diagnostic_information( std::exception const & x );
               
              -    class
              +    class
                   unknown_exception:
                       public std::exception
              -        public boost::exception
              +        public boost::exception
                       {
                       ---unspecified---
              -        };
              +        };    
              +    
              +    typedef ---unspecified--- exception_ptr;    
              +    
              +    template <class T>
              +    exception_ptr copy_exception( T const & e );    
              +    
              +    exception_ptr current_exception();    
              +    
              +    void rethrow_exception( exception_ptr const & ep );
               
              -#ifdef BOOST_NO_EXCEPTIONS
              +    template <class T>
              +    ---unspecified--- enable_current_exception( T const & e );
              +
              +    #ifdef BOOST_NO_EXCEPTIONS
              +    
                   void throw_exception( std::exception const & e ); // user defined
              -#else
              +    
              +    #else
              +    
                   template <class E>
                   void throw_exception( E const & e );
              -#endif
              +    
              +    #endif
                   }
              -

              exception

              -

              #include <boost/exception/exception.hpp>

              +

              Class exception

              +

              exception

              +

              #include <boost/exception/exception.hpp>

              namespace
               boost
                   {
              @@ -162,49 +167,54 @@ boost
                   exception
                       {
                       public:
              -
              -        virtual char const * what() const throw();
              -
              +    
              +        virtual char const * diagnostic_information() const throw();    
              +        virtual char const * what() const throw();    
              +    
                       protected:
              -
              -        exception();
              -        exception( exception const & x );
              -        ~exception();
              -
              -        private:
              -
              -        ---unspecified---
              +    
              +        exception();
              +        exception( exception const & x );    
              +        ~exception();    
                       };
                   }
              -

              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 constructors

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

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

              Effects:

              -
              • Default constructor: initializes an empty boost::exception object.
              • -
              • Copy constructor: initializes a boost::exception object which shares with x all data added through operator<<(), including data that is added at a future time.
              • +
                • Default constructor: initializes an empty boost::exception object.
                • +
                • Copy constructor: initializes a boost::exception object which shares with x all data added through operator<<, including data that is added at a future time.

                Throws:

                Nothing.

                -

              exception destructor

              -

              exception::~exception

              +

              Effects:

              -

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

              +

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

              Throws:

              Nothing.

              -

              exception::what()

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

              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: Logging of boost::exception Objects" for details.

              +

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

              -

              Transporting of Arbitrary Data to the Catch Site

              +

              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.

              +

              Transporting of Arbitrary Data to the Catch Site

              error_info

              -

              #include <boost/exception/info.hpp>

              +

              #include <boost/exception/info.hpp>

              namespace
               boost
                   {
              @@ -213,53 +223,40 @@ boost
                   error_info
                       {
                       public:
              -
              +    
                       typedef T value_type;
              -
              +    
                       error_info( value_type const & );
              -
              -        private:
              -
              -        ---unspecified---
                       };
                   }

              Requirements:

              -

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

              +

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

              Description:

              -

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

              +

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

              Note:

              -

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

              +

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

              #include <boost/exception/error_info.hpp>
               
               typedef boost::error_info<struct tag_errno,int> errno_info;
              -

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

              -

              operator<<()

              -

              #include <boost/exception/info.hpp> 
              #include <boost/exception/info_tuple.hpp>

              +

              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

              +

              #include <boost/exception/info.hpp> 

              namespace
               boost
                   {
              -    template <class E, class Tag1, class T1>
              -    E const & operator<<( E const & x, error_info<Tag1,T1> const & v );
              -
              -    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 );
              +    template <class E, class Tag, class T>
              +    E const & operator<<( E const & x, error_info<Tag,T> const & v );
                   }

              Requirements:

              -

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

              +

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

              Effects:

              -
              • The first overload stores a copy of v into x. If x already contains data of type error_info<Tag1,T1>, that data is overwritten.
              • -
              • The boost::tuple overload is equivalent to x << v.get<0>() << ... << v.get<N>().
              • -
              +

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

              Returns:

              -

              x.

              +

              x.

              Throws:

              -

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

              -

              get_error_info()

              -

              #include <boost/exception/info.hpp>

              +

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

              +

              get_error_info

              +

              #include <boost/exception/info.hpp>

              namespace
               boost
                   {
              @@ -267,13 +264,13 @@ 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.

              +

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

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

              Throws:

              Nothing.

              -

              enable_error_info()

              -

              enable_error_info

              +

              #include <boost/exception/enable_error_info.hpp>

              namespace
               boost
                   {
              @@ -281,41 +278,41 @@ 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.

              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.

              +

              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.

              Throws:

              Nothing.

              BOOST_ERROR_INFO

              -

              #include <boost/exception/info.hpp>

              +

              #include <boost/exception/info.hpp>

              namespace
               boost
                   {
                   typedef error_info<struct tag_throw_function,char const *> throw_function;
                   typedef error_info<struct tag_throw_file,char const *> throw_file;
                   typedef error_info<struct tag_throw_line,int> throw_line;
              -
              +    
                   #define BOOST_ERROR_INFO\
                       ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\
                       ::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

              -

              #include <boost/exception_ptr.hpp>

              +

              #include <boost/exception_ptr.hpp>

              namespace
               boost
                   {
                   typedef ---unspecified--- exception_ptr;
                   }
              -

              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.

              +

              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
                   {
              @@ -323,11 +320,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 &).

              +

              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 cloning 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
              @@ -336,28 +333,30 @@ 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.

              +

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

              -

              current_exception()

              -

              #include <boost/exception_ptr.hpp>

              +

              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

              +

              #include <boost/exception_ptr.hpp>

              namespace
               boost
                   {
                   exception_ptr current_exception();
                   }

              Requirements:

              -

              The current_exception() function must not be called outside of a catch block.

              +

              The current_exception function must not be called outside of a catch block.

              Returns:

              -
              • An exception_ptr 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 exception_ptr that refers to an instance of std::bad_alloc.
              • +
                • An exception_ptr 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 exception_ptr that refers to an instance of std::bad_alloc.
                +

                Throws:

                +

                Nothing.

                Notes:

                -

                copy_exception()

                -

                copy_exception

                +

                #include <boost/exception_ptr.hpp>

                namespace
                 boost
                     {
                @@ -365,50 +364,64 @@ boost
                     exception_ptr copy_exception( T const & e );
                     }

                Effects:

                -

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

                -

                rethrow_exception()

                -

                #include <boost/exception_ptr.hpp>

                +

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

                +

                rethrow_exception

                +

                #include <boost/exception_ptr.hpp>

                namespace
                 boost
                     {
                     void rethrow_exception( exception_ptr const & ep );
                     }

                Precondition:

                -

                ep shall not be null.

                +

                ep shall not be null.

                Throws:

                -

                The exception to which ep refers.

                +

                The exception to which ep refers.

                unknown_exception

                -

                #include <boost/exception_ptr.hpp>

                +

                #include <boost/exception_ptr.hpp>

                namespace
                 boost
                     {
                     class
                     unknown_exception:
                         public std::exception
                -        public boost::exception
                +        public boost::exception
                         {
                         ---unspecified---
                         };
                     }
                -

                This type is used by the cloning support in Boost Exception. Please see current_exception().

                -

                Throwing Exceptions

                -

                throw_exception()

                -

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

                +

                Printing Diagnostic Information

                +

                diagnostic_information

                +

                #include <boost/exception/diagnostic_information.hpp>

                namespace
                 boost
                     {
                -#ifdef BOOST_NO_EXCEPTIONS
                +    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().

                +

                Throwing Exceptions

                +

                throw_exception

                +

                #include <boost/throw_exception.hpp>

                +
                namespace
                +boost
                +    {
                +    #ifdef BOOST_NO_EXCEPTIONS
                +    
                     void throw_exception( std::exception const & e ); // user defined
                -#else
                +    
                +    #else
                +    
                     template <class E>
                     void throw_exception( E const & e );
                -#endif
                +    
                +    #endif
                     }

                Requirements:

                -

                E must derive publicly from std::exception.

                +

                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 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.
                diff --git a/doc/boost_exception_diagnostic_information_hpp.html b/doc/boost_exception_diagnostic_information_hpp.html new file mode 100644 index 0000000..2fe07fd --- /dev/null +++ b/doc/boost_exception_diagnostic_information_hpp.html @@ -0,0 +1,53 @@ + + + + + boost/exception/diagnostic_information.hpp + + + +
                +
                +
                +
                + +

                Boost Exception

                +
                + + + +

                boost/exception/diagnostic_information.hpp

                +

                Synopsis

                +
                #include <exception>
                +
                +namespace
                +boost
                +    {
                +    std::string diagnostic_information( std::exception const & x );
                +    }
                +

                See also:

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

                copy_exception()

                -

                #include <boost/exception_ptr.hpp>

                +

                copy_exception

                +

                #include <boost/exception_ptr.hpp>

                namespace
                 boost
                     {
                @@ -28,9 +28,10 @@ boost
                     exception_ptr copy_exception( T const & e );
                     }

                Effects:

                -

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

                +

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

                See also:

                diff --git a/doc/current_exception.html b/doc/current_exception.html index 765f813..759f47f 100644 --- a/doc/current_exception.html +++ b/doc/current_exception.html @@ -19,25 +19,28 @@ -

                current_exception()

                -

                #include <boost/exception_ptr.hpp>

                +

                current_exception

                +

                #include <boost/exception_ptr.hpp>

                namespace
                 boost
                     {
                     exception_ptr current_exception();
                     }

                Requirements:

                -

                The current_exception() function must not be called outside of a catch block.

                +

                The current_exception function must not be called outside of a catch block.

                Returns:

                -
                • An exception_ptr 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 exception_ptr that refers to an instance of std::bad_alloc.
                • +
                  • An exception_ptr 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 exception_ptr that refers to an instance of std::bad_alloc.
                  +

                  Throws:

                  +

                  Nothing.

                  Notes:

                  -

                  See also:

                  Boost Exception
                  +
                  boost/exception_ptr.hpp
                  copy_exception
                  enable_current_exception
                  exception_ptr
                  diff --git a/doc/diagnostic_information.html b/doc/diagnostic_information.html new file mode 100644 index 0000000..c60ef6f --- /dev/null +++ b/doc/diagnostic_information.html @@ -0,0 +1,52 @@ + + + + + diagnostic_information + + + +
                  +
                  +
                  +
                  + +

                  Boost Exception

                  +
                  + + + +

                  diagnostic_information

                  +

                  #include <boost/exception/diagnostic_information.hpp>

                  +
                  namespace
                  +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:

                  + + + + + +
                  +
                  +
                  + + diff --git a/doc/enable_current_exception.html b/doc/enable_current_exception.html index 3b86896..fbcc5fb 100644 --- a/doc/enable_current_exception.html +++ b/doc/enable_current_exception.html @@ -19,8 +19,8 @@ -

                  enable_current_exception()

                  -

                  #include <boost/exception/enable_current_exception.hpp>

                  +

                  enable_current_exception

                  +

                  #include <boost/exception/enable_current_exception.hpp>

                  namespace
                   boost
                       {
                  @@ -28,11 +28,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 &).

                  +

                  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 cloning 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
                  @@ -41,13 +41,14 @@ 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.

                  +

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

                  +

                  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:

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

                  enable_error_info()

                  -

                  #include <boost/exception/enable_error_info.hpp>

                  +

                  enable_error_info

                  +

                  #include <boost/exception/enable_error_info.hpp>

                  namespace
                   boost
                       {
                  @@ -28,14 +28,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.

                  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.

                  +

                  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.

                  Throws:

                  Nothing.

                  See also:

                  diff --git a/doc/error_info.html b/doc/error_info.html index 4960946..61f6f00 100644 --- a/doc/error_info.html +++ b/doc/error_info.html @@ -20,7 +20,7 @@

                  error_info

                  -

                  #include <boost/exception/info.hpp>

                  +

                  #include <boost/exception/info.hpp>

                  namespace
                   boost
                       {
                  @@ -29,35 +29,33 @@ boost
                       error_info
                           {
                           public:
                  -
                  +    
                           typedef T value_type;
                  -
                  +    
                           error_info( value_type const & );
                  -
                  -        private:
                  -
                  -        ---unspecified---
                           };
                       }

                  Requirements:

                  -

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

                  +

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

                  Description:

                  -

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

                  +

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

                  Note:

                  -

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

                  +

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

                  #include <boost/exception/error_info.hpp>
                   
                   typedef boost::error_info<struct tag_errno,int> errno_info;
                  -

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

                  +

                  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:

                  diff --git a/doc/exception.html b/doc/exception.html index c3ee13d..2b7f81b 100644 --- a/doc/exception.html +++ b/doc/exception.html @@ -19,8 +19,8 @@ -

                  exception

                  -

                  #include <boost/exception/exception.hpp>

                  +

                  exception

                  +

                  #include <boost/exception/exception.hpp>

                  namespace
                   boost
                       {
                  @@ -28,59 +28,67 @@ boost
                       exception
                           {
                           public:
                  -
                  -        virtual char const * what() const throw();
                  -
                  +    
                  +        virtual char const * diagnostic_information() const throw();    
                  +        virtual char const * what() const throw();    
                  +    
                           protected:
                  -
                  -        exception();
                  -        exception( exception const & x );
                  -        ~exception();
                  -
                  -        private:
                  -
                  -        ---unspecified---
                  +    
                  +        exception();
                  +        exception( exception const & x );    
                  +        ~exception();    
                           };
                       }
                  -

                  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 constructors

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

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

                  Effects:

                  -
                  • Default constructor: initializes an empty boost::exception object.
                  • -
                  • Copy constructor: initializes a boost::exception object which shares with x all data added through operator<<(), including data that is added at a future time.
                  • +
                    • Default constructor: initializes an empty boost::exception object.
                    • +
                    • Copy constructor: initializes a boost::exception object which shares with x all data added through operator<<, including data that is added at a future time.

                    Throws:

                    Nothing.

                    -

                  exception destructor

                  -

                  exception::~exception

                  +

                  Effects:

                  -

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

                  +

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

                  Throws:

                  Nothing.

                  -

                  exception::what()

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

                  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: Logging of boost::exception Objects" for details.

                  +

                  An 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:

                  +

                  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/exception_cloning_hpp.html b/doc/exception_cloning_hpp.html index 051928c..a712e73 100644 --- a/doc/exception_cloning_hpp.html +++ b/doc/exception_cloning_hpp.html @@ -19,9 +19,34 @@ -

                  boost/exception_ptr.hpp

                  -

                  This header file contains the following definitions/declarations:

                  -
                  copy_exception
                  +

                  boost/exception_ptr.hpp

                  +

                  Synopsis

                  +
                  #include <boost/exception/exception.hpp>
                  +
                  +namespace
                  +boost
                  +    {
                  +    class
                  +    unknown_exception:
                  +        public std::exception
                  +        public boost::exception
                  +        {
                  +        ---unspecified---
                  +        };    
                  +    
                  +    typedef ---unspecified--- exception_ptr;    
                  +    
                  +    template <class T>
                  +    exception_ptr copy_exception( T const & e );    
                  +    
                  +    exception_ptr current_exception();    
                  +    
                  +    void rethrow_exception( exception_ptr const & ep );
                  +    }
                  +

                  See also:

                  +
                  Boost Exception
                  +
                  boost/exception.hpp
                  +
                  copy_exception
                  current_exception
                  exception_ptr
                  rethrow_exception
                  diff --git a/doc/exception_constructors.html b/doc/exception_constructors.html index 2646e3c..447674d 100644 --- a/doc/exception_constructors.html +++ b/doc/exception_constructors.html @@ -19,12 +19,12 @@ -

                  exception constructors

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

                  exception::exception

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

                  Effects:

                  -
                  • Default constructor: initializes an empty boost::exception object.
                  • -
                  • Copy constructor: initializes a boost::exception object which shares with x all data added through operator<<(), including data that is added at a future time.
                  • +
                    • Default constructor: initializes an empty boost::exception object.
                    • +
                    • Copy constructor: initializes a boost::exception object which shares with x all data added through operator<<, including data that is added at a future time.

                    Throws:

                    Nothing.

                    diff --git a/doc/exception_destructor.html b/doc/exception_destructor.html index aa4a089..785e6f2 100644 --- a/doc/exception_destructor.html +++ b/doc/exception_destructor.html @@ -19,10 +19,10 @@ -

                    exception destructor

                    -
                            ~exception();
                    +

                    exception::~exception

                    +

                    Effects:

                    -

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

                    +

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

                    Throws:

                    Nothing.

                    See also:

                    diff --git a/doc/exception_diagnostic_information.html b/doc/exception_diagnostic_information.html new file mode 100644 index 0000000..f68a336 --- /dev/null +++ b/doc/exception_diagnostic_information.html @@ -0,0 +1,53 @@ + + + + + exception::diagnostic_information + + + +
                    +
                    +
                    +
                    + +

                    Boost Exception

                    +
                    + + + +

                    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.

                    +

                    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/exception_enable_error_info_hpp.html b/doc/exception_enable_error_info_hpp.html index 0e87786..d135d70 100644 --- a/doc/exception_enable_error_info_hpp.html +++ b/doc/exception_enable_error_info_hpp.html @@ -19,9 +19,20 @@ -

                    boost/exception/enable_error_info.hpp

                    -

                    This header file contains the following definitions/declarations:

                    -
                    enable_error_info
                    +

                    boost/exception/enable_error_info.hpp

                    +

                    Synopsis

                    +
                    #include <boost/exception/exception.hpp>
                    +
                    +namespace
                    +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 604cd8e..761c5f1 100644 --- a/doc/exception_enable_exception_cloning_hpp.html +++ b/doc/exception_enable_exception_cloning_hpp.html @@ -19,9 +19,20 @@ -

                    boost/exception/enable_current_exception.hpp

                    -

                    This header file contains the following definitions/declarations:

                    -
                    enable_current_exception
                    +

                    boost/exception/enable_current_exception.hpp

                    +

                    Synopsis

                    +
                    #include <boost/exception/exception.hpp>
                    +
                    +namespace
                    +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 9da07f6..3db6a18 100644 --- a/doc/exception_error_info_group_hpp.html +++ b/doc/exception_error_info_group_hpp.html @@ -19,9 +19,24 @@ -

                    boost/exception/info_tuple.hpp

                    -

                    This header file contains the following definitions/declarations:

                    -
                    operator<</exception
                    +

                    See also:

                    + diff --git a/doc/exception_error_info_hpp.html b/doc/exception_error_info_hpp.html index 2f06695..4a72bc4 100644 --- a/doc/exception_error_info_hpp.html +++ b/doc/exception_error_info_hpp.html @@ -19,9 +19,44 @@ -

                    boost/exception/info.hpp

                    -

                    This header file contains the following definitions/declarations:

                    -
                    BOOST_ERROR_INFO
                    +

                    boost/exception/info.hpp

                    +

                    Synopsis

                    +
                    #include <boost/exception/exception.hpp>
                    +#include <boost/current_function.hpp>
                    +#include <boost/shared_ptr.hpp>
                    +
                    +namespace
                    +boost
                    +    {
                    +    template <class Tag,class T>
                    +    class
                    +    error_info
                    +        {
                    +        public:
                    +    
                    +        typedef T value_type;
                    +    
                    +        error_info( value_type const & );
                    +        };    
                    +    
                    +    template <class ErrorInfo,class E>
                    +    shared_ptr<typename ErrorInfo::value_type const> get_error_info( E const & x );    
                    +    
                    +    typedef error_info<struct tag_throw_function,char const *> throw_function;
                    +    typedef error_info<struct tag_throw_file,char const *> throw_file;
                    +    typedef error_info<struct tag_throw_line,int> throw_line;
                    +    
                    +    #define BOOST_ERROR_INFO\
                    +        ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\
                    +        ::boost::throw_file(__FILE__) <<\
                    +        ::boost::throw_line((int)__LINE__)    
                    +    
                    +    template <class E, class Tag, class T>
                    +    E const & operator<<( E const & x, error_info<Tag,T> const & v );
                    +    }
                    +
                    BOOST_ERROR_INFO
                    +
                    Boost Exception
                    +
                    boost/exception.hpp
                    error_info
                    get_error_info
                    operator<</exception
                    diff --git a/doc/exception_error_info_value_hpp.html b/doc/exception_error_info_value_hpp.html index b1ccabf..7cf82a7 100644 --- a/doc/exception_error_info_value_hpp.html +++ b/doc/exception_error_info_value_hpp.html @@ -19,14 +19,18 @@ -

                    boost/exception/error_info.hpp

                    -

                    This header file contains the following declaration:

                    -
                    namespace
                    +

                    See also:

                    + diff --git a/doc/exception_exception_hpp.html b/doc/exception_exception_hpp.html index 7d61633..c16e1a4 100644 --- a/doc/exception_exception_hpp.html +++ b/doc/exception_exception_hpp.html @@ -19,9 +19,33 @@ -

                    boost/exception/exception.hpp

                    -

                    This header file contains the following definitions/declarations:

                    -
                    exception
                    +

                    boost/exception/exception.hpp

                    +

                    Synopsis

                    +
                    namespace
                    +boost
                    +    {
                    +    class
                    +    exception
                    +        {
                    +        public:
                    +    
                    +        virtual char const * diagnostic_information() const throw();    
                    +        virtual char const * what() const throw();    
                    +    
                    +        protected:
                    +    
                    +        exception();
                    +        exception( exception const & x );    
                    +        ~exception();    
                    +        };
                    +    }
                    +

                    See also:

                    + diff --git a/doc/exception_hpp.html b/doc/exception_hpp.html index 2ca1673..5b32d79 100644 --- a/doc/exception_hpp.html +++ b/doc/exception_hpp.html @@ -19,17 +19,17 @@ -

                    boost/exception.hpp

                    -

                    This header file includes all other header files of Boost Exception:

                    -
                    boost/exception.hpp
                    -
                    boost/exception/enable_current_exception.hpp
                    -
                    boost/exception/enable_error_info.hpp
                    -
                    boost/exception/error_info.hpp
                    -
                    boost/exception/exception.hpp
                    -
                    boost/exception/info.hpp
                    -
                    boost/exception/info_tuple.hpp
                    -
                    boost/exception_ptr.hpp
                    -
                    boost/throw_exception.hpp
                    +

                    See also:

                    + diff --git a/doc/exception_ptr.html b/doc/exception_ptr.html index 8a0c382..50655eb 100644 --- a/doc/exception_ptr.html +++ b/doc/exception_ptr.html @@ -20,23 +20,25 @@

                    exception_ptr

                    -

                    #include <boost/exception_ptr.hpp>

                    +

                    #include <boost/exception_ptr.hpp>

                    namespace
                     boost
                         {
                         typedef ---unspecified--- exception_ptr;
                         }
                    -

                    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.

                    +

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

                    +

                    exception_ptr objects are returned by current_exception and copy_exception.

                    See also:

                    diff --git a/doc/exception_what.html b/doc/exception_what.html index 6c5069d..2cef231 100644 --- a/doc/exception_what.html +++ b/doc/exception_what.html @@ -19,17 +19,16 @@ -

                    exception::what()

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

                    exception::what

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

                    Returns:

                    -

                    An string representation of all data stored in the boost::exception object by the operator<<() function. See "Tutorial: Logging of boost::exception Objects" for details.

                    +

                    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 1b43302..47d598e 100644 --- a/doc/get_error_info.html +++ b/doc/get_error_info.html @@ -19,8 +19,8 @@ -

                    get_error_info()

                    -

                    #include <boost/exception/info.hpp>

                    +

                    get_error_info

                    +

                    #include <boost/exception/info.hpp>

                    namespace
                     boost
                         {
                    @@ -28,13 +28,14 @@ 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.

                    +

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

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

                    Throws:

                    Nothing.

                    See also:

                    diff --git a/doc/name_idx.html b/doc/name_idx.html index c8eeebb..00633eb 100644 --- a/doc/name_idx.html +++ b/doc/name_idx.html @@ -24,6 +24,7 @@

                    BOOST_ERROR_INFO

                    b

                    boost/exception.hpp

                    +

                    boost/exception/diagnostic_information.hpp

                    boost/exception/enable_current_exception.hpp

                    boost/exception/enable_error_info.hpp

                    boost/exception/error_info.hpp

                    @@ -35,11 +36,14 @@

                    c

                    copy_exception

                    current_exception

                    +

                    d

                    +

                    diagnostic_information

                    e

                    enable_current_exception

                    enable_error_info

                    error_info

                    exception

                    +

                    exception::diagnostic_information

                    exception::exception

                    exception::what

                    exception::~exception

                    @@ -48,8 +52,14 @@

                    get_error_info

                    o

                    operator<</exception

                    +

                    operator<</tuple

                    r

                    rethrow_exception

                    +

                    T

                    +

                    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

                    t

                    throw_exception

                    u

                    diff --git a/doc/operator_shl_exception.html b/doc/operator_shl_exception.html index b2c0367..b458fb3 100644 --- a/doc/operator_shl_exception.html +++ b/doc/operator_shl_exception.html @@ -19,39 +19,33 @@ -

                    operator<<()

                    -

                    #include <boost/exception/info.hpp> 
                    #include <boost/exception/info_tuple.hpp>

                    +

                    operator<<, error_info overload

                    +

                    #include <boost/exception/info.hpp> 

                    namespace
                     boost
                         {
                    -    template <class E, class Tag1, class T1>
                    -    E const & operator<<( E const & x, error_info<Tag1,T1> const & v );
                    -
                    -    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 );
                    +    template <class E, class Tag, class T>
                    +    E const & operator<<( E const & x, error_info<Tag,T> const & v );
                         }

                    Requirements:

                    -

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

                    +

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

                    Effects:

                    -
                    • The first overload stores a copy of v into x. If x already contains data of type error_info<Tag1,T1>, that data is overwritten.
                    • -
                    • The boost::tuple overload is equivalent to x << v.get<0>() << ... << v.get<N>().
                    • -
                    +

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

                    Returns:

                    -

                    x.

                    +

                    x.

                    Throws:

                    -

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

                    +

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

                    See also:

                    diff --git a/doc/operator_shl_tuple.html b/doc/operator_shl_tuple.html new file mode 100644 index 0000000..3cbb657 --- /dev/null +++ b/doc/operator_shl_tuple.html @@ -0,0 +1,63 @@ + + + + + operator<</tuple + + + +
                    +
                    +
                    +
                    + +

                    Boost Exception

                    +
                    + + + +

                    operator<<, tuple overload

                    +

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

                    +

                    See also:

                    + + + + + +
                    +
                    +
                    + + diff --git a/doc/rethrow_exception.html b/doc/rethrow_exception.html index cd03e75..ea33e37 100644 --- a/doc/rethrow_exception.html +++ b/doc/rethrow_exception.html @@ -19,19 +19,20 @@ -

                    rethrow_exception()

                    -

                    #include <boost/exception_ptr.hpp>

                    +

                    rethrow_exception

                    +

                    #include <boost/exception_ptr.hpp>

                    namespace
                     boost
                         {
                         void rethrow_exception( exception_ptr const & ep );
                         }

                    Precondition:

                    -

                    ep shall not be null.

                    +

                    ep shall not be null.

                    Throws:

                    -

                    The exception to which ep refers.

                    +

                    The exception to which ep refers.

                    See also:

                    diff --git a/doc/source/boost-exception.reno b/doc/source/boost-exception.reno index 9750b41..da46c6b 100644 --- a/doc/source/boost-exception.reno +++ b/doc/source/boost-exception.reno @@ -44,7 +44,7 @@ - 36 + 40 0 @@ -53,1261 +53,6 @@ reno_context - - - - - - 2 - 973F8368D72D56424349CBB81C8F3015CB9F4F0CD7B23A8C62C3DBADDA37CD57 - 3833800883 - 4832 - 514 - 921FBF6991E17349BFF2AD6F165372F85AA9457DDB28E502ABB6B392BBA6B529 - 3119269037 - 284 - 4423 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>copy_exception</string> - - - - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 6 - - reno_context - - - - - - - 1 - 40C2FBC8600FE6877A6D46EC005D97EB1F612B8687CCA297C838E10A80E089AA - 2576029551 - 94 - 227 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>boost/exception_ptr.hpp</string> - - - exception_cloning_hpp - - - - - - 1 - 2 - !!!boost/exception_ptr.hpp This header file contains the following definitions/declarations: (:pagelist link="backlink" layer="synopsis":) - - - - - 0 - - 7 - - reno_context - - - - - - - 1 - E64E4DFB1DC251F844260AE133EFD419677D0F7143D65B578DEE525492F6B624 - 2172131053 - 94 - 227 - - - - - - 0 - ../../../../boost/exception.hpp - 0 - 0 - - - - - <string>boost/exception.hpp</string> - - - exception_hpp - - - - - - 1 - 2 - !!!boost/exception.hpp This header file includes all other header files of Boost Exception: (:pagelist tags="header":) - - - - - 0 - - 8 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Tutorial: Transporting of Exceptions between Threads</string> - - - cloning - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 9 - - 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> - - - using_enable_error_info - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 10 - - reno_context - - - - - - - 2 - 973F8368D72D56424349CBB81C8F3015CB9F4F0CD7B23A8C62C3DBADDA37CD57 - 3833800883 - 4832 - 514 - 156B870761DB092CE4269C1173B479A344A1041BA2B883765AF19A72B371D776 - 3239976720 - 117 - 4709 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>rethrow_exception</string> - - - - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 11 - - reno_context - - - - - - - 2 - 427FFBF157B284A9FB0CF4FAEC4A9BB2ADA8AC6CB4F4C329FAE0FED649640E3E - 2573550761 - 6200 - 737 - 865A7E598C4F2EDA41CCDFAD253F5E4699012898C97E29E3CB1C68DABA0C62B1 - 2395321958 - 721 - 726 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - - <string>error_info</string> - - - - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 12 - - 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 - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 13 - - reno_context - - - - - - - 1 - E444EE9697EEADFDE0767E1D0242FC0E70D98E61FB1F0FFA099648DE509B82F3 - 94503238 - 773 - 374 - - - - - - 0 - ../../example/info_tuple.cpp - 0 - 0 - - - - - <string>Tutorial: Adding Grouped Data to Exceptions</string> - - - grouping_data - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 14 - - reno_context - - - - - - - 2 - 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A - 1770110914 - 587 - 1207 - 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D - 3929437933 - 361 - 213 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - - <string>throw_exception</string> - - - - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 15 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Index</string> - - - name_idx - - - - - - 1 - 2 - !Index (:pagelist fmt="index" except_tags="noindex":) - - - - - 0 - - 16 - - reno_context - - - - - - - 2 - 973F8368D72D56424349CBB81C8F3015CB9F4F0CD7B23A8C62C3DBADDA37CD57 - 3833800883 - 4832 - 514 - 9DEEF8ED70BF74F501A96BA5DE5BFD42FAD16DE333ABE189E512C332586FC465 - 2250569940 - 1893 - 2528 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>current_exception</string> - - - - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 17 - - reno_context - - - - - - - 2 - E285EAA0D81E350113B888423C3FA5D2071F070FCA2759D99666EE07C0F8449F - 4208148208 - 2125 - 457 - ACC64445E8B6AAEF58395C0083BC0247CDE33AC00ED8DB9B7B4F216325DEE410 - 2943579912 - 400 - 1719 - - - - - - 0 - ../../../../boost/exception/enable_error_info.hpp - 0 - 0 - - - - - <string>enable_error_info</string> - - - - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 18 - - reno_context - - - - - - - 2 - 427FFBF157B284A9FB0CF4FAEC4A9BB2ADA8AC6CB4F4C329FAE0FED649640E3E - 2573550761 - 6200 - 737 - 65D13C1BB0A16823F69A32BAB56A51CA317075C7FC8B7441EE0D9B57AF5AB2AC - 2592266329 - 712 - 1850 - - - - - - 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 - - 19 - - reno_context - - - - - - - 3 - 49EA85868C2355F4F7ED6CF9D05FDC08547EF85F76913E1FDBBC96F8712C6C83 - 385672468 - 2694 - 503 - 041A9EA55D30804689CD4DEB864994D595EDF33378B25EA81DB5DA2CF402E542 - 1211481835 - 1683 - 846 - 59711C7B9D807F0C41EF49B8AAC509CDB449D81C392B5FF5988DEDE47026E856 - 1948539350 - 445 - 57 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>exception::what</string> - - - - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 20 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>exception::exception</string> - - - exception_constructors - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 21 - - reno_context - - - - - - - 4 - 49EA85868C2355F4F7ED6CF9D05FDC08547EF85F76913E1FDBBC96F8712C6C83 - 385672468 - 2694 - 503 - 041A9EA55D30804689CD4DEB864994D595EDF33378B25EA81DB5DA2CF402E542 - 1211481835 - 1683 - 846 - 85EE1980CFB24E054EDB1B3BDFA61FD4D65AD0EF248A1A42D4C2552700459327 - 2238151539 - 428 - 682 - AD3F339F7126003907BCBDB3EF846FCACA895132E1100D202DA67D2B7846EE65 - 3032091776 - 60 - 369 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>exception::~exception</string> - - - exception_destructor - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 22 - - reno_context - - - - - - - 1 - DFB8EFE8A4EE9FB101DC20A69A4217A96B78A272D7DE88D579CFE8ECCC070531 - 2228033283 - 94 - 227 - - - - - - 0 - ../../../../boost/exception/enable_error_info.hpp - 0 - 0 - - - - - <string>boost/exception/enable_error_info.hpp</string> - - - exception_enable_error_info_hpp - - - - - - 1 - 2 - !!!boost/exception/enable_error_info.hpp This header file contains the following definitions/declarations: (:pagelist link="backlink" layer="synopsis":) - - - - - 0 - - 23 - - reno_context - - - - - - - 1 - CAD6C404CB725D336A44920D2341ECA131149AB02C368B59028F8147F16737BF - 2258638601 - 94 - 227 - - - - - - 0 - ../../../../boost/exception/info_tuple.hpp - 0 - 0 - - - - - <string>boost/exception/info_tuple.hpp</string> - - - exception_error_info_group_hpp - - - - - - 1 - 2 - !!!boost/exception/info_tuple.hpp This header file contains the following definitions/declarations: (:pagelist link="backlink" layer="synopsis":) - - - - - 0 - - 24 - - reno_context - - - - - - - 1 - C9AFCA0931CB65AE31811E702FC48CB22348149B1D259CD9161D391FEC640FA8 - 2324436793 - 94 - 227 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>boost/exception/exception.hpp</string> - - - exception_exception_hpp - - - - - - 1 - 2 - !!!boost/exception/exception.hpp This header file contains the following definitions/declarations: (:pagelist link="backlink" layer="synopsis":) - - - - - 0 - - 25 - - reno_context - - - - - - - 1 - EB524A8A61E5F1A93CE4336B980696C09E7ADF42A6B933BA76EFB1544AB7C4CC - 2274957083 - 94 - 227 - - - - - - 0 - ../../../../boost/exception/error_info.hpp - 0 - 0 - - - - - <string>boost/exception/error_info.hpp</string> - - - exception_error_info_value_hpp - - - - - - 3 - 2 - !!!boost/exception/error_info.hpp This header file contains the following declaration: [@namespace boost { template <class Tag, class T> class (:link - 1 - - 0 - - -11 - - - 2 - :); }@] - - - - - 0 - - 26 - - 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 - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 27 - - 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 - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 28 - - reno_context - - - - - - - 1 - 5EE6ED209B5DBBD30DFCDA1FD30719A799EE9DBD48A5176F73EADB588CAEB2AA - 2442598207 - 94 - 227 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - - <string>boost/exception/info.hpp</string> - - - exception_error_info_hpp - - - - - - 1 - 2 - !!!boost/exception/info.hpp This header file contains the following definitions/declarations: (:pagelist link="backlink" layer="synopsis":) - - - - - 0 - - 29 - - reno_context - - - - - - - 1 - F4C951B28F7DE500973AA3DFAA99F2BADA6EDAFA2B406C30BEF3B7FBE6FD57D7 - 2263754923 - 982 - 306 - - - - - - 0 - ../../example/error_info_2.cpp - 0 - 0 - - - - - <string>Tutorial: Adding of Arbitrary Data to Active Exception Objects</string> - - - adding_data_later - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 30 - - reno_context - - - - - - - 2 - 6D87824C3C2750FDF44C61E4C06CEDDD45B2F77C309BDEC3A4F3F72AFF48953D - 629396270 - 3191 - 506 - 8F3B5E1A267CA225679713F4DDF528041F573BC02D1DBCD8FFEF57EF0AA599B9 - 4197332561 - 180 - 3005 - - - - - - 0 - ../../../../boost/exception/enable_current_exception.hpp - 0 - 0 - - - - - <string>enable_current_exception</string> - - - - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 31 - - reno_context - - - - - - - 1 - AEB5EEC1A44A4F0B184A6F73617CB57E82CE06A15DB6036D54109C66CDE06EFF - 625364235 - 290 - 302 - - - - - - 0 - ../../example/logging.cpp - 0 - 0 - - - - - <string>Tutorial: Logging of boost::exception Objects</string> - - - logging - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 32 - - reno_context - @@ -1353,195 +98,7 @@ 0 - 33 - - reno_context - - - - - - - 1 - 2C5F1B7E5C5052C9C9305848AB499A9C166D728EAAD25DC936B75FCA997A0650 - 3171555959 - 88 - 1 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - - <string>boost/throw_exception.hpp</string> - - - throw_exception_hpp - - - - - - 1 - 2 - !!!boost/exception/throw_exception.hpp This header file contains the following definitions/declarations: (:pagelist link="backlink" layer="synopsis":) - - - - - 0 - - 34 - - 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 - !!!boost/exception/enable_current_exception.hpp This header file contains the following definitions/declarations: (:pagelist link="backlink" layer="synopsis":) - - - - - 0 - - 35 - - reno_context - - - - - - - 2 - 427FFBF157B284A9FB0CF4FAEC4A9BB2ADA8AC6CB4F4C329FAE0FED649640E3E - 2573550761 - 6200 - 737 - 27AC1164E0A824D548386BEDCDC81DCAC283F3D286B0ECEE05B039BB8C392BFC - 1247954090 - 249 - 1599 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - - <string>operator<</exception</string> - - - - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 36 - - reno_context - - - - - - - 2 - 49EA85868C2355F4F7ED6CF9D05FDC08547EF85F76913E1FDBBC96F8712C6C83 - 385672468 - 2694 - 503 - 041A9EA55D30804689CD4DEB864994D595EDF33378B25EA81DB5DA2CF402E542 - 1211481835 - 1683 - 846 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>exception</string> - - - - - - - - - 1 - 2 - (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) - - - - - 0 - - 37 + 6 reno_context @@ -1570,32 +127,93 @@ - 113 + 111 2 - !!Abstract 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 + !!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 1 0 - -8 + 7 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Tutorial: Transporting of Exceptions between Threads</string> + + + tutorial_exception_ptr + + 2 - |cloning:) of exception objects, implemented non-intrusively and automatically by the @@boost::(:link + |copying:) of exception objects, implemented non-intrusively and automatically by the boost::(:link 1 0 - -14 + 8 + + reno_context + + + + + + + 2 + 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A + 1770110914 + 587 + 1207 + 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D + 3929437933 + 361 + 213 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>throw_exception</string> + + + + + 2 - :)()@@ function. !!!!Note: Boost Exception was accepted as a Boost library on November 7 2007, however it has not yet been part of an official Boost release. Current version can be downloaded from (:link http://svn.boost.org/svn/boost/trunk | Boost SVN:). !!Contents #Tutorial ##(:link + :) function. !!!!Note: Boost Exception was accepted as a Boost library on November 7 2007, however it has not yet been part of an official Boost release. Current version can be downloaded from (:link http://svn.boost.org/svn/boost/trunk | Boost SVN:). !!Contents #Tutorial ##(:link 1 0 - 38 + 9 reno_context @@ -1618,7 +236,7 @@ Tutorial: Transporting of Arbitrary Data to the Catch Site - transporting_data + tutorial_transporting_data @@ -1629,7 +247,39 @@ 0 - -9 + 10 + + 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 + + 2 @@ -1638,7 +288,7 @@ 0 - -8 + -7 2 @@ -1647,61 +297,318 @@ 0 - -31 + 11 + + reno_context + + + + + + + 1 + CE411E21EE9878B55B5906D033A0FC52574FB59D8A8CECB75405E9B1C9D782DB + 1173443713 + 308 + 302 + + + + + + 0 + ../../example/logging.cpp + 0 + 0 + + + + + <string>Tutorial: Diagnostic Information</string> + + + tutorial_diagnostic_information + + 2 - :) #Documentation ##Class @@(:link + :) #Documentation ##Class (:link 1 0 - -36 + 12 + + reno_context + + + + + + + 2 + A7FCD03648AFFAA8F55075E82DC576D3B1C55D679898BCA9AC478C383EA87718 + 1461147844 + 3075 + 503 + 448283E535298648F5CDD43FF7441A0CF89C29AD31611615019EE8D418172E27 + 1566975658 + 2032 + 878 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>exception</string> + + + + + 2 - :)@@ ##Transporting of Arbitrary Data to the Catch Site ###@@(:link + :) ##Transporting of Arbitrary Data to the Catch Site ###(:link 1 0 - -11 + 13 + + reno_context + + + + + + + 2 + CD3F710B486176CA8D8ACA2F7616CF34AA2753963298A76144B6148F2B5ABA26 + 4080812830 + 6213 + 737 + F839AFD37DC086BB1231B8E87D8EEBD28129649A06FC685AC7DF65595871AE30 + 2291609923 + 1204 + 243 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>error_info</string> + + + + + 2 - :)@@ ###@@(:link + :) ###(:link 1 0 - -35 + 14 + + reno_context + + + + + + + 2 + CD3F710B486176CA8D8ACA2F7616CF34AA2753963298A76144B6148F2B5ABA26 + 4080812830 + 6213 + 737 + 27AC1164E0A824D548386BEDCDC81DCAC283F3D286B0ECEE05B039BB8C392BFC + 1247954090 + 249 + 1449 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>operator<</exception</string> + + + + + 2 - |operator<<:)()@@ ###@@(:link + :) ###(:link 1 0 - -18 + 15 + + reno_context + + + + + + + 2 + 07430F64896197A110C276D8A14CA8A75FBA482DDF50CD40D689A1898C84D054 + 1712604289 + 1296 + 396 + BCCB91D0DCA6EC45F29CB70CB64AEA6AB54F32F8F1D1937C4CB80B059346DC81 + 695614553 + 1264 + 26 + + + + + + 0 + ../../../../boost/exception/info_tuple.hpp + 0 + 0 + + + + + <string>operator<</tuple</string> + + + + + 2 - :)()@@ ###@@(:link + :) ###(:link 1 0 - -17 + 16 + + reno_context + + + + + + + 2 + CD3F710B486176CA8D8ACA2F7616CF34AA2753963298A76144B6148F2B5ABA26 + 4080812830 + 6213 + 737 + 65D13C1BB0A16823F69A32BAB56A51CA317075C7FC8B7441EE0D9B57AF5AB2AC + 2592266329 + 712 + 1700 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>get_error_info</string> + + + + + 2 - :)()@@ ###@@(:link + :) ###(:link 1 0 - 39 + 17 + + reno_context + + + + + + + 2 + 28A531BCBAD8FFAE7E4C677D03F80EEECB5FA6499394099BD0BD63C7FFE5CD96 + 624392859 + 2341 + 457 + 092F1DB4E7BC16F1A8471AE6ACF17318A002F34863C169FD159F74ED833442E3 + 2302636659 + 2309 + 26 + + + + + + 0 + ../../../../boost/exception/enable_error_info.hpp + 0 + 0 + + + + + <string>enable_error_info</string> + + + + + + + + 2 + :) ###(:link + 1 + + 0 + + 18 reno_context @@ -1737,12 +644,12 @@ 2 - :)@@ ##Transporting of Exceptions between Threads ###@@(:link + :) ##(:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:) Transporting of Exceptions between Threads ###(:link 1 0 - 40 + 19 reno_context @@ -1782,25 +689,187 @@ 2 - :)@@ ###@@(:link + :) ###(:link 1 0 - -30 + 20 + + reno_context + + + + + + + 2 + 6D87824C3C2750FDF44C61E4C06CEDDD45B2F77C309BDEC3A4F3F72AFF48953D + 629396270 + 3191 + 506 + 8F3B5E1A267CA225679713F4DDF528041F573BC02D1DBCD8FFEF57EF0AA599B9 + 4197332561 + 180 + 3005 + + + + + + 0 + ../../../../boost/exception/enable_current_exception.hpp + 0 + 0 + + + + + <string>enable_current_exception</string> + + + + + 2 - :)()@@ ###@@(:link + :) ###(:link 1 0 - -16 + 21 + + reno_context + + + + + + + 2 + 973F8368D72D56424349CBB81C8F3015CB9F4F0CD7B23A8C62C3DBADDA37CD57 + 3833800883 + 4832 + 514 + 9DEEF8ED70BF74F501A96BA5DE5BFD42FAD16DE333ABE189E512C332586FC465 + 2250569940 + 1893 + 2528 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>current_exception</string> + + + + + 2 - :)()@@ ###@@(:link + :) ###(:link + 1 + + 0 + + 22 + + reno_context + + + + + + + 2 + 973F8368D72D56424349CBB81C8F3015CB9F4F0CD7B23A8C62C3DBADDA37CD57 + 3833800883 + 4832 + 514 + 921FBF6991E17349BFF2AD6F165372F85AA9457DDB28E502ABB6B392BBA6B529 + 3119269037 + 284 + 4423 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>copy_exception</string> + + + + + + + + 2 + :) ###(:link + 1 + + 0 + + 23 + + reno_context + + + + + + + 2 + 973F8368D72D56424349CBB81C8F3015CB9F4F0CD7B23A8C62C3DBADDA37CD57 + 3833800883 + 4832 + 514 + 156B870761DB092CE4269C1173B479A344A1041BA2B883765AF19A72B371D776 + 3239976720 + 117 + 4709 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>rethrow_exception</string> + + + + + + + + 2 + :) ###(:link 1 0 @@ -1809,97 +878,505 @@ 2 - :)()@@ ###@@(:link + :) ##(:link 1 0 - -10 + 24 + + reno_context + + + + + + + 2 + 8CFD9ACEF3312EA03496BC3C8274665972835B6FA5D5CEFAF9915D890F931195 + 3756482723 + 321 + 408 + C0753D41DBCBCA44DBF22990F7591F4B6C80C6AA58D9D81688C858D871157355 + 3548862587 + 289 + 26 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + + <string>diagnostic_information</string> + + + + + 2 - :)()@@ ###@@(:link + :) ##(:link 1 0 - -32 + -8 2 - :)@@ ##@@(:link + :) ##Headers ###(:link 1 0 - -14 + 25 + + reno_context + + + + + + + 1 + 429F0DE3599A4CC08B9458E2AECA2EAC202AB3471554FE82C307493805E6676E + 4224422781 + 401 + 323 + + + + + + 0 + ../../../../boost/exception.hpp + 0 + 0 + + + + + <string>boost/exception.hpp</string> + + + exception_hpp + + 2 - :)()@@ ##Headers ###@@(:link + :) ###(:link 1 0 - -7 + 26 + + reno_context + + + + + + + 1 + 1B2485351B4AE4EF49CE30C98DB235C543D350E55A42F47A14BA200AC10B5FA0 + 3097066977 + 406 + 323 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + + <string>boost/exception/diagnostic_information.hpp</string> + + + + + 2 - :)@@ ###@@(:link + :) ###(:link 1 0 - -6 + 27 + + 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 + + 2 - :)@@ ###@@(:link + :) ###(:link 1 0 - -33 + 28 + + reno_context + + + + + + + 1 + A7775E23BFAA55F15935752060C841BC57BB5BEF2A227D789D327F326F1354C8 + 823044407 + 2475 + 323 + + + + + + 0 + ../../../../boost/exception/enable_error_info.hpp + 0 + 0 + + + + + <string>boost/exception/enable_error_info.hpp</string> + + + exception_enable_error_info_hpp + + 2 - :)@@ ###@@(:link + :) ###(:link 1 0 - -34 + 29 + + reno_context + + + + + + + 1 + CAB4D823BD4720B71E1CA5BE482AC95B42A9E07CD5E08671EA23184635F281A2 + 3077708282 + 89 + 323 + + + + + + 0 + ../../../../boost/exception/error_info.hpp + 0 + 0 + + + + + <string>boost/exception/error_info.hpp</string> + + + exception_error_info_value_hpp + + 2 - :)@@ ###@@(:link + :) ###(:link 1 0 - -22 + 30 + + reno_context + + + + + + + 1 + 6A180E68AF0079742E66F01E4A3A7D3377E90442C073DAFBC501EF38F4A6A7E9 + 1094752415 + 3255 + 323 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>boost/exception/exception.hpp</string> + + + exception_exception_hpp + + 2 - :)@@ ###@@(:link + :) ###(:link 1 0 - -28 + 31 + + reno_context + + + + + + + 1 + 3299EE83038AFF1989ABF199648564104BB7B01D87140BB8736FA641AE351DFF + 1085459966 + 6627 + 323 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>boost/exception/info.hpp</string> + + + exception_error_info_hpp + + 2 - :)@@ ###@@(:link + :) ###(:link 1 0 - -23 + 32 + + reno_context + + + + + + + 1 + CAD6C404CB725D336A44920D2341ECA131149AB02C368B59028F8147F16737BF + 2258638601 + 94 + 227 + + + + + + 0 + ../../../../boost/exception/info_tuple.hpp + 0 + 0 + + + + + <string>boost/exception/info_tuple.hpp</string> + + + exception_error_info_group_hpp + + 2 - :)@@ ###@@(:link + :) ###(:link + 1 + + 0 + + 33 + + reno_context + + + + + + + 1 + CB567E3390BC92DA06F9899E700792C3790D3707C024CA21D15C930D908AD10A + 3422645546 + 5023 + 323 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>boost/exception_ptr.hpp</string> + + + exception_cloning_hpp + + + + + 2 + :) ###(:link + 1 + + 0 + + 34 + + reno_context + + + + + + + 1 + 48A0C42CCA66A6C935724A9B7BD30B6B3DF16A0A808C804A585A5CC90D85DC5E + 1606229033 + 1723 + 91 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>boost/throw_exception.hpp</string> + + + throw_exception_hpp + + + + + 2 + :) #(:link + 1 + + 0 + + 35 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Index</string> + + + name_idx + + + + + 2 + :) !!Synopsis `#include <(:link 1 0 @@ -1908,97 +1385,7 @@ 2 - :)@@ ###@@(:link - 1 - - 0 - - -24 - - - 2 - :)@@ #(:link - 1 - - 0 - - -15 - - - 2 - :) !!Synopsis @@#include <(:link - 1 - - 0 - - -7 - - - 2 - :)>@@ [@namespace boost { (:include - 1 - - 0 - - -36 - - - 2 - decl:) (:include - 1 - - 0 - - -11 - - - 2 - decl:) (:include - 1 - - 0 - - -35 - - - 2 - decl:) (:include - 1 - - 0 - - -18 - - - 2 - decl:) (:include - 1 - - 0 - - -17 - - - 2 - decl:) (:include - 1 - - 0 - - -39 - - - 2 - decl:) (:include - 1 - - 0 - - -40 - - - 2 - decl:) (:include + :)> [@namespace boost { (:include 1 0 @@ -2007,34 +1394,16 @@ 2 - decl:) (:include + decl pre_indent="4":) (:include 1 0 - -16 + -31 2 - decl:) (:include - 1 - - 0 - - -5 - - - 2 - decl:) (:include - 1 - - 0 - - -10 - - - 2 - decl:) (:include + decl pre_indent="4":) (:include 1 0 @@ -2043,21 +1412,57 @@ 2 - decl:) (:include + decl pre_indent="4":) (:include 1 0 - -14 + -28 2 - decl:) }@] (:include + decl pre_indent="4":) (:include 1 0 - -36 + -26 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -33 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -27 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -34 + + + 2 + decl pre_indent="4":) }@] !!Class exception (:include + 1 + + 0 + + -12 2 @@ -2066,7 +1471,7 @@ 0 - -11 + -13 2 @@ -2075,52 +1480,7 @@ 0 - -35 - - - 2 - :) (:include - 1 - - 0 - - -18 - - - 2 - :) (:include - 1 - - 0 - - -17 - - - 2 - :) (:include - 1 - - 0 - - -39 - - - 2 - :) !!Transporting of Exceptions between Threads (:include - 1 - - 0 - - -40 - - - 2 - :) (:include - 1 - - 0 - - -30 + -14 2 @@ -2135,6 +1495,69 @@ 2 :) (:include 1 + + 0 + + -17 + + + 2 + :) (:include + 1 + + 0 + + -18 + + + 2 + :) !!Transporting of Exceptions between Threads (:include + 1 + + 0 + + -19 + + + 2 + :) (:include + 1 + + 0 + + -20 + + + 2 + :) (:include + 1 + + 0 + + -21 + + + 2 + :) (:include + 1 + + 0 + + -22 + + + 2 + :) (:include + 1 + + 0 + + -23 + + + 2 + :) (:include + 1 0 @@ -2142,21 +1565,12 @@ 2 - :) (:include + :) !!Printing Diagnostic Information (:include 1 0 - -10 - - - 2 - :) (:include - 1 - - 0 - - -32 + -24 2 @@ -2165,7 +1579,7 @@ 0 - -14 + -8 2 @@ -2176,7 +1590,7 @@ 0 - -38 + -7 @@ -2189,7 +1603,7 @@ 0 - -39 + -8 @@ -2202,7 +1616,776 @@ 0 - -40 + -12 + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso,exception":) + + + + + 0 + + -9 + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + -10 + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + -11 + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + -13 + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + -14 + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + -15 + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + -16 + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + -17 + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + -18 + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + -19 + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + -20 + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + -21 + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + -22 + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + -23 + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + -24 + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + -25 + + + + 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 + + -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 + + -31 + + + + 1 + 2 + (:include include:) (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + -32 + + + + 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 + + -35 + + + + 1 + 2 + !Index (:pagelist fmt="index" except_tags="index,noindex":) + + + + + 0 + + -26 + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + 36 + + 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 + + 37 + + reno_context + + + + + + + 4 + A7FCD03648AFFAA8F55075E82DC576D3B1C55D679898BCA9AC478C383EA87718 + 1461147844 + 3075 + 503 + 448283E535298648F5CDD43FF7441A0CF89C29AD31611615019EE8D418172E27 + 1566975658 + 2032 + 878 + 85EE1980CFB24E054EDB1B3BDFA61FD4D65AD0EF248A1A42D4C2552700459327 + 2238151539 + 428 + 1031 + AD3F339F7126003907BCBDB3EF846FCACA895132E1100D202DA67D2B7846EE65 + 3032091776 + 60 + 369 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>exception::~exception</string> + + + exception_destructor + + + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + 38 + + reno_context + + + + + + + 3 + A7FCD03648AFFAA8F55075E82DC576D3B1C55D679898BCA9AC478C383EA87718 + 1461147844 + 3075 + 503 + 448283E535298648F5CDD43FF7441A0CF89C29AD31611615019EE8D418172E27 + 1566975658 + 2032 + 878 + FC8AE1B9FA13A964C37467E84E2A128A76318654D90A6D87F1E4F8248F8940BA + 4233308735 + 156 + 183 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>exception::diagnostic_information</string> + + + + + + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + 39 + + 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 + + 40 + + reno_context + + + + + + + 3 + A7FCD03648AFFAA8F55075E82DC576D3B1C55D679898BCA9AC478C383EA87718 + 1461147844 + 3075 + 503 + 448283E535298648F5CDD43FF7441A0CF89C29AD31611615019EE8D418172E27 + 1566975658 + 2032 + 878 + BACD79DFB4C710C1A67687FC6344DF2251E2379613C2DF5B2729B2CD37E24EA3 + 458367129 + 154 + 363 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>exception::exception</string> + + + exception_constructors + + + + + + 1 + 2 + (:include include:) !!!See also: (:pagelist link="backlink" except_tags="noalso":) + + + + + 0 + + 41 + + 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 + + 42 + + 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 + + 43 + + reno_context + + + + + + + 1 + F4C951B28F7DE500973AA3DFAA99F2BADA6EDAFA2B406C30BEF3B7FBE6FD57D7 + 2263754923 + 982 + 306 + + + + + + 0 + ../../example/error_info_2.cpp + 0 + 0 + + + + + <string>Tutorial: Adding of Arbitrary Data to Active Exception Objects</string> + + + adding_data_later + + + + + + 0 + + + + + 0 + + 44 + + reno_context + + + + + + + 3 + A7FCD03648AFFAA8F55075E82DC576D3B1C55D679898BCA9AC478C383EA87718 + 1461147844 + 3075 + 503 + 448283E535298648F5CDD43FF7441A0CF89C29AD31611615019EE8D418172E27 + 1566975658 + 2032 + 878 + 18564D10CA94AF81046EA7A5EA591091CB0ED00B3ED10D47CC65A38BB54282C5 + 76816478 + 124 + 57 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>exception::what</string> + + + + + @@ -2218,13 +2401,13 @@ headers - 41 + 45 reno_layer - 36 + 40 0 @@ -2269,6 +2452,17 @@ 0 + + + 0 + + -12 + + + + 0 + + 0 @@ -2287,25 +2481,6 @@ -10 - - 3 - 2 - [@#include < - 1 - - 1 - - 2 - >@] - - - - - 0 - - -11 - - 0 @@ -2314,7 +2489,7 @@ 0 - -12 + -11 @@ -2362,15 +2537,7 @@ - 3 - 2 - [@#include < - 1 - - 1 - - 2 - >@] + 0 @@ -2403,7 +2570,15 @@ - 0 + 3 + 2 + [@#include < + 1 + + 1 + + 2 + >@] @@ -2447,7 +2622,15 @@ - 0 + 3 + 2 + [@#include < + 1 + + 1 + + 2 + >@] @@ -2472,94 +2655,6 @@ 0 - - - 0 - - -26 - - - - 0 - - - - - 0 - - -27 - - - - 0 - - - - - 0 - - -28 - - - - 0 - - - - - 0 - - -29 - - - - 0 - - - - - 0 - - -30 - - - - 3 - 2 - [@#include <(:link - 1 - - 0 - - -34 - - - 2 - :)> - - - - - 0 - - -31 - - - - 0 - - - - - 0 - - -32 - - - - 0 - - 0 @@ -2582,6 +2677,72 @@ 0 + + + 0 + + -27 + + + + 0 + + + + + 0 + + -28 + + + + 0 + + + + + 0 + + -31 + + + + 0 + + + + + 0 + + -32 + + + + 0 + + + + + 0 + + -29 + + + + 0 + + + + + 0 + + -30 + + + + 0 + + 0 @@ -2593,6 +2754,17 @@ 0 + + + 0 + + -26 + + + + 0 + + 0 @@ -2645,15 +2817,51 @@ - 3 - 2 - [@#include < - 1 - - 1 - - 2 - >@] + 0 + + + + + 0 + + -41 + + + + 0 + + + + + 0 + + -42 + + + + 0 + + + + + 0 + + -43 + + + + 0 + + + + + 0 + + -44 + + + + 0 @@ -2663,13 +2871,13 @@ ctors - 42 + 46 reno_layer - 36 + 40 0 @@ -2714,6 +2922,17 @@ 0 + + + 0 + + -12 + + + + 0 + + 0 @@ -2747,17 +2966,6 @@ 0 - - - 0 - - -12 - - - - 0 - - 0 @@ -2905,7 +3113,18 @@ 0 - -26 + -33 + + + + 0 + + + + + 0 + + -34 @@ -2934,28 +3153,6 @@ 0 - - - 0 - - -29 - - - - 0 - - - - - 0 - - -30 - - - - 0 - - 0 @@ -2982,7 +3179,7 @@ 0 - -33 + -29 @@ -2993,7 +3190,7 @@ 0 - -34 + -30 @@ -3011,6 +3208,17 @@ 0 + + + 0 + + -26 + + + + 0 + + 0 @@ -3066,6 +3274,50 @@ 0 + + + 0 + + -41 + + + + 0 + + + + + 0 + + -42 + + + + 0 + + + + + 0 + + -43 + + + + 0 + + + + + 0 + + -44 + + + + 0 + + @@ -3073,13 +3325,13 @@ free - 43 + 47 reno_layer - 36 + 40 0 @@ -3124,6 +3376,17 @@ 0 + + + 0 + + -12 + + + + 0 + + 0 @@ -3157,17 +3420,6 @@ 0 - - - 0 - - -12 - - - - 0 - - 0 @@ -3315,7 +3567,18 @@ 0 - -26 + -33 + + + + 0 + + + + + 0 + + -34 @@ -3344,28 +3607,6 @@ 0 - - - 0 - - -29 - - - - 0 - - - - - 0 - - -30 - - - - 0 - - 0 @@ -3392,7 +3633,7 @@ 0 - -33 + -29 @@ -3403,7 +3644,7 @@ 0 - -34 + -30 @@ -3421,6 +3662,17 @@ 0 + + + 0 + + -26 + + + + 0 + + 0 @@ -3476,6 +3728,50 @@ 0 + + + 0 + + -41 + + + + 0 + + + + + 0 + + -42 + + + + 0 + + + + + 0 + + -43 + + + + 0 + + + + + 0 + + -44 + + + + 0 + + @@ -3483,13 +3779,13 @@ decl - 44 + 48 reno_layer - 36 + 40 0 @@ -3500,16 +3796,7 @@ 5 2 - [@ template <class T> (:link - 1 - - 0 - - -40 - - - 2 - :) (:link + [@class (:link 1 0 @@ -3518,7 +3805,16 @@ 2 - :)( T const & e );@] + :): public std::exception public boost:: + 1 + + 0 + + -12 + + + 2 + { ---unspecified--- };@] @@ -3551,7 +3847,85 @@ - 0 + 5 + 2 + [@#ifdef BOOST_NO_EXCEPTIONS void (:link + 1 + + 0 + + -8 + + + 2 + :)( std::exception const & e ); // user defined #else template <class E> void (:link + 1 + + 0 + + -8 + + + 2 + :)( E const & e ); #endif@] + + + + + 0 + + -12 + + + + 11 + 2 + [@class (:link + 1 + + 0 + + -12 + + + 2 + :) { public: (:include + 1 + + 0 + + -38 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -44 + + + 2 + decl pre_indent="4":) protected: (:include + 1 + + 0 + + -40 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -37 + + + 2 + decl pre_indent="4":) };@] @@ -3573,27 +3947,7 @@ - 5 - 2 - [@ void (:link - 1 - - 0 - - -10 - - - 2 - :)( (:link - 1 - - 0 - - -40 - - - 2 - :) const & ep ); + 0 @@ -3603,28 +3957,6 @@ -11 - - 3 - 2 - [@ template <class Tag,class T> class (:link - 1 - - 0 - - -11 - - - 2 - :) { public: typedef T value_type; error_info( value_type const & ); private: ---unspecified--- };@] - - - - - 0 - - -12 - - 0 @@ -3637,7 +3969,18 @@ - 0 + 3 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -13 + + + 2 + :) { public: typedef T value_type; error_info( value_type const & ); };@] @@ -3650,7 +3993,7 @@ 5 2 - [@#ifdef BOOST_NO_EXCEPTIONS void (:link + [@template <class E, class Tag, class T> E const & (:link 1 0 @@ -3659,16 +4002,16 @@ 2 - :)( std::exception const & e ); // user defined #else template <class E> void (:link + |operator<<:)( E const & x, (:link 1 0 - -14 + -13 2 - :)( E const & e ); #endif@] + :)<Tag,T> const & v );@] @@ -3679,7 +4022,36 @@ - 0 + 7 + 2 + [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link + 1 + + 0 + + -15 + + + 2 + |operator<<:)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link + 1 + + 0 + + -13 + + + 2 + :)<Tag1,T1>, ..., (:link + 1 + + 0 + + -13 + + + 2 + :)<TagN,TN> > const & v );@] @@ -3690,18 +4062,9 @@ - 5 + 3 2 - [@ (:link - 1 - - 0 - - -40 - - - 2 - :) (:link + [@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 @@ -3710,7 +4073,7 @@ 2 - :)();@] + :)( E const & x );@] @@ -3723,7 +4086,7 @@ 3 2 - [@ template <class T> ---unspecified--- (:link + [@template <class T> ---unspecified--- (:link 1 0 @@ -3743,9 +4106,36 @@ - 3 + 9 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 + [@typedef (:link + 1 + + 0 + + -13 + + + 2 + :)<struct tag_throw_function,char const *> throw_function; typedef (:link + 1 + + 0 + + -13 + + + 2 + :)<struct tag_throw_file,char const *> throw_file; typedef (:link + 1 + + 0 + + -13 + + + 2 + :)<struct tag_throw_line,int> throw_line; #define (:link 1 0 @@ -3754,7 +4144,7 @@ 2 - :)( E const & x ); + :)\ ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\ ::boost::throw_file(__FILE__) <<\ ::boost::throw_line((int)__LINE__)@] @@ -3767,7 +4157,7 @@ 3 2 - [@ virtual char const * (:link + [@typedef ---unspecified--- (:link 1 0 @@ -3776,7 +4166,7 @@ 2 - :::)() const throw();@] + :);@] @@ -3787,9 +4177,9 @@ - 7 + 3 2 - [@ (:link + [@template <class T> ---unspecified--- (:link 1 0 @@ -3798,25 +4188,7 @@ 2 - :::)(); (:link - 1 - - 0 - - -20 - - - 2 - :::)( (:link - 1 - - 0 - - -36 - - - 2 - :) const & x );@] + :)( T const & e );@] @@ -3827,9 +4199,18 @@ - 3 + 5 2 - [@ (:link + [@(:link + 1 + + 0 + + -19 + + + 2 + :) (:link 1 0 @@ -3838,7 +4219,7 @@ 2 - :::)();@] + :)();@] @@ -3849,7 +4230,27 @@ - 0 + 5 + 2 + [@template <class T> (:link + 1 + + 0 + + -19 + + + 2 + :) (:link + 1 + + 0 + + -22 + + + 2 + :)( T const & e );@] @@ -3860,7 +4261,27 @@ - 0 + 5 + 2 + [@void (:link + 1 + + 0 + + -23 + + + 2 + :)( (:link + 1 + + 0 + + -19 + + + 2 + :) const & ep ); @@ -3871,7 +4292,18 @@ - 0 + 3 + 2 + [@std::string + 1 + + 0 + + -24 + + + 2 + ( std::exception const & x );@] @@ -3889,11 +4321,80 @@ 0 - -26 + -33 - 0 + 11 + 2 + [@(:include + 1 + + 0 + + -5 + + + 2 + decl:) (:include + 1 + + 0 + + -19 + + + 2 + decl:) (:include + 1 + + 0 + + -22 + + + 2 + decl:) (:include + 1 + + 0 + + -21 + + + 2 + decl:) (:include + 1 + + 0 + + -23 + + + 2 + decl:)@] + + + + + 0 + + -34 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -8 + + + 2 + decl:)@] @@ -3904,7 +4405,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -20 + + + 2 + decl:)@] @@ -3914,41 +4426,19 @@ -28 - - 0 - - - - - 0 - - -29 - - - - 0 - - - - - 0 - - -30 - - 3 2 - [@ template <class T> ---unspecified--- (:link + [@(:include 1 0 - -30 + -17 2 - :)( T const & e ); + decl:)@] @@ -3959,7 +4449,45 @@ - 0 + 9 + 2 + [@(:include + 1 + + 0 + + -13 + + + 2 + decl:) (:include + 1 + + 0 + + -16 + + + 2 + decl:) (:include + 1 + + 0 + + -18 + + + 2 + decl:) (:include + 1 + + 0 + + -14 + + + 2 + decl:)@] @@ -3972,38 +4500,60 @@ 3 2 - [@ class (:link + [@(:include 1 0 - -32 + -15 2 - :): public std::exception public boost::exception { ---unspecified--- };@] + decl:)@] 0 - -33 + -29 - 0 + 3 + 2 + [@template <class Tag, class T> class (:link + 1 + + 0 + + -13 + + + 2 + :);@] 0 - -34 + -30 - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -12 + + + 2 + decl:)@] @@ -4014,36 +4564,29 @@ - 7 + 0 + + + + + 0 + + -26 + + + + 3 2 - [@ template <class E, class Tag1, class T1> E const & operator<<( E const & x, (:link + [@(:include 1 0 - -11 + -24 2 - :)<Tag1,T1> const & v ); template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & operator<<( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link - 1 - - 0 - - -11 - - - 2 - :)<Tag1,T1>, ..., (:link - 1 - - 0 - - -11 - - - 2 - :)<TagN,TN> > const & v );@] + decl:)@] @@ -4054,45 +4597,7 @@ - 9 - 2 - [@ class (:link - 1 - - 0 - - -36 - - - 2 - :) { public: (:include - 1 - - 0 - - -19 - - - 2 - decl:) protected: (:include - 1 - - 0 - - -20 - - - 2 - decl:) (:include - 1 - - 0 - - -21 - - - 2 - decl:) private: ---unspecified--- };@] + 0 @@ -4103,7 +4608,18 @@ - 0 + 3 + 2 + [@(:link + 1 + + 0 + + -37 + + + 2 + :::)();@] @@ -4114,7 +4630,18 @@ - 0 + 3 + 2 + [@virtual char const * (:link + 1 + + 0 + + -38 + + + 2 + :::)() const throw();@] @@ -4125,45 +4652,7 @@ - 9 - 2 - [@ typedef (:link - 1 - - 0 - - -11 - - - 2 - :)<struct tag_throw_function,char const *> throw_function; typedef (:link - 1 - - 0 - - -11 - - - 2 - :)<struct tag_throw_file,char const *> throw_file; typedef (:link - 1 - - 0 - - -11 - - - 2 - :)<struct tag_throw_line,int> throw_line; #define (:link - 1 - - 0 - - -39 - - - 2 - :)\ ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\ ::boost::throw_file(__FILE__) <<\ ::boost::throw_line((int)__LINE__)@] + 0 @@ -4174,9 +4663,9 @@ - 3 + 7 2 - [@ typedef ---unspecified--- (:link + [@(:link 1 0 @@ -4185,7 +4674,80 @@ 2 - :);@] + :::)(); (:link + 1 + + 0 + + -40 + + + 2 + :::)( (:link + 1 + + 0 + + -12 + + + 2 + :) const & x );@] + + + + + 0 + + -41 + + + + 0 + + + + + 0 + + -42 + + + + 0 + + + + + 0 + + -43 + + + + 0 + + + + + 0 + + -44 + + + + 3 + 2 + [@virtual char const * (:link + 1 + + 0 + + -44 + + + 2 + :::)() const throw();@] @@ -4195,13 +4757,13 @@ include - 45 + 49 reno_layer - 36 + 40 0 @@ -4210,18 +4772,27 @@ - 3 + 5 2 - !!!copy_exception() (:include synopsis:) !!!!Effects: As if @@try { throw e; } catch( ... ) { return + !!!unknown_exception (:include synopsis:) This type is used by the 1 0 - -16 + -19 2 - (); }@@ + support in Boost Exception. Please see (:link + 1 + + 0 + + -21 + + + 2 + :). @@ -4242,57 +4813,28 @@ -7 - - 0 - - - - - 0 - - -8 - - 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 + !!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 - -30 + -20 2 - :)()@@ at the time of the throw is required in order to use cloning. !!!!Note: All exceptions emitted by the familiar function @@boost::(:link + :) 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 - -14 + -8 2 - :)()@@ are guaranteed to derive from @@boost::(:link - 1 - - 0 - - -36 - - - 2 - :)@@ and to support cloning. (:include - 1 - - 0 - - -26 - - - 2 - :) (:include + :) are guaranteed to derive from boost::(:link 1 0 @@ -4301,6 +4843,24 @@ 2 + :) and to support cloning. (:include + 1 + + 0 + + -39 + + + 2 + :) (:include + 1 + + 0 + + -36 + + + 2 :) @@ -4308,524 +4868,27 @@ 0 - -9 - - - - 27 - 2 - !!Integrating Boost Exception in Existing Exception Class Hierarchies Some exception hierarchies can not be modified to make @@boost::(:link - 1 - - 0 - - -36 - - - 2 - :)@@ a base type. For this case, the @@(:link - 1 - - 0 - - -17 - - - 2 - :)()@@ function template can be used to make exception objects derive from @@boost::(:link - 1 - - 0 - - -36 - - - 2 - :)@@ anyway. Here is an example: [@#include <(:link - 1 - - 0 - - -7 - - - 2 - :)> #include <stdexcept> typedef boost::(:link - 1 - - 0 - - -11 - - - 2 - :)<struct tag_std_range_min,size_t> std_range_min; typedef boost::(:link - 1 - - 0 - - -11 - - - 2 - :)<struct tag_std_range_max,size_t> std_range_max; typedef boost::(:link - 1 - - 0 - - -11 - - - 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 - - -17 - - - 2 - :)(std::range_error("Index out of range")) << std_range_min(0) << std_range_max(size()) << std_range_index(i); //.... } }; @] @@(:link - 1 - - 0 - - -17 - - - 2 - |Enable_error_info:)<T>@@ returns an object of ''unspecified type'' which is guaranteed to derive from both @@boost::(:link - 1 - - 0 - - -36 - - - 2 - :)@@ and @@T@@. This makes it possible to use @@(:link - 1 - - 0 - - -35 - - - 2 - |operator<<:)()@@ to store additional information in the exception object. The exception can be intercepted as @@T &@@, therefore existing exception handling will not break. It can also be intercepted as @@boost::(:link - 1 - - 0 - - -36 - - - 2 - :) &@@, so that (:link - 1 - - 0 - - -38 - - - 2 - |more information can be added to the exception at a later time:). - - - - - 0 - - -10 - - - - 1 - 2 - !!!rethrow_exception() (:include synopsis:) !!!!Precondition: @@ep@@ shall not be null. !!!!Throws: The exception to which @@ep@@ refers. - - - - - 0 - - -11 - - - - 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 - - -11 - - - 2 - :)<Tag,T>@@ can be passed to @@(:link - 1 - - 0 - - -35 - - - 2 - |operator<<:)()@@ to be stored in objects of type @@boost::(:link - 1 - - 0 - - -36 - - - 2 - :)@@. !!!!Note: The header @@<(:link - 1 - - 0 - - -25 - - - 2 - :)>@@ provides a declaration of the @@(:link - 1 - - 0 - - -11 - - - 2 - :)@@ template, which is sufficient for the purpose of @@typedef@@ing an instance for specific @@Tag@@ and @@T@@, like this: [@#include <(:link - 1 - - 0 - - -25 - - - 2 - :)> typedef boost::(:link - 1 - - 0 - - -11 - - - 2 - :)<struct tag_errno,int> errno_info;@] Of course, to actually add an @@errno_info@@ object to exceptions using @@(:link - 1 - - 0 - - -35 - - - 2 - |operator<<:)()@@, or to retrieve it using @@(:link - 1 - - 0 - - -18 - - - 2 - :)()@@, you must first @@#include <(:link - 1 - - 0 - - -28 - - - 2 - :)>@@. - - - - - 0 - - -12 - - - - 39 - 2 - !!!Cloning and Re-throwing an Exception When you catch a @@boost::(:link - 1 - - 0 - - -36 - - - 2 - :)@@, you can call @@(:link - 1 - - 0 - - -16 - - - 2 - :)()@@ to get an @@(:link - 1 - - 0 - - -40 - - - 2 - :)@@ object: [@#include <(:link - 1 - - 0 - - -6 - - - 2 - :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link - 1 - - 0 - - -36 - - - 2 - :)s void worker_thread( boost::(:link - 1 - - 0 - - -40 - - - 2 - :) & error ) { try { do_work(); error = boost::(:link - 1 - - 0 - - -40 - - - 2 - :)(); } catch( ... ) { error = boost::(:link - 1 - - 0 - - -16 - - - 2 - :)(); } }@] In the above example, note that @@(:link - 1 - - 0 - - -16 - - - 2 - :)()@@ captures the original type of the exception object. The exception can be thrown again using the @@(:link - 1 - - 0 - - -10 - - - 2 - :)()@@ function: [@// ...continued void work() { boost::(:link - 1 - - 0 - - -40 - - - 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 - - -10 - - - 2 - :)(error); }@] @@(:link - 1 - - 0 - - -16 - - - 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 - - -40 - - - 2 - :)@@ points to an instance of @@std::bad_alloc@@, or * if @@(:link - 1 - - 0 - - -30 - - - 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 - - -40 - - - 2 - :)@@ points to an instance of @@(:link - 1 - - 0 - - -32 - - - 2 - :)@@. Regardless, the use of @@(:link - 1 - - 0 - - -16 - - - 2 - :)()@@ and @@(:link - 1 - - 0 - - -10 - - - 2 - :)()@@ in the above examples is well-formed. - - - - - 0 - - -13 - - - - 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 - - -23 - - - 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link - 1 - - 0 - - -11 - - - 2 - :)<struct tag_file_name,std::string> file_name_info; typedef boost::(:link - 1 - - 0 - - -11 - - - 2 - :)<struct tag_function,char const *> function_info; typedef boost::(:link - 1 - - 0 - - -11 - - - 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 - - -36 - - - 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 - - -18 - - - 2 - :)()@@. - - - - - 0 - - -14 + -8 9 2 - !!!throw_exception() (:include synopsis:) !!!!Requirements: @@E@@ must derive publicly from @@std::exception@@. !!!!Effects: * If @@BOOST_NO_EXCEPTIONS@@ is not defined, @@boost::(:link + !!!throw_exception (:include synopsis:) !!!!Requirements: E must derive publicly from std::exception. !!!!Effects: * If BOOST_NO_EXCEPTIONS is not defined, boost::(:link 1 0 - -14 + -8 2 - :)(e)@@ is equivalent to @@throw boost::(:link + :)(e) is equivalent to throw boost::(:link 1 0 - -30 + -20 2 @@ -4838,7 +4901,56 @@ 2 - :)(e))@@, unless @@BOOST_EXCEPTION_DISABLE@@ is defined, in which case @@boost::(:link + :)(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::(:link + 1 + + 0 + + -8 + + + 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 + + -12 + + + + 21 + 2 + !!!exception (:include synopsis:) Class boost::(:link + 1 + + 0 + + -12 + + + 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 + + -12 + + + 2 + :) can store data of arbitrary types, using the (:link + 1 + + 0 + + -13 + + + 2 + :) wrapper and (:link 1 0 @@ -4847,7 +4959,495 @@ 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. + |operator<<:). To retrieve data from a boost::(:link + 1 + + 0 + + -12 + + + 2 + :) object, use the (:link + 1 + + 0 + + -16 + + + 2 + :) function template. (:include + 1 + + 0 + + -40 + + + 2 + :) (:include + 1 + + 0 + + -37 + + + 2 + :) (:include + 1 + + 0 + + -38 + + + 2 + :) (:include + 1 + + 0 + + -44 + + + 2 + :) + + + + + 0 + + -9 + + + + 11 + 2 + !!Transporting of Arbitrary Data to the Catch Site All exception types that derive from boost::(:link + 1 + + 0 + + -12 + + + 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 + + -12 + + + 2 + :) at the time of the throw, or at a later time. (:include + 1 + + 0 + + -42 + + + 2 + :) (:include + 1 + + 0 + + -43 + + + 2 + :) (:include + 1 + + 0 + + -41 + + + 2 + :) + + + + + 0 + + -10 + + + + 27 + 2 + !!Integrating Boost Exception in Existing Exception Class Hierarchies Some exception hierarchies can not be modified to make boost::(:link + 1 + + 0 + + -12 + + + 2 + :) a base type. For this case, the (:link + 1 + + 0 + + -17 + + + 2 + :) function template can be used to make exception objects derive from boost::(:link + 1 + + 0 + + -12 + + + 2 + :) anyway. Here is an example: [@#include <(:link + 1 + + 0 + + -25 + + + 2 + :)> #include <stdexcept> typedef boost::(:link + 1 + + 0 + + -13 + + + 2 + :)<struct tag_std_range_min,size_t> std_range_min; typedef boost::(:link + 1 + + 0 + + -13 + + + 2 + :)<struct tag_std_range_max,size_t> std_range_max; typedef boost::(:link + 1 + + 0 + + -13 + + + 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 + + -17 + + + 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 + + -17 + + + 2 + :)<T> gets us an object of ''unspecified type'' which is guaranteed to derive from both boost::(:link + 1 + + 0 + + -12 + + + 2 + :) and T. This makes it possible to use (:link + 1 + + 0 + + -14 + + + 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 + + -12 + + + 2 + :) &, so that (:link + 1 + + 0 + + -9 + + + 2 + |more information can be added to the exception at a later time:). + + + + + 0 + + -11 + + + + 21 + 2 + !!Diagnostic Information Class boost::(:link + 1 + + 0 + + -12 + + + 2 + :) provides a virtual member function (:link + 1 + + 0 + + -38 + + + 2 + :::), 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 + + -25 + + + 2 + :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link + 1 + + 0 + + -12 + + + 2 + :). void g() { try { f(); } catch( boost::(:link + 1 + + 0 + + -12 + + + 2 + :) & e ) { std::cerr << e.(:link + 1 + + 0 + + -38 + + + 2 + :::)(); } }@] The (:link + 1 + + 0 + + -38 + + + 2 + :::) member function iterates over all data objects stored in the boost::(:link + 1 + + 0 + + -12 + + + 2 + :) through (:link + 1 + + 0 + + -14 + + + 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 + + -13 + + + 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 + + -13 + + + + 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 + + -13 + + + 2 + :)<Tag,T> can be passed to (:link + 1 + + 0 + + -14 + + + 2 + |operator<<:) to be stored in objects of type boost::(:link + 1 + + 0 + + -12 + + + 2 + :). !!!!Note: The header <(:link + 1 + + 0 + + -29 + + + 2 + :)> provides a declaration of the (:link + 1 + + 0 + + -13 + + + 2 + :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, like this: [@#include <(:link + 1 + + 0 + + -29 + + + 2 + :)> typedef boost::(:link + 1 + + 0 + + -13 + + + 2 + :)<struct tag_errno,int> errno_info;@] Of course, to actually add an errno_info object to exceptions using (:link + 1 + + 0 + + -14 + + + 2 + |operator<<:), or to retrieve it using (:link + 1 + + 0 + + -16 + + + 2 + :), you must first #include <(:link + 1 + + 0 + + -31 + + + 2 + :)>. + + + + + 0 + + -14 + + + + 7 + 2 + !!!operator<<, error_info overload (:include synopsis:) !!!!Requirements: E must be boost::(:link + 1 + + 0 + + -12 + + + 2 + :), or a type that derives (indirectly) from boost::(:link + 1 + + 0 + + -12 + + + 2 + :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link + 1 + + 0 + + -13 + + + 2 + :)<Tag1,T1>, that data is overwritten. !!!!Returns: x. (:include throws:) @@ -4858,7 +5458,27 @@ - 0 + 5 + 2 + !!!operator<<, tuple overload (:include synopsis:) !!!!Requirements: E must be boost::(:link + 1 + + 0 + + -12 + + + 2 + :), or a type that derives (indirectly) from boost::(:link + 1 + + 0 + + -12 + + + 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:) @@ -4869,135 +5489,36 @@ - 29 + 7 2 - !!!current_exception() (:include synopsis:) !!!!Requirements: The @@(:link + !!!get_error_info (:include synopsis:) !!!!Requirements: The type of the x object must derive from boost::(:link 1 0 - -16 + -12 2 - :)()@@ function must not be called outside of a @@catch@@ block. !!!!Returns: * An @@(:link + :); ErrorInfo must be an instance of the (:link 1 0 - -40 + -13 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 + :) 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 - -40 + -14 2 - :)@@ that refers to an instance of @@std::bad_alloc@@. !!!!Notes: * It is unspecified whether the return values of two successive calls to @@(:link - 1 - - 0 - - -16 - - - 2 - :)()@@ refer to the same exception object. * Correct implementation of @@(:link - 1 - - 0 - - -16 - - - 2 - :)()@@ may require compiler support, unless @@(:link - 1 - - 0 - - -30 - - - 2 - :)()@@ is used at the time the currently handled exception object was passed to @@throw@@. If @@(:link - 1 - - 0 - - -30 - - - 2 - :)()@@ is not used, and if the compiler does not provide the necessary support, then @@(:link - 1 - - 0 - - -16 - - - 2 - :)()@@ may return an @@(:link - 1 - - 0 - - -40 - - - 2 - :)@@ that refers to an instance of @@(:link - 1 - - 0 - - -32 - - - 2 - :)@@. In this case, if the original exception object derives from @@boost::(:link - 1 - - 0 - - -36 - - - 2 - :)@@, then the @@boost::(:link - 1 - - 0 - - -36 - - - 2 - :)@@ sub-object of the @@(:link - 1 - - 0 - - -32 - - - 2 - :)@@ object is initialized by the @@boost::(:link - 1 - - 0 - - -36 - - - 2 - :)@@ copy constructor. + |operator<<:) to store values in exception objects. !!!!Throws: Nothing. @@ -5010,34 +5531,34 @@ 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 + !!!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 - -36 + -12 2 - :)@@. The @@T@@ sub-object is initialized from @@x@@ by the @@T@@ copy constructor. If @@T@@ already derives from @@boost::(:link + :). The T sub-object is initialized from x by the T copy constructor. If T already derives from boost::(:link 1 0 - -36 + -12 2 - :)@@, then the type of the returned object does not derive @@boost::(:link + :), then the type of the returned object does not derive boost::(:link 1 0 - -36 + -12 2 - :)@@. !!!!Throws: Nothing. + :). !!!!Throws: Nothing. @@ -5050,34 +5571,34 @@ 7 2 - !!!get_error_info() (:include synopsis:) !!!!Requirements: The type of the @@x@@ object must derive from @@boost::(:link + !!!BOOST_ERROR_INFO (:include synopsis:) This macro is designed to be used with (:link 1 0 - -36 + -14 2 - :)@@; @@ErrorInfo@@ must be an instance of the @@(:link + |operator<<:) when throwing a boost::(:link 1 0 - -11 + -12 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 + :), to store information about the location of the throw statement. It can be chained with other (:link 1 0 - -35 + -13 2 - |operator<<:)()@@ to store values in exception objects. !!!!Throws: Nothing. + :)s in a single throw expression. @@ -5088,36 +5609,72 @@ - 7 + 15 2 - !!!exception::what() (:include decl:) !!!!Returns: An string representation of all data stored in the @@boost::(:link + !!!exception_ptr (:include synopsis:) The (:link 1 0 - -36 + -19 2 - :)@@ object by the @@(:link + :) 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 - -35 + -19 2 - |operator<<:)()@@ function. See "(:link + :)'s operations do not throw. Two instances of (:link 1 0 - -31 + -19 2 - :)" for details. !!!!Throws: Nothing. !!!!Note: The return value remains valid until the exception object from which it is obtained is destroyed or modified. + :) are equivalent and compare equal if and only if they refer to the same exception. The default constructor of (:link + 1 + + 0 + + -19 + + + 2 + :) produces the null value of the type. The null value is equivalent only to itself. !!!!Note: (:link + 1 + + 0 + + -19 + + + 2 + :) objects are returned by (:link + 1 + + 0 + + -21 + + + 2 + :) and (:link + 1 + + 0 + + -22 + + + 2 + :). @@ -5128,36 +5685,81 @@ - 7 + 17 2 - !!!exception constructors (:include decl:) !!!!Effects: * Default constructor: initializes an empty @@boost::(:link + !!!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 - -36 + -20 2 - :)@@ object. * Copy constructor: initializes a @@boost::(:link + :)(my_exception());@] Unless (:link 1 0 - -36 + -20 2 - :)@@ object which shares with @@x@@ all data added through @@(:link + :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link 1 0 - -35 + -21 2 - |operator<<:)()@@, including data that is added at a future time. !!!!Throws: Nothing. + :) may return an (:link + 1 + + 0 + + -19 + + + 2 + :) which refers to an instance of (:link + 1 + + 0 + + -5 + + + 2 + :). See (:link + 1 + + 0 + + -21 + + + 2 + :) for details. !!!!Note: Instead of using the throw keyword directly, it is preferable to call boost::(:link + 1 + + 0 + + -8 + + + 2 + :). This is guaranteed to throw an exception that derives from boost::(:link + 1 + + 0 + + -12 + + + 2 + :) and supports exception_ptr functionality. @@ -5168,18 +5770,135 @@ - 3 + 29 2 - !!!exception destructor (:include decl:) !!!!Effects: Frees all resources associated with a @@boost::(:link + !!!current_exception (:include synopsis:) !!!!Requirements: The (:link 1 0 - -36 + -21 2 - :)@@ object. !!!!Throws: Nothing. + :) function must not be called outside of a catch block. !!!!Returns: * An (:link + 1 + + 0 + + -19 + + + 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 + + -19 + + + 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 + + -21 + + + 2 + :) refer to the same exception object. * Correct implementation of (:link + 1 + + 0 + + -21 + + + 2 + :) may require compiler support, unless (:link + 1 + + 0 + + -20 + + + 2 + :) is used at the time the currently handled exception object was passed to throw. If (:link + 1 + + 0 + + -20 + + + 2 + :) is not used, and if the compiler does not provide the necessary support, then (:link + 1 + + 0 + + -21 + + + 2 + :) may return an (:link + 1 + + 0 + + -19 + + + 2 + :) that refers to an instance of (:link + 1 + + 0 + + -5 + + + 2 + :). In this case, if the original exception object derives from boost::(:link + 1 + + 0 + + -12 + + + 2 + :), then the boost::(:link + 1 + + 0 + + -12 + + + 2 + :) sub-object of the (:link + 1 + + 0 + + -5 + + + 2 + :) object is initialized by the boost::(:link + 1 + + 0 + + -12 + + + 2 + :) copy constructor. @@ -5190,7 +5909,18 @@ - 0 + 3 + 2 + !!!copy_exception (:include synopsis:) !!!!Effects: As if try { throw e; } catch( ... ) { return (:link + 1 + + 0 + + -21 + + + 2 + :)(); } @@ -5201,7 +5931,9 @@ - 0 + 1 + 2 + !!!rethrow_exception (:include synopsis:) !!!!Precondition: ep shall not be null. !!!!Throws: The exception to which ep refers. @@ -5212,7 +5944,27 @@ - 0 + 5 + 2 + !!!diagnostic_information (:include synopsis:) !!!!Returns: If dynamic_cast<boost::(:link + 1 + + 0 + + -12 + + + 2 + :) *>(&x) is not null, the returned string is initialized by a call to (:link + 1 + + 0 + + -38 + + + 2 + :); otherwise, the returned string combines the output of x.what() and typeid(x).name(). @@ -5222,6 +5974,123 @@ -25 + + 1 + 2 + !!boost/exception.hpp !!Synopsis (:include synopsis:) + + + + + 0 + + -33 + + + + 1 + 2 + !!boost/exception_ptr.hpp !!!Synopsis (:include synopsis:) + + + + + 0 + + -34 + + + + 1 + 2 + !!boost/throw_exception.hpp !!!Synopsis (:include synopsis:) + + + + + 0 + + -27 + + + + 1 + 2 + !!boost/exception/enable_current_exception.hpp !!!Synopsis (:include synopsis:) + + + + + 0 + + -28 + + + + 1 + 2 + !!boost/exception/enable_error_info.hpp !!!Synopsis (:include synopsis:) + + + + + 0 + + -31 + + + + 1 + 2 + !!boost/exception/info.hpp !!!Synopsis (:include synopsis:) + + + + + 0 + + -32 + + + + 1 + 2 + !!boost/exception/info_tuple.hpp !!!Synopsis (:include synopsis:) + + + + + 0 + + -29 + + + + 1 + 2 + !!boost/exception/error_info.hpp !!!Synopsis (:include synopsis:) + + + + + 0 + + -30 + + + + 1 + 2 + !!boost/exception/exception.hpp !!!Synopsis (:include synopsis:) + + + + + 0 + + -35 + + 0 @@ -5234,534 +6103,9 @@ - 9 + 1 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 - - -34 - - - 2 - :)> #include <(:link - 1 - - 0 - - -28 - - - 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 - - -36 - - - 2 - :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::(:link - 1 - - 0 - - -30 - - - 2 - :)(file_read_error()) << errno_info(errno); }@] - - - - - 0 - - -27 - - - - 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 - - -7 - - - 2 - :)> #include <errno.h> #include <iostream> typedef boost::(:link - 1 - - 0 - - -11 - - - 2 - :)<struct tag_errno,int> errno_info; //(1) class my_error: public boost::(:link - 1 - - 0 - - -36 - - - 2 - :), public std::exception { }; //(2) void f() { throw my_error() << errno_info(errno); //(3) } @] First, we instantiate the @@(:link - 1 - - 0 - - -11 - - - 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 - - -36 - - - 2 - :)@@. Finally, (3) illustrates how the @@typedef@@ from (1) can be used with @@(:link - 1 - - 0 - - -35 - - - 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 - - -18 - - - 2 - :)<errno_info>(x) ) std::cerr << "Error code: " << *err; } }@] The @@(:link - 1 - - 0 - - -18 - - - 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 - - -36 - - - 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 - - -28 - - - - 0 - - - - - 0 - - -29 - - - - 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 - - -36 - - - 2 - :)@@, and free the @@file_read()@@ function from the burden of storing the file name in exceptions it throws: [@#include <(:link - 1 - - 0 - - -7 - - - 2 - :)> #include <stdio.h> #include <errno.h> typedef boost::(:link - 1 - - 0 - - -11 - - - 2 - :)<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link - 1 - - 0 - - -36 - - - 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 - - -7 - - - 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> typedef boost::(:link - 1 - - 0 - - -11 - - - 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 - - -36 - - - 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 - - -36 - - - 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 - - -36 - - - 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 - - -18 - - - 2 - :)()@@. - - - - - 0 - - -30 - - - - 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 cloning support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link - 1 - - 0 - - -30 - - - 2 - :)(my_exception());@] Unless @@(:link - 1 - - 0 - - -30 - - - 2 - :)()@@ is called at the time an exception object is used in a throw-expression, an attempt to copy it using @@(:link - 1 - - 0 - - -16 - - - 2 - :)()@@ may return an @@(:link - 1 - - 0 - - -40 - - - 2 - :)@@ which refers to an instance of @@(:link - 1 - - 0 - - -32 - - - 2 - :)@@. See @@(:link - 1 - - 0 - - -16 - - - 2 - :)()@@ for details. !!!!Note: Instead of using the @@throw@@ keyword directly, it is preferable to call @@boost::(:link - 1 - - 0 - - -14 - - - 2 - :)()@@. This is guaranteed to throw an exception that derives from @@boost::(:link - 1 - - 0 - - -36 - - - 2 - :)@@ and supports cloning. - - - - - 0 - - -31 - - - - 21 - 2 - !!Logging of boost::exception Objects Class @@boost::(:link - 1 - - 0 - - -36 - - - 2 - :)@@ provides a virtual member function @@(:link - 1 - - 0 - - -19 - - - 2 - :::)()@@, with a signature identical 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 - - -7 - - - 2 - :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link - 1 - - 0 - - -36 - - - 2 - :). void g() { try { f(); } catch( boost::(:link - 1 - - 0 - - -36 - - - 2 - :) & e ) { std::cerr << e.(:link - 1 - - 0 - - -19 - - - 2 - :::)(); } }@] The @@(:link - 1 - - 0 - - -19 - - - 2 - :::)()@@ member function iterates over all data objects stored in the @@boost::(:link - 1 - - 0 - - -36 - - - 2 - :)@@ through @@(:link - 1 - - 0 - - -35 - - - 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 - - -11 - - - 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 - - -32 - - - - 5 - 2 - !!!unknown_exception (:include synopsis:) This type is used by the (:link - 1 - - 0 - - -8 - - - 2 - |cloning:) support in Boost Exception. Please see @@(:link - 1 - - 0 - - -16 - - - 2 - :)()@@. - - - - - 0 - - -33 - - - - 0 - - - - - 0 - - -34 - - - - 0 - - - - - 0 - - -35 - - - - 7 - 2 - !!!operator<<() (:include synopsis:) !!!!Requirements: @@E@@ must be @@boost::(:link - 1 - - 0 - - -36 - - - 2 - :)@@, or a type that derives (indirectly) from @@boost::(:link - 1 - - 0 - - -36 - - - 2 - :)@@. !!!!Effects: * The first overload stores a copy of @@v@@ into @@x@@. If @@x@@ already contains data of type @@(:link - 1 - - 0 - - -11 - - - 2 - :)<Tag1,T1>@@, that data is overwritten. * The @@boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)@@ overload is 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:) + !!boost/exception/diagnostic_information.hpp !!!Synopsis (:include synopsis:) @@ -5772,63 +6116,171 @@ - 13 + 37 2 - !!exception (:include synopsis:) Class @@boost::(:link + !!!Cloning and Re-throwing an Exception When you catch an exception, you can call (:link 1 0 - -36 + -21 2 - :)@@ is designed to be used as a universal base for user-defined exception types. An object of any type deriving from @@boost::(:link + :) to get an (:link 1 0 - -36 + -19 2 - :)@@ can store data of arbitrary types, using the @@ + :) object: [@#include <(:link 1 0 - -11 + -33 2 - @@ wrapper and @@(:link + :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link 1 0 - -35 + -12 2 - |operator<<:)()@@. To retrieve data from a @@boost::(:link + :)s void worker_thread( boost::(:link 1 0 - -36 + -19 2 - :)@@ object, use the @@(:link + :) & error ) { try { do_work(); error = boost::(:link 1 0 - -18 + -19 2 - :)()@@ function template. (:include members:) + :)(); } catch( ... ) { error = boost::(:link + 1 + + 0 + + -21 + + + 2 + :)(); } }@] In the above example, note that (:link + 1 + + 0 + + -21 + + + 2 + :) captures the original type of the exception object. The exception can be thrown again using the (:link + 1 + + 0 + + -23 + + + 2 + :) function: [@// ...continued void work() { boost::(:link + 1 + + 0 + + -19 + + + 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 + + -23 + + + 2 + :)(error); }@] Note that (:link + 1 + + 0 + + -21 + + + 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 + + -19 + + + 2 + :) points to an instance of std::bad_alloc, or * if (:link + 1 + + 0 + + -20 + + + 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 + + -19 + + + 2 + :) points to an instance of (:link + 1 + + 0 + + -5 + + + 2 + :). Regardless, the use of (:link + 1 + + 0 + + -21 + + + 2 + :) and (:link + 1 + + 0 + + -23 + + + 2 + :) in the above examples is well-formed. @@ -5839,7 +6291,18 @@ - 0 + 3 + 2 + !!!exception::~exception (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link + 1 + + 0 + + -12 + + + 2 + :) object. !!!!Throws: Nothing. @@ -5850,54 +6313,36 @@ - 11 + 7 2 - !!Transporting of Arbitrary Data to the Catch Site All exception types that derive from @@boost::(:link + !!!exception::diagnostic_information (:include decl:) !!!!Returns: An string representation of all data stored in the boost::(:link 1 0 - -36 + -12 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 classes. Data can be added to a @@boost::(:link + :) object by the (:link 1 0 - -36 + -14 2 - :)@@ at the time of the throw, or at a later time. (:include + |operator<<:) function. See "(:link 1 0 - -27 + -11 2 - :) (:include - 1 - - 0 - - -29 - - - 2 - :) (:include - 1 - - 0 - - -13 - - - 2 - :) + :)" for details. !!!!Throws: Nothing. !!!!Note: The return value remains valid until the exception object from which it is obtained is destroyed or modified. @@ -5908,36 +6353,63 @@ - 7 + 13 2 - !!!BOOST_ERROR_INFO (:include synopsis:) This macro is designed to be used with @@(:link + !!!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 - -35 + -27 2 - |operator<<:)()@@ when throwing a @@boost::(:link + :)> #include <(:link 1 0 - -36 + -31 2 - :)@@, to store information about the location of the throw statement. It can be chained with other @@(:link + :)> #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 - -11 + -12 2 - :)@@s in a single throw expression. + :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::(:link + 1 + + 0 + + -20 + + + 2 + :)(file_read_error()) << errno_info(errno); }@] Of course, + 1 + + 0 + + -20 + + + 2 + may be used with any exception type; there is no requirement that it should derive from boost:: + 1 + + 0 + + -12 + + + 2 + . @@ -5948,54 +6420,94 @@ - 15 + 7 2 - !!!exception_ptr (:include synopsis:) The @@(:link + !!!exception::exception (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link 1 0 - -40 + -12 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 + :) object. * Copy constructor: initializes a boost::(:link 1 0 - -40 + -12 2 - :)@@'s operations do not throw. Two instances of @@(:link + :) object which shares with x all data added through (:link 1 0 - -40 + -14 2 - :)@@ are equivalent and compare equal if and only if they refer to the same exception. The default constructor of @@(:link + |operator<<:), including data that is added at a future time. !!!!Throws: Nothing. + + + + + 0 + + -41 + + + + 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 - -40 + -32 2 - :)@@ produces the null value of the type. The null value is equivalent only to itself. !!!!Note: @@(:link + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link 1 0 - -40 + -13 2 - :)@@ objects are returned by @@(:link + :)<struct tag_file_name,std::string> file_name_info; typedef boost::(:link + 1 + + 0 + + -13 + + + 2 + :)<struct tag_function,char const *> function_info; typedef boost::(:link + 1 + + 0 + + -13 + + + 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 + + -12 + + + 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 @@ -6004,16 +6516,253 @@ 2 - :)()@@ and @@(:link + :). + + + + + 0 + + -42 + + + + 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 - -5 + -25 2 - :)()@@. + :)> #include <errno.h> #include <iostream> typedef boost::(:link + 1 + + 0 + + -13 + + + 2 + :)<struct tag_errno,int> errno_info; //(1) class my_error: public boost::(:link + 1 + + 0 + + -12 + + + 2 + :), public std::exception { }; //(2) void f() { throw my_error() << errno_info(errno); //(3) } @] First, we instantiate the (:link + 1 + + 0 + + -13 + + + 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 + + -12 + + + 2 + :). Finally, (3) illustrates how the typedef from (1) can be used with (:link + 1 + + 0 + + -14 + + + 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 + + -16 + + + 2 + :)<errno_info>(x) ) std::cerr << "Error code: " << *err; } }@] The (:link + 1 + + 0 + + -16 + + + 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 + + -12 + + + 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 + + -43 + + + + 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 + + -12 + + + 2 + :), and free the file_read function from the burden of storing the file name in exceptions it throws: [@#include <(:link + 1 + + 0 + + -25 + + + 2 + :)> #include <stdio.h> #include <errno.h> typedef boost::(:link + 1 + + 0 + + -13 + + + 2 + :)<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link + 1 + + 0 + + -12 + + + 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 + + -25 + + + 2 + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> typedef boost::(:link + 1 + + 0 + + -13 + + + 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 + + -12 + + + 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 + + -12 + + + 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 + + -12 + + + 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 + + -16 + + + 2 + :). + + + + + 0 + + -44 + + + + 9 + 2 + !!!exception::what (:include decl:) !!!!Returns: The default implementation is equivalent to return (:link + 1 + + 0 + + -38 + + + 2 + :)(). The signature of boost::(:link + 1 + + 0 + + -44 + + + 2 + :) is identical to the familiar std::exception::what function, so that when an exception type that derives both std::exception and boost::(:link + 1 + + 0 + + -12 + + + 2 + :) overrides the what function, it overrides both std::exception::what and boost::(:link + 1 + + 0 + + -44 + + + 2 + :). !!!!Throws: Nothing. !!!!Note: The return value remains valid until the exception object from which it is obtained is destroyed or modified. @@ -6023,13 +6772,13 @@ throws - 46 + 50 reno_layer - 36 + 40 0 @@ -6074,6 +6823,17 @@ 0 + + + 0 + + -12 + + + + 0 + + 0 @@ -6103,28 +6863,6 @@ -11 - - 3 - 2 - !!!!Throws: @@std::bad_alloc@@, or any other exception resulting from copying any of the arguments of @@(:link - 1 - - 0 - - -11 - - - 2 - :)()@@. - - - - - 0 - - -12 - - 0 @@ -6148,7 +6886,9 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. @@ -6159,7 +6899,9 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. @@ -6276,7 +7018,18 @@ 0 - -26 + -33 + + + + 0 + + + + + 0 + + -34 @@ -6305,28 +7058,6 @@ 0 - - - 0 - - -29 - - - - 0 - - - - - 0 - - -30 - - - - 0 - - 0 @@ -6353,7 +7084,7 @@ 0 - -33 + -29 @@ -6364,7 +7095,7 @@ 0 - -34 + -30 @@ -6379,9 +7110,18 @@ - 1 - 2 - !!!!Throws: @@std::bad_alloc@@, or any exception emitted by @@T1..TN@@ copy constructor. + 0 + + + + + 0 + + -26 + + + + 0 @@ -6439,6 +7179,50 @@ 0 + + + 0 + + -41 + + + + 0 + + + + + 0 + + -42 + + + + 0 + + + + + 0 + + -43 + + + + 0 + + + + + 0 + + -44 + + + + 0 + + @@ -6446,13 +7230,13 @@ members - 47 + 51 reno_layer - 36 + 40 0 @@ -6497,6 +7281,17 @@ 0 + + + 0 + + -12 + + + + 0 + + 0 @@ -6530,17 +7325,6 @@ 0 - - - 0 - - -12 - - - - 0 - - 0 @@ -6688,7 +7472,18 @@ 0 - -26 + -33 + + + + 0 + + + + + 0 + + -34 @@ -6717,28 +7512,6 @@ 0 - - - 0 - - -29 - - - - 0 - - - - - 0 - - -30 - - - - 0 - - 0 @@ -6765,7 +7538,7 @@ 0 - -33 + -29 @@ -6776,7 +7549,7 @@ 0 - -34 + -30 @@ -6794,6 +7567,17 @@ 0 + + + 0 + + -26 + + + + 0 + + 0 @@ -6802,36 +7586,7 @@ - 7 - 2 - (:include - 1 - - 0 - - -20 - - - 2 - :) (:include - 1 - - 0 - - -21 - - - 2 - :) (:include - 1 - - 0 - - -19 - - - 2 - :) + 0 @@ -6878,6 +7633,50 @@ 0 + + + 0 + + -41 + + + + 0 + + + + + 0 + + -42 + + + + 0 + + + + + 0 + + -43 + + + + 0 + + + + + 0 + + -44 + + + + 0 + + @@ -6885,13 +7684,13 @@ synopsis - 48 + 52 reno_layer - 36 + 40 0 @@ -6902,16 +7701,16 @@ 3 2 - @@#include <(:link + `#include <(:link 1 0 - -6 + -33 2 - :)>@@ [@namespace boost { (:include decl:) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -6944,7 +7743,40 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -34 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -12 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -30 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -6966,18 +7798,7 @@ - 3 - 2 - @@#include <(:link - 1 - - 0 - - -6 - - - 2 - :)>@@ [@namespace boost { (:include decl:) }@] + 0 @@ -6987,28 +7808,6 @@ -11 - - 3 - 2 - @@#include <(:link - 1 - - 0 - - -28 - - - 2 - :)>@@ [@namespace boost { (:include decl:) }@] - - - - - 0 - - -12 - - 0 @@ -7021,7 +7820,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -31 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7034,16 +7844,16 @@ 3 2 - @@#include <(:link + `#include <(:link 1 0 - -33 + -31 2 - :)>@@ [@namespace boost { (:include decl:) }@] + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7054,7 +7864,27 @@ - 0 + 5 + 2 + `#include <(:link + 1 + + 0 + + -32 + + + 2 + :)> [@namespace boost { (:include + 1 + + 0 + + -15 + + + 2 + decl pre_indent="4":) }@] @@ -7067,16 +7897,16 @@ 3 2 - @@#include <(:link + `#include <(:link 1 0 - -6 + -31 2 - :)>@@ [@namespace boost { (:include decl:) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7089,16 +7919,16 @@ 3 2 - @@#include <(:link + `#include <(:link 1 0 - -22 + -28 2 - :)>@@ [@namespace boost { (:include decl:) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7111,16 +7941,16 @@ 3 2 - @@#include <(:link + `#include <(:link 1 0 - -28 + -31 2 - :)>@@ [@namespace boost { (:include decl:) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7131,7 +7961,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -33 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7142,7 +7983,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -27 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7153,7 +8005,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -33 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7164,7 +8027,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -33 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7175,7 +8049,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -33 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7186,7 +8071,18 @@ - 0 + 3 + 2 + `#include < + 1 + + 0 + + -26 + + + 2 + > [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7196,6 +8092,222 @@ -25 + + 11 + 2 + [@#include <(:link + 1 + + 0 + + -31 + + + 2 + :)> #include <(:link + 1 + + 0 + + -32 + + + 2 + :)> #include < + 1 + + 0 + + -26 + + + 2 + > #include <(:link + 1 + + 0 + + -33 + + + 2 + :)> #include <(:link + 1 + + 0 + + -34 + + + 2 + :)>@] + + + + + 0 + + -33 + + + + 3 + 2 + [@#include < + 1 + + 0 + + -30 + + + 2 + > namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -34 + + + + 5 + 2 + [@#include <(:link + 1 + + 0 + + -27 + + + 2 + :)> #include <(:link + 1 + + 0 + + -28 + + + 2 + :)> #include <exception> namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -27 + + + + 3 + 2 + [@#include <(:link + 1 + + 0 + + -30 + + + 2 + :)> namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -28 + + + + 3 + 2 + [@#include < + 1 + + 0 + + -30 + + + 2 + > namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -31 + + + + 3 + 2 + [@#include <(:link + 1 + + 0 + + -30 + + + 2 + :)> #include <boost/current_function.hpp> #include <boost/shared_ptr.hpp> namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -32 + + + + 1 + 2 + [@#include <boost/tuple/tuple.hpp> namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -29 + + + + 1 + 2 + [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -30 + + + + 1 + 2 + [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -35 + + 0 @@ -7208,148 +8320,9 @@ - 0 - - - - - 0 - - -27 - - - - 0 - - - - - 0 - - -28 - - - - 0 - - - - - 0 - - -29 - - - - 0 - - - - - 0 - - -30 - - - - 3 + 1 2 - @@#include <(:link - 1 - - 0 - - -34 - - - 2 - :)>@@ [@namespace boost { (:include decl:) }@] - - - - - 0 - - -31 - - - - 0 - - - - - 0 - - -32 - - - - 3 - 2 - @@#include <(:link - 1 - - 0 - - -6 - - - 2 - :)>@@ [@namespace boost { (:include decl:) }@] - - - - - 0 - - -33 - - - - 0 - - - - - 0 - - -34 - - - - 0 - - - - - 0 - - -35 - - - - 5 - 2 - @@#include <(:link - 1 - - 0 - - -28 - - - 2 - :)>@@\\ @@#include <(:link - 1 - - 0 - - -23 - - - 2 - :)> [@namespace boost { (:include decl:) }@] + [@#include <exception> namespace boost { (:include decl pre_indent="4":) }@] @@ -7360,18 +8333,7 @@ - 3 - 2 - @@#include <(:link - 1 - - 0 - - -24 - - - 2 - :)>@@ [@namespace boost { (:include decl:) }@] + 0 @@ -7404,18 +8366,7 @@ - 3 - 2 - @@#include <(:link - 1 - - 0 - - -28 - - - 2 - :)>@@ [@namespace boost { (:include decl:) }@] + 0 @@ -7426,18 +8377,51 @@ - 3 - 2 - @@#include <(:link - 1 - - 0 - - -6 - - - 2 - :)>@@ [@namespace boost { (:include decl:) }@] + 0 + + + + + 0 + + -41 + + + + 0 + + + + + 0 + + -42 + + + + 0 + + + + + 0 + + -43 + + + + 0 + + + + + 0 + + -44 + + + + 0 @@ -7450,14 +8434,14 @@ - 49 + 53 reno_context_map - 36 + 40 -5 @@ -7470,6 +8454,9 @@ -8 + + -12 + -9 @@ -7479,9 +8466,6 @@ -11 - - -12 - -13 @@ -7522,7 +8506,10 @@ -25 - -26 + -33 + + + -34 -27 @@ -7530,12 +8517,6 @@ -28 - - -29 - - - -30 - -31 @@ -7543,14 +8524,17 @@ -32 - -33 + -29 - -34 + -30 -35 + + -26 + -36 @@ -7566,11 +8550,23 @@ -40 + + -41 + + + -42 + + + -43 + + + -44 + - 36 + 40 @@ -7585,7 +8581,7 @@ - -37 + -6 @@ -7602,7 +8598,7 @@ - -20 + -7 @@ -7619,7 +8615,7 @@ - -8 + -9 @@ -7636,24 +8632,31 @@ - -38 + -35 - 0 + 1 + CB567E3390BC92DA06F9899E700792C3790D3707C024CA21D15C930D908AD10A + 3422645546 + 5023 + 323 - 1 + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 - -15 + -33 @@ -7676,6 +8679,34 @@ 0 + + -36 + + + + + + + 2 + A7FCD03648AFFAA8F55075E82DC576D3B1C55D679898BCA9AC478C383EA87718 + 1461147844 + 3075 + 503 + 448283E535298648F5CDD43FF7441A0CF89C29AD31611615019EE8D418172E27 + 1566975658 + 2032 + 878 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + -12 @@ -7684,48 +8715,216 @@ - 1 - E64E4DFB1DC251F844260AE133EFD419677D0F7143D65B578DEE525492F6B624 - 2172131053 - 94 - 227 + 4 + A7FCD03648AFFAA8F55075E82DC576D3B1C55D679898BCA9AC478C383EA87718 + 1461147844 + 3075 + 503 + 448283E535298648F5CDD43FF7441A0CF89C29AD31611615019EE8D418172E27 + 1566975658 + 2032 + 878 + 85EE1980CFB24E054EDB1B3BDFA61FD4D65AD0EF248A1A42D4C2552700459327 + 2238151539 + 428 + 1031 + AD3F339F7126003907BCBDB3EF846FCACA895132E1100D202DA67D2B7846EE65 + 3032091776 + 60 + 369 0 - ../../../../boost/exception.hpp + ../../../../boost/exception/exception.hpp 0 0 - -7 + -37 - 1 - DFB8EFE8A4EE9FB101DC20A69A4217A96B78A272D7DE88D579CFE8ECCC070531 - 2228033283 - 94 - 227 + 3 + A7FCD03648AFFAA8F55075E82DC576D3B1C55D679898BCA9AC478C383EA87718 + 1461147844 + 3075 + 503 + 448283E535298648F5CDD43FF7441A0CF89C29AD31611615019EE8D418172E27 + 1566975658 + 2032 + 878 + BACD79DFB4C710C1A67687FC6344DF2251E2379613C2DF5B2729B2CD37E24EA3 + 458367129 + 154 + 363 0 - ../../../../boost/exception/enable_error_info.hpp + ../../../../boost/exception/exception.hpp 0 0 - -22 + -40 + + + + + + + 3 + A7FCD03648AFFAA8F55075E82DC576D3B1C55D679898BCA9AC478C383EA87718 + 1461147844 + 3075 + 503 + 448283E535298648F5CDD43FF7441A0CF89C29AD31611615019EE8D418172E27 + 1566975658 + 2032 + 878 + FC8AE1B9FA13A964C37467E84E2A128A76318654D90A6D87F1E4F8248F8940BA + 4233308735 + 156 + 183 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + -38 + + + + + + + 3 + A7FCD03648AFFAA8F55075E82DC576D3B1C55D679898BCA9AC478C383EA87718 + 1461147844 + 3075 + 503 + 448283E535298648F5CDD43FF7441A0CF89C29AD31611615019EE8D418172E27 + 1566975658 + 2032 + 878 + 18564D10CA94AF81046EA7A5EA591091CB0ED00B3ED10D47CC65A38BB54282C5 + 76816478 + 124 + 57 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + -44 + + + + + + + 2 + CD3F710B486176CA8D8ACA2F7616CF34AA2753963298A76144B6148F2B5ABA26 + 4080812830 + 6213 + 737 + F839AFD37DC086BB1231B8E87D8EEBD28129649A06FC685AC7DF65595871AE30 + 2291609923 + 1204 + 243 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + -13 + + + + + + + 2 + CD3F710B486176CA8D8ACA2F7616CF34AA2753963298A76144B6148F2B5ABA26 + 4080812830 + 6213 + 737 + 65D13C1BB0A16823F69A32BAB56A51CA317075C7FC8B7441EE0D9B57AF5AB2AC + 2592266329 + 712 + 1700 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + -16 + + + + + + + 2 + CD3F710B486176CA8D8ACA2F7616CF34AA2753963298A76144B6148F2B5ABA26 + 4080812830 + 6213 + 737 + 27AC1164E0A824D548386BEDCDC81DCAC283F3D286B0ECEE05B039BB8C392BFC + 1247954090 + 249 + 1449 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + -14 @@ -7749,7 +8948,7 @@ - -9 + -10 @@ -7773,7 +8972,7 @@ - -26 + -39 @@ -7801,7 +9000,7 @@ - -30 + -20 @@ -7809,107 +9008,27 @@ 2 - 427FFBF157B284A9FB0CF4FAEC4A9BB2ADA8AC6CB4F4C329FAE0FED649640E3E - 2573550761 - 6200 - 737 - 65D13C1BB0A16823F69A32BAB56A51CA317075C7FC8B7441EE0D9B57AF5AB2AC - 2592266329 - 712 - 1850 + 07430F64896197A110C276D8A14CA8A75FBA482DDF50CD40D689A1898C84D054 + 1712604289 + 1296 + 396 + BCCB91D0DCA6EC45F29CB70CB64AEA6AB54F32F8F1D1937C4CB80B059346DC81 + 695614553 + 1264 + 26 0 - ../../../../boost/exception/info.hpp + ../../../../boost/exception/info_tuple.hpp 0 0 - -18 - - - - - - - 2 - 427FFBF157B284A9FB0CF4FAEC4A9BB2ADA8AC6CB4F4C329FAE0FED649640E3E - 2573550761 - 6200 - 737 - 865A7E598C4F2EDA41CCDFAD253F5E4699012898C97E29E3CB1C68DABA0C62B1 - 2395321958 - 721 - 726 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - -11 - - - - - - - 2 - 427FFBF157B284A9FB0CF4FAEC4A9BB2ADA8AC6CB4F4C329FAE0FED649640E3E - 2573550761 - 6200 - 737 - 27AC1164E0A824D548386BEDCDC81DCAC283F3D286B0ECEE05B039BB8C392BFC - 1247954090 - 249 - 1599 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - -35 - - - - - - - 1 - 2C5F1B7E5C5052C9C9305848AB499A9C166D728EAAD25DC936B75FCA997A0650 - 3171555959 - 88 - 1 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - -33 + -15 @@ -7937,7 +9056,7 @@ - -5 + -22 @@ -7965,7 +9084,7 @@ - -32 + -5 @@ -7993,7 +9112,7 @@ - -16 + -21 @@ -8021,7 +9140,7 @@ - -10 + -23 @@ -8049,7 +9168,7 @@ - -40 + -19 @@ -8073,7 +9192,31 @@ - -39 + -18 + + + + + + + 1 + 48A0C42CCA66A6C935724A9B7BD30B6B3DF16A0A808C804A585A5CC90D85DC5E + 1606229033 + 1723 + 91 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + -34 @@ -8097,7 +9240,31 @@ - -34 + -27 + + + + + + + 1 + 429F0DE3599A4CC08B9458E2AECA2EAC202AB3471554FE82C307493805E6676E + 4224422781 + 401 + 323 + + + + + + 0 + ../../../../boost/exception.hpp + 0 + 0 + + + + -25 @@ -8105,95 +9272,55 @@ 2 - 49EA85868C2355F4F7ED6CF9D05FDC08547EF85F76913E1FDBBC96F8712C6C83 - 385672468 - 2694 - 503 - 041A9EA55D30804689CD4DEB864994D595EDF33378B25EA81DB5DA2CF402E542 - 1211481835 - 1683 - 846 + 8CFD9ACEF3312EA03496BC3C8274665972835B6FA5D5CEFAF9915D890F931195 + 3756482723 + 321 + 408 + C0753D41DBCBCA44DBF22990F7591F4B6C80C6AA58D9D81688C858D871157355 + 3548862587 + 289 + 26 0 - ../../../../boost/exception/exception.hpp + ../../../../boost/exception/diagnostic_information.hpp 0 0 - -36 + -24 - 4 - 49EA85868C2355F4F7ED6CF9D05FDC08547EF85F76913E1FDBBC96F8712C6C83 - 385672468 - 2694 - 503 - 041A9EA55D30804689CD4DEB864994D595EDF33378B25EA81DB5DA2CF402E542 - 1211481835 - 1683 - 846 - 85EE1980CFB24E054EDB1B3BDFA61FD4D65AD0EF248A1A42D4C2552700459327 - 2238151539 - 428 - 682 - AD3F339F7126003907BCBDB3EF846FCACA895132E1100D202DA67D2B7846EE65 - 3032091776 - 60 - 369 + 2 + 28A531BCBAD8FFAE7E4C677D03F80EEECB5FA6499394099BD0BD63C7FFE5CD96 + 624392859 + 2341 + 457 + 092F1DB4E7BC16F1A8471AE6ACF17318A002F34863C169FD159F74ED833442E3 + 2302636659 + 2309 + 26 0 - ../../../../boost/exception/exception.hpp + ../../../../boost/exception/enable_error_info.hpp 0 0 - -21 - - - - - - - 3 - 49EA85868C2355F4F7ED6CF9D05FDC08547EF85F76913E1FDBBC96F8712C6C83 - 385672468 - 2694 - 503 - 041A9EA55D30804689CD4DEB864994D595EDF33378B25EA81DB5DA2CF402E542 - 1211481835 - 1683 - 846 - 59711C7B9D807F0C41EF49B8AAC509CDB449D81C392B5FF5988DEDE47026E856 - 1948539350 - 445 - 57 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - -19 + -17 @@ -8221,35 +9348,7 @@ - -14 - - - - - - - 2 - E285EAA0D81E350113B888423C3FA5D2071F070FCA2759D99666EE07C0F8449F - 4208148208 - 2125 - 457 - ACC64445E8B6AAEF58395C0083BC0247CDE33AC00ED8DB9B7B4F216325DEE410 - 2943579912 - 400 - 1719 - - - - - - 0 - ../../../../boost/exception/enable_error_info.hpp - 0 - 0 - - - - -17 + -8 @@ -8257,23 +9356,23 @@ 1 - C9AFCA0931CB65AE31811E702FC48CB22348149B1D259CD9161D391FEC640FA8 - 2324436793 - 94 - 227 + 1B2485351B4AE4EF49CE30C98DB235C543D350E55A42F47A14BA200AC10B5FA0 + 3097066977 + 406 + 323 0 - ../../../../boost/exception/exception.hpp + ../../../../boost/exception/diagnostic_information.hpp 0 0 - -24 + -26 @@ -8281,47 +9380,23 @@ 1 - 40C2FBC8600FE6877A6D46EC005D97EB1F612B8687CCA297C838E10A80E089AA - 2576029551 - 94 - 227 + CAB4D823BD4720B71E1CA5BE482AC95B42A9E07CD5E08671EA23184635F281A2 + 3077708282 + 89 + 323 0 - ../../../../boost/exception_ptr.hpp + ../../../../boost/exception/error_info.hpp 0 0 - -6 - - - - - - - 1 - 5EE6ED209B5DBBD30DFCDA1FD30719A799EE9DBD48A5176F73EADB588CAEB2AA - 2442598207 - 94 - 227 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - -28 + -29 @@ -8345,7 +9420,7 @@ - -23 + -32 @@ -8353,23 +9428,23 @@ 1 - EB524A8A61E5F1A93CE4336B980696C09E7ADF42A6B933BA76EFB1544AB7C4CC - 2274957083 - 94 - 227 + A7775E23BFAA55F15935752060C841BC57BB5BEF2A227D789D327F326F1354C8 + 823044407 + 2475 + 323 0 - ../../../../boost/exception/error_info.hpp + ../../../../boost/exception/enable_error_info.hpp 0 0 - -25 + -28 @@ -8393,7 +9468,55 @@ - -29 + -43 + + + + + + + 1 + CE411E21EE9878B55B5906D033A0FC52574FB59D8A8CECB75405E9B1C9D782DB + 1173443713 + 308 + 302 + + + + + + 0 + ../../example/logging.cpp + 0 + 0 + + + + -11 + + + + + + + 1 + 6A180E68AF0079742E66F01E4A3A7D3377E90442C073DAFBC501EF38F4A6A7E9 + 1094752415 + 3255 + 323 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + -30 @@ -8417,7 +9540,7 @@ - -27 + -42 @@ -8441,7 +9564,7 @@ - -13 + -41 @@ -8449,17 +9572,17 @@ 1 - AEB5EEC1A44A4F0B184A6F73617CB57E82CE06A15DB6036D54109C66CDE06EFF - 625364235 - 290 - 302 + 3299EE83038AFF1989ABF199648564104BB7B01D87140BB8736FA641AE351DFF + 1085459966 + 6627 + 323 0 - ../../example/logging.cpp + ../../../../boost/exception/info.hpp 0 0 @@ -8475,14 +9598,14 @@ - 50 + 54 tag_index - 37 + 41 1 @@ -8496,7 +9619,7 @@ -5 - cloning,copy_exception,exception,free,function + exception_ptr,type,unknown_exception @@ -8505,7 +9628,7 @@ -6 - boost/exception_ptr.hpp,header + noindex @@ -8514,7 +9637,7 @@ -7 - boost/exception.hpp,exception,header + tutorial @@ -8523,34 +9646,7 @@ -8 - cloning,exception,noindex,tutorial - - - - 0 - - -9 - - - noindex,tutorial - - - - 0 - - -10 - - - cloning,exception,free,function,rethrow_exception - - - - 0 - - -11 - - - error_info,exception,free,function,template + free,function,throw_exception @@ -8559,7 +9655,34 @@ -12 - noalso,noindex,tutorial + exception,type + + + + 0 + + -9 + + + tutorial + + + + 0 + + -10 + + + tutorial + + + + 0 + + -11 + + + tutorial @@ -8568,7 +9691,7 @@ -13 - noalso,noindex,tutorial + error_info,free,type @@ -8577,7 +9700,7 @@ -14 - cloning,exception,free,function,template,throw_exception + error_info,free,function,operator<<,operator<</exception @@ -8586,7 +9709,7 @@ -15 - index,noindex + error_info,free,function,operator<<,operator<</tuple @@ -8595,7 +9718,7 @@ -16 - cloning,current_exception,exception,free,function + error_info,free,function,get_error_info @@ -8604,7 +9727,7 @@ -17 - enable_error_info,error_info,exception,free,function,template + enable_error_info,error_info,free,function @@ -8613,7 +9736,7 @@ -18 - error_info,exception,free,function,get_error_info,template + BOOST_ERROR_INFO,error_info,macro @@ -8622,7 +9745,7 @@ -19 - exception,exception::what,function,member,noalso + exception_ptr,type @@ -8631,7 +9754,7 @@ -20 - exception,exception::exception,function,member,noalso + enable_current_exception,exception_ptr,free,function @@ -8640,7 +9763,7 @@ -21 - exception,exception::~exception,function,member,noalso + current_exception,exception_ptr,free,function @@ -8649,7 +9772,7 @@ -22 - boost/exception/enable_error_info.hpp,exception,header + copy_exception,exception_ptr,free,function @@ -8658,7 +9781,7 @@ -23 - boost/exception/info_tuple.hpp,exception,header + exception_ptr,free,function,rethrow_exception @@ -8667,7 +9790,7 @@ -24 - boost/exception/exception.hpp,exception,header + diagnostic_information,free,function @@ -8676,70 +9799,7 @@ -25 - boost/exception/error_info.hpp,exception,header - - - - 0 - - -26 - - - noalso,noindex,tutorial - - - - 0 - - -27 - - - noalso,noindex,tutorial - - - - 0 - - -28 - - - boost/exception/info.hpp,exception,header - - - - 0 - - -29 - - - noalso,noindex,tutorial - - - - 0 - - -30 - - - cloning,enable_current_exception,exception,free,function,template - - - - 0 - - -31 - - - noindex,tutorial - - - - 0 - - -32 - - - cloning,exception,type,unknown_exception + boost/exception.hpp,header @@ -8748,7 +9808,7 @@ -33 - boost/throw_exception.hpp,header + boost/exception_ptr.hpp,exception_ptr,header @@ -8757,7 +9817,61 @@ -34 - boost/exception/enable_current_exception.hpp,exception,header + boost/throw_exception.hpp,header,throw_exception + + + + 0 + + -27 + + + boost/exception/enable_current_exception.hpp,enable_current_exception,exception_ptr,header + + + + 0 + + -28 + + + boost/exception/enable_error_info.hpp,enable_error_info,error_info,header + + + + 0 + + -31 + + + boost/exception/info.hpp,error_info,header,info + + + + 0 + + -32 + + + boost/exception/info_tuple.hpp,error_info,header,info_tuple + + + + 0 + + -29 + + + boost/exception/error_info.hpp,error_info,header + + + + 0 + + -30 + + + boost/exception/exception.hpp,exception,header @@ -8766,7 +9880,16 @@ -35 - error_info,exception,free,function,operator<</exception,template + index,noindex + + + + 0 + + -26 + + + boost/exception/diagnostic_information.hpp,diagnostic_information,header @@ -8775,7 +9898,7 @@ -36 - exception,type + noalso,noindex,tutorial @@ -8784,7 +9907,7 @@ -37 - exception,noindex + exception,exception::~exception,function,member @@ -8793,7 +9916,7 @@ -38 - error_info,exception,noindex,tutorial + diagnostic_information,exception,exception::diagnostic_information,function,member @@ -8802,7 +9925,7 @@ -39 - BOOST_ERROR_INFO,error_info,exception,macro + noalso,noindex,tutorial @@ -8811,7 +9934,43 @@ -40 - cloning,exception,exception_ptr,type + exception,exception::exception,function,member + + + + 0 + + -41 + + + noalso,noindex,tutorial + + + + 0 + + -42 + + + noalso,noindex,tutorial + + + + 0 + + -43 + + + noalso,noindex,tutorial + + + + 0 + + -44 + + + exception,exception::what,function,member diff --git a/doc/throw_exception.html b/doc/throw_exception.html index a45da04..853c8aa 100644 --- a/doc/throw_exception.html +++ b/doc/throw_exception.html @@ -19,28 +19,33 @@ -

                    throw_exception()

                    -

                    #include <boost/throw_exception.hpp>

                    +

                    throw_exception

                    +

                    #include <boost/throw_exception.hpp>

                    namespace
                     boost
                         {
                    -#ifdef BOOST_NO_EXCEPTIONS
                    +    #ifdef BOOST_NO_EXCEPTIONS
                    +    
                         void throw_exception( std::exception const & e ); // user defined
                    -#else
                    +    
                    +    #else
                    +    
                         template <class E>
                         void throw_exception( E const & e );
                    -#endif
                    +    
                    +    #endif
                         }

                    Requirements:

                    -

                    E must derive publicly from std::exception.

                    +

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

                    See also:

                    diff --git a/doc/throw_exception_hpp.html b/doc/throw_exception_hpp.html index dbdc0a1..0e0417a 100644 --- a/doc/throw_exception_hpp.html +++ b/doc/throw_exception_hpp.html @@ -19,9 +19,30 @@ -

                    boost/exception/throw_exception.hpp

                    -

                    This header file contains the following definitions/declarations:

                    -
                    throw_exception
                    +

                    boost/throw_exception.hpp

                    +

                    Synopsis

                    +
                    #include <boost/exception/enable_current_exception.hpp>
                    +#include <boost/exception/enable_error_info.hpp>
                    +#include <exception>
                    +
                    +namespace
                    +boost
                    +    {
                    +    #ifdef BOOST_NO_EXCEPTIONS
                    +    
                    +    void throw_exception( std::exception const & e ); // user defined
                    +    
                    +    #else
                    +    
                    +    template <class E>
                    +    void throw_exception( E const & e );
                    +    
                    +    #endif
                    +    }
                    +

                    See also:

                    + diff --git a/doc/logging.html b/doc/tutorial_diagnostic_information.html similarity index 54% rename from doc/logging.html rename to doc/tutorial_diagnostic_information.html index 15c8261..6d3d45c 100644 --- a/doc/logging.html +++ b/doc/tutorial_diagnostic_information.html @@ -3,7 +3,7 @@ - Tutorial: Logging of boost::exception Objects + Tutorial: Diagnostic Information @@ -19,8 +19,8 @@ -

                    Logging of boost::exception Objects

                    -

                    Class boost::exception provides a virtual member function what(), with a signature identical 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:

                    +

                    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>
                     
                    @@ -36,15 +36,16 @@ g()
                         catch(
                         boost::exception & e )
                             {
                    -        std::cerr << e.what();
                    +        std::cerr << e.diagnostic_information();
                             }
                         }
                    -

                    The what() 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.

                    -

                    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.

                    +

                    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.

                    +

                    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/using_enable_error_info.html b/doc/tutorial_enable_error_info.html similarity index 70% rename from doc/using_enable_error_info.html rename to doc/tutorial_enable_error_info.html index c1f9788..c966995 100644 --- a/doc/using_enable_error_info.html +++ b/doc/tutorial_enable_error_info.html @@ -20,7 +20,7 @@

                    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:

                    +

                    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:

                    #include <boost/exception.hpp>
                     #include <stdexcept>
                     
                    @@ -48,7 +48,7 @@ my_container
                             }
                         };
                     
                    -

                    Enable_error_info<T> returns 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 &, therefore 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.

                    +

                    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:

                    diff --git a/doc/cloning.html b/doc/tutorial_exception_ptr.html similarity index 64% rename from doc/cloning.html rename to doc/tutorial_exception_ptr.html index 3047475..26a7bec 100644 --- a/doc/cloning.html +++ b/doc/tutorial_exception_ptr.html @@ -20,10 +20,10 @@

                    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.

                    +

                    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

                    +

                    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

                    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>
                    @@ -41,8 +41,9 @@ file_read( FILE * f, void * buffer, size_t size )
                             throw boost::enable_current_exception(file_read_error()) <<
                                 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

                    -

                    When you catch a boost::exception, you can call current_exception() to get an exception_ptr object:

                    +

                    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>
                     #include <boost/bind.hpp>
                    @@ -63,7 +64,7 @@ worker_thread( boost::except
                             error = boost::current_exception();
                             }
                         }
                    -

                    In the above example, note that current_exception() captures the original type of the exception object. The exception can be thrown again using the rethrow_exception() function:

                    +

                    In the above example, note that current_exception captures the original type of the exception object. The exception can be thrown again using the rethrow_exception function:

                    // ...continued
                     
                     void
                    @@ -75,14 +76,12 @@ work()
                         if( error )
                             boost::rethrow_exception(error);
                         }
                    -

                    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.

                      +

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

                    See also:

                    diff --git a/doc/transporting_data.html b/doc/tutorial_transporting_data.html similarity index 56% rename from doc/transporting_data.html rename to doc/tutorial_transporting_data.html index df82f3b..e1bb3c3 100644 --- a/doc/transporting_data.html +++ b/doc/tutorial_transporting_data.html @@ -20,9 +20,9 @@

                    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 classes. Data can be added to a boost::exception at the time of the throw, or at a later time.

                    +

                    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

                    -

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

                    +

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

                    #include <boost/exception.hpp>
                     #include <errno.h>
                     #include <iostream>
                    @@ -37,10 +37,10 @@ f()
                         throw my_error() << errno_info(errno); //(3)
                         }
                     
                    -

                    First, we instantiate the error_info 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::exception.

                    -

                    Finally, (3) illustrates how the typedef from (1) can be used with 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:

                    +

                    First, we instantiate the error_info 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::exception.

                    +

                    Finally, (3) illustrates how the typedef from (1) can be used with 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
                    @@ -57,7 +57,7 @@ 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.

                    +

                    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

                    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>
                    @@ -91,9 +91,9 @@ 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::exception, and free the file_read() function from the burden of storing the file name in exceptions it throws:

                    +

                    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::exception, and free the file_read function from the burden of storing the file name in exceptions it throws:

                    #include <boost/exception.hpp>
                     #include <stdio.h>
                     #include <errno.h>
                    @@ -108,7 +108,7 @@ 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:

                    +

                    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 <boost/exception.hpp>
                     #include <boost/shared_ptr.hpp>
                     #include <stdio.h>
                    @@ -136,10 +136,10 @@ parse_file( char const * 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::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().

                    +

                    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

                    -

                    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:

                    +

                    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>
                     #include <stdio.h>
                    @@ -163,10 +163,10 @@ file_open( char const * name, char const * mode )
                                 file_name_info(name) <<
                                 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().

                    +

                    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 aed3b2a..74f3ffb 100644 --- a/doc/unknown_exception.html +++ b/doc/unknown_exception.html @@ -20,21 +20,22 @@

                    unknown_exception

                    -

                    #include <boost/exception_ptr.hpp>

                    +

                    #include <boost/exception_ptr.hpp>

                    namespace
                     boost
                         {
                         class
                         unknown_exception:
                             public std::exception
                    -        public boost::exception
                    +        public boost::exception
                             {
                             ---unspecified---
                             };
                         }
                    -

                    This type is used by the cloning support in Boost Exception. Please see current_exception().

                    +

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

                    See also:

                    diff --git a/example/example_io.cpp b/example/example_io.cpp index 2fb0dd4..3777e9a 100644 --- a/example/example_io.cpp +++ b/example/example_io.cpp @@ -41,7 +41,7 @@ error: //Base for all exception objects we throw. char const * what() const throw() { - return boost::exception::what(); + return boost::exception::diagnostic_information(); } protected: @@ -169,8 +169,8 @@ dump_all_info( boost::exception const & x ) dump_copy_info(x); dump_file_info(x); dump_clib_info(x); - std::cout << "\nOutput from what():\n"; - std::cout << x.what(); + std::cout << "\nOutput from diagnostic_information():\n"; + std::cout << x.diagnostic_information(); } int diff --git a/example/logging.cpp b/example/logging.cpp index dd81922..41295b5 100644 --- a/example/logging.cpp +++ b/example/logging.cpp @@ -20,6 +20,6 @@ g() catch( boost::exception & e ) { - std::cerr << e.what(); + std::cerr << e.diagnostic_information(); } } diff --git a/include/boost/exception/detail/object_hex_dump.hpp b/include/boost/exception/detail/object_hex_dump.hpp new file mode 100644 index 0000000..b1cba64 --- /dev/null +++ b/include/boost/exception/detail/object_hex_dump.hpp @@ -0,0 +1,39 @@ +//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef UUID_6F463AC838DF11DDA3E6909F56D89593 +#define UUID_6F463AC838DF11DDA3E6909F56D89593 + +#include +#include +#include +#include +#include + +namespace +boost + { + namespace + exception_detail + { + template + std::string + object_hex_dump( T const & x, size_t max_size=16 ) + { + std::ostringstream s; + s << "type: " << typeid(x).name() << ", size: " << sizeof(T) << ", dump: "; + size_t n=sizeof(T)>max_size?max_size:sizeof(T); + s.fill('0'); + s.width(2); + unsigned char const * b=reinterpret_cast(&x); + s << std::setw(2) << std::hex << (unsigned int)*b; + for( unsigned char const * e=b+n; ++b!=e; ) + s << " " << std::setw(2) << std::hex << (unsigned int)*b; + return s.str(); + } + } + } + +#endif diff --git a/include/boost/exception/diagnostic_information.hpp b/include/boost/exception/diagnostic_information.hpp new file mode 100644 index 0000000..a456577 --- /dev/null +++ b/include/boost/exception/diagnostic_information.hpp @@ -0,0 +1,27 @@ +//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef UUID_0552D49838DD11DD90146B8956D89593 +#define UUID_0552D49838DD11DD90146B8956D89593 + +#include +#include +#include + +namespace +boost + { + inline + std::string + diagnostic_information( std::exception const & x ) + { + if( exception const * be = dynamic_cast(&x) ) + return be->diagnostic_information(); + else + return std::string("[ what: ") + x.what() + ", type: " + typeid(x).name() + " ]"; + } + } + +#endif diff --git a/include/boost/exception/enable_current_exception.hpp b/include/boost/exception/enable_current_exception.hpp index 3db0b4d..12a200c 100644 --- a/include/boost/exception/enable_current_exception.hpp +++ b/include/boost/exception/enable_current_exception.hpp @@ -92,7 +92,7 @@ boost count_(0) { if( boost::exception * be1=dynamic_cast(this) ) - if( boost::exception const * be2=dynamic_cast(&x) ) + if( boost::exception const * be2=dynamic_cast(&x) ) *be1 = *be2; } diff --git a/include/boost/exception/enable_error_info.hpp b/include/boost/exception/enable_error_info.hpp index daf8aac..c57d34b 100644 --- a/include/boost/exception/enable_error_info.hpp +++ b/include/boost/exception/enable_error_info.hpp @@ -32,6 +32,18 @@ boost ~error_info_injector() throw() { } + + char const * + what() const throw() + { + return T::what(); + } + + char const * + diagnostic_information() const throw() + { + return exception::_diagnostic_information(T::what()); + } }; struct large_size { char c[256]; }; diff --git a/include/boost/exception/exception.hpp b/include/boost/exception/exception.hpp index 4129833..c8a7e72 100644 --- a/include/boost/exception/exception.hpp +++ b/include/boost/exception/exception.hpp @@ -27,7 +27,7 @@ boost error_info_container: public exception_detail::counted_base { - virtual char const * what( std::type_info const & ) const = 0; + virtual char const * diagnostic_information( char const *, std::type_info const & ) const = 0; virtual shared_ptr get( std::type_info const & ) const = 0; virtual void set( shared_ptr const & ) = 0; }; @@ -51,17 +51,14 @@ boost char const * what() const throw() { - if( data_ ) - try - { - char const * w = data_->what(typeid(*this)); - BOOST_ASSERT(0!=w); - return w; - } - catch(...) - { - } - return typeid(*this).name(); + return diagnostic_information(); + } + + virtual + char const * + diagnostic_information() const throw() + { + return _diagnostic_information(0); } protected: @@ -75,6 +72,22 @@ boost { } + char const * + _diagnostic_information( char const * std_what ) const throw() + { + if( data_ ) + try + { + char const * w = data_->diagnostic_information(std_what,typeid(*this)); + BOOST_ASSERT(0!=w); + return w; + } + catch(...) + { + } + return std_what ? std_what : typeid(*this).name(); + } + #if BOOST_WORKAROUND( BOOST_MSVC, BOOST_TESTED_AT(1500) ) //Force class exception to be abstract. //Otherwise, MSVC bug allows throw exception(), even though the copy constructor is protected. diff --git a/include/boost/exception/info.hpp b/include/boost/exception/info.hpp index 2ce8ba8..fa35e37 100644 --- a/include/boost/exception/info.hpp +++ b/include/boost/exception/info.hpp @@ -85,13 +85,6 @@ virtual //Disable bogus GCC warning. value_type const value_; }; - template - struct - error_info_type - { - typedef typename ErrorInfo::value_type value_type; - }; - template E const & operator<<( E const & x, error_info const & v ) @@ -155,11 +148,18 @@ virtual //Disable bogus GCC warning. } char const * - what( std::type_info const & exception_type ) const + diagnostic_information( char const * std_what, std::type_info const & exception_type ) const { if( what_.empty() ) { - std::string tmp(exception_type.name()); + std::string tmp; + if( std_what ) + { + tmp += std_what; + tmp += '\n'; + } + tmp += "Dynamic exception type: "; + tmp += exception_type.name(); tmp += '\n'; for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i ) { diff --git a/include/boost/exception/to_string.hpp b/include/boost/exception/to_string.hpp index 784c7fa..844dc97 100644 --- a/include/boost/exception/to_string.hpp +++ b/include/boost/exception/to_string.hpp @@ -53,6 +53,20 @@ boost { enum e { value=to_string_detail::has_to_string_impl::value>::value }; }; + + template + std::string + to_string( std::pair const & x ) + { + return std::string("(") + to_string(x.first) + ',' + to_string(x.second) + ')'; + } + + inline + std::string + to_string( std::exception const & x ) + { + return x.what(); + } } #endif diff --git a/include/boost/exception/to_string_stub.hpp b/include/boost/exception/to_string_stub.hpp index bfe330d..adc553c 100644 --- a/include/boost/exception/to_string_stub.hpp +++ b/include/boost/exception/to_string_stub.hpp @@ -7,9 +7,8 @@ #define UUID_E788439ED9F011DCB181F25B55D89593 #include -#include -#include -#include +#include +#include namespace boost @@ -41,6 +40,23 @@ boost { return s(x); } + + template + static + std::string + convert( T const & x, std::string s ) + { + return s; + } + + template + static + std::string + convert( T const & x, char const * s ) + { + BOOST_ASSERT(s!=0); + return s; + } }; namespace @@ -58,15 +74,7 @@ boost std::string string_stub_dump( T const & x ) { - std::ostringstream s; - s << "[ type: " << typeid(x).name() << ", size: " << sizeof(T) << ", dump: "; - size_t n=sizeof(T)>16?16:sizeof(T); - s.fill('0'); - s.width(2); - for( unsigned char const * b=reinterpret_cast(&x),* e=b+n; b!=e; ++b ) - s << std::setw(2) << std::hex << (unsigned int)*b << " "; - s << "]"; - return s.str(); + return "[ " + exception_detail::object_hex_dump(x) + " ]"; } } @@ -83,13 +91,6 @@ boost { return exception_detail::to_string_dispatch::dispatch(x,s); } - - template - std::string - to_string( std::pair const & x ) - { - return std::string("(") + to_string(x.first) + ',' + to_string(x.second) + ')'; - } } #endif diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index c56991a..f532e3e 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -7,7 +7,10 @@ import testing ; +project : requirements on ; + #to_string + run is_output_streamable_test.cpp ; run has_to_string_test.cpp ; run to_string_test.cpp ; @@ -15,6 +18,7 @@ run to_string_stub_test.cpp ; compile-fail to_string_fail.cpp ; #exception + run cloning_test.cpp ; run copy_exception_test.cpp ; run unknown_exception_test.cpp ; @@ -24,11 +28,15 @@ run enable_error_info_test.cpp helper1.cpp ; run throw_exception_test.cpp helper2.cpp ; run errno_test.cpp ; run error_info_test.cpp ; +run diagnostic_information_test.cpp ; run what_test.cpp ; compile-fail exception_fail.cpp ; compile-fail throw_exception_fail.cpp ; #headers + +compile exception_ptr_hpp_test.cpp ; +compile diagnostic_information_hpp_test.cpp ; compile enable_current_exception_hpp_test.cpp ; compile enable_error_info_hpp_test.cpp ; compile error_info_hpp_test.cpp ; diff --git a/test/diagnostic_information_hpp_test.cpp b/test/diagnostic_information_hpp_test.cpp new file mode 100644 index 0000000..e7381db --- /dev/null +++ b/test/diagnostic_information_hpp_test.cpp @@ -0,0 +1,6 @@ +//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include diff --git a/test/diagnostic_information_test.cpp b/test/diagnostic_information_test.cpp new file mode 100644 index 0000000..873f835 --- /dev/null +++ b/test/diagnostic_information_test.cpp @@ -0,0 +1,80 @@ +//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include + +typedef boost::error_info tag_int; + +struct +error1: + public std::exception + { + char const * + what() const throw() + { + return "error1"; + } + }; + +struct +error2: + public std::exception, + public boost::exception + { + char const * + what() const throw() + { + return "error2"; + } + }; + +struct +error3: + public boost::exception + { + }; + +std::string +get_diagnostic_information( std::exception const & x ) + { + return boost::diagnostic_information(x); + } + +std::string +get_what( std::exception const & x ) + { + return x.what(); + } + +int +main() + { + using namespace boost; + { + error1 x; + BOOST_TEST(get_what(x)=="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(get_what(x)=="error2"); + std::string di=get_diagnostic_information(x); + BOOST_TEST(di.find("type:")!=std::string::npos); + BOOST_TEST(di.find("error2")!=std::string::npos); + } + { + error3 x; + x << tag_int(1); + std::string w1 = x.diagnostic_information(); + x << tag_int(2); + std::string w2 = x.diagnostic_information(); + BOOST_TEST( w1!=w2 ); + } + return boost::report_errors(); + } diff --git a/test/enable_error_info_test.cpp b/test/enable_error_info_test.cpp index d9b7076..eaa34ff 100644 --- a/test/enable_error_info_test.cpp +++ b/test/enable_error_info_test.cpp @@ -5,6 +5,7 @@ #include "helper1.hpp" #include +#include #include namespace @@ -24,6 +25,11 @@ namespace x << test_int(42); throw; } + catch( + ... ) + { + BOOST_TEST(false); + } } } @@ -39,6 +45,8 @@ main() std::exception & x ) { BOOST_TEST( 42==*boost::get_error_info(x) ); + BOOST_TEST( std::string(x.what())==std::string("exception test length error") ); + BOOST_TEST( std::string(x.what())!=std::string(boost::diagnostic_information(x)) ); } catch( ... ) diff --git a/test/error_info_test.cpp b/test/error_info_test.cpp index 988975d..c61609a 100644 --- a/test/error_info_test.cpp +++ b/test/error_info_test.cpp @@ -18,7 +18,7 @@ typedef boost::error_info test_6; struct test_exception: - public boost::exception + boost::exception { }; @@ -110,6 +110,11 @@ test_empty() BOOST_TEST( dynamic_cast(&x) ); BOOST_TEST( !boost::get_error_info(x) ); } + catch( + ... ) + { + BOOST_TEST(false); + } try { @@ -121,6 +126,11 @@ test_empty() { BOOST_TEST( dynamic_cast(&x) ); } + catch( + ... ) + { + BOOST_TEST(false); + } } void @@ -136,6 +146,12 @@ test_basic_throw_catch() { BOOST_TEST(*boost::get_error_info(x)==std::string("test")); } + catch( + ... ) + { + BOOST_TEST(false); + } + try { throw_test_2(); @@ -146,6 +162,11 @@ test_basic_throw_catch() { BOOST_TEST(boost::get_error_info(x)); } + catch( + ... ) + { + BOOST_TEST(false); + } } void @@ -161,6 +182,11 @@ test_catch_add_info() { BOOST_TEST(*boost::get_error_info(x)==std::string("test")); } + catch( + ... ) + { + BOOST_TEST(false); + } } void @@ -179,6 +205,11 @@ test_add_tuple() BOOST_TEST( *boost::get_error_info(x)==42 ); BOOST_TEST( *boost::get_error_info(x)==42u ); } + catch( + ... ) + { + BOOST_TEST(false); + } try { throw test_exception() << test_123(42,42u,42.0f); @@ -190,6 +221,11 @@ test_add_tuple() BOOST_TEST( *boost::get_error_info(x)==42u ); BOOST_TEST( *boost::get_error_info(x)==42.0f ); } + catch( + ... ) + { + BOOST_TEST(false); + } try { throw test_exception() << test_1235(42,42u,42.0f,std::string("42")); @@ -202,6 +238,11 @@ test_add_tuple() BOOST_TEST( *boost::get_error_info(x)==42.0f ); BOOST_TEST( *boost::get_error_info(x)=="42" ); } + catch( + ... ) + { + BOOST_TEST(false); + } } int diff --git a/test/exception_ptr_hpp_test.cpp b/test/exception_ptr_hpp_test.cpp new file mode 100644 index 0000000..a671147 --- /dev/null +++ b/test/exception_ptr_hpp_test.cpp @@ -0,0 +1,6 @@ +//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include diff --git a/test/helper1.cpp b/test/helper1.cpp index 3f2d214..cfd734b 100644 --- a/test/helper1.cpp +++ b/test/helper1.cpp @@ -16,7 +16,7 @@ boost void throw_length_error() { - throw enable_error_info( std::length_error("my length error") ); + throw enable_error_info( std::length_error("exception test length error") ); } } } diff --git a/test/unknown_exception_test.cpp b/test/unknown_exception_test.cpp index bccf3a6..e493e90 100644 --- a/test/unknown_exception_test.cpp +++ b/test/unknown_exception_test.cpp @@ -50,7 +50,10 @@ main() catch( boost::unknown_exception & x ) { - BOOST_TEST( 42==*boost::get_error_info(x) ); + if( boost::shared_ptr d=boost::get_error_info(x) ) + BOOST_TEST( 42==*d ); + else + BOOST_TEST(false); } catch( ... ) @@ -64,7 +67,10 @@ main() catch( boost::exception & x ) { - BOOST_TEST( 42==*boost::get_error_info(x) ); + if( boost::shared_ptr d=boost::get_error_info(x) ) + BOOST_TEST( 42==*d ); + else + BOOST_TEST(false); } catch( ... ) diff --git a/test/what_test.cpp b/test/what_test.cpp index 84fbd3d..cc7021a 100644 --- a/test/what_test.cpp +++ b/test/what_test.cpp @@ -3,25 +3,30 @@ //Distributed under the Boost Software License, Version 1.0. (See accompanying //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include +#include +#include +#include #include -typedef boost::error_info test; - -class -my_exception: - public boost::exception +struct +test_exception: + std::exception, + boost::exception { + char const * + what() const throw() + { + return "test_exception"; + } }; int main() { - my_exception x; - x << test(1); - std::string w1 = x.what(); - x << test(2); - std::string w2 = x.what(); - BOOST_TEST( w1!=w2 ); + test_exception x; + std::exception & sx(x); + boost::exception & bx(x); + BOOST_TEST(std::string(sx.what())=="test_exception"); + BOOST_TEST(std::string(bx.what())=="test_exception"); return boost::report_errors(); }