diff --git a/doc/BOOST_THROW_EXCEPTION.html b/doc/BOOST_THROW_EXCEPTION.html index d56d97e..bf355d7 100644 --- a/doc/BOOST_THROW_EXCEPTION.html +++ b/doc/BOOST_THROW_EXCEPTION.html @@ -22,7 +22,7 @@

BOOST_THROW_EXCEPTION

#include <boost/throw_exception.hpp>

-
#if !defined( BOOST_NO_EXCEPTIONS ) && !defined( BOOST_EXCEPTION_DISABLE )
+
#if !defined( BOOST_EXCEPTION_DISABLE )
     #include <boost/exception/exception.hpp>
     #include <boost/current_function.hpp>
     #define BOOST_THROW_EXCEPTION(x)\
@@ -34,10 +34,13 @@
     #define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x)
 #endif

This macro takes an exception object, records BOOST_CURRENT_FUNCTION, __FILE__ and __LINE__ in it, and forwards it to throw_exception. To recover this information at the catch site, use get_error_info; the information is also included in the message returned by diagnostic_information.

-
Boost Exception
+

+

See Also:

+
+
diff --git a/doc/boost-exception.html b/doc/boost-exception.html index 899e5f5..93e5dfb 100644 --- a/doc/boost-exception.html +++ b/doc/boost-exception.html @@ -19,7 +19,7 @@ -

Introduction

+

Introduction

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

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

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

@@ -27,14 +27,18 @@

Contents

  1. Motivation
  2. Tutorial
  3. Documentation
    1. Class exception
    2. +
    3. Throwing Exceptions +
    4. Transporting of Arbitrary Data to the Catch Site
    5. -
    6. diagnostic_information
    7. -
    8. throw_exception, BOOST_THROW_EXCEPTION
    9. -
    10. Configuration Macros
    11. -
    12. Headers +
    13. +
    14. API
    15. Frequently Asked Questions
    16. -
    17. Index
    18. +
    19. Page Index
    -

    Synopsis

    -

    #include <boost/exception.hpp>

    -
    namespace
    -boost
    -    {
    -    class
    -    exception
    -        {
    -        protected:
    -    
    -        exception();
    -        exception( exception const & x );    
    -        ~exception();    
    -        };    
    -    
    -    template <class Tag,class T>
    -    class error_info;    
    -    
    -    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;
    -
    -    template <class Tag,class T>
    -    class
    -    error_info
    -        {
    -        public:
    -    
    -        typedef T value_type;    
    -    
    -        error_info( value_type const & v );    
    -        value_type const & value() const;    
    -        };    
    -    
    -    template <class E, class Tag, class T>
    -    E const & operator<<( E const & x, error_info<Tag,T> 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 T>
    -    ---unspecified--- enable_error_info( T const & x );
    -
    -    std::string diagnostic_information( boost::exception const & );
    -
    -    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 );
    -
    -    template <class T>
    -    ---unspecified--- enable_current_exception( T const & e );
    -    }
    -

    #include <boost/throw_exception.hpp>

    -
    #if !defined( BOOST_NO_EXCEPTIONS ) && !defined( BOOST_EXCEPTION_DISABLE )
    -    #include <boost/exception/exception.hpp>
    -    #include <boost/current_function.hpp>
    -    #define BOOST_THROW_EXCEPTION(x)\
    -        ::boost::throw_exception( ::boost::enable_error_info(x) <<\
    -        ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\
    -        ::boost::throw_file(__FILE__) <<\
    -        ::boost::throw_line((int)__LINE__) )
    -#else
    -    #define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x)
    -#endif
    -
    -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
    -    }
    -

    Class exception

    -

    exception

    -
    -

    #include <boost/exception/exception.hpp>

    -
    namespace
    -boost
    -    {
    -    class
    -    exception
    -        {
    -        protected:
    -    
    -        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.

    -

    Transporting of Arbitrary Data to the Catch Site

    -

    error_info

    -
    -

    #include <boost/exception/info.hpp>

    -
    namespace
    -boost
    -    {
    -    template <class Tag,class T>
    -    class
    -    error_info
    -        {
    -        public:
    -    
    -        typedef T value_type;    
    -    
    -        error_info( value_type const & v );    
    -        value_type const & value() const;    
    -        };
    -    }
    -

    Requirements:

    -

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

    -

    Description:

    -

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

    -

    Usage:

    -

    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, for example:

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

    Or, the shorter equivalent:

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

    This errno_info typedef can be passed to operator<< (#include <boost/exception/info.hpp> first) to store an int named tag_errno in exceptions of types that derive from boost::exception:

    -
    throw file_read_error() << errno_info(errno);
    -

    It can also be passed to get_error_info (#include <boost/exception/get_error_info.hpp> first) to retrieve the tag_errno int from a boost::exception:

    -
    catch( boost::exception & x )
    -    {
    -    if( boost::shared_ptr<int const> e=boost::get_error_info<errno_info>(x) )
    -        ....
    -    }
    -

    exception/operator<<

    -
    -

    #include <boost/exception/info.hpp> 

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

    Requirements:

    -

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

    -

    Effects:

    -

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

    -

    Returns:

    -

    x.

    -

    Throws:

    -

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

    -

    tuple/operator<<

    -
    -

    #include <boost/exception/info_tuple.hpp>

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

    Requirements:

    -

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

    -

    Effects:

    -

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

    -

    Returns:

    -

    x.

    -

    Throws:

    -

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

    -

    get_error_info

    -
    -

    #include <boost/exception/get_error_info.hpp>

    -
    namespace
    -boost
    -    {
    -    template <class ErrorInfo,class E>
    -    shared_ptr<typename ErrorInfo::value_type const> get_error_info( E const & x );
    -    }
    -

    Requirements:

    -
    • ErrorInfo must be an instance of the error_info template.
    • -
    • E must be polymorphic.
    • -
    • The get_error_info function must not be called outside of a catch block.
    • -
    -

    Returns:

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

    Throws:

    -

    Nothing.

    -

    Note:

    -

    The interface of get_error_info may be affected by the build configuration macros.

    -

    enable_error_info

    -
    -

    #include <boost/exception/enable_error_info.hpp>

    -
    namespace
    -boost
    -    {
    -    template <class T>
    -    ---unspecified--- enable_error_info( T const & x );
    -    }
    -

    Requirements:

    -

    T must be a class with an accessible no-throw copy constructor as per (15.5.1).

    -

    Returns:

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

    Throws:

    -

    Nothing.

    -

    Transporting of Exceptions between Threads

    -

    exception_ptr

    -
    -

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

    -

    Thread safety

    -
    • It is legal for multiple threads to hold exception_ptr references to the same exception object.
    • -
    • It is illegal for multiple threads to modify the same exception_ptr object concurrently.
    • -
    • While calling current_exception makes a copy of the current exception object, it is still possible for the two copies to share internal state. Therefore, in general it is not safe to call rethrow_exception concurrently to throw the same exception object into multiple threads.
    • -
    -

    enable_current_exception

    -
    -

    #include <boost/exception/enable_current_exception.hpp>

    -
    namespace
    -boost
    -    {
    -    template <class T>
    -    ---unspecified--- enable_current_exception( T const & e );
    -    }
    -

    Requirements:

    -

    T must be a class with 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::enable_current_exception(my_exception());
    -

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

    -

    Note:

    -

    Instead of using the throw keyword directly, it is preferable to call boost::throw_exception. This is guaranteed to throw an exception that derives from boost::exception and supports the 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.

    -

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

    Throws:

    -

    Nothing.

    -

    Notes:

    -
    -

    copy_exception

    -
    -

    #include <boost/exception_ptr.hpp>

    -
    namespace
    -boost
    -    {
    -    template <class T>
    -    exception_ptr copy_exception( T const & e );
    -    }
    -

    Effects:

    -

    As if

    -
    try
    -    {
    -    throw enable_current_exception(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.

    -

    Throws:

    -

    The exception to which ep refers.

    -

    unknown_exception

    -
    -

    #include <boost/exception_ptr.hpp>

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

    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
    -    {
    -    std::string diagnostic_information( boost::exception const & );
    -    }
    -

    Returns:

    -

    This function returns a string value that is automatically composed from the string representations of all error_info objects stored in a boost::exception through operator<<, along with other diagnostic information relevant to the exception.

    -

    The string representation of each error_info object is deduced by a function call that is bound at the time the error_info<Tag,T> template is instantiated. The following overload resolutions are attempted in order:

    -
    1. Unqualified call to to_string(x), where x is of type error_info<Tag,T> (the return value is expected to be of type std::string.)
    2. -
    3. Unqualified call to to_string(x.value()) (the return value is expected to be of type std::string.)
    4. -
    5. Unqualified call to s << x.value(), where s is a std::ostringstream.
    6. -
    -

    The first successfully bound function is used at the time diagnostic_information is called; if all 3 overload resolutions are unsuccessful, the system is unable to convert the error_info object to string, and an unspecified stub string value is used without issuing a compile error.

    -

    Notes:

    -
    • The format of the returned string is unspecified.
    • -
    • The returned string is not user-friendly.
    • -
    • If dynamic_cast<std::exception const *>(&x) is not null, the returned string includes the output from std::exception::what.
    • -
    • The returned string may include additional platform-specific diagnostic information.
    • -
    -

    Example:

    -

    this is a possible output from the diagnostic_information function, as used in libs/exception/example/example_io.cpp:

    -
    libs\exception\example\example_io.cpp(83): Throw in function class boost::shared_ptr<struct _iobuf> __cdecl my_fopen(const char *,const char *)
    -Dynamic exception type: class boost::exception_detail::clone_impl<class fopen_error>
    -std::exception::what: example_io error
    -[struct tag_errno *] = 2, OS says "No such file or directory"
    -[struct tag_file_name *] = tmp1.txt
    -[struct tag_function *] = fopen
    -[struct tag_open_mode *] = rb
    -

    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
    -    template <class E>
    -    void throw_exception( E const & e );
    -#endif
    -    }
    -

    Requirements:

    -

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

    BOOST_THROW_EXCEPTION

    -
    -

    #include <boost/throw_exception.hpp>

    -
    #if !defined( BOOST_NO_EXCEPTIONS ) && !defined( BOOST_EXCEPTION_DISABLE )
    -    #include <boost/exception/exception.hpp>
    -    #include <boost/current_function.hpp>
    -    #define BOOST_THROW_EXCEPTION(x)\
    -        ::boost::throw_exception( ::boost::enable_error_info(x) <<\
    -        ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\
    -        ::boost::throw_file(__FILE__) <<\
    -        ::boost::throw_line((int)__LINE__) )
    -#else
    -    #define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x)
    -#endif
    -

    This macro takes an exception object, records BOOST_CURRENT_FUNCTION, __FILE__ and __LINE__ in it, and forwards it to throw_exception. To recover this information at the catch site, use get_error_info; the information is also included in the message returned by diagnostic_information.

    -

    Acknowledgements

    -

    Peter Dimov has been continuously influencing the design and evolution of Boost Exception. Also thanks to Tobias Schwinger, Tom Brinkman, Pavel Vozenilek and everyone who participated in the review process.

    - +

    Acknowledgements

    +

    Thanks to Peter Dimov for his continuing help. Also thanks to Tobias Schwinger, Tom Brinkman, Pavel Vozenilek and everyone who participated in the review process.

    +

See Also:

- diff --git a/doc/exception_error_info_group_hpp.html b/doc/exception_error_info_group_hpp.html index 2b587d8..9c2d0d1 100644 --- a/doc/exception_error_info_group_hpp.html +++ b/doc/exception_error_info_group_hpp.html @@ -22,7 +22,8 @@

boost/exception/info_tuple.hpp

Synopsis

-
#include <boost/tuple/tuple.hpp>
+
#include <boost/exception/info.hpp>
+#include <boost/tuple/tuple.hpp>
 
 namespace
 boost
@@ -36,8 +37,8 @@ boost
     }

See Also:

- diff --git a/doc/exception_error_info_hpp.html b/doc/exception_error_info_hpp.html index 1277c5a..3d48ebc 100644 --- a/doc/exception_error_info_hpp.html +++ b/doc/exception_error_info_hpp.html @@ -23,8 +23,6 @@

Synopsis

#include <boost/exception/exception.hpp>
-#include <boost/current_function.hpp>
-#include <boost/shared_ptr.hpp>
 
 namespace
 boost
@@ -46,13 +44,14 @@ boost
     }

See Also:

- diff --git a/doc/exception_error_info_value_hpp.html b/doc/exception_error_info_value_hpp.html index f91e244..bdf5c06 100644 --- a/doc/exception_error_info_value_hpp.html +++ b/doc/exception_error_info_value_hpp.html @@ -30,9 +30,9 @@ boost }

See Also:

- diff --git a/doc/exception_exception_hpp.html b/doc/exception_exception_hpp.html index 0c60895..ff73ba2 100644 --- a/doc/exception_exception_hpp.html +++ b/doc/exception_exception_hpp.html @@ -45,13 +45,13 @@ boost

See Also:

diff --git a/doc/exception_get_error_info_hpp.html b/doc/exception_get_error_info_hpp.html index dcb39d8..727c7c5 100644 --- a/doc/exception_get_error_info_hpp.html +++ b/doc/exception_get_error_info_hpp.html @@ -28,14 +28,12 @@ namespace boost { template <class ErrorInfo,class E> - shared_ptr<typename ErrorInfo::value_type const> get_error_info( E const & x ); + typename ErrorInfo::value_type const * get_error_info( E const & x ); }

See Also:

-
Boost Exception
-
boost/exception.hpp
+
diff --git a/doc/exception_hpp.html b/doc/exception_hpp.html index 05cb8b2..01c3674 100644 --- a/doc/exception_hpp.html +++ b/doc/exception_hpp.html @@ -31,9 +31,9 @@ #include <boost/exception_ptr.hpp>

See Also:

-
Boost Exception
-
Diagnostic Information
+
diff --git a/doc/functions.html b/doc/functions.html new file mode 100644 index 0000000..298dcc9 --- /dev/null +++ b/doc/functions.html @@ -0,0 +1,69 @@ + + + + + Functions + + + +
+ +
+ + diff --git a/doc/get_error_info.html b/doc/get_error_info.html index 34f9ba2..e7cdeef 100644 --- a/doc/get_error_info.html +++ b/doc/get_error_info.html @@ -21,21 +21,19 @@

get_error_info

-

#include <boost/exception/get_error_info.hpp>

-
namespace
+
namespace
 boost
     {
     template <class ErrorInfo,class E>
-    shared_ptr<typename ErrorInfo::value_type const> get_error_info( E const & x );
+    typename ErrorInfo::value_type const * get_error_info( E const & x );
     }

Requirements:

  • ErrorInfo must be an instance of the error_info template.
  • E must be polymorphic.
  • -
  • The get_error_info function must not be called outside of a catch block.

Returns:

-
-

Finally here is how the handler retreives data from exceptions that derive from boost::exception:

+

Finally here is how the handler retrieves data from exceptions that derive from boost::exception:

catch( io_error & e )
     {
     std::cerr << "I/O Error!\n";
diff --git a/doc/name_idx.html b/doc/page_idx.html
similarity index 84%
rename from doc/name_idx.html
rename to doc/page_idx.html
index 4f3dfc8..4408d0f 100644
--- a/doc/name_idx.html
+++ b/doc/page_idx.html
@@ -3,7 +3,7 @@
 
 
 	
-	Index
+	page index
 	
 
 
@@ -19,12 +19,14 @@
 
 
 
-

Index

+

+

See Also:

+ +
diff --git a/doc/source/boost-exception.reno b/doc/source/boost-exception.reno index f61dc8a..6cd9ce9 100644 --- a/doc/source/boost-exception.reno +++ b/doc/source/boost-exception.reno @@ -39,7 +39,7 @@ - 48 + 56 0 @@ -53,25 +53,29 @@ - 1 - 17FF6C63843EE64ED66CB038DD95B4C4D6BA1B0FD36B27BEFD84A909161D2853 - 1237535165 - 231 - 1186 + 2 + 1D3204D3ADDAB7AA716BEA1489EA852A9D6B5C110243364F6931FEF1CC2E5F88 + 422052608 + 3923 + 518 + 6E325144EF4F41FA3A225EB30729101382C4E99B3D6160E307311E4B4E641010 + 1097215175 + 161 + 240 0 - ../../../../boost/throw_exception.hpp + ../../../../boost/exception/info.hpp 0 0 - <string>BOOST_THROW_EXCEPTION</string> + <string>error_info::error_info</string> @@ -82,7 +86,7 @@ 1 2 - (:include include:) (:pagelist link="backlink":) + (:include include:) (:auto also:) @@ -93,6 +97,55 @@ reno_context + + + + + + 2 + 1D3204D3ADDAB7AA716BEA1489EA852A9D6B5C110243364F6931FEF1CC2E5F88 + 422052608 + 3923 + 518 + D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 + 4055211476 + 525 + 3392 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>exception/operator<<</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 7 + + reno_context + @@ -134,55 +187,6 @@ (:include include:) (:auto also:) - - - 0 - - 7 - - reno_context - - - - - - - 2 - 808CABE6CCA47C52CC9DD21911BF0B42284A5DD55AC3E665B29ED2B5F16AF7DA - 3660693492 - 8718 - 487 - 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 - 2078296250 - 305 - 8150 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>copy_exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - 0 @@ -197,14 +201,14 @@ 2 - 808CABE6CCA47C52CC9DD21911BF0B42284A5DD55AC3E665B29ED2B5F16AF7DA - 3660693492 - 8718 - 487 - E23085202D084CBB50F289988A6A592F06D923B77D0AB25D7A98A7188DF5BE3B - 1414247481 - 766 - 7382 + 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 + 2533933282 + 8724 + 615 + F86EB07D04CD0D0645080D1121DA899746D0C45137E17E1D9BE605E75396F047 + 1983537541 + 1346 + 148 @@ -218,7 +222,7 @@ - <string>current_exception</string> + <string>exception_ptr</string> @@ -240,6 +244,82 @@ reno_context + + + + + + 0 + + + + + + 1 + + + + + <string>frequently asked questions</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 10 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>exception types as simple semantic tags</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 11 + + reno_context + @@ -277,87 +357,6 @@ (:include include:) (:auto also:) - - - 0 - - 10 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>boost/exception/enable_current_exception.hpp</string> - - - exception_enable_current_exception_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 11 - - reno_context - - - - - - - 1 - F4C951B28F7DE500973AA3DFAA99F2BADA6EDAFA2B406C30BEF3B7FBE6FD57D7 - 2263754923 - 982 - 306 - - - - - - 0 - ../../example/error_info_2.cpp - 0 - 0 - - - - - <string>adding of arbitrary data to active exception objects</string> - - - adding_data_later - - - - - - 0 - - 0 @@ -366,104 +365,6 @@ reno_context - - - - - - 2 - E8AFD260BD0196A516F0E29A9FE6D09BF84B37D31E228910E3370365CAA4AB43 - 3229661566 - 3665 - 504 - BB8AF986C96801345719855FEA083AF5684FBC349F6520E150F19A6370019265 - 3731478139 - 686 - 2973 - - - - - - 0 - ../../../../boost/exception/get_error_info.hpp - 0 - 0 - - - - - <string>get_error_info</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 13 - - reno_context - - - - - - - 2 - 00067869F918D0E8905D8A464C17FA9DAD9F497B3A172EB360239EEB5778A206 - 3465219615 - 4025 - 518 - 6E325144EF4F41FA3A225EB30729101382C4E99B3D6160E307311E4B4E641010 - 1097215175 - 161 - 240 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - - <string>error_info::error_info</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 14 - - reno_context - @@ -503,7 +404,7 @@ 0 - 15 + 13 reno_context @@ -541,148 +442,7 @@ 0 - 16 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Motivation</string> - - - motivation - - - - - - 7 - 2 - (:include include:) (:auto also explicit=" - 1 - - 0 - - 17 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>exception types as simple semantic tags</string> - - - - - - - - 2 - - 1 - - 0 - - -9 - - - 2 - - 1 - - 0 - - 18 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>frequently asked questions</string> - - - - - - - - 2 - ":) - - - - - 0 - - -17 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -18 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 19 + 14 reno_context @@ -692,28 +452,28 @@ 2 - 00067869F918D0E8905D8A464C17FA9DAD9F497B3A172EB360239EEB5778A206 - 3465219615 - 4025 - 518 - D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 - 4055211476 - 525 - 3494 + 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 + 2533933282 + 8724 + 615 + 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 + 2078296250 + 305 + 8156 0 - ../../../../boost/exception/info.hpp + ../../../../boost/exception_ptr.hpp 0 0 - <string>exception/operator<<</string> + <string>copy_exception</string> @@ -731,56 +491,7 @@ 0 - 20 - - reno_context - - - - - - - 2 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - DF9EA87B0140AACF4422F1B76F6A6A409C15F32858BBBA85A35981A824C56BA9 - 1137981799 - 192 - 8994 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>enable_current_exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 21 + 15 reno_context @@ -825,6 +536,312 @@ (:include include:) (:auto also:) + + + 0 + + 16 + + reno_context + + + + + + + 3 + 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A + 1770110914 + 587 + 1462 + 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D + 3929437933 + 361 + 213 + CD1241D84950468704F3C3F04116B8DA5162A8BEA4364F10951232F49113C5DE + 1658463867 + 121 + 238 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>configuration macros</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 17 + + reno_context + + + + + + + 2 + 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF + 1282550303 + 9192 + 323 + DF9EA87B0140AACF4422F1B76F6A6A409C15F32858BBBA85A35981A824C56BA9 + 1137981799 + 192 + 8994 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>enable_current_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 18 + + reno_context + + + + + + + 1 + 04DDC793002AFCF4F4166D250C67D09B6FE8B86224318ED7847AD6EC423B70CA + 922651615 + 433 + 1027 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>BOOST_THROW_EXCEPTION</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 19 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Motivation</string> + + + motivation + + + + + + 7 + 2 + (:include include:) (:auto also explicit=" + 1 + + 0 + + -10 + + + 2 + + 1 + + 0 + + -11 + + + 2 + + 1 + + 0 + + -9 + + + 2 + ":) + + + + + 0 + + 20 + + reno_context + + + + + + + 1 + 7116AEECEA666794E31DC99390ADEC1BA6AF74B2398067A0739767B4B76FA97A + 4128134227 + 307 + 302 + + + + + + 0 + ../../example/logging.cpp + 0 + 0 + + + + + <string>diagnostic information</string> + + + tutorial_diagnostic_information + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 21 + + reno_context + + + + + + + 2 + F7537DC10435D0F7CC368E0FC747B2B1169E1CE60FCBAE8AC86F2256667C95B2 + 3301865866 + 4151 + 557 + D747B0A0953B72747224DE7856DB793A4BFF7B73793873CF22810FCB304A7310 + 505472020 + 3665 + 26 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + + <string>diagnostic_information</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + 0 @@ -833,6 +850,55 @@ reno_context + + + + + + 2 + 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 + 2533933282 + 8724 + 615 + E23085202D084CBB50F289988A6A592F06D923B77D0AB25D7A98A7188DF5BE3B + 1414247481 + 766 + 7388 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>current_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 23 + + reno_context + @@ -874,7 +940,7 @@ 0 - 23 + 24 reno_context @@ -884,9 +950,9 @@ 1 - F6C6B72C2CDEBC5E3EAA924F637563A8F8A95684AF6EEF39FE2260C86C77F531 - 2151348977 - 3846 + 2F432507CFD796BE673F33D9AC68C535F1ED1F4FCD3A8E3AEEC320D9795FB4AE + 2319362875 + 2574 323 @@ -919,7 +985,7 @@ 0 - 24 + 25 reno_context @@ -968,7 +1034,143 @@ 0 - 25 + 26 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>boost/exception/enable_current_exception.hpp</string> + + + exception_enable_current_exception_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 27 + + reno_context + + + + + + + 2 + F7537DC10435D0F7CC368E0FC747B2B1169E1CE60FCBAE8AC86F2256667C95B2 + 3301865866 + 4151 + 557 + 90ECFCA1DA49DBB79A23B5998A39D8A6B122632524671C56DA10F96A1BA07CD2 + 1653443895 + 452 + 3693 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + + <string>current_exception_diagnostic_information</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 28 + + reno_context + + + + + + + 2 + FEABD2D011FBCE667D26BAD68A1C65D81E98DD40081CC70F2738AC3151A8FC4A + 4260129224 + 2393 + 504 + C708EDCAC3964E2F3C3A081700112C5F15C7BF7A61FDF2EF39D112FC9B987CE3 + 1739153824 + 2361 + 26 + + + + + + 0 + ../../../../boost/exception/get_error_info.hpp + 0 + 0 + + + + + <string>get_error_info</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 29 reno_context @@ -997,1235 +1199,41 @@ - 127 + 1 2 - !!Introduction The purpose of Boost Exception is to ease the design of exception class hierarchies and to help write exception handling and error reporting code. It supports transporting of arbitrary data to the catch site, which is otherwise tricky due to the no-throw requirements (15.5.1) for exception types. Data can be added to any exception object, either directly in the throw-expression (15.1), or at a later time as the exception object propagates up the call stack. The ability to add data to exception objects after they have been passed to throw is important, because often some of the information needed to handle an exception is unavailable in the context where the failure is detected. Boost Exception also supports (:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:)-style (:link - 1 - - 0 - - 26 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>transporting of exceptions between threads</string> - - - tutorial_exception_ptr - - - - - 2 - |copying:) of exception objects, implemented non-intrusively and automatically by the boost::(:link - 1 - - 0 - - 27 - - reno_context - - - - - - - 2 - 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A - 1770110914 - 587 - 1497 - 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D - 3929437933 - 361 - 213 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - - <string>throw_exception</string> - - - - - - - - 2 - :) function. !!Contents #(:link - 1 - - 0 - - -16 - - - 2 - :) #Tutorial ##(:link - 1 - - 0 - - -15 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - 28 - - reno_context - - - - - - - 1 - 7116AEECEA666794E31DC99390ADEC1BA6AF74B2398067A0739767B4B76FA97A - 4128134227 - 307 - 302 - - - - - - 0 - ../../example/logging.cpp - 0 - 0 - - - - - <string>diagnostic information</string> - - - tutorial_diagnostic_information - - - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -9 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -26 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -17 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - 29 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>using virtual inheritance in exception types</string> - - - - - - - - 2 - mod="w":) #Documentation ##Class (:link - 1 - - 0 - - 30 - - reno_context - - - - - - - 2 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 - 1693870740 - 2195 - 3720 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>exception</string> - - - - - - - - 2 - :) ##Transporting of Arbitrary Data to the Catch Site ###(:link - 1 - - 0 - - 31 - - reno_context - - - - - - - 2 - 126BB1D8971585CBE7D78EF3C12259D72FD5E973A84626AA9FC3234220A11CAB - 3471702891 - 969 - 344 - A7FD310E1340E103081DA2A7899DA0E213C696C84D52C17ADA09F6942EE97D47 - 2978648279 - 530 - 433 - - - - - - 0 - ../../../../boost/exception/detail/error_info_impl.hpp - 0 - 0 - - - - - <string>error_info</string> - - - - - - - - 2 - :) ###(:link - 1 - - 0 - - -19 - - - 2 - :) ###(:link - 1 - - 0 - - -21 - - - 2 - :) ###(:link - 1 - - 0 - - -12 - - - 2 - :) ###(:link - 1 - - 0 - - -6 - - - 2 - :) ##(:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:) Transporting of Exceptions between Threads ###(:link - 1 - - 0 - - 32 - - reno_context - - - - - - - 2 - 808CABE6CCA47C52CC9DD21911BF0B42284A5DD55AC3E665B29ED2B5F16AF7DA - 3660693492 - 8718 - 487 - F86EB07D04CD0D0645080D1121DA899746D0C45137E17E1D9BE605E75396F047 - 1983537541 - 1346 - 148 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>exception_ptr</string> - - - - - - - - 2 - :) ###(:link - 1 - - 0 - - -20 - - - 2 - :) ###(:link - 1 - - 0 - - -8 - - - 2 - :) ###(:link - 1 - - 0 - - -7 - - - 2 - :) ###(:link - 1 - - 0 - - 33 - - reno_context - - - - - - - 2 - 808CABE6CCA47C52CC9DD21911BF0B42284A5DD55AC3E665B29ED2B5F16AF7DA - 3660693492 - 8718 - 487 - 0E9DF8366080712A816BE91ABCEF1E2044145B63D75B0B995B537900F378189E - 1069696031 - 255 - 8457 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>rethrow_exception</string> - - - - - - - - 2 - :) ###(:link - 1 - - 0 - - 34 - - reno_context - - - - - - - 2 - 808CABE6CCA47C52CC9DD21911BF0B42284A5DD55AC3E665B29ED2B5F16AF7DA - 3660693492 - 8718 - 487 - DA033132CFA8F85C147C01F51FF7CF7399CF7D32D412F730EA3219CDAC608C72 - 3830952485 - 712 - 1496 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>unknown_exception</string> - - - - - - - - 2 - :) ##(:link - 1 - - 0 - - 35 - - reno_context - - - - - - - 2 - 3D64A3F5639045A59A0CD362AD4C531ECC763B7C523E284DCBFBACAAF5F681C3 - 4142572795 - 1596 - 462 - 6FE1F0AF570A010E8FDA1647DE61E0CC3AA979C8A8638722DAACDF8FBC4790D2 - 1246830037 - 1023 - 567 - - - - - - 0 - ../../../../boost/exception/diagnostic_information.hpp - 0 - 0 - - - - - <string>diagnostic_information</string> - - - - - - - - 2 - :) ##(:link - 1 - - 0 - - -27 - - - 2 - :), (:link - 1 - - 0 - - -5 - - - 2 - :) ##(:link - 1 - - 0 - - 36 - - reno_context - - - - - - - 3 - 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A - 1770110914 - 587 - 1497 - 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D - 3929437933 - 361 - 213 - CD1241D84950468704F3C3F04116B8DA5162A8BEA4364F10951232F49113C5DE - 1658463867 - 121 - 238 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - - <string>configuration macros</string> - - - - - - - - 2 - mod="w":) ##Headers ###(:link - 1 - - 0 - - 37 - - reno_context - - - - - - - 1 - F647827E95C64B626A8E3751AD4E4D21237DD17482EEA6DB93A16A2C6AC79E87 - 527078204 - 446 - 227 - - - - - - 0 - ../../../../boost/exception.hpp - 0 - 0 - - - - - <string>boost/exception.hpp</string> - - - exception_hpp - - - - - 2 - :) ###(:link - 1 - - 0 - - 38 - - reno_context - - - - - - - 1 - 77680088697752BD6CCF429C0B264C866F5BF1D911D3BF3F1F18B06490D9F0CB - 2016079400 - 1841 - 227 - - - - - - 0 - ../../../../boost/exception/diagnostic_information.hpp - 0 - 0 - - - - - <string>boost/exception/diagnostic_information.hpp</string> - - - exception_diagnostic_information_hpp - - - - - 2 - :) ###(:link - 1 - - 0 - - -10 - - - 2 - :) ###(:link - 1 - - 0 - - 39 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>boost/exception/enable_error_info.hpp</string> - - - exception_enable_error_info_hpp - - - - - 2 - :) ###(:link - 1 - - 0 - - 40 - - reno_context - - - - - - - 2 - 9A4ECF9A49A73AED83C1565CB8C67AE1519E8AFE6818F968B4C4733CB9E86CEF - 1615599655 - 68 - 227 - 34F0583BC8DE767CE2D79721E1F956895E43E5397473B1050F59BE7E26C773DB - 805836816 - 66 - 1 - - - - - - 0 - ../../../../boost/exception/error_info.hpp - 0 - 0 - - - - - <string>boost/exception/error_info.hpp</string> - - - exception_error_info_value_hpp - - - - - 2 - :) ###(:link - 1 - - 0 - - -22 - - - 2 - :) ###(:link - 1 - - 0 - - -23 - - - 2 - :) ###(:link - 1 - - 0 - - 41 - - reno_context - - - - - - - 1 - 3D40DD88A1E41D75BC79CA8DACC35BEE2A16A64422AC8E6BE0D61169D9360EF7 - 4184757263 - 4220 - 323 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - - <string>boost/exception/info.hpp</string> - - - exception_error_info_hpp - - - - - 2 - :) ###(:link - 1 - - 0 - - 42 - - 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 - 1 - - 0 - - 43 - - reno_context - - - - - - - 1 - FBC69CDA5E19FA40270F3855A8B99B2F77572439353F9DC5D15386F3520BC616 - 1405483403 - 8882 - 323 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>boost/exception_ptr.hpp</string> - - - exception_cloning_hpp - - - - - 2 - :) ###(:link - 1 - - 0 - - 44 - - reno_context - - - - - - - 1 - 373FAB70D1DAE4F1111AACCCCD3F6B55EAF8D1222E03A26A5A2F860B70D2D0C4 - 3697768091 - 2013 - 91 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - - <string>boost/throw_exception.hpp</string> - - - throw_exception_hpp - - - - - 2 - :) #(:link - 1 - - 0 - - -18 - - - 2 - mod="w":) #(:link - 1 - - 0 - - 45 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Index</string> - - - name_idx - - - - - 2 - :) !!Synopsis `#include <(:link - 1 - - 0 - - -37 - - - 2 - :)> [@namespace boost { (:include - 1 - - 0 - - -22 - - - 2 - api pre_indent="4":) (:include - 1 - - 0 - - -41 - - - 2 - api pre_indent="4":) (:include - 1 - - 0 - - -42 - - - 2 - api pre_indent="4":) (:include - 1 - - 0 - - -39 - - - 2 - api pre_indent="4":) (:include - 1 - - 0 - - -38 - - - 2 - api pre_indent="4":) (:include - 1 - - 0 - - -43 - - - 2 - api pre_indent="4":) (:include - 1 - - 0 - - -10 - - - 2 - api pre_indent="4":) }@] `#include <(:link - 1 - - 0 - - -44 - - - 2 - :)> [@(:include - 1 - - 0 - - -44 - - - 2 - api:)@] !!Class exception (:include - 1 - - 0 - - -30 - - - 2 - :) !!Transporting of Arbitrary Data to the Catch Site (:include - 1 - - 0 - - -31 - - - 2 - :) (:include - 1 - - 0 - - -19 - - - 2 - :) (:include - 1 - - 0 - - -21 - - - 2 - :) (:include - 1 - - 0 - - -12 - - - 2 - :) (:include - 1 - - 0 - - -6 - - - 2 - :) !!Transporting of Exceptions between Threads (:include - 1 - - 0 - - -32 - - - 2 - :) (:include - 1 - - 0 - - -20 - - - 2 - :) (:include - 1 - - 0 - - -8 - - - 2 - :) (:include - 1 - - 0 - - -7 - - - 2 - :) (:include - 1 - - 0 - - -33 - - - 2 - :) (:include - 1 - - 0 - - -34 - - - 2 - :) !!Printing Diagnostic Information (:include - 1 - - 0 - - -35 - - - 2 - :) !!Throwing Exceptions (:include - 1 - - 0 - - -27 - - - 2 - :) (:include - 1 - - 0 - - -5 - - - 2 - :) !!Acknowledgements Peter Dimov has been continuously influencing the design and evolution of Boost Exception. Also thanks to Tobias Schwinger, Tom Brinkman, Pavel Vozenilek and everyone who participated in the review process. + (:include include:) 0 - -26 + 30 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>transporting of exceptions between threads</string> + + + tutorial_exception_ptr + + @@ -2238,7 +1246,43 @@ 0 - -27 + 31 + + reno_context + + + + + + + 2 + 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A + 1770110914 + 587 + 1462 + 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D + 3929437933 + 361 + 213 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>throw_exception</string> + + + + + @@ -2251,7 +1295,43 @@ 0 - -28 + 32 + + reno_context + + + + + + + 2 + 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 + 2533933282 + 8724 + 615 + 0E9DF8366080712A816BE91ABCEF1E2044145B63D75B0B995B537900F378189E + 1069696031 + 255 + 8463 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>rethrow_exception</string> + + + + + @@ -2264,7 +1344,32 @@ 0 - -29 + 33 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>using virtual inheritance in exception types</string> + + + + + @@ -2277,7 +1382,43 @@ 0 - -30 + 34 + + reno_context + + + + + + + 2 + 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF + 1282550303 + 9192 + 323 + 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 + 1693870740 + 2195 + 3720 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>exception</string> + + + + + @@ -2290,7 +1431,43 @@ 0 - -31 + 35 + + reno_context + + + + + + + 2 + 126BB1D8971585CBE7D78EF3C12259D72FD5E973A84626AA9FC3234220A11CAB + 3471702891 + 969 + 344 + A7FD310E1340E103081DA2A7899DA0E213C696C84D52C17ADA09F6942EE97D47 + 2978648279 + 530 + 433 + + + + + + 0 + ../../../../boost/exception/detail/error_info_impl.hpp + 0 + 0 + + + + + <string>error_info</string> + + + + + @@ -2303,7 +1480,86 @@ 0 - -32 + 36 + + reno_context + + + + + + + 1 + 4ED9709788BBAB4DE7CF336561606B8C0B41F70877A3395F4EE026F4AEB66CC6 + 743998427 + 409 + 307 + + + + + + 0 + ../../example/cloning_1.cpp + 0 + 0 + + + + + <string>using enable_current_exception at the time of the throw</string> + + + using_enable_cloning + + + + + + 0 + + + + + 0 + + 37 + + reno_context + + + + + + + 2 + 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 + 2533933282 + 8724 + 615 + 9F3671DA5E8AB414F1FBA3B160D49134EAEE8DFF33E95376EDB41534E916FF38 + 2436936467 + 718 + 1496 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>unknown_exception</string> + + + + + @@ -2316,7 +1572,43 @@ 0 - -33 + 38 + + reno_context + + + + + + + 2 + 6FB85B536F965F137409D5B5D34786DCBF0B9957A7C251D271B717A1156B823D + 1090406464 + 362 + 323 + D16DAEA8B1792A019AF7FCA362FDC6EFD381AF4C43C076A01C029ECE51F994A6 + 3172941848 + 330 + 26 + + + + + + 0 + ../../../../boost/exception/current_exception_cast.hpp + 0 + 0 + + + + + <string>current_exception_cast</string> + + + + + @@ -2329,7 +1621,32 @@ 0 - -34 + 39 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Types</string> + + + types + + @@ -2342,7 +1659,82 @@ 0 - -35 + 40 + + reno_context + + + + + + + 1 + F4C951B28F7DE500973AA3DFAA99F2BADA6EDAFA2B406C30BEF3B7FBE6FD57D7 + 2263754923 + 982 + 306 + + + + + + 0 + ../../example/error_info_2.cpp + 0 + 0 + + + + + <string>adding of arbitrary data to active exception objects</string> + + + adding_data_later + + + + + + 0 + + + + + 0 + + 41 + + reno_context + + + + + + + 1 + 9E3988368193B192FA2426DE2B97FA8D0DA8A9FFECAD6A010FE1B5CD9662FAE9 + 109897168 + 4491 + 227 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + + <string>boost/exception/diagnostic_information.hpp</string> + + + exception_diagnostic_information_hpp + + @@ -2355,7 +1747,47 @@ 0 - -36 + 42 + + reno_context + + + + + + + 3 + 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF + 1282550303 + 9192 + 323 + 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 + 1693870740 + 2195 + 3720 + DA154372D8C23BD9EDC30005CA7959CE686D198891097A837D006B5222F04DE9 + 2768248809 + 143 + 60 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>exception::exception</string> + + + exception_constructors + + @@ -2368,7 +1800,47 @@ 0 - -37 + 43 + + reno_context + + + + + + + 3 + 126BB1D8971585CBE7D78EF3C12259D72FD5E973A84626AA9FC3234220A11CAB + 3471702891 + 969 + 344 + A7FD310E1340E103081DA2A7899DA0E213C696C84D52C17ADA09F6942EE97D47 + 2978648279 + 530 + 433 + 02372FA6B987EAC15E78C5A12036F203A92B3D4C857C02985B1BF0A24008D976 + 2987989218 + 109 + 259 + + + + + + 0 + ../../../../boost/exception/detail/error_info_impl.hpp + 0 + 0 + + + + + <string>error_info::value</string> + + + + + @@ -2381,7 +1853,32 @@ 0 - -38 + 44 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Functions</string> + + + functions + + @@ -2394,7 +1891,39 @@ 0 - -39 + 45 + + 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 + + @@ -2403,84 +1932,6 @@ (:include include:) (:auto also:) - - - 0 - - -40 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -41 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -42 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -43 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -44 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -45 - - - - 1 - 2 - (:auto !:) (:pagelist fmt="index" except_tags="index noindex" mod="w":) - - 0 @@ -2495,33 +1946,35 @@ 1 - 187BFD2B78A0DD006717B5B06FFD465E2468F521C32A86FB793F7A68AB5417F3 - 4276724153 - 574 - 382 + F647827E95C64B626A8E3751AD4E4D21237DD17482EEA6DB93A16A2C6AC79E87 + 527078204 + 446 + 227 0 - ../../example/error_info_1.cpp + ../../../../boost/exception.hpp 0 0 - <string>adding of arbitrary data at the point of the throw</string> + <string>boost/exception.hpp</string> - adding_data_at_throw + exception_hpp - 0 + 1 + 2 + (:include include:) (:auto also:) @@ -2590,36 +2043,21 @@ - 3 - 126BB1D8971585CBE7D78EF3C12259D72FD5E973A84626AA9FC3234220A11CAB - 3471702891 - 969 - 344 - A7FD310E1340E103081DA2A7899DA0E213C696C84D52C17ADA09F6942EE97D47 - 2978648279 - 530 - 433 - 02372FA6B987EAC15E78C5A12036F203A92B3D4C857C02985B1BF0A24008D976 - 2987989218 - 109 - 259 + 0 - 0 - ../../../../boost/exception/detail/error_info_impl.hpp - 0 - 0 + 1 - <string>error_info::value</string> + <string>boost/exception/enable_error_info.hpp</string> - + exception_enable_error_info_hpp @@ -2643,36 +2081,21 @@ - 3 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 - 1693870740 - 2195 - 3720 - DA154372D8C23BD9EDC30005CA7959CE686D198891097A837D006B5222F04DE9 - 2768248809 - 143 - 60 + 0 - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 + 1 - <string>exception::exception</string> + <string>Headers</string> - exception_constructors + headers @@ -2691,6 +2114,397 @@ reno_context + + + + + + 2 + 9A4ECF9A49A73AED83C1565CB8C67AE1519E8AFE6818F968B4C4733CB9E86CEF + 1615599655 + 68 + 227 + 34F0583BC8DE767CE2D79721E1F956895E43E5397473B1050F59BE7E26C773DB + 805836816 + 66 + 1 + + + + + + 0 + ../../../../boost/exception/error_info.hpp + 0 + 0 + + + + + <string>boost/exception/error_info.hpp</string> + + + exception_error_info_value_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 51 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Macros</string> + + + macros + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 52 + + reno_context + + + + + + + 1 + A449DE2B3A2CDAE9DD932C06D224B3E07C95EBACBB4EA5890CA4CCF2DC74A693 + 1718307056 + 4118 + 323 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>boost/exception/info.hpp</string> + + + exception_error_info_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 53 + + reno_context + + + + + + + 1 + E127BAFA15A5B7031C0DD1817993041600F935B71E7BDE42E1F4AF50959B6AB3 + 2166367611 + 9016 + 323 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>boost/exception_ptr.hpp</string> + + + exception_cloning_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 54 + + reno_context + + + + + + + 1 + 05698FEF1D553EDBC15212673561F5436DF771AA5488C8ED8164D303078DE08E + 119041194 + 1978 + 91 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>boost/throw_exception.hpp</string> + + + throw_exception_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 55 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>page index</string> + + + page_idx + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 56 + + reno_context + + + + + + + 1 + A14B5595A6DD87562792D402B48500AAD71FA1ABD75C14EDF089FCC7318CBB9B + 3469762901 + 468 + 227 + + + + + + 0 + ../../../../boost/exception/current_exception_cast.hpp + 0 + 0 + + + + + <string>boost/exception/current_exception_cast.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 57 + + reno_context + + + + + + + 1 + D10E536B909EFFF78FB09E6242AEC7C74ACDD75AE7DF32B45870422B752E5D8E + 1903336130 + 557 + 382 + + + + + + 0 + ../../example/error_info_1.cpp + 0 + 0 + + + + + <string>adding of arbitrary data at the point of the throw</string> + + + adding_data_at_throw + + + + + + 0 + + + + + 0 + + 58 + + reno_context + + + + + + + 1 + 9E8DCE3BCF462A3A332DA70F61E46FA5C2AB791B95E33D3F2AF1307F53C84B1C + 1960675522 + 6483 + 591 + + + + + + 0 + ../../example/example_io.cpp + 0 + 0 + + + + + <string>diagnostic_information example</string> + + + + + + + + + 0 + + + + + 0 + + 59 + + reno_context + @@ -2730,7 +2544,7 @@ 0 - 51 + 60 reno_context @@ -2739,77 +2553,29 @@ - 1 - 4ED9709788BBAB4DE7CF336561606B8C0B41F70877A3395F4EE026F4AEB66CC6 - 743998427 - 409 - 307 + 0 - 0 - ../../example/cloning_1.cpp - 0 - 0 + 1 - <string>using enable_current_exception at the time of the throw</string> + <string>Synopsis</string> - using_enable_cloning + synopsis - 0 - - - - - 0 - - 52 - - reno_context - - - - - - - 1 - D0024B58523F5885E87F608259810B61D3BE489CEC885FFAE91118F1E43B10A4 - 399616739 - 6563 - 591 - - - - - - 0 - ../../example/example_io.cpp - 0 - 0 - - - - - <string>diagnostic_information example</string> - - - - - - - - - 0 + 1 + 2 + (:include include:) (:auto also:) @@ -2819,13 +2585,13 @@ def - 53 + 61 reno_layer - 48 + 56 0 @@ -3109,36 +2875,7 @@ - 7 - 2 - [@class (:link - 1 - - 0 - - -30 - - - 2 - :) { protected: (:include - 1 - - 0 - - -49 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -24 - - - 2 - decl pre_indent="4":) };@] + 0 @@ -3149,45 +2886,7 @@ - 9 - 2 - [@template <class Tag,class T> class (:link - 1 - - 0 - - -31 - - - 2 - :) { public: (:include - 1 - - 0 - - -47 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -13 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -48 - - - 2 - decl pre_indent="4":) };@] + 0 @@ -3220,7 +2919,36 @@ - 0 + 7 + 2 + [@class (:link + 1 + + 0 + + -34 + + + 2 + :) { protected: (:include + 1 + + 0 + + -42 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -25 + + + 2 + decl pre_indent="4":) };@] @@ -3231,7 +2959,45 @@ - 0 + 9 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -35 + + + 2 + :) { public: (:include + 1 + + 0 + + -47 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -5 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -43 + + + 2 + decl pre_indent="4":) };@] @@ -3421,6 +3187,94 @@ 0 + + + 0 + + -53 + + + + 0 + + + + + 0 + + -54 + + + + 0 + + + + + 0 + + -55 + + + + 0 + + + + + 0 + + -56 + + + + 0 + + + + + 0 + + -57 + + + + 0 + + + + + 0 + + -58 + + + + 0 + + + + + 0 + + -59 + + + + 0 + + + + + 0 + + -60 + + + + 0 + + @@ -3428,13 +3282,13 @@ api - 54 + 62 reno_layer - 48 + 56 0 @@ -3498,18 +3352,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -20 - - - 2 - decl:)@] + 0 @@ -3641,54 +3484,7 @@ - 11 - 2 - [@(:include - 1 - - 0 - - -30 - - - 2 - def:) (:include - 1 - - 0 - - -31 - - - 2 - decl:) typedef (:link - 1 - - 0 - - -31 - - - 2 - :)<struct tag_throw_function,char const *> throw_function; typedef (:link - 1 - - 0 - - -31 - - - 2 - :)<struct tag_throw_file,char const *> throw_file; typedef (:link - 1 - - 0 - - -31 - - - 2 - :)<struct tag_throw_line,int> throw_line;@] + 0 @@ -3699,18 +3495,54 @@ - 3 + 11 2 [@(:include 1 0 - -12 + -34 2 - decl:)@] + def:) (:include + 1 + + 0 + + -35 + + + 2 + decl:) typedef (:link + 1 + + 0 + + -35 + + + 2 + :)<struct tag_throw_function,char const *> throw_function; typedef (:link + 1 + + 0 + + -35 + + + 2 + :)<struct tag_throw_file,char const *> throw_file; typedef (:link + 1 + + 0 + + -35 + + + 2 + :)<struct tag_throw_line,int> throw_line;@] @@ -3721,7 +3553,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -28 + + + 2 + decl:)@] @@ -3743,7 +3586,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -17 + + + 2 + decl:)@] @@ -3863,6 +3717,136 @@ -37 + + 0 + + + + + 0 + + -38 + + + + 0 + + + + + 0 + + -39 + + + + 0 + + + + + 0 + + -40 + + + + 0 + + + + + 0 + + -41 + + + + 5 + 2 + [@(:include + 1 + + 0 + + -21 + + + 2 + decl:) (:include + 1 + + 0 + + -27 + + + 2 + decl:)@] + + + + + 0 + + -42 + + + + 0 + + + + + 0 + + -43 + + + + 0 + + + + + 0 + + -44 + + + + 0 + + + + + 0 + + -45 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -15 + + + 2 + decl:)@] + + + + + 0 + + -46 + + 15 2 @@ -3871,7 +3855,7 @@ 0 - -38 + -41 2 @@ -3880,16 +3864,7 @@ 0 - -40 - - - 2 - :)> #include <(:link - 1 - - 0 - - -22 + -50 2 @@ -3907,7 +3882,7 @@ 0 - -41 + -24 2 @@ -3916,7 +3891,7 @@ 0 - -42 + -52 2 @@ -3925,7 +3900,16 @@ 0 - -43 + -45 + + + 2 + :)> #include <(:link + 1 + + 0 + + -53 2 @@ -3936,7 +3920,51 @@ 0 - -38 + -47 + + + + 0 + + + + + 0 + + -48 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -7 + + + 2 + decl:)@] + + + + + 0 + + -49 + + + + 0 + + + + + 0 + + -50 @@ -3954,258 +3982,6 @@ decl:)@] - - - 0 - - -39 - - - - 3 - 2 - [@(:include - 1 - - 0 - - -6 - - - 2 - decl:)@] - - - - - 0 - - -40 - - - - 3 - 2 - [@(:include - 1 - - 0 - - -31 - - - 2 - decl:)@] - - - - - 0 - - -41 - - - - 5 - 2 - [@(:include - 1 - - 0 - - -31 - - - 2 - def:) (:include - 1 - - 0 - - -19 - - - 2 - decl:)@] - - - - - 0 - - -42 - - - - 3 - 2 - [@(:include - 1 - - 0 - - -21 - - - 2 - decl:)@] - - - - - 0 - - -43 - - - - 11 - 2 - [@(:include - 1 - - 0 - - -34 - - - 2 - decl:) (:include - 1 - - 0 - - -32 - - - 2 - decl:) (:include - 1 - - 0 - - -7 - - - 2 - decl:) (:include - 1 - - 0 - - -8 - - - 2 - decl:) (:include - 1 - - 0 - - -33 - - - 2 - decl:)@] - - - - - 0 - - -44 - - - - 5 - 2 - [@(:include - 1 - - 0 - - -5 - - - 2 - decl:) namespace boost { (:include - 1 - - 0 - - -27 - - - 2 - decl:) }@] - - - - - 0 - - -45 - - - - 0 - - - - - 0 - - -46 - - - - 0 - - - - - 0 - - -47 - - - - 0 - - - - - 0 - - -48 - - - - 0 - - - - - 0 - - -49 - - - - 0 - - - - - 0 - - -50 - - - - 0 - - 0 @@ -4224,6 +4000,192 @@ -52 + + 5 + 2 + [@(:include + 1 + + 0 + + -35 + + + 2 + def:) (:include + 1 + + 0 + + -6 + + + 2 + decl:)@] + + + + + 0 + + -53 + + + + 11 + 2 + [@(:include + 1 + + 0 + + -37 + + + 2 + decl:) (:include + 1 + + 0 + + -8 + + + 2 + decl:) (:include + 1 + + 0 + + -14 + + + 2 + decl:) (:include + 1 + + 0 + + -22 + + + 2 + decl:) (:include + 1 + + 0 + + -32 + + + 2 + decl:)@] + + + + + 0 + + -54 + + + + 5 + 2 + [@(:include + 1 + + 0 + + -18 + + + 2 + decl:) namespace boost { (:include + 1 + + 0 + + -31 + + + 2 + decl:) }@] + + + + + 0 + + -55 + + + + 0 + + + + + 0 + + -56 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -38 + + + 2 + decl:)@] + + + + + 0 + + -57 + + + + 0 + + + + + 0 + + -58 + + + + 0 + + + + + 0 + + -59 + + + + 0 + + + + + 0 + + -60 + + 0 @@ -4235,13 +4197,13 @@ decl - 55 + 63 reno_layer - 48 + 56 0 @@ -4249,153 +4211,6 @@ -5 - - 19 - 2 - [@#if !defined( BOOST_NO_EXCEPTIONS ) && !defined( BOOST_EXCEPTION_DISABLE ) #include < - 1 - - 0 - - -22 - - - 2 - > #include <boost/current_function.hpp> #define - 1 - - 0 - - -5 - - - 2 - (x)\ ::boost:: - 1 - - 0 - - -27 - - - 2 - ( ::boost:: - 1 - - 0 - - -6 - - - 2 - (x) <<\ ::boost::(:link - 1 - - 0 - - -22 - - - 2 - |throw_function:)(BOOST_CURRENT_FUNCTION) <<\ ::boost::(:link - 1 - - 0 - - -22 - - - 2 - |throw_file:)(__FILE__) <<\ ::boost::(:link - 1 - - 0 - - -22 - - - 2 - |throw_line:)((int)__LINE__) ) #else #define - 1 - - 0 - - -5 - - - 2 - (x) ::boost:: - 1 - - 0 - - -27 - - - 2 - (x) #endif@] - - - - - 0 - - -6 - - - - 3 - 2 - [@template <class T> ---unspecified--- (:link - 1 - - 0 - - -6 - - - 2 - :)( T const & x );@] - - - - - 0 - - -7 - - - - 5 - 2 - [@template <class T> (:link - 1 - - 0 - - -32 - - - 2 - :) (:link - 1 - - 0 - - -7 - - - 2 - :)( T const & e );@] - - - - - 0 - - -8 - - 5 2 @@ -4404,93 +4219,7 @@ 0 - -32 - - - 2 - :) (:link - 1 - - 0 - - -8 - - - 2 - :)();@] - - - - - 0 - - -9 - - - - 0 - - - - - 0 - - -10 - - - - 0 - - - - - 0 - - -11 - - - - 0 - - - - - 0 - - -12 - - - - 3 - 2 - [@template <class ErrorInfo,class E> (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:)<typename ErrorInfo::value_type const> (:link - 1 - - 0 - - -12 - - - 2 - :)( E const & x );@] - - - - - 0 - - -13 - - - - 5 - 2 - [@(:link - 1 - - 0 - - -13 + -5 2 @@ -4510,7 +4239,82 @@ 0 - -14 + -6 + + + + 5 + 2 + [@template <class E, class Tag, class T> E const & (:link + 1 + + 0 + + -6 + + + 2 + mod="/":)( E const & x, (:link + 1 + + 0 + + -35 + + + 2 + :)<Tag,T> const & v );@] + + + + + 0 + + -7 + + + + 3 + 2 + [@template <class T> ---unspecified--- (:link + 1 + + 0 + + -7 + + + 2 + :)( T const & x );@] + + + + + 0 + + -8 + + + + 3 + 2 + [@typedef ---unspecified--- (:link + 1 + + 0 + + -8 + + + 2 + :);@] + + + + + 0 + + -9 @@ -4521,13 +4325,117 @@ 0 - -15 + -10 0 + + + 0 + + -11 + + + + 0 + + + + + 0 + + -12 + + + + 0 + + + + + 0 + + -13 + + + + 0 + + + + + 0 + + -14 + + + + 5 + 2 + [@template <class T> (:link + 1 + + 0 + + -8 + + + 2 + :) (:link + 1 + + 0 + + -14 + + + 2 + :)( T const & e );@] + + + + + 0 + + -15 + + + + 7 + 2 + [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link + 1 + + 0 + + -15 + + + 2 + mod="/":)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link + 1 + + 0 + + -35 + + + 2 + :)<Tag1,T1>, ..., (:link + 1 + + 0 + + -35 + + + 2 + :)<TagN,TN> > const & v );@] + + 0 @@ -4546,59 +4454,6 @@ -17 - - 0 - - - - - 0 - - -18 - - - - 0 - - - - - 0 - - -19 - - - - 5 - 2 - [@template <class E, class Tag, class T> E const & (:link - 1 - - 0 - - -19 - - - 2 - mod="/":)( E const & x, (:link - 1 - - 0 - - -31 - - - 2 - :)<Tag,T> const & v );@] - - - - - 0 - - -20 - - 3 2 @@ -4607,13 +4462,129 @@ 0 - -20 + -17 2 :)( T const & e );@] + + + 0 + + -18 + + + + 19 + 2 + [@#if !defined( BOOST_EXCEPTION_DISABLE ) #include <(:link + 1 + + 0 + + -23 + + + 2 + :)> #include <boost/current_function.hpp> #define (:link + 1 + + 0 + + -18 + + + 2 + :)(x)\ ::boost::(:link + 1 + + 0 + + -31 + + + 2 + :)( ::boost::(:link + 1 + + 0 + + -7 + + + 2 + :)(x) <<\ ::boost::(:link + 1 + + 0 + + -23 + + + 2 + |throw_function:)(BOOST_CURRENT_FUNCTION) <<\ ::boost::(:link + 1 + + 0 + + -23 + + + 2 + |throw_file:)(__FILE__) <<\ ::boost::(:link + 1 + + 0 + + -23 + + + 2 + |throw_line:)((int)__LINE__) ) #else #define (:link + 1 + + 0 + + -18 + + + 2 + :)(x) ::boost::(:link + 1 + + 0 + + -31 + + + 2 + :)(x) #endif@] + + + + + 0 + + -19 + + + + 0 + + + + + 0 + + -20 + + + + 0 + + 0 @@ -4622,9 +4593,9 @@ - 7 + 3 2 - [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link + [@template <class E> std::string (:link 1 0 @@ -4633,25 +4604,7 @@ 2 - mod="/":)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link - 1 - - 0 - - -31 - - - 2 - :)<Tag1,T1>, ..., (:link - 1 - - 0 - - -31 - - - 2 - :)<TagN,TN> > const & v );@] + :)( E const & e );@] @@ -4662,7 +4615,27 @@ - 0 + 5 + 2 + [@(:link + 1 + + 0 + + -8 + + + 2 + :) (:link + 1 + + 0 + + -22 + + + 2 + :)();@] @@ -4684,18 +4657,7 @@ - 3 - 2 - [@(:link - 1 - - 0 - - -24 - - - 2 - mod="m":)();@] + 0 @@ -4706,7 +4668,18 @@ - 0 + 3 + 2 + [@(:link + 1 + + 0 + + -25 + + + 2 + mod="m":)();@] @@ -4728,9 +4701,9 @@ - 5 + 3 2 - [@#ifdef BOOST_NO_EXCEPTIONS void (:link + [@std::string (:link 1 0 @@ -4739,16 +4712,7 @@ 2 - :)( std::exception const & e ); // user defined #else template <class E> void (:link - 1 - - 0 - - -27 - - - 2 - :)( E const & e ); #endif@] + :)();@] @@ -4759,7 +4723,18 @@ - 0 + 3 + 2 + [@template <class ErrorInfo,class E> typename ErrorInfo::value_type const * (:link + 1 + + 0 + + -28 + + + 2 + :)( E const & x );@] @@ -4781,18 +4756,7 @@ - 3 - 2 - [@class (:link - 1 - - 0 - - -30 - - - 2 - :);@] + 0 @@ -4803,9 +4767,9 @@ - 3 + 5 2 - [@template <class Tag,class T> class (:link + [@#ifdef BOOST_NO_EXCEPTIONS void (:link 1 0 @@ -4814,7 +4778,16 @@ 2 - :);@] + :)( std::exception const & e ); // user defined #else template <class E> void (:link + 1 + + 0 + + -31 + + + 2 + :)( E const & e ); #endif@] @@ -4824,28 +4797,6 @@ -32 - - 3 - 2 - [@typedef ---unspecified--- (:link - 1 - - 0 - - -32 - - - 2 - :);@] - - - - - 0 - - -33 - - 5 2 @@ -4854,7 +4805,7 @@ 0 - -33 + -32 2 @@ -4863,13 +4814,24 @@ 0 - -32 + -8 2 :) const & ep ); + + + 0 + + -33 + + + + 0 + + 0 @@ -4878,9 +4840,9 @@ - 5 + 3 2 - [@class (:link + [@class (:link 1 0 @@ -4889,16 +4851,7 @@ 2 - :): public std::exception public boost:: - 1 - - 0 - - -30 - - - 2 - { ---unspecified--- };@] + :);@] @@ -4909,9 +4862,9 @@ - 5 + 3 2 - [@std::string (:link + [@template <class Tag,class T> class (:link 1 0 @@ -4920,16 +4873,7 @@ 2 - :)( boost::(:link - 1 - - 0 - - -30 - - - 2 - :) const & );@] + :);@] @@ -4951,7 +4895,27 @@ - 0 + 5 + 2 + [@class (:link + 1 + + 0 + + -37 + + + 2 + :): public std::exception public boost:: + 1 + + 0 + + -34 + + + 2 + { ---unspecified--- };@] @@ -4962,7 +4926,18 @@ - 0 + 3 + 2 + [@template <class E> E * + 1 + + 0 + + -38 + + + 2 + ();@] @@ -5006,7 +4981,36 @@ - 0 + 7 + 2 + [@(:link + 1 + + 0 + + -42 + + + 2 + mod="m":)(); (:link + 1 + + 0 + + -42 + + + 2 + mod="m":)( (:link + 1 + + 0 + + -34 + + + 2 + :) const & x );@] @@ -5017,7 +5021,27 @@ - 0 + 5 + 2 + [@(:link + 1 + + 0 + + -47 + + + 2 + mod="m":) const & (:link + 1 + + 0 + + -43 + + + 2 + mod="m":)() const;@] @@ -5083,27 +5107,7 @@ - 5 - 2 - [@(:link - 1 - - 0 - - -47 - - - 2 - mod="m":) const & (:link - 1 - - 0 - - -48 - - - 2 - mod="m":)() const;@] + 0 @@ -5114,36 +5118,7 @@ - 7 - 2 - [@(:link - 1 - - 0 - - -49 - - - 2 - mod="m":)(); (:link - 1 - - 0 - - -49 - - - 2 - mod="m":)( (:link - 1 - - 0 - - -30 - - - 2 - :) const & x );@] + 0 @@ -5179,6 +5154,94 @@ 0 + + + 0 + + -53 + + + + 0 + + + + + 0 + + -54 + + + + 0 + + + + + 0 + + -55 + + + + 0 + + + + + 0 + + -56 + + + + 0 + + + + + 0 + + -57 + + + + 0 + + + + + 0 + + -58 + + + + 0 + + + + + 0 + + -59 + + + + 0 + + + + + 0 + + -60 + + + + 0 + + @@ -5186,13 +5249,13 @@ include - 56 + 64 reno_layer - 48 + 56 0 @@ -5201,27 +5264,9 @@ - 7 + 3 2 - (:auto !!!:) (:include synopsis:) This macro takes an exception object, records BOOST_CURRENT_FUNCTION, __FILE__ and __LINE__ in it, and forwards it to - 1 - - 0 - - -27 - - - 2 - . To recover this information at the catch site, use - 1 - - 0 - - -12 - - - 2 - ; the information is also included in the message returned by + (:auto !!!:) (:include synopsis:) !!!!Effects: Stores a copy of v in the 1 0 @@ -5230,7 +5275,7 @@ 2 - . + object. (:include throws:) @@ -5241,27 +5286,36 @@ - 5 + 7 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: T must be a class with an accessible no-throw copy constructor as per (15.5.1). !!!!Returns: * If T derives from boost::(:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link 1 0 - -30 + -34 2 - :), the returned object is of type T and is a copy of x. * Otherwise, the returned object is of an unspecified type that derives publicly from both T and boost::(:link + :), or a type that derives (indirectly) from boost::(:link 1 0 - -30 + -34 2 - :). The T sub-object is initialized from x by the T copy constructor. !!!!Throws: Nothing. + :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link + 1 + + 0 + + -35 + + + 2 + :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) @@ -5274,25 +5328,25 @@ 5 2 - (:auto !!!:) (:include synopsis:) !!!!Effects: As if [@try { throw + (:auto !!!:) (:include synopsis:) !!!!Requirements: T must be a class with an accessible no-throw copy constructor as per (15.5.1). !!!!Returns: * If T derives from boost::(:link 1 0 - -20 + -34 2 - (e); } catch(...) { return (:link + :), the returned object is of type T and is a copy of x. * Otherwise, the returned object is of an unspecified type that derives publicly from both T and boost::(:link 1 0 - -8 + -34 2 - :)(); }@] + :). The T sub-object is initialized from x by the T copy constructor. !!!!Throws: Nothing. @@ -5303,9 +5357,9 @@ - 29 + 17 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: The (:link + (:auto !!!:) (:include synopsis:) The (:link 1 0 @@ -5314,7 +5368,61 @@ 2 - :) function must not be called outside of a catch block. !!!!Returns: * An (: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 + + -8 + + + 2 + :)'s operations do not throw. Two instances of (:link + 1 + + 0 + + -8 + + + 2 + :) are equivalent and compare equal if and only if they refer to the same exception. The default constructor of (:link + 1 + + 0 + + -8 + + + 2 + :) produces the null value of the type. The null value is equivalent only to itself. !!!!Thread safety * It is legal for multiple threads to hold (:link + 1 + + 0 + + -8 + + + 2 + :) references to the same exception object. * It is illegal for multiple threads to modify the same (:link + 1 + + 0 + + -8 + + + 2 + :) object concurrently. * While calling (:link + 1 + + 0 + + -22 + + + 2 + :) makes a copy of the current exception object, it is still possible for the two copies to share internal state. Therefore, in general it is not safe to call (:link 1 0 @@ -5323,115 +5431,7 @@ 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 - - -32 - - - 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 - - -8 - - - 2 - :) refer to the same exception object. * Correct implementation of (:link - 1 - - 0 - - -8 - - - 2 - :) may require compiler support, unless (:link - 1 - - 0 - - -20 - - - 2 - :) was used at the time the currently handled exception object was passed to throw. If (:link - 1 - - 0 - - -20 - - - 2 - :) was not used, and if the compiler does not provide the necessary support, then (:link - 1 - - 0 - - -8 - - - 2 - :) may return an (:link - 1 - - 0 - - -32 - - - 2 - :) that refers to an instance of (:link - 1 - - 0 - - -34 - - - 2 - :). In this case, if the original exception object derives from boost::(:link - 1 - - 0 - - -30 - - - 2 - :), then the boost::(:link - 1 - - 0 - - -30 - - - 2 - :) sub-object of the (:link - 1 - - 0 - - -34 - - - 2 - :) object is initialized by the boost::(:link - 1 - - 0 - - -30 - - - 2 - :) copy constructor. + :) concurrently to throw the same exception object into multiple threads. @@ -5442,470 +5442,9 @@ - 27 + 57 2 - (:auto !!:) Some exception hierarchies can not be modified to make boost::(:link - 1 - - 0 - - -30 - - - 2 - :) a base type. In this case, the (:link - 1 - - 0 - - -6 - - - 2 - :) function template can be used to make exception objects derive from boost::(:link - 1 - - 0 - - -30 - - - 2 - :) anyway. Here is an example: [@#include <(:link - 1 - - 0 - - -37 - - - 2 - :)> #include <stdexcept> typedef boost::(:link - 1 - - 0 - - -31 - - - 2 - :)<struct tag_std_range_min,size_t> std_range_min; typedef boost::(:link - 1 - - 0 - - -31 - - - 2 - :)<struct tag_std_range_max,size_t> std_range_max; typedef boost::(:link - 1 - - 0 - - -31 - - - 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 - - -6 - - - 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 - - -6 - - - 2 - :)<T> gets us an object of ''unspecified type'' which is guaranteed to derive from both boost::(:link - 1 - - 0 - - -30 - - - 2 - :) and T. This makes it possible to use (:link - 1 - - 0 - - -19 - - - 2 - mod="/":) 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 - - -30 - - - 2 - :) &, so that (:link - 1 - - 0 - - -15 - - - 2 - |more information can be added to the exception at a later time:). - - - - - 0 - - -10 - - - - 1 - 2 - (:auto !!!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -11 - - - - 19 - 2 - (:auto !!!:) Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Let's say we have an exception type file_read_error, which takes a file name in its constructor. Consider the following function: [@void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error(????); }@] How can the file_read function pass a file name to the exception type constructor? All it has is a FILE handle. Using boost:: - 1 - - 0 - - -30 - - - 2 - allows us to free the file_read function from the burden of storing the file name in exceptions it throws: [@#include <(:link - 1 - - 0 - - -37 - - - 2 - :)> #include <stdio.h> #include <errno.h> typedef boost::(:link - 1 - - 0 - - -31 - - - 2 - :)<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link - 1 - - 0 - - -30 - - - 2 - :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error() << errno_info(errno); }@] If file_read detects a failure, it throws an exception which contains the information that is available at the time, namely the errno. Other relevant information, such as the file name, can be added in a context higher up the call stack, where it is known naturally: [@#include <(:link - 1 - - 0 - - -37 - - - 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> typedef boost::(:link - 1 - - 0 - - -31 - - - 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 - - -30 - - - 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 - - -30 - - - 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 - - -30 - - - 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''. - - - - - 0 - - -12 - - - - 13 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link - 1 - - 0 - - -31 - - - 2 - :) template. * E must be polymorphic. * The (:link - 1 - - 0 - - -12 - - - 2 - :) function must not be called outside of a catch block. !!!!Returns: * If dynamic_cast<boost::(:link - 1 - - 0 - - -30 - - - 2 - :) const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is an empty shared_ptr. * Otherwise, the returned shared_ptr points to the stored value (use (:link - 1 - - 0 - - -19 - - - 2 - mod="/":) to store values in exception objects.) The shared_ptr is valid even after x has been destroyed. !!!!Throws: Nothing. !!!!Note: The interface of (:link - 1 - - 0 - - -12 - - - 2 - :) may be affected by the build (:link - 1 - - 0 - - -36 - - - 2 - :). - - - - - 0 - - -13 - - - - 3 - 2 - (:auto !!!:) (:include synopsis:) !!!!Effects: Stores a copy of v in the - 1 - - 0 - - -31 - - - 2 - object. (:include throws:) - - - - - 0 - - -14 - - - - 37 - 2 - (:auto !!!:) When you catch an exception, you can call (:link - 1 - - 0 - - -8 - - - 2 - :) to get an (:link - 1 - - 0 - - -32 - - - 2 - :) object: [@#include <(:link - 1 - - 0 - - -43 - - - 2 - :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link - 1 - - 0 - - -30 - - - 2 - :)s void worker_thread( boost::(:link - 1 - - 0 - - -32 - - - 2 - :) & error ) { try { do_work(); error = boost::(:link - 1 - - 0 - - -32 - - - 2 - :)(); } catch( ... ) { error = boost::(:link - 1 - - 0 - - -8 - - - 2 - :)(); } }@] In the above example, note that (:link - 1 - - 0 - - -8 - - - 2 - :) captures the original type of the exception object. The exception can be thrown again using the (:link - 1 - - 0 - - -33 - - - 2 - :) function: [@// ...continued void work() { boost::(:link - 1 - - 0 - - -32 - - - 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 - - -33 - - - 2 - :)(error); }@] Note that (:link - 1 - - 0 - - -8 - - - 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 - - -32 - - - 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 - - -32 - - - 2 - :) points to an instance of (:link + (:auto !!!:) !!!Why use operator<< overload for adding info to exceptions? Before throwing an object of type that derives from boost::(:link 1 0 @@ -5914,307 +5453,12 @@ 2 - :). Regardless, the use of (:link - 1 - - 0 - - -8 - - - 2 - :) and (:link - 1 - - 0 - - -33 - - - 2 - :) in the above examples is well-formed. - - - - - 0 - - -15 - - - - 11 - 2 - (:auto !!:) All exception types that derive from boost::(:link - 1 - - 0 - - -30 - - - 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. When exceptions derive from boost::(:link - 1 - - 0 - - -30 - - - 2 - :), arbitrary data can be added to exception objects: *At the point of the throw; *At a later time as exceptions bubble up the call stack. (:include - 1 - - 0 - - -46 - - - 2 - :) (:include - 1 - - 0 - - -11 - - - 2 - :) (:include - 1 - - 0 - - -50 - - - 2 - :) - - - - - 0 - - -16 - - - - 33 - 2 - (:auto !!!:) Traditionally, when using exceptions to report failures, the throw site: *creates an exception object of the appropriate type, and *stuffs it with data relevant to the detected error. A higher context in the program contains a catch statement which: *selects failures based on exception types, and *inspects exception objects for data required to deal with the problem. The main issue with this "traditional" approach is that often, the data available at the point of the throw is insufficient for the catch site to handle the failure. Here is an example of a catch statement: [@catch( file_read_error & e ) { std::cerr << e.file_name(); }@] And here is a possible matching throw: [@void read_file( FILE * f ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error(???); .... }@] Clearly, the problem is that the handler requires a file name but the read_file function does not have a file name to put in the exception object; all it has is a FILE pointer! In an attempt to deal with this problem, we could modify read_file to accept a file name: [@void read_file( FILE * f, char const * name ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error(name); .... }@] This is not a real solution: it simply shifts the burden of supplying a file name to the immediate caller of the read_file function. ->''In general, the data required to handle a given library-emitted exception depends on the program that links to it. Many contexts between the throw and the catch may have relevant information which must be transported to the exception handler.'' !!!Exception wrapping The idea of exception wrapping is to catch an exception from a lower level function (such as the read_file function above), and throw a new exception object that contains the original exception (and also carries a file name.) This method seems to be particularly popular with C++ programmers with Java background. Exception wrapping leads to the following problems: *To wrap an exception object it must be copied, which may result in slicing. *Wrapping is practically impossible to use in generic contexts. The second point is actually special case of violating the exception neutrality principle. Most contexts in a program can not handle exceptions; such contexts should not interfere with the process of exception handling. !!!The boost::exception solution *Simply derive your exception types from boost::(:link - 1 - - 0 - - -30 - - - 2 - :). *Confidently limit the throw site to provide only data that is available naturally. *Use exception-neutral contexts between the throw and the catch to augment exceptions with more relevant data as they bubble up. For example, in the throw statement below we only add the errno code, since this is the only failure-relevant information available in this context: [@struct exception_base: virtual std::exception, virtual boost::(:link - 1 - - 0 - - -30 - - - 2 - :) { }; struct io_error: virtual exception_base { }; struct file_read_error: virtual io_error { }; typedef boost::(:link - 1 - - 0 - - -31 - - - 2 - :)<struct tag_errno_code,int> errno_code; void read_file( FILE * f ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error() (:link - 1 - - 0 - - -19 - - - 2 - |<<:) errno_code(errno); .... }@] In a higher exception-neutral context, we add the file name to ''any'' exception that derives from boost::(:link - 1 - - 0 - - -30 - - - 2 - :): [@typedef boost::(:link - 1 - - 0 - - -31 - - - 2 - :)<struct tag_file_name,std::string> file_name; .... try { if( FILE * fp=fopen("foo.txt","rt") ) { shared_ptr<FILE> f(fp,fclose); .... read_file(fp); //throws types deriving from boost::(:link - 1 - - 0 - - -30 - - - 2 - :) do_something(); .... } else throw file_open_error() (:link - 1 - - 0 - - -19 - - - 2 - |<<:) errno_code(errno); } catch( boost::(:link - 1 - - 0 - - -30 - - - 2 - :) & e ) { e (:link - 1 - - 0 - - -19 - - - 2 - |<<:) file_name("foo.txt"); throw; }@] Finally here is how the handler retreives data from exceptions that derive from boost::(:link - 1 - - 0 - - -30 - - - 2 - :): [@catch( io_error & e ) { std::cerr << "I/O Error!\n"; if( shared_ptr<std::string const> fn=(:link - 1 - - 0 - - -12 - - - 2 - :)<file_name>(e) ) std::cerr << "File name: " << *fn << "\n"; if( shared_ptr<int const> c=(:link - 1 - - 0 - - -12 - - - 2 - :)<errno_code>(e) ) std::cerr << "OS says: " << strerror(*c) << "\n"; }@] In addition, boost::(:link - 1 - - 0 - - -35 - - - 2 - :) can be used to compose an automatic (if not user-friendly) message that contains all of the (:link - 1 - - 0 - - -31 - - - 2 - :) objects added to a boost::(:link - 1 - - 0 - - -30 - - - 2 - :). This is useful for inclusion in logs and other diagnostic objects. - - - - - 0 - - -17 - - - - 7 - 2 - (:auto !!!:) Deriving from boost::(:link - 1 - - 0 - - -30 - - - 2 - :) effectively decouples the semantics of a failure from the information that is relevant to each individual instance of reporting a failure with a given semantic. In other words: with boost::(:link - 1 - - 0 - - -30 - - - 2 - :), what data a given exception object transports depends primarily on the context in which failures are reported (not on its type.) Since exception types need no members, it becomes very natural to throw exceptions that derive from more than one type to indicate multiple appropriate semantics: [@struct exception_base: virtual std::exception, virtual boost::(:link - 1 - - 0 - - -30 - - - 2 - :) { }; struct io_error: virtual exception_base { }; struct file_error: virtual io_error { }; struct read_error: virtual io_error { }; struct file_read_error: virtual file_error, virtual read_error { };@] Using this approach, exception types become a simple tagging system for categorizing errors and selecting failures in exception handlers. - - - - - 0 - - -18 - - - - 57 - 2 - (:auto !!!:) !!!Why use operator<< overload for adding info to exceptions? Before throwing an object of type that derives from boost::(:link - 1 - - 0 - - -30 - - - 2 :), it is often desirable to add one or more (:link 1 0 - -31 + -35 2 @@ -6223,7 +5467,7 @@ 0 - -19 + -6 2 @@ -6232,7 +5476,7 @@ 0 - -19 + -6 2 @@ -6241,7 +5485,7 @@ 0 - -19 + -6 2 @@ -6250,7 +5494,7 @@ 0 - -31 + -35 2 @@ -6259,66 +5503,12 @@ 0 - -30 + -34 2 :) & e ) { e (:link 1 - - 0 - - -19 - - - 2 - |<<:) foo_info(foo); throw e; //Compile error: boost::(:link - 1 - - 0 - - -30 - - - 2 - :) is abstract }@] The correct code is: [@catch( boost::(:link - 1 - - 0 - - -30 - - - 2 - :) & e ) { e (:link - 1 - - 0 - - -19 - - - 2 - |<<:) foo_info(foo); throw; //Okay, re-throwing the original exception object. }@] !!!Why doesn't boost::exception derive from std::exception? Despite that (:link - 1 - - 0 - - -29 - - - 2 - |virtual inheritance should be used in deriving from base exception types:), many programmers fail to follow this principle when deriving from std::exception. If boost::(:link - 1 - - 0 - - -30 - - - 2 - :) derives from std::exception, using the - 1 0 @@ -6326,12 +5516,66 @@ 2 + |<<:) foo_info(foo); throw e; //Compile error: boost::(:link + 1 + + 0 + + -34 + + + 2 + :) is abstract }@] The correct code is: [@catch( boost::(:link + 1 + + 0 + + -34 + + + 2 + :) & e ) { e (:link + 1 + + 0 + + -6 + + + 2 + |<<:) foo_info(foo); throw; //Okay, re-throwing the original exception object. }@] !!!Why doesn't boost::exception derive from std::exception? Despite that (:link + 1 + + 0 + + -33 + + + 2 + |virtual inheritance should be used in deriving from base exception types:), many programmers fail to follow this principle when deriving from std::exception. If boost::(:link + 1 + + 0 + + -34 + + + 2 + :) derives from std::exception, using the + 1 + + 0 + + -7 + + + 2 function with such user-defined types would introduce dangerous ambiguity which would break all catch(std::exception &) statements. Of course, boost::(:link 1 0 - -30 + -34 2 @@ -6340,7 +5584,7 @@ 0 - -30 + -34 2 @@ -6349,7 +5593,7 @@ 0 - -30 + -34 2 @@ -6358,7 +5602,7 @@ 0 - -27 + -31 2 @@ -6367,7 +5611,7 @@ 0 - -30 + -34 2 @@ -6376,7 +5620,7 @@ 0 - -27 + -31 2 @@ -6385,7 +5629,7 @@ 0 - -30 + -34 2 @@ -6394,7 +5638,7 @@ 0 - -32 + -8 2 @@ -6403,7 +5647,7 @@ 0 - -20 + -17 2 @@ -6412,7 +5656,7 @@ 0 - -27 + -31 2 @@ -6421,7 +5665,7 @@ 0 - -5 + -18 2 @@ -6430,7 +5674,7 @@ 0 - -35 + -21 2 @@ -6439,7 +5683,7 @@ 0 - -35 + -21 2 @@ -6448,7 +5692,7 @@ 0 - -5 + -18 2 @@ -6459,98 +5703,13 @@ 0 - -19 + -10 7 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link - 1 - - 0 - - -30 - - - 2 - :), or a type that derives (indirectly) from boost::(:link - 1 - - 0 - - -30 - - - 2 - :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link - 1 - - 0 - - -31 - - - 2 - :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) - - - - - 0 - - -20 - - - - 21 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: T must be a class with 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 (:link - 1 - - 0 - - -32 - - - 2 - :) support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link - 1 - - 0 - - -20 - - - 2 - :)(my_exception());@] Unless (:link - 1 - - 0 - - -20 - - - 2 - :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link - 1 - - 0 - - -8 - - - 2 - :) may return an (:link - 1 - - 0 - - -32 - - - 2 - :) which refers to an instance of (:link + (:auto !!!:) Deriving from boost::(:link 1 0 @@ -6559,7 +5718,177 @@ 2 - :). See (:link + :) effectively decouples the semantics of a failure from the information that is relevant to each individual instance of reporting a failure with a given semantic. In other words: with boost::(:link + 1 + + 0 + + -34 + + + 2 + :), what data a given exception object transports depends primarily on the context in which failures are reported (not on its type.) Since exception types need no members, it becomes very natural to throw exceptions that derive from more than one type to indicate multiple appropriate semantics: [@struct exception_base: virtual std::exception, virtual boost::(:link + 1 + + 0 + + -34 + + + 2 + :) { }; struct io_error: virtual exception_base { }; struct file_error: virtual io_error { }; struct read_error: virtual io_error { }; struct file_read_error: virtual file_error, virtual read_error { };@] Using this approach, exception types become a simple tagging system for categorizing errors and selecting failures in exception handlers. + + + + + 0 + + -11 + + + + 27 + 2 + (:auto !!:) Some exception hierarchies can not be modified to make boost::(:link + 1 + + 0 + + -34 + + + 2 + :) a base type. In this case, the (:link + 1 + + 0 + + -7 + + + 2 + :) function template can be used to make exception objects derive from boost::(:link + 1 + + 0 + + -34 + + + 2 + :) anyway. Here is an example: [@#include <(:link + 1 + + 0 + + -46 + + + 2 + :)> #include <stdexcept> typedef boost::(:link + 1 + + 0 + + -35 + + + 2 + :)<struct tag_std_range_min,size_t> std_range_min; typedef boost::(:link + 1 + + 0 + + -35 + + + 2 + :)<struct tag_std_range_max,size_t> std_range_max; typedef boost::(:link + 1 + + 0 + + -35 + + + 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 + + -7 + + + 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 + + -7 + + + 2 + :)<T> gets us an object of ''unspecified type'' which is guaranteed to derive from both boost::(:link + 1 + + 0 + + -34 + + + 2 + :) and T. This makes it possible to use (:link + 1 + + 0 + + -6 + + + 2 + mod="/":) 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 + + -34 + + + 2 + :) &, so that (:link + 1 + + 0 + + -13 + + + 2 + |more information can be added to the exception at a later time:). + + + + + 0 + + -12 + + + + 37 + 2 + (:auto !!!:) When you catch an exception, you can call (:link + 1 + + 0 + + -22 + + + 2 + :) to get an (:link 1 0 @@ -6568,25 +5897,61 @@ 2 - :) for details. !!!!Note: Instead of using the throw keyword directly, it is preferable to call boost::(:link + :) object: [@#include <(:link 1 0 - -27 + -53 2 - :). This is guaranteed to throw an exception that derives from boost::(:link + :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link 1 0 - -30 + -34 2 - :) and supports the (:link + :)s void worker_thread( boost::(:link + 1 + + 0 + + -8 + + + 2 + :) & error ) { try { do_work(); error = boost::(:link + 1 + + 0 + + -8 + + + 2 + :)(); } catch( ... ) { error = boost::(:link + 1 + + 0 + + -22 + + + 2 + :)(); } }@] In the above example, note that (:link + 1 + + 0 + + -22 + + + 2 + :) captures the original type of the exception object. The exception can be thrown again using the (:link 1 0 @@ -6595,14 +5960,184 @@ 2 - :) functionality. + :) function: [@// ...continued void work() { boost::(:link + 1 + + 0 + + -8 + + + 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 + + -32 + + + 2 + :)(error); }@] Note that (:link + 1 + + 0 + + -22 + + + 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 + + -8 + + + 2 + :) points to an instance of std::bad_alloc, or * if (:link + 1 + + 0 + + -17 + + + 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 + + -8 + + + 2 + :) points to an instance of (:link + 1 + + 0 + + -37 + + + 2 + :). Regardless, the use of (:link + 1 + + 0 + + -22 + + + 2 + :) and (:link + 1 + + 0 + + -32 + + + 2 + :) in the above examples is well-formed. 0 - -21 + -13 + + + + 11 + 2 + (:auto !!:) All exception types that derive from boost::(:link + 1 + + 0 + + -34 + + + 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. When exceptions derive from boost::(:link + 1 + + 0 + + -34 + + + 2 + :), arbitrary data can be added to exception objects: *At the point of the throw; *At a later time as exceptions bubble up the call stack. (:include + 1 + + 0 + + -57 + + + 2 + :) (:include + 1 + + 0 + + -40 + + + 2 + :) (:include + 1 + + 0 + + -59 + + + 2 + :) + + + + + 0 + + -14 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) !!!!Effects: As if [@try { throw + 1 + + 0 + + -17 + + + 2 + (e); } catch(...) { return (:link + 1 + + 0 + + -22 + + + 2 + :)(); }@] + + + + + 0 + + -15 @@ -6613,7 +6148,7 @@ 0 - -30 + -34 2 @@ -6622,13 +6157,622 @@ 0 - -30 + -34 2 :). !!!!Effects: Equivalent to x << v.(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements|get:)<0>() << ... << v.(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements|get:)<N>(). !!!!Returns: x. (:include throws:) + + + 0 + + -16 + + + + 15 + 2 + (:auto !!:) Boost Exception responds to the following configuration macros: '''BOOST_NO_RTTI'''\\ '''BOOST_NO_TYPEID''' The first macro prevents Boost Exception from using dynamic_cast and dynamic typeid. If the second macro is also defined, Boost Exception does not use static typeid either. There are no observable degrading effects on the library functionality, except for the following: ->By default, the (:link + 1 + + 0 + + -28 + + + 2 + :) function template can be called with any exception type. If BOOST_NO_RTTI is defined, (:link + 1 + + 0 + + -28 + + + 2 + :) can be used only with objects of type boost::(:link + 1 + + 0 + + -34 + + + 2 + :). !!!!Note: The library needs RTTI functionality. Disabling the language RTTI support enables an internal RTTI system, which may have more or less overhead depending on the platform. '''BOOST_EXCEPTION_DISABLE''' By default, (:link + 1 + + 0 + + -17 + + + 2 + :) and (:link + 1 + + 0 + + -7 + + + 2 + :) are integrated directly in the (:link + 1 + + 0 + + -31 + + + 2 + :) function. Defining BOOST_EXCEPTION_DISABLE disables this integration. Note that on some non-conformant compilers, for example MSVC 7.0 and older, as well as BCC, BOOST_EXCEPTION_DISABLE is implicitly defined in (:link + 1 + + 0 + + -54 + + + 2 + :). + + + + + 0 + + -17 + + + + 21 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: T must be a class with 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 (:link + 1 + + 0 + + -8 + + + 2 + :) support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link + 1 + + 0 + + -17 + + + 2 + :)(my_exception());@] Unless (:link + 1 + + 0 + + -17 + + + 2 + :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link + 1 + + 0 + + -22 + + + 2 + :) may return an (:link + 1 + + 0 + + -8 + + + 2 + :) which refers to an instance of (:link + 1 + + 0 + + -37 + + + 2 + :). See (:link + 1 + + 0 + + -22 + + + 2 + :) for details. !!!!Note: Instead of using the throw keyword directly, it is preferable to call boost::(:link + 1 + + 0 + + -31 + + + 2 + :). This is guaranteed to throw an exception that derives from boost::(:link + 1 + + 0 + + -34 + + + 2 + :) and supports the (:link + 1 + + 0 + + -8 + + + 2 + :) functionality. + + + + + 0 + + -18 + + + + 7 + 2 + (:auto !!!:) (:include synopsis:) This macro takes an exception object, records BOOST_CURRENT_FUNCTION, __FILE__ and __LINE__ in it, and forwards it to + 1 + + 0 + + -31 + + + 2 + . To recover this information at the catch site, use + 1 + + 0 + + -28 + + + 2 + ; the information is also included in the message returned by + 1 + + 0 + + -21 + + + 2 + . + + + + + 0 + + -19 + + + + 33 + 2 + (:auto !!!:) Traditionally, when using exceptions to report failures, the throw site: *creates an exception object of the appropriate type, and *stuffs it with data relevant to the detected error. A higher context in the program contains a catch statement which: *selects failures based on exception types, and *inspects exception objects for data required to deal with the problem. The main issue with this "traditional" approach is that often, the data available at the point of the throw is insufficient for the catch site to handle the failure. Here is an example of a catch statement: [@catch( file_read_error & e ) { std::cerr << e.file_name(); }@] And here is a possible matching throw: [@void read_file( FILE * f ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error(???); .... }@] Clearly, the problem is that the handler requires a file name but the read_file function does not have a file name to put in the exception object; all it has is a FILE pointer! In an attempt to deal with this problem, we could modify read_file to accept a file name: [@void read_file( FILE * f, char const * name ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error(name); .... }@] This is not a real solution: it simply shifts the burden of supplying a file name to the immediate caller of the read_file function. ->''In general, the data required to handle a given library-emitted exception depends on the program that links to it. Many contexts between the throw and the catch may have relevant information which must be transported to the exception handler.'' !!!Exception wrapping The idea of exception wrapping is to catch an exception from a lower level function (such as the read_file function above), and throw a new exception object that contains the original exception (and also carries a file name.) This method seems to be particularly popular with C++ programmers with Java background. Exception wrapping leads to the following problems: *To wrap an exception object it must be copied, which may result in slicing. *Wrapping is practically impossible to use in generic contexts. The second point is actually special case of violating the exception neutrality principle. Most contexts in a program can not handle exceptions; such contexts should not interfere with the process of exception handling. !!!The boost::exception solution *Simply derive your exception types from boost::(:link + 1 + + 0 + + -34 + + + 2 + :). *Confidently limit the throw site to provide only data that is available naturally. *Use exception-neutral contexts between the throw and the catch to augment exceptions with more relevant data as they bubble up. For example, in the throw statement below we only add the errno code, since this is the only failure-relevant information available in this context: [@struct exception_base: virtual std::exception, virtual boost::(:link + 1 + + 0 + + -34 + + + 2 + :) { }; struct io_error: virtual exception_base { }; struct file_read_error: virtual io_error { }; typedef boost::(:link + 1 + + 0 + + -35 + + + 2 + :)<struct tag_errno_code,int> errno_code; void read_file( FILE * f ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error() (:link + 1 + + 0 + + -6 + + + 2 + |<<:) errno_code(errno); .... }@] In a higher exception-neutral context, we add the file name to ''any'' exception that derives from boost::(:link + 1 + + 0 + + -34 + + + 2 + :): [@typedef boost::(:link + 1 + + 0 + + -35 + + + 2 + :)<struct tag_file_name,std::string> file_name; .... try { if( FILE * fp=fopen("foo.txt","rt") ) { shared_ptr<FILE> f(fp,fclose); .... read_file(fp); //throws types deriving from boost::(:link + 1 + + 0 + + -34 + + + 2 + :) do_something(); .... } else throw file_open_error() (:link + 1 + + 0 + + -6 + + + 2 + |<<:) errno_code(errno); } catch( boost::(:link + 1 + + 0 + + -34 + + + 2 + :) & e ) { e (:link + 1 + + 0 + + -6 + + + 2 + |<<:) file_name("foo.txt"); throw; }@] Finally here is how the handler retrieves data from exceptions that derive from boost::(:link + 1 + + 0 + + -34 + + + 2 + :): [@catch( io_error & e ) { std::cerr << "I/O Error!\n"; if( shared_ptr<std::string const> fn=(:link + 1 + + 0 + + -28 + + + 2 + :)<file_name>(e) ) std::cerr << "File name: " << *fn << "\n"; if( shared_ptr<int const> c=(:link + 1 + + 0 + + -28 + + + 2 + :)<errno_code>(e) ) std::cerr << "OS says: " << strerror(*c) << "\n"; }@] In addition, boost::(:link + 1 + + 0 + + -21 + + + 2 + :) can be used to compose an automatic (if not user-friendly) message that contains all of the (:link + 1 + + 0 + + -35 + + + 2 + :) objects added to a boost::(:link + 1 + + 0 + + -34 + + + 2 + :). This is useful for inclusion in logs and other diagnostic objects. + + + + + 0 + + -20 + + + + 19 + 2 + (:auto !!:) Boost Exception provides a namespace-scope function (:link + 1 + + 0 + + -21 + + + 2 + :) which takes a boost::(:link + 1 + + 0 + + -34 + + + 2 + :). The returned string contains: *the string representation of all data objects added to the boost::(:link + 1 + + 0 + + -34 + + + 2 + :) through (:link + 1 + + 0 + + -6 + + + 2 + mod="/":); *the output from std::exception::what; *additional platform-specific diagnostic information. The returned string 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 + + -46 + + + 2 + :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link + 1 + + 0 + + -34 + + + 2 + :). void g() { try { f(); } catch( boost::(:link + 1 + + 0 + + -34 + + + 2 + :) & e ) { std::cerr << (:link + 1 + + 0 + + -21 + + + 2 + :)(e); } }@] (:include + 1 + + 0 + + -58 + + + 2 + :) + + + + + 0 + + -21 + + + + 29 + 2 + (:auto !!!:) (:include synopsis:) !!!!Returns: A string value that contains varying amount of implementation-specific diagnostic information about the passed exception object: *If E can be statically converted to boost::(:link + 1 + + 0 + + -34 + + + 2 + :), the returned value contains the string representations of all (:link + 1 + + 0 + + -35 + + + 2 + :) objects stored in the boost::(:link + 1 + + 0 + + -34 + + + 2 + :) through (:link + 1 + + 0 + + -6 + + + 2 + mod="/":), along with other diagnostic information relevant to the exception. If e can be dynamically converted to std::exception, the returned value also contains the what() string. *Otherwise, if E can be statically converted std::exception: **if e can be dynamically converted to boost::exception, the returned value is the same as if E could be statically converted to boost::(:link + 1 + + 0 + + -34 + + + 2 + :); **otherwise the returned value contains the what() string. *Otherwise, the boost:: + 1 + + 0 + + -21 + + + 2 + template is not available. The string representation of each (:link + 1 + + 0 + + -35 + + + 2 + :) object is deduced by a function call that is bound at the time the (:link + 1 + + 0 + + -35 + + + 2 + :)<Tag,T> template is instantiated. The following overload resolutions are attempted in order: #Unqualified call to to_string(x), where x is of type (:link + 1 + + 0 + + -35 + + + 2 + :)<Tag,T> (the return value is expected to be of type std::string.) #Unqualified call to to_string(x.(:link + 1 + + 0 + + -43 + + + 2 + mod="m":)()) (the return value is expected to be of type std::string.) #Unqualified call to s << x.(:link + 1 + + 0 + + -43 + + + 2 + mod="m":)(), where s is a std::ostringstream. The first successfully bound function is used at the time (:link + 1 + + 0 + + -21 + + + 2 + :) is called; if all 3 overload resolutions are unsuccessful, the system is unable to convert the (:link + 1 + + 0 + + -35 + + + 2 + :) object to string, and ''an unspecified stub string value is used without issuing a compile error.'' !!!!Notes: *The format of the returned string is unspecified. *The returned string is ''not'' user-friendly. *The returned string may include additional platform-specific diagnostic information. (:include + 1 + + 0 + + -58 + + + 2 + :) + + 0 @@ -6637,9 +6781,135 @@ - 1 + 29 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!!:) (:include synopsis:) !!!!Requirements: The (:link + 1 + + 0 + + -22 + + + 2 + :) function must not be called outside of a catch block. !!!!Returns: * An (:link + 1 + + 0 + + -8 + + + 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 + + -8 + + + 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 + + -22 + + + 2 + :) refer to the same exception object. * Correct implementation of (:link + 1 + + 0 + + -22 + + + 2 + :) may require compiler support, unless (:link + 1 + + 0 + + -17 + + + 2 + :) was used at the time the currently handled exception object was passed to throw. If (:link + 1 + + 0 + + -17 + + + 2 + :) was not used, and if the compiler does not provide the necessary support, then (:link + 1 + + 0 + + -22 + + + 2 + :) may return an (:link + 1 + + 0 + + -8 + + + 2 + :) that refers to an instance of (:link + 1 + + 0 + + -37 + + + 2 + :). In this case, if the original exception object derives from boost::(:link + 1 + + 0 + + -34 + + + 2 + :), then the boost::(:link + 1 + + 0 + + -34 + + + 2 + :) sub-object of the (:link + 1 + + 0 + + -37 + + + 2 + :) object is initialized by the boost::(:link + 1 + + 0 + + -34 + + + 2 + :) copy constructor. @@ -6663,18 +6933,9 @@ - 3 + 1 2 - (:auto !!!:) (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link - 1 - - 0 - - -30 - - - 2 - :) object. !!!!Throws: Nothing. + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -6685,7 +6946,18 @@ - 0 + 3 + 2 + (:auto !!!:) (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link + 1 + + 0 + + -34 + + + 2 + :) object. !!!!Throws: Nothing. @@ -6696,54 +6968,9 @@ - 11 + 1 2 - (:auto !!:) Boost Exception supports transporting of exception objects between threads through cloning. This system is similar to (:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:), but because Boost Exception can not rely on language support, the use of (:link - 1 - - 0 - - -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 - 1 - - 0 - - -27 - - - 2 - :) are guaranteed to derive from boost::(:link - 1 - - 0 - - -30 - - - 2 - :) and to support cloning. (:include - 1 - - 0 - - -51 - - - 2 - :) (:include - 1 - - 0 - - -14 - - - 2 - :) + (:auto !!!:) !!!Synopsis (:include synopsis:) @@ -6754,9 +6981,27 @@ - 13 + 9 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must derive publicly from std::exception. !!!!Effects: * If BOOST_NO_EXCEPTIONS is not defined, boost::(:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: This function must not be called outside of a catch block. !!!!Returns: If the current exception object can be converted to boost::(:link + 1 + + 0 + + -34 + + + 2 + :) or std::exception, this function returns the same string value returned by (:link + 1 + + 0 + + -21 + + + 2 + :) for the current exception object. Otherwise, an unspecified non-empty string is returned. Typical use is to call 1 0 @@ -6765,25 +7010,7 @@ 2 - :)(e) is equivalent to throw boost::(:link - 1 - - 0 - - -20 - - - 2 - :)(boost::(:link - 1 - - 0 - - -6 - - - 2 - :)(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::(:link + from a top-level function to output diagnostic information about unhandled exceptions: [@int main() { try { run_program(); } catch( error & e ) { //handle error } catch( ...) { std::cerr << "Unhandled exception!" << std::endl << boost:: 1 0 @@ -6792,25 +7019,7 @@ 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 (:link - 1 - - 0 - - -27 - - - 2 - :) are allowed to assume that the function never returns; therefore, if the user-defined (:link - 1 - - 0 - - -27 - - - 2 - :) returns, the behavior is undefined. + (); } }@] @@ -6821,9 +7030,9 @@ - 19 + 13 2 - (:auto !!:) Boost Exception provides a namespace-scope function (:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link 1 0 @@ -6832,79 +7041,52 @@ 2 - :) which takes a boost::(:link + :) template. * E must be polymorphic. !!!!Returns: * If dynamic_cast<boost::(:link 1 0 - -30 + -34 2 - :). The returned string contains: *the string representation of all data objects added to the boost::(:link + :) const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is null. * Otherwise, the returned pointer points to the stored value (use (:link 1 0 - -30 + -6 2 - :) through (:link + mod="/":) to store values in exception objects.) When x is destroyed, any pointers returned by (:link 1 0 - -19 + -28 2 - mod="/":); *the output from std::exception::what; *additional platform-specific diagnostic information. The returned string 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 + :) become invalid. !!!!Throws: Nothing. !!!!Note: The interface of (:link 1 0 - -37 + -28 2 - :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link + :) may be affected by the build (:link 1 0 - -30 + -16 2 - :). void g() { try { f(); } catch( boost::(:link - 1 - - 0 - - -30 - - - 2 - :) & e ) { std::cerr << (:link - 1 - - 0 - - -35 - - - 2 - :)(e); } }@] (:include - 1 - - 0 - - -52 - - - 2 - :) + :). @@ -6915,9 +7097,9 @@ - 5 + 69 2 - (:auto !!!:) Exception types should use virtual inheritance when deriving from other exception types. This insight is due to Andrew Koenig. Using virtual inheritance prevents ambiguity problems in the exception handler: [@#include <iostream> struct my_exc1 : std::exception { char const* what() const throw(); }; struct my_exc2 : std::exception { char const* what() const throw(); }; struct your_exc3 : my_exc1, my_exc2 {}; int main() { try { throw your_exc3(); } catch(std::exception const& e) {} catch(...) { std::cout << "whoops!" << std::endl; } }@] The program above outputs "whoops!" because the conversion to std::exception is ambiguous. The overhead introduced by virtual inheritance is always negligible in the context of exception handling. Note that virtual bases are initialized directly by the constructor of the most-derived-type (the type passed to the throw statement, in case of exceptions.) However, typically this detail is of no concern when boost::(:link + !!Introduction The purpose of Boost Exception is to ease the design of exception class hierarchies and to help write exception handling and error reporting code. It supports transporting of arbitrary data to the catch site, which is otherwise tricky due to the no-throw requirements (15.5.1) for exception types. Data can be added to any exception object, either directly in the throw-expression (15.1), or at a later time as the exception object propagates up the call stack. The ability to add data to exception objects after they have been passed to throw is important, because often some of the information needed to handle an exception is unavailable in the context where the failure is detected. Boost Exception also supports (:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:)-style (:link 1 0 @@ -6926,7 +7108,160 @@ 2 - :) is used, because it enables exception types to be trivial structs with no members (there's nothing to initialize.) See (:link + |copying:) of exception objects, implemented non-intrusively and automatically by the boost::(:link + 1 + + 0 + + -31 + + + 2 + :) function. !!Contents #(:link + 1 + + 0 + + -19 + + + 2 + :) #Tutorial ##(:link + 1 + + 0 + + -13 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -11 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -30 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -10 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -33 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -20 + + + 2 + mod="w":) #Documentation ##Class (:link + 1 + + 0 + + -34 + + + 2 + :) ##Throwing Exceptions ###(:link + 1 + + 0 + + -18 + + + 2 + :) ###(:link + 1 + + 0 + + -31 + + + 2 + :) ##Transporting of Arbitrary Data to the Catch Site ###(:link + 1 + + 0 + + -35 + + + 2 + :) ###(:link + 1 + + 0 + + -6 + + + 2 + :) ###(:link + 1 + + 0 + + -15 + + + 2 + :) ###(:link + 1 + + 0 + + -28 + + + 2 + :) ###(:link + 1 + + 0 + + -7 + + + 2 + :) ##(:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:) Transporting of Exceptions between Threads ###(:link + 1 + + 0 + + -8 + + + 2 + :) ###(:link 1 0 @@ -6935,7 +7270,142 @@ 2 - mod="w":). + :) ###(:link + 1 + + 0 + + -22 + + + 2 + :) ###(:link + 1 + + 0 + + -14 + + + 2 + :) ###(:link + 1 + + 0 + + -32 + + + 2 + :) ###(:link + 1 + + 0 + + -37 + + + 2 + :) ##Diagnostic Information ###(:link + 1 + + 0 + + -21 + + + 2 + :) ###(:link + 1 + + 0 + + -27 + + + 2 + :) ##(:link + 1 + + 0 + + -38 + + + 2 + :) #API ##(:link + 1 + + 0 + + -60 + + + 2 + :) ##(:link + 1 + + 0 + + -49 + + + 2 + :) ##(:link + 1 + + 0 + + -39 + + + 2 + :) ##(:link + 1 + + 0 + + -44 + + + 2 + :) ##(:link + 1 + + 0 + + -51 + + + 2 + :) ##(:link + 1 + + 0 + + -16 + + + 2 + mod="w":) #(:link + 1 + + 0 + + -9 + + + 2 + mod="w":) #(:link + 1 + + 0 + + -55 + + + 2 + mod="w":) !!!Acknowledgements Thanks to Peter Dimov for his continuing help. Also thanks to Tobias Schwinger, Tom Brinkman, Pavel Vozenilek and everyone who participated in the review process. @@ -6946,27 +7416,18 @@ - 13 + 11 2 - (:auto !!!:) (:include synopsis:) Class boost::(:link + (:auto !!:) Boost Exception supports transporting of exception objects between threads through cloning. This system is similar to (:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:), but because Boost Exception can not rely on language support, the use of (:link 1 0 - -30 + -17 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 - - -30 - - - 2 - :) can store data of arbitrary types, using the (: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 @@ -6975,25 +7436,25 @@ 2 - :) wrapper and (:link + :) are guaranteed to derive from boost::(:link 1 0 - -19 + -34 2 - mod="/":). To retrieve data from a boost::(:link + :) and to support cloning. (:include 1 0 - -30 + -36 2 - :) object, use the (:link + :) (:include 1 0 @@ -7002,7 +7463,7 @@ 2 - :) function template. + :) @@ -7013,9 +7474,9 @@ - 37 + 13 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: T must have accessible copy constructor and must not be a reference (there is no requirement that T's copy constructor does not throw.) !!!!Description: This class template is used to associate a Tag type with a value type T. Objects of type (:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must derive publicly from std::exception. !!!!Effects: * If BOOST_NO_EXCEPTIONS is not defined, boost::(:link 1 0 @@ -7024,34 +7485,25 @@ 2 - :)<Tag,T> can be passed to (:link + :)(e) is equivalent to throw boost::(:link 1 0 - -19 + -17 2 - mod="/":) to be stored in objects of type boost::(:link + :)(boost::(:link 1 0 - -30 + -7 2 - :). !!!!Usage: The header <(:link - 1 - - 0 - - -40 - - - 2 - :)> provides a declaration of the (:link + :)(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::(:link 1 0 @@ -7060,16 +7512,7 @@ 2 - :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, for example: [@#include <(:link - 1 - - 0 - - -40 - - - 2 - :)> struct tag_errno; typedef boost::(:link + :)(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 (:link 1 0 @@ -7078,16 +7521,7 @@ 2 - :)<tag_errno,int> errno_info;@] Or, the shorter equivalent: [@#include <(:link - 1 - - 0 - - -40 - - - 2 - :)> typedef boost::(:link + :) are allowed to assume that the function never returns; therefore, if the user-defined (:link 1 0 @@ -7096,88 +7530,7 @@ 2 - :)<struct tag_errno,int> errno_info;@] This errno_info typedef can be passed to (:link - 1 - - 0 - - -19 - - - 2 - mod="/":) (#include <(:link - 1 - - 0 - - -41 - - - 2 - :)> first) to store an int named tag_errno in exceptions of types that derive from boost::(:link - 1 - - 0 - - -30 - - - 2 - :): [@throw file_read_error() (:link - 1 - - 0 - - -19 - - - 2 - |<<:) errno_info(errno);@] It can also be passed to - 1 - - 0 - - -12 - - - 2 - (#include < - 1 - - 0 - - -23 - - - 2 - > first) to retrieve the tag_errno int from a boost::(:link - 1 - - 0 - - -30 - - - 2 - :): [@catch( boost::(:link - 1 - - 0 - - -30 - - - 2 - :) & x ) { if( boost::shared_ptr<int const> e=boost:: - 1 - - 0 - - -12 - - - 2 - <errno_info>(x) ) .... }@] + :) returns, the behavior is undefined. @@ -7187,91 +7540,6 @@ -32 - - 17 - 2 - (:auto !!!:) (:include synopsis:) The (:link - 1 - - 0 - - -32 - - - 2 - :) type can be used to refer to a copy of an exception object. It is Default Constructible, Copy Constructible, Assignable and Equality Comparable; (:link - 1 - - 0 - - -32 - - - 2 - :)'s operations do not throw. Two instances of (:link - 1 - - 0 - - -32 - - - 2 - :) are equivalent and compare equal if and only if they refer to the same exception. The default constructor of (:link - 1 - - 0 - - -32 - - - 2 - :) produces the null value of the type. The null value is equivalent only to itself. !!!!Thread safety * It is legal for multiple threads to hold (:link - 1 - - 0 - - -32 - - - 2 - :) references to the same exception object. * It is illegal for multiple threads to modify the same (:link - 1 - - 0 - - -32 - - - 2 - :) object concurrently. * While calling (:link - 1 - - 0 - - -8 - - - 2 - :) makes a copy of the current exception object, it is still possible for the two copies to share internal state. Therefore, in general it is not safe to call (:link - 1 - - 0 - - -33 - - - 2 - :) concurrently to throw the same exception object into multiple threads. - - - - - 0 - - -33 - - 1 2 @@ -7282,31 +7550,98 @@ 0 - -34 + -33 5 2 - (:auto !!!:) (:include synopsis:) This type is used by the (:link + (:auto !!!:) Exception types should use virtual inheritance when deriving from other exception types. This insight is due to Andrew Koenig. Using virtual inheritance prevents ambiguity problems in the exception handler: [@#include <iostream> struct my_exc1 : std::exception { char const* what() const throw(); }; struct my_exc2 : std::exception { char const* what() const throw(); }; struct your_exc3 : my_exc1, my_exc2 {}; int main() { try { throw your_exc3(); } catch(std::exception const& e) {} catch(...) { std::cout << "whoops!" << std::endl; } }@] The program above outputs "whoops!" because the conversion to std::exception is ambiguous. The overhead introduced by virtual inheritance is always negligible in the context of exception handling. Note that virtual bases are initialized directly by the constructor of the most-derived-type (the type passed to the throw statement, in case of exceptions.) However, typically this detail is of no concern when boost::(:link 1 0 - -32 + -34 2 - :) support in Boost Exception. Please see (:link + :) is used, because it enables exception types to be trivial structs with no members (there's nothing to initialize.) See (:link 1 0 - -8 + -10 2 - :). + mod="w":). + + + + + 0 + + -34 + + + + 13 + 2 + (:auto !!!:) (:include synopsis:) Class boost::(:link + 1 + + 0 + + -34 + + + 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 + + -34 + + + 2 + :) can store data of arbitrary types, using the (:link + 1 + + 0 + + -35 + + + 2 + :) wrapper and (:link + 1 + + 0 + + -6 + + + 2 + mod="/":). To retrieve data from a boost::(:link + 1 + + 0 + + -34 + + + 2 + :) object, use the (:link + 1 + + 0 + + -28 + + + 2 + :) function template. @@ -7317,81 +7652,9 @@ - 23 + 37 2 - (:auto !!!:) (:include synopsis:) !!!!Returns: This function returns a string value that is automatically composed from the string representations of all (:link - 1 - - 0 - - -31 - - - 2 - :) objects stored in a boost::(:link - 1 - - 0 - - -30 - - - 2 - :) through (:link - 1 - - 0 - - -19 - - - 2 - mod="/":), along with other diagnostic information relevant to the exception. The string representation of each (:link - 1 - - 0 - - -31 - - - 2 - :) object is deduced by a function call that is bound at the time the (:link - 1 - - 0 - - -31 - - - 2 - :)<Tag,T> template is instantiated. The following overload resolutions are attempted in order: #Unqualified call to to_string(x), where x is of type (:link - 1 - - 0 - - -31 - - - 2 - :)<Tag,T> (the return value is expected to be of type std::string.) #Unqualified call to to_string(x.(:link - 1 - - 0 - - -48 - - - 2 - mod="m":)()) (the return value is expected to be of type std::string.) #Unqualified call to s << x.(:link - 1 - - 0 - - -48 - - - 2 - mod="m":)(), where s is a std::ostringstream. The first successfully bound function is used at the time (:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: T must have accessible copy constructor and must not be a reference (there is no requirement that T's copy constructor does not throw.) !!!!Description: This class template is used to associate a Tag type with a value type T. Objects of type (:link 1 0 @@ -7400,16 +7663,88 @@ 2 - :) is called; if all 3 overload resolutions are unsuccessful, the system is unable to convert the (:link + :)<Tag,T> can be passed to (:link 1 0 - -31 + -6 2 - :) object to string, and ''an unspecified stub string value is used without issuing a compile error.'' !!!!Notes: *The format of the returned string is unspecified. *The returned string is ''not'' user-friendly. *If dynamic_cast<std::exception const *>(&x) is not null, the returned string includes the output from std::exception::what. *The returned string may include additional platform-specific diagnostic information. (:include + mod="/":) to be stored in objects of type boost::(:link + 1 + + 0 + + -34 + + + 2 + :). !!!!Usage: The header <(:link + 1 + + 0 + + -50 + + + 2 + :)> provides a declaration of the (:link + 1 + + 0 + + -35 + + + 2 + :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, for example: [@#include <(:link + 1 + + 0 + + -50 + + + 2 + :)> struct tag_errno; typedef boost::(:link + 1 + + 0 + + -35 + + + 2 + :)<tag_errno,int> errno_info;@] Or, the shorter equivalent: [@#include <(:link + 1 + + 0 + + -50 + + + 2 + :)> typedef boost::(:link + 1 + + 0 + + -35 + + + 2 + :)<struct tag_errno,int> errno_info;@] This errno_info typedef can be passed to (:link + 1 + + 0 + + -6 + + + 2 + mod="/":) (#include <(:link 1 0 @@ -7418,7 +7753,70 @@ 2 - :) + :)> first) to store an int named tag_errno in exceptions of types that derive from boost::(:link + 1 + + 0 + + -34 + + + 2 + :): [@throw file_read_error() (:link + 1 + + 0 + + -6 + + + 2 + |<<:) errno_info(errno);@] It can also be passed to + 1 + + 0 + + -28 + + + 2 + (#include < + 1 + + 0 + + -24 + + + 2 + > first) to retrieve the tag_errno int from a boost::(:link + 1 + + 0 + + -34 + + + 2 + :): [@catch( boost::(:link + 1 + + 0 + + -34 + + + 2 + :) & x ) { if( boost::shared_ptr<int const> e=boost:: + 1 + + 0 + + -28 + + + 2 + <errno_info>(x) ) .... }@] @@ -7429,68 +7827,50 @@ - 15 + 11 2 - (:auto !!!:) Boost Exception responds to the following configuration macros: '''BOOST_NO_RTTI'''\\ '''BOOST_NO_TYPEID''' The first macro prevents Boost Exception from using dynamic_cast and dynamic typeid. If the second macro is also defined, Boost Exception does not use static typeid either. There are no observable degrading effects on the library functionality, except for the following: ->By default, the (:link + (:auto !!!:) Here is how cloning can be enabled in a throw-expression (15.1): [@#include <(:link 1 0 - -12 + -52 2 - :) function template can be called with any exception type. If BOOST_NO_RTTI is defined, (: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 - -12 + -34 2 - :) can be used only with objects of type boost::(:link + :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::(:link 1 0 - -30 + -17 2 - :). !!!!Note: The library needs RTTI functionality. Disabling the language RTTI support enables an internal RTTI system, which may have more or less overhead depending on the platform. '''BOOST_EXCEPTION_DISABLE''' By default, (:link + :)(file_read_error()) << errno_info(errno); }@] Of course, (:link 1 0 - -20 + -17 2 - :) and (:link + :) may be used with any exception type; there is no requirement that it should derive from boost::(:link 1 0 - -6 - - - 2 - :) are integrated directly in the (:link - 1 - - 0 - - -27 - - - 2 - :) function. Defining BOOST_EXCEPTION_DISABLE disables this integration. Note that on some non-conformant compilers, for example MSVC 7.0 and older, as well as BCC, BOOST_EXCEPTION_DISABLE is implicitly defined in (:link - 1 - - 0 - - -44 + -34 2 @@ -7505,9 +7885,27 @@ - 1 + 5 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!!:) (:include synopsis:) This type is used by the (:link + 1 + + 0 + + -8 + + + 2 + :) support in Boost Exception. Please see (:link + 1 + + 0 + + -22 + + + 2 + :). @@ -7520,7 +7918,7 @@ 1 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!!:) (:include synopsis:) !!!!Requirements: This function must not be called outside of a catch block. !!!!Returns: A pointer of type E to the current exception object, or null if the current exception object can not be converted to E *. !!!!Throws: Nothing. @@ -7533,7 +7931,7 @@ 1 2 - (:auto !!!:) !!!Synopsis (:include synopsis:) + (:auto !!:) (:pagelist fmt="index" tags="type":) @@ -7544,9 +7942,90 @@ - 1 + 19 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!!:) Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Let's say we have an exception type file_read_error, which takes a file name in its constructor. Consider the following function: [@void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error(????); }@] How can the file_read function pass a file name to the exception type constructor? All it has is a FILE handle. Using boost::(:link + 1 + + 0 + + -34 + + + 2 + :) allows us to free the file_read function from the burden of storing the file name in exceptions it throws: [@#include <(:link + 1 + + 0 + + -46 + + + 2 + :)> #include <stdio.h> #include <errno.h> typedef boost::(:link + 1 + + 0 + + -35 + + + 2 + :)<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link + 1 + + 0 + + -34 + + + 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 + + -46 + + + 2 + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> typedef boost::(:link + 1 + + 0 + + -35 + + + 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 + + -34 + + + 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 + + -34 + + + 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 + + -34 + + + 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''. @@ -7570,9 +8049,36 @@ - 1 + 7 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!!:) (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link + 1 + + 0 + + -34 + + + 2 + :) object. * Copy constructor: initializes a boost::(:link + 1 + + 0 + + -34 + + + 2 + :) object which shares ownership with x of all data added through (:link + 1 + + 0 + + -6 + + + 2 + mod="/":), including data that is added at a future time. !!!!Throws: Nothing. @@ -7583,9 +8089,27 @@ - 1 + 5 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!!:) (:include synopsis:) !!!!Description: Returns a const reference to the copy of the value passed to (:link + 1 + + 0 + + -35 + + + 2 + :)'s constructor stored in the (:link + 1 + + 0 + + -35 + + + 2 + :) object. !!!!Throws: Nothing. @@ -7598,7 +8122,7 @@ 1 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!:) (:pagelist fmt="index" tags="function":) @@ -7609,7 +8133,9 @@ - 0 + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -7620,81 +8146,9 @@ - 17 + 1 2 - (:auto !!!:) The following example demonstrates how errno can be stored in exception objects using Boost Exception: [@#include <(:link - 1 - - 0 - - -37 - - - 2 - :)> #include <errno.h> #include <iostream> typedef boost::(:link - 1 - - 0 - - -31 - - - 2 - :)<struct tag_errno,int> errno_info; //(1) class my_error: public boost::(:link - 1 - - 0 - - -30 - - - 2 - :), public std::exception { }; //(2) void f() { throw my_error() << errno_info(errno); //(3) } @] First, we instantiate the (:link - 1 - - 0 - - -31 - - - 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 - - -30 - - - 2 - :). Finally, (3) illustrates how the typedef from (1) can be used with (:link - 1 - - 0 - - -19 - - - 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 - - -12 - - - 2 - :)<errno_info>(x) ) std::cerr << "Error code: " << *err; } }@] The (:link - 1 - - 0 - - -12 - - - 2 - :) function template is instantiated with the typedef from (1), and is passed an exception object of a polymorphic type. If the exception object contains the requested value, the returned (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:) will point to it; otherwise an empty (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:) is returned. + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -7712,7 +8166,7 @@ 0 - -31 + -35 2 @@ -7736,27 +8190,9 @@ - 5 + 1 2 - (:auto !!!:) (:include synopsis:) !!!!Description: Returns a const reference to the copy of the value passed to (:link - 1 - - 0 - - -31 - - - 2 - :)'s constructor stored in the (:link - 1 - - 0 - - -31 - - - 2 - :) object. !!!!Throws: Nothing. + (:auto !!!:) !!!Synopsis (:include synopsis:) @@ -7767,36 +8203,9 @@ - 7 + 1 2 - (:auto !!!:) (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link - 1 - - 0 - - -30 - - - 2 - :) object. * Copy constructor: initializes a boost::(:link - 1 - - 0 - - -30 - - - 2 - :) object which shares ownership with x of all data added through (:link - 1 - - 0 - - -19 - - - 2 - mod="/":), including data that is added at a future time. !!!!Throws: Nothing. + (:auto !!:) (:pagelist fmt="index" tags="hpp" sort_prefix="6":) @@ -7807,63 +8216,9 @@ - 13 + 1 2 - (:auto !!!:) The code snippet below demonstrates how boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) can be used to bundle the name of the function that failed, together with the reported errno so that they can be added to exception objects more conveniently together: [@#include <(:link - 1 - - 0 - - -42 - - - 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link - 1 - - 0 - - -31 - - - 2 - :)<struct tag_file_name,std::string> file_name_info; typedef boost::(:link - 1 - - 0 - - -31 - - - 2 - :)<struct tag_function,char const *> function_info; typedef boost::(:link - 1 - - 0 - - -31 - - - 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 - - -30 - - - 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 - - -12 - - - 2 - :). + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -7874,54 +8229,9 @@ - 11 + 1 2 - (:auto !!!:) Here is how cloning can be enabled in a throw-expression (15.1): [@#include <(:link - 1 - - 0 - - -41 - - - 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 - - -30 - - - 2 - :) { }; 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, (:link - 1 - - 0 - - -20 - - - 2 - :) may be used with any exception type; there is no requirement that it should derive from boost::(:link - 1 - - 0 - - -30 - - - 2 - :). + (:auto !!:) (:pagelist tags="macro":) @@ -7932,9 +8242,83 @@ - 3 + 1 2 - !!!!Example: this is a possible output from the (:link + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -53 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -54 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -55 + + + + 1 + 2 + (:auto !:) This is an alphabetical list of all Boost Exception documentation pages. (:pagelist fmt="index" except_tags="index noindex" mod="w":) + + + + + 0 + + -56 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -57 + + + + 17 + 2 + (:auto !!!:) The following example demonstrates how errno can be stored in exception objects using Boost Exception: [@#include <(:link + 1 + + 0 + + -46 + + + 2 + :)> #include <errno.h> #include <iostream> typedef boost::(:link 1 0 @@ -7943,7 +8327,361 @@ 2 - :) function, as used in ''libs/exception/example/example_io.cpp:'' [@libs\exception\example\example_io.cpp(83): Throw in function class boost::shared_ptr<struct _iobuf> __cdecl my_fopen(const char *,const char *) Dynamic exception type: class boost::exception_detail::clone_impl<class fopen_error> std::exception::what: example_io error [struct tag_errno *] = 2, OS says "No such file or directory" [struct tag_file_name *] = tmp1.txt [struct tag_function *] = fopen [struct tag_open_mode *] = rb@] + :)<struct tag_errno,int> errno_info; //(1) class my_error: public boost::(:link + 1 + + 0 + + -34 + + + 2 + :), public std::exception { }; //(2) void f() { throw my_error() << errno_info(errno); //(3) } @] First, we instantiate the (:link + 1 + + 0 + + -35 + + + 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 + + -34 + + + 2 + :). Finally, (3) illustrates how the typedef from (1) can be used with (:link + 1 + + 0 + + -6 + + + 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( int const * err=boost::(:link + 1 + + 0 + + -28 + + + 2 + :)<errno_info>(x) ) std::cerr << "Error code: " << *err; } }@] The (:link + 1 + + 0 + + -28 + + + 2 + :) function template is instantiated with the typedef from (1), and is passed an exception object of a polymorphic type. If the exception object contains the requested value, err will point to it; otherwise a null pointer is returned. + + + + + 0 + + -58 + + + + 3 + 2 + !!!!Example: this is a possible output from the (:link + 1 + + 0 + + -21 + + + 2 + :) function, as used in ''libs/exception/example/example_io.cpp:'' [@example_io.cpp(83): Throw in function class boost::shared_ptr<struct _iobuf> __cdecl my_fopen(const char *,const char *) Dynamic exception type: class boost::exception_detail::clone_impl<class fopen_error> std::exception::what: example_io error [struct tag_errno *] = 2, OS says "No such file or directory" [struct tag_file_name *] = tmp1.txt [struct tag_function *] = fopen [struct tag_open_mode *] = rb@] + + + + + 0 + + -59 + + + + 13 + 2 + (:auto !!!:) The code snippet below demonstrates how boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) can be used to bundle the name of the function that failed, together with the reported errno so that they can be added to exception objects more conveniently together: [@#include <(:link + 1 + + 0 + + -45 + + + 2 + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link + 1 + + 0 + + -35 + + + 2 + :)<struct tag_file_name,std::string> file_name_info; typedef boost::(:link + 1 + + 0 + + -35 + + + 2 + :)<struct tag_function,char const *> function_info; typedef boost::(:link + 1 + + 0 + + -35 + + + 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 + + -34 + + + 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 + + -28 + + + 2 + :). + + + + + 0 + + -60 + + + + 45 + 2 + !!Synopsis List of documented definitions, declarations and includes by header file: `#include <(:link + 1 + + 0 + + -23 + + + 2 + :)> [@(:include + 1 + + 0 + + -23 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -50 + + + 2 + :)> [@(:include + 1 + + 0 + + -50 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -52 + + + 2 + :)> [@(:include + 1 + + 0 + + -52 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -45 + + + 2 + :)> [@(:include + 1 + + 0 + + -45 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -48 + + + 2 + :)> [@(:include + 1 + + 0 + + -48 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -41 + + + 2 + :)> [@(:include + 1 + + 0 + + -41 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -56 + + + 2 + :)> [@(:include + 1 + + 0 + + -56 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -53 + + + 2 + :)> [@(:include + 1 + + 0 + + -53 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -26 + + + 2 + :)> [@(:include + 1 + + 0 + + -26 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -54 + + + 2 + :)> [@(:include + 1 + + 0 + + -54 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -46 + + + 2 + :)> (:include + 1 + + 0 + + -46 + + + 2 + synopsis:) @@ -7953,13 +8691,13 @@ throws - 57 + 65 reno_layer - 48 + 56 0 @@ -7968,7 +8706,9 @@ - 0 + 1 + 2 + !!!!Throws: Any exception emitted by v's copy constructor. @@ -7979,7 +8719,9 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. @@ -8056,9 +8798,7 @@ - 1 - 2 - !!!!Throws: Any exception emitted by v's copy constructor. + 0 @@ -8080,7 +8820,9 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. @@ -8124,9 +8866,7 @@ - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. + 0 @@ -8148,9 +8888,7 @@ - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. + 0 @@ -8494,6 +9232,94 @@ 0 + + + 0 + + -53 + + + + 0 + + + + + 0 + + -54 + + + + 0 + + + + + 0 + + -55 + + + + 0 + + + + + 0 + + -56 + + + + 0 + + + + + 0 + + -57 + + + + 0 + + + + + 0 + + -58 + + + + 0 + + + + + 0 + + -59 + + + + 0 + + + + + 0 + + -60 + + + + 0 + + @@ -8501,13 +9327,13 @@ synopsis - 58 + 66 reno_layer - 48 + 56 0 @@ -8518,16 +9344,16 @@ 3 2 - `#include < + `#include <(:link 1 0 - -44 + -52 2 - > (:include decl:) + :)> [@(:include decl:)@] @@ -8540,16 +9366,16 @@ 3 2 - `#include < + `#include <(:link 1 0 - -39 + -52 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] @@ -8562,16 +9388,16 @@ 3 2 - `#include <(:link + `#include < 1 0 - -43 + -48 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + > [@namespace boost { (:include decl pre_indent="4":) }@] @@ -8589,7 +9415,7 @@ 0 - -43 + -53 2 @@ -8615,18 +9441,7 @@ - 3 - 2 - [@#include < - 1 - - 0 - - -22 - - - 2 - > namespace boost { (:include api pre_indent="4":) }@] + 0 @@ -8648,18 +9463,7 @@ - 3 - 2 - `#include < - 1 - - 0 - - -23 - - - 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -8670,18 +9474,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -41 - - - 2 - :)> [@(:include decl:)@] + 0 @@ -8692,7 +9485,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -53 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -8703,7 +9507,27 @@ - 0 + 5 + 2 + `#include <(:link + 1 + + 0 + + -45 + + + 2 + :)> [@namespace boost { (:include + 1 + + 0 + + -15 + + + 2 + decl pre_indent="4":) }@] @@ -8725,7 +9549,18 @@ - 0 + 3 + 2 + `#include < + 1 + + 0 + + -26 + + + 2 + > [@namespace boost { (:include decl pre_indent="4":) }@] @@ -8736,7 +9571,18 @@ - 0 + 3 + 2 + `#include < + 1 + + 0 + + -54 + + + 2 + > (:include decl:) @@ -8746,6 +9592,28 @@ -19 + + 0 + + + + + 0 + + -20 + + + + 0 + + + + + 0 + + -21 + + 3 2 @@ -8765,66 +9633,22 @@ 0 - -20 + -22 3 2 - `#include < - 1 - - 0 - - -10 - - - 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -21 - - - - 5 - 2 `#include <(:link 1 0 - -42 + -53 2 - :)> [@namespace boost { (:include - 1 - - 0 - - -21 - - - 2 - decl pre_indent="4":) }@] - - - - - 0 - - -22 - - - - 1 - 2 - [@namespace boost { (:include api pre_indent="4":) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -8837,7 +9661,7 @@ 1 2 - [@#include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] + [@namespace boost { (:include api pre_indent="4":) }@] @@ -8848,7 +9672,9 @@ - 0 + 1 + 2 + [@#include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] @@ -8870,7 +9696,18 @@ - 0 + 3 + 2 + [@#include < + 1 + + 0 + + -23 + + + 2 + > namespace boost { (:include api pre_indent="4":) }@] @@ -8888,11 +9725,11 @@ 0 - -44 + -41 2 - :)> [@namespace boost { (:include decl:) }@] + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] @@ -8903,7 +9740,9 @@ - 0 + 1 + 2 + [@namespace boost { (:include decl pre_indent="4":) }@] @@ -8925,18 +9764,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -22 - - - 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] + 0 @@ -8954,11 +9782,11 @@ 0 - -41 + -54 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] + :)> [@namespace boost { (:include decl:) }@] @@ -8976,7 +9804,7 @@ 0 - -43 + -53 2 @@ -8991,18 +9819,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -43 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -9020,11 +9837,11 @@ 0 - -43 + -23 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + :)> [@namespace boost { (:include def pre_indent="4":) }@] @@ -9042,11 +9859,11 @@ 0 - -38 + -52 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + :)> [@namespace boost { (:include def pre_indent="4":) }@] @@ -9068,9 +9885,18 @@ - 1 + 3 2 - [@(:include api:)@] + `#include <(:link + 1 + + 0 + + -53 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -9081,18 +9907,9 @@ - 3 + 1 2 - [@#include <string> namespace boost { (:include - 1 - - 0 - - -30 - - - 2 - decl pre_indent="4":) (:include api pre_indent="4":) }@] + [@namespace boost { (:include decl pre_indent="4":) }@] @@ -9103,18 +9920,7 @@ - 3 - 2 - [@#include < - 1 - - 0 - - -22 - - - 2 - > namespace boost { (:include api pre_indent="4":) }@] + 0 @@ -9125,9 +9931,7 @@ - 1 - 2 - [@namespace boost { (:include api pre_indent="4":) }@] + 0 @@ -9140,16 +9944,16 @@ 3 2 - [@#include <(:link + [@#include <string> namespace boost { (:include 1 0 - -22 + -34 2 - :)> #include <boost/current_function.hpp> #include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] + decl pre_indent="4":) (:include api pre_indent="4":) }@] @@ -9160,9 +9964,7 @@ - 1 - 2 - [@#include <boost/tuple/tuple.hpp> namespace boost { (:include api pre_indent="4":) }@] + 0 @@ -9175,16 +9977,16 @@ 3 2 - [@#include <(:link + `#include <(:link 1 0 - -22 + -52 2 - :)> namespace boost { (:include api pre_indent="4":) }@] + :)> [@(:include decl:)@] @@ -9195,9 +9997,7 @@ - 1 - 2 - (:include api:) + 0 @@ -9208,7 +10008,18 @@ - 0 + 3 + 2 + [@#include < + 1 + + 0 + + -52 + + + 2 + > #include <boost/tuple/tuple.hpp> namespace boost { (:include api pre_indent="4":) }@] @@ -9219,7 +10030,9 @@ - 0 + 1 + 2 + [@(:include api:)@] @@ -9237,7 +10050,7 @@ 0 - -41 + -52 2 @@ -9254,16 +10067,16 @@ 3 2 - `#include <(:link + [@#include < 1 0 - -41 + -23 2 - :)> [@(:include decl:)@] + > namespace boost { (:include api pre_indent="4":) }@] @@ -9285,7 +10098,9 @@ - 0 + 1 + 2 + [@namespace boost { (:include api pre_indent="4":) }@] @@ -9306,6 +10121,120 @@ -52 + + 3 + 2 + [@#include <(:link + 1 + + 0 + + -23 + + + 2 + :)> namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -53 + + + + 3 + 2 + [@#include <(:link + 1 + + 0 + + -23 + + + 2 + :)> namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -54 + + + + 1 + 2 + (:include api:) + + + + + 0 + + -55 + + + + 0 + + + + + 0 + + -56 + + + + 1 + 2 + [@namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -57 + + + + 0 + + + + + 0 + + -58 + + + + 0 + + + + + 0 + + -59 + + + + 0 + + + + + 0 + + -60 + + 0 @@ -9320,14 +10249,14 @@ - 59 + 67 reno_context_map - 48 + 56 -5 @@ -9472,11 +10401,35 @@ -52 + + -53 + + + -54 + + + -55 + + + -56 + + + -57 + + + -58 + + + -59 + + + -60 + - 48 + 56 @@ -9491,7 +10444,75 @@ - -25 + -29 + + + + + + + 0 + + + + + + 1 + + + + -30 + + + + + + + 0 + + + + + + 1 + + + + -13 + + + + + + + 0 + + + + + + 1 + + + + -55 + + + + + + + 0 + + + + + + 1 + + + + -48 @@ -9525,7 +10546,7 @@ - -15 + -19 @@ -9542,24 +10563,7 @@ - -45 - - - - - - - 0 - - - - - - 1 - - - - -39 + -33 @@ -9593,7 +10597,7 @@ - -16 + -9 @@ -9610,7 +10614,7 @@ - -29 + -44 @@ -9627,7 +10631,7 @@ - -17 + -49 @@ -9644,87 +10648,41 @@ - -18 + -39 - 2 - 00067869F918D0E8905D8A464C17FA9DAD9F497B3A172EB360239EEB5778A206 - 3465219615 - 4025 - 518 - 6E325144EF4F41FA3A225EB30729101382C4E99B3D6160E307311E4B4E641010 - 1097215175 - 161 - 240 + 0 - 0 - ../../../../boost/exception/info.hpp - 0 - 0 + 1 - -13 + -51 - 2 - 00067869F918D0E8905D8A464C17FA9DAD9F497B3A172EB360239EEB5778A206 - 3465219615 - 4025 - 518 - D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 - 4055211476 - 525 - 3494 + 0 - 0 - ../../../../boost/exception/info.hpp - 0 - 0 + 1 - -19 - - - - - - - 1 - FBC69CDA5E19FA40270F3855A8B99B2F77572439353F9DC5D15386F3520BC616 - 1405483403 - 8882 - 323 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - -43 + -60 @@ -9748,7 +10706,7 @@ - -14 + -12 @@ -9756,23 +10714,23 @@ 1 - F6C6B72C2CDEBC5E3EAA924F637563A8F8A95684AF6EEF39FE2260C86C77F531 - 2151348977 - 3846 - 323 + 9E8DCE3BCF462A3A332DA70F61E46FA5C2AB791B95E33D3F2AF1307F53C84B1C + 1960675522 + 6483 + 591 0 - ../../../../boost/exception/get_error_info.hpp + ../../example/example_io.cpp 0 0 - -23 + -58 @@ -9796,7 +10754,7 @@ - -9 + -11 @@ -9804,14 +10762,182 @@ 2 - E8AFD260BD0196A516F0E29A9FE6D09BF84B37D31E228910E3370365CAA4AB43 - 3229661566 - 3665 + 6FB85B536F965F137409D5B5D34786DCBF0B9957A7C251D271B717A1156B823D + 1090406464 + 362 + 323 + D16DAEA8B1792A019AF7FCA362FDC6EFD381AF4C43C076A01C029ECE51F994A6 + 3172941848 + 330 + 26 + + + + + + 0 + ../../../../boost/exception/current_exception_cast.hpp + 0 + 0 + + + + -38 + + + + + + + 2 + 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 + 2533933282 + 8724 + 615 + 9F3671DA5E8AB414F1FBA3B160D49134EAEE8DFF33E95376EDB41534E916FF38 + 2436936467 + 718 + 1496 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -37 + + + + + + + 2 + 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 + 2533933282 + 8724 + 615 + E23085202D084CBB50F289988A6A592F06D923B77D0AB25D7A98A7188DF5BE3B + 1414247481 + 766 + 7388 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -22 + + + + + + + 2 + 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 + 2533933282 + 8724 + 615 + F86EB07D04CD0D0645080D1121DA899746D0C45137E17E1D9BE605E75396F047 + 1983537541 + 1346 + 148 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -8 + + + + + + + 2 + 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 + 2533933282 + 8724 + 615 + 0E9DF8366080712A816BE91ABCEF1E2044145B63D75B0B995B537900F378189E + 1069696031 + 255 + 8463 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -32 + + + + + + + 2 + 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 + 2533933282 + 8724 + 615 + 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 + 2078296250 + 305 + 8156 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -14 + + + + + + + 2 + FEABD2D011FBCE667D26BAD68A1C65D81E98DD40081CC70F2738AC3151A8FC4A + 4260129224 + 2393 504 - BB8AF986C96801345719855FEA083AF5684FBC349F6520E150F19A6370019265 - 3731478139 - 686 - 2973 + C708EDCAC3964E2F3C3A081700112C5F15C7BF7A61FDF2EF39D112FC9B987CE3 + 1739153824 + 2361 + 26 @@ -9824,31 +10950,7 @@ - -12 - - - - - - - 1 - 17FF6C63843EE64ED66CB038DD95B4C4D6BA1B0FD36B27BEFD84A909161D2853 - 1237535165 - 231 - 1186 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - -5 + -28 @@ -9872,7 +10974,7 @@ - -28 + -20 @@ -9896,7 +10998,135 @@ - -37 + -46 + + + + + + + 2 + 1D3204D3ADDAB7AA716BEA1489EA852A9D6B5C110243364F6931FEF1CC2E5F88 + 422052608 + 3923 + 518 + 6E325144EF4F41FA3A225EB30729101382C4E99B3D6160E307311E4B4E641010 + 1097215175 + 161 + 240 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + -5 + + + + + + + 2 + 1D3204D3ADDAB7AA716BEA1489EA852A9D6B5C110243364F6931FEF1CC2E5F88 + 422052608 + 3923 + 518 + D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 + 4055211476 + 525 + 3392 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + -6 + + + + + + + 1 + D10E536B909EFFF78FB09E6242AEC7C74ACDD75AE7DF32B45870422B752E5D8E + 1903336130 + 557 + 382 + + + + + + 0 + ../../example/error_info_1.cpp + 0 + 0 + + + + -57 + + + + + + + 1 + 05698FEF1D553EDBC15212673561F5436DF771AA5488C8ED8164D303078DE08E + 119041194 + 1978 + 91 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + -54 + + + + + + + 1 + A449DE2B3A2CDAE9DD932C06D224B3E07C95EBACBB4EA5890CA4CCF2DC74A693 + 1718307056 + 4118 + 323 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + -52 @@ -9907,7 +11137,7 @@ 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A 1770110914 587 - 1497 + 1462 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D 3929437933 361 @@ -9924,7 +11154,7 @@ - -27 + -31 @@ -9935,7 +11165,7 @@ 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A 1770110914 587 - 1497 + 1462 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D 3929437933 361 @@ -9956,7 +11186,7 @@ - -36 + -16 @@ -9964,23 +11194,23 @@ 1 - D0024B58523F5885E87F608259810B61D3BE489CEC885FFAE91118F1E43B10A4 - 399616739 - 6563 - 591 + A14B5595A6DD87562792D402B48500AAD71FA1ABD75C14EDF089FCC7318CBB9B + 3469762901 + 468 + 227 0 - ../../example/example_io.cpp + ../../../../boost/exception/current_exception_cast.hpp 0 0 - -52 + -56 @@ -10008,7 +11238,7 @@ - -31 + -35 @@ -10072,7 +11302,111 @@ - -48 + -43 + + + + + + + 1 + 2F432507CFD796BE673F33D9AC68C535F1ED1F4FCD3A8E3AEEC320D9795FB4AE + 2319362875 + 2574 + 323 + + + + + + 0 + ../../../../boost/exception/get_error_info.hpp + 0 + 0 + + + + -24 + + + + + + + 2 + F7537DC10435D0F7CC368E0FC747B2B1169E1CE60FCBAE8AC86F2256667C95B2 + 3301865866 + 4151 + 557 + D747B0A0953B72747224DE7856DB793A4BFF7B73793873CF22810FCB304A7310 + 505472020 + 3665 + 26 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + -21 + + + + + + + 2 + F7537DC10435D0F7CC368E0FC747B2B1169E1CE60FCBAE8AC86F2256667C95B2 + 3301865866 + 4151 + 557 + 90ECFCA1DA49DBB79A23B5998A39D8A6B122632524671C56DA10F96A1BA07CD2 + 1653443895 + 452 + 3693 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + -27 + + + + + + + 1 + E127BAFA15A5B7031C0DD1817993041600F935B71E7BDE42E1F4AF50959B6AB3 + 2166367611 + 9016 + 323 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -53 @@ -10096,7 +11430,7 @@ - -22 + -23 @@ -10124,7 +11458,7 @@ - -24 + -25 @@ -10152,7 +11486,7 @@ - -20 + -17 @@ -10180,7 +11514,7 @@ - -6 + -7 @@ -10208,7 +11542,7 @@ - -30 + -34 @@ -10240,7 +11574,7 @@ - -49 + -42 @@ -10264,59 +11598,7 @@ - -42 - - - - - - - 2 - 3D64A3F5639045A59A0CD362AD4C531ECC763B7C523E284DCBFBACAAF5F681C3 - 4142572795 - 1596 - 462 - 6FE1F0AF570A010E8FDA1647DE61E0CC3AA979C8A8638722DAACDF8FBC4790D2 - 1246830037 - 1023 - 567 - - - - - - 0 - ../../../../boost/exception/diagnostic_information.hpp - 0 - 0 - - - - -35 - - - - - - - 1 - 373FAB70D1DAE4F1111AACCCCD3F6B55EAF8D1222E03A26A5A2F860B70D2D0C4 - 3697768091 - 2013 - 91 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - -44 + -45 @@ -10340,7 +11622,7 @@ - -51 + -36 @@ -10348,23 +11630,23 @@ 1 - 77680088697752BD6CCF429C0B264C866F5BF1D911D3BF3F1F18B06490D9F0CB - 2016079400 - 1841 - 227 + 04DDC793002AFCF4F4166D250C67D09B6FE8B86224318ED7847AD6EC423B70CA + 922651615 + 433 + 1027 0 - ../../../../boost/exception/diagnostic_information.hpp + ../../../../boost/throw_exception.hpp 0 0 - -38 + -18 @@ -10388,147 +11670,31 @@ - -11 + -40 - 2 - 808CABE6CCA47C52CC9DD21911BF0B42284A5DD55AC3E665B29ED2B5F16AF7DA - 3660693492 - 8718 - 487 - E23085202D084CBB50F289988A6A592F06D923B77D0AB25D7A98A7188DF5BE3B - 1414247481 - 766 - 7382 + 1 + 9E3988368193B192FA2426DE2B97FA8D0DA8A9FFECAD6A010FE1B5CD9662FAE9 + 109897168 + 4491 + 227 0 - ../../../../boost/exception_ptr.hpp + ../../../../boost/exception/diagnostic_information.hpp 0 0 - -8 - - - - - - - 2 - 808CABE6CCA47C52CC9DD21911BF0B42284A5DD55AC3E665B29ED2B5F16AF7DA - 3660693492 - 8718 - 487 - F86EB07D04CD0D0645080D1121DA899746D0C45137E17E1D9BE605E75396F047 - 1983537541 - 1346 - 148 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - -32 - - - - - - - 2 - 808CABE6CCA47C52CC9DD21911BF0B42284A5DD55AC3E665B29ED2B5F16AF7DA - 3660693492 - 8718 - 487 - DA033132CFA8F85C147C01F51FF7CF7399CF7D32D412F730EA3219CDAC608C72 - 3830952485 - 712 - 1496 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - -34 - - - - - - - 2 - 808CABE6CCA47C52CC9DD21911BF0B42284A5DD55AC3E665B29ED2B5F16AF7DA - 3660693492 - 8718 - 487 - 0E9DF8366080712A816BE91ABCEF1E2044145B63D75B0B995B537900F378189E - 1069696031 - 255 - 8457 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - -33 - - - - - - - 2 - 808CABE6CCA47C52CC9DD21911BF0B42284A5DD55AC3E665B29ED2B5F16AF7DA - 3660693492 - 8718 - 487 - 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 - 2078296250 - 305 - 8150 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - -7 + -41 @@ -10556,7 +11722,7 @@ - -40 + -50 @@ -10584,31 +11750,7 @@ - -21 - - - - - - - 1 - 187BFD2B78A0DD006717B5B06FFD465E2468F521C32A86FB793F7A68AB5417F3 - 4276724153 - 574 - 382 - - - - - - 0 - ../../example/error_info_1.cpp - 0 - 0 - - - - -46 + -15 @@ -10632,31 +11774,7 @@ - -50 - - - - - - - 1 - 3D40DD88A1E41D75BC79CA8DACC35BEE2A16A64422AC8E6BE0D61169D9360EF7 - 4184757263 - 4220 - 323 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - -41 + -59 @@ -10666,14 +11784,14 @@ - 60 + 68 tag_index - 44 + 47 1 @@ -10687,7 +11805,7 @@ -5 - + function member @@ -10705,7 +11823,7 @@ -7 - exception_ptr free function + error_info free function @@ -10714,25 +11832,7 @@ -8 - exception_ptr free function - - - - 0 - - -9 - - - tutorial - - - - 0 - - -10 - - - exception_ptr + type @@ -10741,7 +11841,7 @@ -11 - noalso noindex tutorial + tutorial @@ -10750,7 +11850,7 @@ -12 - error_info free function + noindex tutorial @@ -10759,7 +11859,7 @@ -13 - function member + tutorial @@ -10768,7 +11868,7 @@ -14 - noindex tutorial + exception_ptr free function @@ -10777,16 +11877,25 @@ -15 - tutorial + error_info free function 0 - -19 + -17 - error_info free function + exception_ptr free function + + + + 0 + + -18 + + + macro @@ -10795,7 +11904,7 @@ -20 - exception_ptr free function + diagnostic_information tutorial @@ -10804,7 +11913,7 @@ -21 - error_info free function + diagnostic_information free function @@ -10813,7 +11922,7 @@ -22 - + exception_ptr free function @@ -10822,7 +11931,7 @@ -23 - error_info + @@ -10831,7 +11940,7 @@ -24 - function + error_info @@ -10840,7 +11949,7 @@ -25 - noindex + function @@ -10849,7 +11958,7 @@ -26 - tutorial + exception_ptr @@ -10858,7 +11967,7 @@ -27 - free function + function @@ -10867,7 +11976,7 @@ -28 - diagnostic_information tutorial + error_info free function @@ -10876,7 +11985,7 @@ -29 - tutorial + noindex @@ -10885,7 +11994,7 @@ -30 - type + tutorial @@ -10894,7 +12003,7 @@ -31 - type + free function @@ -10903,7 +12012,7 @@ -32 - type + exception_ptr free function @@ -10912,7 +12021,7 @@ -33 - exception_ptr free function + tutorial @@ -10921,7 +12030,7 @@ -34 - exception_ptr type + type @@ -10930,7 +12039,16 @@ -35 - diagnostic_information free function + type + + + + 0 + + -36 + + + noindex tutorial @@ -10939,7 +12057,7 @@ -37 - + exception_ptr type @@ -10948,16 +12066,7 @@ -38 - - - - - 0 - - -39 - - - error_info + function @@ -10966,7 +12075,7 @@ -40 - + noalso noindex tutorial @@ -10984,7 +12093,7 @@ -42 - + function @@ -10993,16 +12102,7 @@ -43 - - - - - 0 - - -44 - - - + function member @@ -11020,7 +12120,7 @@ -46 - noalso noindex tutorial + @@ -11038,16 +12138,7 @@ -48 - function member - - - - 0 - - -49 - - - function + error_info @@ -11056,16 +12147,70 @@ -50 + + + + + 0 + + -52 + + + + + + + 0 + + -53 + + + + + + + 0 + + -54 + + + + + + + 0 + + -55 + + + + + + + 0 + + -56 + + + + + + + 0 + + -57 + + noalso noindex tutorial 0 - -51 + -59 - noindex tutorial + noalso noindex tutorial diff --git a/doc/synopsis.html b/doc/synopsis.html new file mode 100644 index 0000000..b8e3ca3 --- /dev/null +++ b/doc/synopsis.html @@ -0,0 +1,201 @@ + + + + + Synopsis + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

Synopsis

+

List of documented definitions, declarations and includes by header file:

+

#include <boost/exception/exception.hpp>

+
namespace
+boost
+    {
+    class
+    exception
+        {
+        protected:
+    
+        exception();
+        exception( exception const & x );    
+        ~exception();    
+        };    
+    
+    template <class Tag,class T>
+    class error_info;    
+    
+    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;
+    }
+

#include <boost/exception/error_info.hpp>

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

#include <boost/exception/info.hpp>

+
#include <boost/exception/exception.hpp>
+
+namespace
+boost
+    {
+    template <class Tag,class T>
+    class
+    error_info
+        {
+        public:
+    
+        typedef T value_type;    
+    
+        error_info( value_type const & v );    
+        value_type const & value() const;    
+        };    
+    
+    template <class E, class Tag, class T>
+    E const & operator<<( E const & x, error_info<Tag,T> const & v );
+    }
+

#include <boost/exception/info_tuple.hpp>

+
#include <boost/exception/info.hpp>
+#include <boost/tuple/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 );
+    }
+

#include <boost/exception/enable_error_info.hpp>

+
#include <boost/exception/exception.hpp>
+
+namespace
+boost
+    {
+    template <class T>
+    ---unspecified--- enable_error_info( T const & x );
+    }
+

#include <boost/exception/diagnostic_information.hpp>

+
#include <string>
+
+namespace
+boost
+    {
+    class exception;
+
+    template <class E>
+    std::string diagnostic_information( E const & e );    
+    
+    std::string current_exception_diagnostic_information();
+    }
+

#include <boost/exception/current_exception_cast.hpp>

+
namespace
+boost
+    {
+    template <class E>
+    E * current_exception_cast();
+    }
+

#include <boost/exception_ptr.hpp>

+
#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 );
+    }
+

#include <boost/exception/enable_current_exception.hpp>

+
#include <boost/exception/exception.hpp>
+
+namespace
+boost
+    {
+    template <class T>
+    ---unspecified--- enable_current_exception( T const & e );
+    }
+

#include <boost/throw_exception.hpp>

+
#if !defined( BOOST_EXCEPTION_DISABLE ) + #include <boost/exception/exception.hpp> + #include <boost/current_function.hpp> + #define BOOST_THROW_EXCEPTION(x)\ + ::boost::throw_exception( ::boost::enable_error_info(x) <<\ + ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\ + ::boost::throw_file(__FILE__) <<\ + ::boost::throw_line((int)__LINE__) ) +#else + #define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x) +#endif + +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 + }
+

#include <boost/exception.hpp>

+

+

See Also:

+ +
+ + + + +
+
+
+ + diff --git a/doc/throw_exception_hpp.html b/doc/throw_exception_hpp.html index 57c5cf6..9743a27 100644 --- a/doc/throw_exception_hpp.html +++ b/doc/throw_exception_hpp.html @@ -22,7 +22,7 @@

boost/throw_exception.hpp

Synopsis

-
#if !defined( BOOST_NO_EXCEPTIONS ) && !defined( BOOST_EXCEPTION_DISABLE )
+
#if !defined( BOOST_EXCEPTION_DISABLE )
     #include <boost/exception/exception.hpp>
     #include <boost/current_function.hpp>
     #define BOOST_THROW_EXCEPTION(x)\
@@ -47,8 +47,8 @@ boost
 
diff --git a/doc/tutorial_diagnostic_information.html b/doc/tutorial_diagnostic_information.html index ef0feb0..835d4d6 100644 --- a/doc/tutorial_diagnostic_information.html +++ b/doc/tutorial_diagnostic_information.html @@ -47,7 +47,7 @@ g() }

Example:

this is a possible output from the diagnostic_information function, as used in libs/exception/example/example_io.cpp:

-
libs\exception\example\example_io.cpp(83): Throw in function class boost::shared_ptr<struct _iobuf> __cdecl my_fopen(const char *,const char *)
+
example_io.cpp(83): Throw in function class boost::shared_ptr<struct _iobuf> __cdecl my_fopen(const char *,const char *)
 Dynamic exception type: class boost::exception_detail::clone_impl<class fopen_error>
 std::exception::what: example_io error
 [struct tag_errno *] = 2, OS says "No such file or directory"
diff --git a/doc/tutorial_transporting_data.html b/doc/tutorial_transporting_data.html
index 96931ff..816015b 100644
--- a/doc/tutorial_transporting_data.html
+++ b/doc/tutorial_transporting_data.html
@@ -59,11 +59,11 @@ g()
     catch(
     my_error & x )
         {
-        if( boost::shared_ptr<int const> err=boost::get_error_info<errno_info>(x) )
+        if( int const * err=boost::get_error_info<errno_info>(x) )
             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 a polymorphic type. If the exception object contains the requested value, the returned shared_ptr will point to it; otherwise an empty shared_ptr is returned.

+

The get_error_info function template is instantiated with the typedef from (1), and is passed an exception object of a polymorphic type. If the exception object contains the requested value, err will point to it; otherwise a null pointer 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. Let's say we have an exception type file_read_error, which takes a file name in its constructor. Consider the following function:

diff --git a/doc/types.html b/doc/types.html new file mode 100644 index 0000000..2f2c94d --- /dev/null +++ b/doc/types.html @@ -0,0 +1,54 @@ + + + + + Types + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

+

See Also:

+ +
+ + + + +
+
+
+ + diff --git a/example/Jamfile b/example/Jamfile index 54037a1..244fefe 100644 --- a/example/Jamfile +++ b/example/Jamfile @@ -1,6 +1,6 @@ # Boost Exception Library example Jamfile # -# Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +# Copyright (c) 2006-2009 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) diff --git a/example/cloning_1.cpp b/example/cloning_1.cpp index a65ad5e..4e23a62 100644 --- a/example/cloning_1.cpp +++ b/example/cloning_1.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/example/cloning_2.cpp b/example/cloning_2.cpp index 3c10786..79b56cb 100644 --- a/example/cloning_2.cpp +++ b/example/cloning_2.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/example/enable_error_info.cpp b/example/enable_error_info.cpp index 0470bf1..47adb61 100644 --- a/example/enable_error_info.cpp +++ b/example/enable_error_info.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/example/error_info_1.cpp b/example/error_info_1.cpp index b67f728..1b433cf 100644 --- a/example/error_info_1.cpp +++ b/example/error_info_1.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) @@ -30,7 +30,7 @@ g() catch( my_error & x ) { - if( boost::shared_ptr err=boost::get_error_info(x) ) + if( int const * err=boost::get_error_info(x) ) std::cerr << "Error code: " << *err; } } diff --git a/example/error_info_2.cpp b/example/error_info_2.cpp index 7464aaf..3234256 100644 --- a/example/error_info_2.cpp +++ b/example/error_info_2.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/example/example_io.cpp b/example/example_io.cpp index 4b3a5a3..3befc46 100644 --- a/example/example_io.cpp +++ b/example/example_io.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) @@ -132,7 +132,7 @@ copy_data( char const * src_file_name, char const * dst_file_name ) catch( boost::exception & x ) { - if( boost::shared_ptr const> f=boost::get_error_info(x) ) + if( boost::weak_ptr const * f=boost::get_error_info(x) ) if( boost::shared_ptr fs = f->lock() ) { if( fs==src ) @@ -150,37 +150,37 @@ copy_data( char const * src_file_name, char const * dst_file_name ) void dump_copy_info( boost::exception const & x ) { - if( boost::shared_ptr src = boost::get_error_info(x) ) - std::cout << "Source file name: " << *src << "\n"; - if( boost::shared_ptr dst = boost::get_error_info(x) ) - std::cout << "Destination file name: " << *dst << "\n"; + if( std::string const * src = boost::get_error_info(x) ) + std::cerr << "Source file name: " << *src << "\n"; + if( std::string const * dst = boost::get_error_info(x) ) + std::cerr << "Destination file name: " << *dst << "\n"; } void dump_file_info( boost::exception const & x ) { - if( boost::shared_ptr fn = boost::get_error_info(x) ) - std::cout << "File name: " << *fn << "\n"; + if( std::string const * fn = boost::get_error_info(x) ) + std::cerr << "File name: " << *fn << "\n"; } void dump_clib_info( boost::exception const & x ) { - if( boost::shared_ptr err=boost::get_error_info(x) ) - std::cout << "OS error: " << *err << "\n"; - if( boost::shared_ptr fn=boost::get_error_info(x) ) - std::cout << "Failed function: " << *fn << "\n"; + if( int const * err=boost::get_error_info(x) ) + std::cerr << "OS error: " << *err << "\n"; + if( std::string const * fn=boost::get_error_info(x) ) + std::cerr << "Failed function: " << *fn << "\n"; } void dump_all_info( boost::exception const & x ) { - std::cout << "-------------------------------------------------\n"; + std::cerr << "-------------------------------------------------\n"; dump_copy_info(x); dump_file_info(x); dump_clib_info(x); - std::cout << "\nOutput from diagnostic_information():\n"; - std::cout << diagnostic_information(x); + std::cerr << "\nOutput from diagnostic_information():\n"; + std::cerr << diagnostic_information(x); } int @@ -199,7 +199,7 @@ main() catch( read_error & x ) { - std::cout << "\nCaught 'read_error' exception.\n"; + std::cerr << "\nCaught 'read_error' exception.\n"; dump_all_info(x); } @@ -212,14 +212,14 @@ main() catch( open_error & x ) { - std::cout << "\nCaught 'open_error' exception.\n"; + std::cerr << "\nCaught 'open_error' exception.\n"; dump_all_info(x); } } catch( - boost::exception & x ) + ... ) { - std::cout << "\nCaught unexpected boost::exception!\n"; - dump_all_info(x); + std::cerr << "\nCaught unexpected exception!\n"; + std::cerr << boost::current_exception_diagnostic_information(); } } diff --git a/example/info_tuple.cpp b/example/info_tuple.cpp index 53c1aa0..de19c44 100644 --- a/example/info_tuple.cpp +++ b/example/info_tuple.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/example/logging.cpp b/example/logging.cpp index b72b03e..11e6401 100644 --- a/example/logging.cpp +++ b/example/logging.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/include/boost/exception/current_exception_cast.hpp b/include/boost/exception/current_exception_cast.hpp new file mode 100644 index 0000000..1147d71 --- /dev/null +++ b/include/boost/exception/current_exception_cast.hpp @@ -0,0 +1,34 @@ +//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_7E83C166200811DE885E826156D89593 +#define UUID_7E83C166200811DE885E826156D89593 + +namespace +boost + { + template + inline + E * + current_exception_cast() + { + try + { + throw; + } + catch( + E & e ) + { + return &e; + } + catch( + ...) + { + return 0; + } + } + } + +#endif diff --git a/include/boost/exception/detail/error_info_impl.hpp b/include/boost/exception/detail/error_info_impl.hpp index 7a57b8b..8d9b72f 100644 --- a/include/boost/exception/detail/error_info_impl.hpp +++ b/include/boost/exception/detail/error_info_impl.hpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/include/boost/exception/detail/is_output_streamable.hpp b/include/boost/exception/detail/is_output_streamable.hpp index 57376bf..af59cb8 100644 --- a/include/boost/exception/detail/is_output_streamable.hpp +++ b/include/boost/exception/detail/is_output_streamable.hpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/include/boost/exception/detail/object_hex_dump.hpp b/include/boost/exception/detail/object_hex_dump.hpp index a6221b6..f535944 100644 --- a/include/boost/exception/detail/object_hex_dump.hpp +++ b/include/boost/exception/detail/object_hex_dump.hpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/include/boost/exception/detail/type_info.hpp b/include/boost/exception/detail/type_info.hpp index 97bf726..ac0960d 100644 --- a/include/boost/exception/detail/type_info.hpp +++ b/include/boost/exception/detail/type_info.hpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/include/boost/exception/diagnostic_information.hpp b/include/boost/exception/diagnostic_information.hpp index af10837..66deb70 100644 --- a/include/boost/exception/diagnostic_information.hpp +++ b/include/boost/exception/diagnostic_information.hpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) @@ -8,6 +8,8 @@ #include #include +#include +#include #include #include #include @@ -18,6 +20,38 @@ boost namespace exception_detail { + template + struct + enable_boost_exception_overload + { + typedef struct yes { char q[100]; }; + typedef char no; + static yes check(exception const *); + static no check(...); + enum e { value=sizeof(check((T*)0))==sizeof(yes) }; + }; + + template + struct + enable_std_exception_overload + { + typedef struct yes { char q[100]; }; + typedef char no; + static yes check(std::exception const *); + static no check(...); + enum e { value = !enable_boost_exception_overload::value && sizeof(check((T*)0))==sizeof(yes) }; + }; + +#ifndef BOOST_NO_RTTI + template + inline + std::string + dynamic_exception_type( T const & x ) + { + return std::string("Dynamic exception type: ") + BOOST_EXCEPTION_DYNAMIC_TYPEID(x).name(); + } +#endif + inline char const * get_diagnostic_information( exception const & x ) @@ -36,33 +70,76 @@ boost #endif return 0; } + + inline + std::string + boost_diagnostic_information( exception const & x ) + { + std::ostringstream tmp; + if( char const * const * f=get_error_info(x) ) + { + tmp << *f; + if( int const * l=get_error_info(x) ) + tmp << '(' << *l << "): "; + } + tmp << "Throw in function "; + if( char const * const * fn=get_error_info(x) ) + tmp << *fn; + else + tmp << "(unknown)"; + tmp << std::endl; +#ifndef BOOST_NO_RTTI + tmp << dynamic_exception_type(x) << std::endl; + if( std::exception const * e=dynamic_cast(&x) ) + tmp << "std::exception::what: " << e->what() << std::endl; +#endif + if( char const * s=exception_detail::get_diagnostic_information(x) ) + if( *s ) + tmp << s; + return tmp.str(); + } + + inline + std::string + std_diagnostic_information( std::exception const & x ) + { + std::ostringstream tmp; +#ifndef BOOST_NO_RTTI + if( exception const * e=dynamic_cast(&x) ) + return boost_diagnostic_information(*e); + tmp << dynamic_exception_type(x) << std::endl; +#endif + tmp << "std::exception::what: " << x.what() << std::endl; + return tmp.str(); + } + } + + template + inline + typename enable_if,std::string>::type + diagnostic_information( T const & e ) + { + return exception_detail::boost_diagnostic_information(e); + } + + template + inline + typename enable_if,std::string>::type + diagnostic_information( T const & e ) + { + return exception_detail::std_diagnostic_information(e); } inline std::string - diagnostic_information( exception const & x ) + current_exception_diagnostic_information() { - std::ostringstream tmp; - if( boost::shared_ptr f=get_error_info(x) ) - { - tmp << *f; - if( boost::shared_ptr l=get_error_info(x) ) - tmp << '(' << *l << "): "; - } - tmp << "Throw in function "; - if( boost::shared_ptr fn=get_error_info(x) ) - tmp << *fn; + if( boost::exception const * e=current_exception_cast() ) + return diagnostic_information(*e); + else if( std::exception const * e=current_exception_cast() ) + return diagnostic_information(*e); else - tmp << "(unknown)"; -#ifndef BOOST_NO_RTTI - tmp << "\nDynamic exception type: " << BOOST_EXCEPTION_DYNAMIC_TYPEID(x).name(); - if( std::exception const * e=dynamic_cast(&x) ) - tmp << "\nstd::exception::what: " << e->what(); -#endif - if( char const * s=exception_detail::get_diagnostic_information(x) ) - if( *s ) - tmp << '\n' << s; - return tmp.str(); + return "No diagnostic information available."; } } diff --git a/include/boost/exception/enable_current_exception.hpp b/include/boost/exception/enable_current_exception.hpp index 7e6403b..9881053 100644 --- a/include/boost/exception/enable_current_exception.hpp +++ b/include/boost/exception/enable_current_exception.hpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/include/boost/exception/enable_error_info.hpp b/include/boost/exception/enable_error_info.hpp index 7e6403b..9881053 100644 --- a/include/boost/exception/enable_error_info.hpp +++ b/include/boost/exception/enable_error_info.hpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/include/boost/exception/error_info.hpp b/include/boost/exception/error_info.hpp index d80bf39..2e6832a 100644 --- a/include/boost/exception/error_info.hpp +++ b/include/boost/exception/error_info.hpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/include/boost/exception/exception.hpp b/include/boost/exception/exception.hpp index 53e6ed0..6df93ac 100644 --- a/include/boost/exception/exception.hpp +++ b/include/boost/exception/exception.hpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/include/boost/exception/get_error_info.hpp b/include/boost/exception/get_error_info.hpp index 1bca37b..826ef22 100644 --- a/include/boost/exception/get_error_info.hpp +++ b/include/boost/exception/get_error_info.hpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) @@ -17,82 +17,12 @@ boost namespace exception_detail { - struct - strwrap - { - std::string str; - char const * ptr; - - explicit - strwrap( char const * s ): - str(s), - ptr(&str[0]) - { - } - - private: - - strwrap( strwrap const & ); - strwrap & operator=( strwrap const & ); - }; - - template <> - struct - get_info - { - static - shared_ptr - get( exception const & x ) - { - if( x.throw_function_ && *x.throw_function_ ) - { - shared_ptr s(new strwrap(x.throw_function_)); - return shared_ptr(s,&s->ptr); - } - else - return shared_ptr(); - } - }; - - template <> - struct - get_info - { - static - shared_ptr - get( exception const & x ) - { - if( x.throw_file_ && *x.throw_file_ ) - { - shared_ptr s(new strwrap(x.throw_file_)); - return shared_ptr(s,&s->ptr); - } - else - return shared_ptr(); - } - }; - - template <> - struct - get_info - { - static - shared_ptr - get( exception const & x ) - { - if( x.throw_line_!=-1 ) - return boost::shared_ptr(new int(x.throw_line_)); - else - return shared_ptr(); - } - }; - template struct get_info { static - shared_ptr + typename ErrorInfo::value_type const * get( exception const & x ) { if( exception_detail::error_info_container * c=x.data_.get() ) @@ -102,9 +32,45 @@ boost BOOST_ASSERT( 0!=dynamic_cast(eib.get()) ); #endif ErrorInfo const * w = static_cast(eib.get()); - return shared_ptr(eib,&w->value()); + return &w->value(); } - return shared_ptr(); + return 0; + } + }; + + template <> + struct + get_info + { + static + char const * const * + get( exception const & x ) + { + return x.throw_function_ ? &x.throw_function_ : 0; + } + }; + + template <> + struct + get_info + { + static + char const * const * + get( exception const & x ) + { + return x.throw_file_ ? &x.throw_file_ : 0; + } + }; + + template <> + struct + get_info + { + static + int const * + get( exception const & x ) + { + return x.throw_line_!=-1 ? &x.throw_line_ : 0; } }; } @@ -112,7 +78,7 @@ boost #ifdef BOOST_NO_RTTI template inline - shared_ptr + typename ErrorInfo::value_type const * get_error_info( boost::exception const & x ) { return exception_detail::get_info::get(x); @@ -120,13 +86,13 @@ boost #else template inline - shared_ptr + typename ErrorInfo::value_type const * get_error_info( E const & some_exception ) { if( exception const * x = dynamic_cast(&some_exception) ) return exception_detail::get_info::get(*x); else - return shared_ptr(); + return 0; } #endif } diff --git a/include/boost/exception/info.hpp b/include/boost/exception/info.hpp index 64097af..92a347e 100644 --- a/include/boost/exception/info.hpp +++ b/include/boost/exception/info.hpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) @@ -102,17 +102,13 @@ boost { if( diagnostic_info_str_.empty() ) { - std::string tmp; + std::ostringstream tmp; for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i ) { shared_ptr const & x = i->second; - tmp += '['; - tmp += x->tag_typeid_name(); - tmp += "] = "; - tmp += x->value_as_string(); - tmp += '\n'; + tmp << '[' << x->tag_typeid_name() << "] = " << x->value_as_string() << std::endl; } - diagnostic_info_str_.swap(tmp); + tmp.str().swap(diagnostic_info_str_); } return diagnostic_info_str_.c_str(); } diff --git a/include/boost/exception/info_tuple.hpp b/include/boost/exception/info_tuple.hpp index 3c8197a..38b2512 100644 --- a/include/boost/exception/info_tuple.hpp +++ b/include/boost/exception/info_tuple.hpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/include/boost/exception/to_string.hpp b/include/boost/exception/to_string.hpp index e10cbfd..5d88efa 100644 --- a/include/boost/exception/to_string.hpp +++ b/include/boost/exception/to_string.hpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/include/boost/exception/to_string_stub.hpp b/include/boost/exception/to_string_stub.hpp index 1cd08bb..4b70281 100644 --- a/include/boost/exception/to_string_stub.hpp +++ b/include/boost/exception/to_string_stub.hpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/include/boost/exception_ptr.hpp b/include/boost/exception_ptr.hpp index 196329d..2499d8a 100644 --- a/include/boost/exception_ptr.hpp +++ b/include/boost/exception_ptr.hpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) @@ -6,6 +6,10 @@ #ifndef UUID_FA5836A2CADA11DC8CD47C8555D89593 #define UUID_FA5836A2CADA11DC8CD47C8555D89593 +#include +#ifdef BOOST_NO_EXCEPTIONS +#error This header requires exception handling to be enabled. +#endif #include #include #include @@ -99,7 +103,7 @@ boost private: - exception_detail::clone_base const * + exception_detail::clone_base const * clone() const { return new unknown_exception(*this); diff --git a/include/boost/throw_exception.hpp b/include/boost/throw_exception.hpp index 69cdad0..da14339 100644 --- a/include/boost/throw_exception.hpp +++ b/include/boost/throw_exception.hpp @@ -11,7 +11,7 @@ // boost/throw_exception.hpp // // Copyright (c) 2002 Peter Dimov and Multi Media Ltd. -// Copyright (c) 2008 Emil Dotchevski and Reverge Studios, Inc. +// Copyright (c) 2008-2009 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 @@ -32,7 +32,7 @@ # define BOOST_EXCEPTION_DISABLE #endif -#if !defined( BOOST_NO_EXCEPTIONS ) && !defined( BOOST_EXCEPTION_DISABLE ) +#if !defined( BOOST_EXCEPTION_DISABLE ) # include # include # define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(::boost::enable_error_info(x) <<\ diff --git a/test/1-throw_exception_test.cpp b/test/1-throw_exception_test.cpp index 5719e80..06273bc 100644 --- a/test/1-throw_exception_test.cpp +++ b/test/1-throw_exception_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/2-throw_exception_no_exceptions_test.cpp b/test/2-throw_exception_no_exceptions_test.cpp index aca309d..91b84b7 100644 --- a/test/2-throw_exception_no_exceptions_test.cpp +++ b/test/2-throw_exception_no_exceptions_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/3-throw_exception_no_integration_test.cpp b/test/3-throw_exception_no_integration_test.cpp index 16b3d8c..6fa78f5 100644 --- a/test/3-throw_exception_no_integration_test.cpp +++ b/test/3-throw_exception_no_integration_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/4-throw_exception_no_both_test.cpp b/test/4-throw_exception_no_both_test.cpp index 4c58605..789bb74 100644 --- a/test/4-throw_exception_no_both_test.cpp +++ b/test/4-throw_exception_no_both_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 01ff3e5..894a916 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -1,6 +1,6 @@ # Boost Exception Library test Jamfile # -# Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +# Copyright (c) 2006-2009 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) @@ -33,6 +33,8 @@ run errno_test.cpp ; run error_info_test.cpp ; run diagnostic_information_test.cpp ; run refcount_ptr_test.cpp ; +run current_exception_cast_test.cpp ; +run no_exceptions_test.cpp : : : off ; compile-fail exception_fail.cpp ; compile-fail throw_exception_fail.cpp ; @@ -47,3 +49,4 @@ compile info_hpp_test.cpp ; compile info_tuple_hpp_test.cpp ; compile to_string_hpp_test.cpp ; compile to_string_stub_hpp_test.cpp ; +compile current_exception_cast_hpp_test.cpp ; diff --git a/test/cloning_test.cpp b/test/cloning_test.cpp index 695e2af..14c772a 100644 --- a/test/cloning_test.cpp +++ b/test/cloning_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) @@ -382,7 +382,7 @@ main() boost::unknown_exception & x ) { BOOST_TEST(boost::get_error_info(x)); - if( boost::shared_ptr p=boost::get_error_info(x) ) + if( int const * p=boost::get_error_info(x) ) BOOST_TEST(*p==42); boost::exception_ptr p = boost::current_exception(); BOOST_TEST(!(p==boost::exception_ptr())); @@ -397,7 +397,7 @@ main() boost::unknown_exception & x ) { BOOST_TEST(boost::get_error_info(x)); - if( boost::shared_ptr p=boost::get_error_info(x) ) + if( int const * p=boost::get_error_info(x) ) BOOST_TEST(*p==42); } catch( @@ -433,7 +433,7 @@ main() boost::unknown_exception & x ) { BOOST_TEST(boost::get_error_info(x)); - if( boost::shared_ptr p=boost::get_error_info(x) ) + if( int const * p=boost::get_error_info(x) ) BOOST_TEST(*p==42); boost::exception_ptr p = boost::current_exception(); BOOST_TEST(!(p==boost::exception_ptr())); @@ -448,7 +448,7 @@ main() boost::unknown_exception & x ) { BOOST_TEST(boost::get_error_info(x)); - if( boost::shared_ptr p=boost::get_error_info(x) ) + if( int const * p=boost::get_error_info(x) ) BOOST_TEST(*p==42); } catch( diff --git a/test/copy_exception_test.cpp b/test/copy_exception_test.cpp index 721c7e4..236a610 100644 --- a/test/copy_exception_test.cpp +++ b/test/copy_exception_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/current_exception_cast_hpp_test.cpp b/test/current_exception_cast_hpp_test.cpp new file mode 100644 index 0000000..d3211e2 --- /dev/null +++ b/test/current_exception_cast_hpp_test.cpp @@ -0,0 +1,7 @@ +//Copyright (c) 2006-2009 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 diff --git a/test/current_exception_cast_test.cpp b/test/current_exception_cast_test.cpp new file mode 100644 index 0000000..1f2e6b3 --- /dev/null +++ b/test/current_exception_cast_test.cpp @@ -0,0 +1,47 @@ +//Copyright (c) 2006-2009 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 + +class +my_exception: + public std::exception + { + }; + +class +polymorphic + { + virtual + ~polymorphic() + { + } + }; + +int +main() + { + try + { + throw my_exception(); + } + catch( + std::exception & e ) + { + try + { + throw; + } + catch( + ...) + { + BOOST_TEST(boost::current_exception_cast()==&e); + BOOST_TEST(!boost::current_exception_cast()); + } + } + return boost::report_errors(); + } diff --git a/test/diagnostic_information_hpp_test.cpp b/test/diagnostic_information_hpp_test.cpp index 5fe5a4c..92a3751 100644 --- a/test/diagnostic_information_hpp_test.cpp +++ b/test/diagnostic_information_hpp_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/diagnostic_information_test.cpp b/test/diagnostic_information_test.cpp index 669b7b0..ff3607d 100644 --- a/test/diagnostic_information_test.cpp +++ b/test/diagnostic_information_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) @@ -27,8 +27,8 @@ to_string( tagged_int2 const & x ) struct error1: - public std::exception, - public boost::exception + std::exception, + boost::exception { char const * what() const throw() @@ -39,10 +39,42 @@ error1: struct error2: - public boost::exception + boost::exception { }; +void +test1( std::string const & di1, std::string const & di2 ) + { + BOOST_TEST( di1!=di2 ); +#ifndef BOOST_NO_RTTI + BOOST_TEST(di1.find("type:")!=std::string::npos); + BOOST_TEST(di1.find("error1")!=std::string::npos); +#endif + BOOST_TEST(di1.find("test_tag1")!=std::string::npos); + BOOST_TEST(di1.find("test_tag2")!=std::string::npos); + BOOST_TEST(di1.find("fourty-two")!=std::string::npos); +#ifndef BOOST_NO_RTTI + BOOST_TEST(di2.find("type:")!=std::string::npos); + BOOST_TEST(di2.find("error1")!=std::string::npos); +#endif + BOOST_TEST(di2.find("test_tag1")!=std::string::npos); + BOOST_TEST(di2.find("test_tag2")!=std::string::npos); + BOOST_TEST(di2.find("bad value")!=std::string::npos); + } + +void +test2( std::string const & di1, std::string const & di2 ) + { + BOOST_TEST( di1!=di2 ); + BOOST_TEST(di1.find("test_tag1")!=std::string::npos); + BOOST_TEST(di1.find("test_tag2")!=std::string::npos); + BOOST_TEST(di1.find("fourty-two")!=std::string::npos); + BOOST_TEST(di2.find("test_tag1")!=std::string::npos); + BOOST_TEST(di2.find("test_tag2")!=std::string::npos); + BOOST_TEST(di2.find("bad value")!=std::string::npos); + } + int main() { @@ -54,30 +86,26 @@ main() throw x; } catch( - boost::exception & x ) + error1 & x ) { std::string di1=boost::diagnostic_information(x); x << tagged_int1(2) << tagged_int2(2); std::string di2 = diagnostic_information(x); -#ifndef BOOST_NO_RTTI - BOOST_TEST(di1.find("type:")!=std::string::npos); - BOOST_TEST(di1.find("error1")!=std::string::npos); -#endif - BOOST_TEST(di1.find("test_tag1")!=std::string::npos); - BOOST_TEST(di1.find("test_tag2")!=std::string::npos); - BOOST_TEST(di1.find("fourty-two")!=std::string::npos); -#ifndef BOOST_NO_RTTI - BOOST_TEST(di2.find("type:")!=std::string::npos); - BOOST_TEST(di2.find("error1")!=std::string::npos); -#endif - BOOST_TEST(di2.find("test_tag1")!=std::string::npos); - BOOST_TEST(di2.find("test_tag2")!=std::string::npos); - BOOST_TEST(di2.find("bad value")!=std::string::npos); + test1(di1,di2); + } + try + { + error1 x; x << tagged_int1(42) << tagged_int2(42); + BOOST_TEST(x.what()==std::string("error1")); + throw x; } catch( - ... ) + error1 & x ) { - BOOST_TEST(false); + std::string di1=boost::current_exception_diagnostic_information(); + x << tagged_int1(2) << tagged_int2(2); + std::string di2 = current_exception_diagnostic_information(); + test1(di1,di2); } try { @@ -86,23 +114,26 @@ main() throw x; } catch( - boost::exception & x ) + error2 & x ) { std::string di1 = diagnostic_information(x); x << tagged_int1(2) << tagged_int2(2); std::string di2 = diagnostic_information(x); - BOOST_TEST( di1!=di2 ); - BOOST_TEST(di1.find("test_tag1")!=std::string::npos); - BOOST_TEST(di1.find("test_tag2")!=std::string::npos); - BOOST_TEST(di1.find("fourty-two")!=std::string::npos); - BOOST_TEST(di2.find("test_tag1")!=std::string::npos); - BOOST_TEST(di2.find("test_tag2")!=std::string::npos); - BOOST_TEST(di2.find("bad value")!=std::string::npos); + test2(di1,di2); + } + try + { + error2 x; + x << tagged_int1(42) << tagged_int2(42); + throw x; } catch( - ... ) + error2 & x ) { - BOOST_TEST(false); + std::string di1 = current_exception_diagnostic_information(); + x << tagged_int1(2) << tagged_int2(2); + std::string di2 = current_exception_diagnostic_information(); + test2(di1,di2); } return boost::report_errors(); } diff --git a/test/enable_error_info_test.cpp b/test/enable_error_info_test.cpp index e1a743d..351c5f8 100644 --- a/test/enable_error_info_test.cpp +++ b/test/enable_error_info_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) @@ -55,7 +55,7 @@ main() { #endif BOOST_TEST( boost::get_error_info(x) ); - if( boost::shared_ptr p=boost::get_error_info(x) ) + if( int const * p=boost::get_error_info(x) ) BOOST_TEST( 42==*p ); #ifdef BOOST_NO_RTTI } diff --git a/test/errno_test.cpp b/test/errno_test.cpp index 2a7064c..31dc828 100644 --- a/test/errno_test.cpp +++ b/test/errno_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/error_info_hpp_test.cpp b/test/error_info_hpp_test.cpp index f38680c..ffe9ac8 100644 --- a/test/error_info_hpp_test.cpp +++ b/test/error_info_hpp_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/error_info_test.cpp b/test/error_info_test.cpp index 7a44ac8..9997162 100644 --- a/test/error_info_test.cpp +++ b/test/error_info_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/exception_fail.cpp b/test/exception_fail.cpp index 0edbf7e..3249f5c 100644 --- a/test/exception_fail.cpp +++ b/test/exception_fail.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/exception_hpp_test.cpp b/test/exception_hpp_test.cpp index 6e53d83..6f77efe 100644 --- a/test/exception_hpp_test.cpp +++ b/test/exception_hpp_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/exception_ptr_hpp_test.cpp b/test/exception_ptr_hpp_test.cpp index 91c90dc..dbfebbf 100644 --- a/test/exception_ptr_hpp_test.cpp +++ b/test/exception_ptr_hpp_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/exception_test.cpp b/test/exception_test.cpp index 7cadc5d..cc6537a 100644 --- a/test/exception_test.cpp +++ b/test/exception_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/get_error_info_hpp_test.cpp b/test/get_error_info_hpp_test.cpp index 1317640..61013fc 100644 --- a/test/get_error_info_hpp_test.cpp +++ b/test/get_error_info_hpp_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/has_to_string_test.cpp b/test/has_to_string_test.cpp index 7d55acc..4479d50 100644 --- a/test/has_to_string_test.cpp +++ b/test/has_to_string_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/helper1.cpp b/test/helper1.cpp index a839bff..f25f49f 100644 --- a/test/helper1.cpp +++ b/test/helper1.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/helper1.hpp b/test/helper1.hpp index 65570dc..adf6ec1 100644 --- a/test/helper1.hpp +++ b/test/helper1.hpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/helper2.cpp b/test/helper2.cpp index 258b6aa..982d084 100644 --- a/test/helper2.cpp +++ b/test/helper2.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/helper2.hpp b/test/helper2.hpp index df36fd9..0708476 100644 --- a/test/helper2.hpp +++ b/test/helper2.hpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/info_hpp_test.cpp b/test/info_hpp_test.cpp index f0fd463..25d382d 100644 --- a/test/info_hpp_test.cpp +++ b/test/info_hpp_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/info_tuple_hpp_test.cpp b/test/info_tuple_hpp_test.cpp index 59a14a4..293329c 100644 --- a/test/info_tuple_hpp_test.cpp +++ b/test/info_tuple_hpp_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/is_output_streamable_test.cpp b/test/is_output_streamable_test.cpp index 521d176..cb030b7 100644 --- a/test/is_output_streamable_test.cpp +++ b/test/is_output_streamable_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/no_exceptions_test.cpp b/test/no_exceptions_test.cpp new file mode 100644 index 0000000..ecdb03f --- /dev/null +++ b/test/no_exceptions_test.cpp @@ -0,0 +1,40 @@ +//Copyright (c) 2006-2009 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) + +#define BOOST_NO_EXCEPTIONS +#include +#include +#include +#include +#include +#include + +struct my_exception: boost::exception, std::exception { }; +typedef boost::error_info my_int; + +bool called=false; + +namespace +boost + { + void + throw_exception( std::exception const & x ) + { + called=true; + std::string s=boost::diagnostic_information(x); + std::cout << s; +#ifndef BOOST_NO_RTTI + BOOST_TEST(s.find("my_tag")!=std::string::npos); +#endif + } + } + +int +main() + { + BOOST_THROW_EXCEPTION( my_exception() << my_int(42) ); + BOOST_TEST(called); + return boost::report_errors(); + } diff --git a/test/refcount_ptr_test.cpp b/test/refcount_ptr_test.cpp index 68ccaec..773d784 100644 --- a/test/refcount_ptr_test.cpp +++ b/test/refcount_ptr_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/throw_exception_fail.cpp b/test/throw_exception_fail.cpp index 19fda91..9f34104 100644 --- a/test/throw_exception_fail.cpp +++ b/test/throw_exception_fail.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/throw_exception_test.cpp b/test/throw_exception_test.cpp index 9397509..6770d33 100644 --- a/test/throw_exception_test.cpp +++ b/test/throw_exception_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) @@ -35,9 +35,9 @@ boost_throw_exception_test() catch( boost::exception & x ) { - boost::shared_ptr file=boost::get_error_info(x); - boost::shared_ptr function=boost::get_error_info(x); - boost::shared_ptr line=boost::get_error_info(x); + char const * const * file=boost::get_error_info(x); + char const * const * function=boost::get_error_info(x); + int const * line=boost::get_error_info(x); BOOST_TEST( file && *file ); BOOST_TEST( function && *function ); BOOST_TEST( line && *line==32 ); @@ -55,10 +55,10 @@ boost_throw_exception_test() catch( boost::exception & x ) { - boost::shared_ptr file=boost::get_error_info(x); - boost::shared_ptr function=boost::get_error_info(x); - boost::shared_ptr line=boost::get_error_info(x); - boost::shared_ptr data=boost::get_error_info(x); + char const * const * file=boost::get_error_info(x); + char const * const * function=boost::get_error_info(x); + int const * line=boost::get_error_info(x); + int const * data=boost::get_error_info(x); BOOST_TEST( file && *file ); BOOST_TEST( function && *function ); BOOST_TEST( line && *line==52 ); @@ -117,7 +117,7 @@ tester() { #endif BOOST_TEST(boost::get_error_info(y)); - if( boost::shared_ptr d=boost::get_error_info(y) ) + if( int const * d=boost::get_error_info(y) ) BOOST_TEST(*d==42); #ifdef BOOST_NO_RTTI } diff --git a/test/to_string_fail.cpp b/test/to_string_fail.cpp index d1b903c..1bb3a2c 100644 --- a/test/to_string_fail.cpp +++ b/test/to_string_fail.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/to_string_hpp_test.cpp b/test/to_string_hpp_test.cpp index 98dc77f..560e3b1 100644 --- a/test/to_string_hpp_test.cpp +++ b/test/to_string_hpp_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/to_string_stub_hpp_test.cpp b/test/to_string_stub_hpp_test.cpp index a265ee1..c5ad03f 100644 --- a/test/to_string_stub_hpp_test.cpp +++ b/test/to_string_stub_hpp_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/to_string_stub_test.cpp b/test/to_string_stub_test.cpp index d5d6518..0b5cab8 100644 --- a/test/to_string_stub_test.cpp +++ b/test/to_string_stub_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/to_string_test.cpp b/test/to_string_test.cpp index 31aeb3b..eb18534 100644 --- a/test/to_string_test.cpp +++ b/test/to_string_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) diff --git a/test/unknown_exception_test.cpp b/test/unknown_exception_test.cpp index d163802..4918b44 100644 --- a/test/unknown_exception_test.cpp +++ b/test/unknown_exception_test.cpp @@ -1,4 +1,4 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2009 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) @@ -56,7 +56,7 @@ main() catch( boost::unknown_exception & x ) { - if( boost::shared_ptr d=boost::get_error_info(x) ) + if( int const * d=boost::get_error_info(x) ) BOOST_TEST( 42==*d ); else BOOST_TEST(false); @@ -73,7 +73,7 @@ main() catch( boost::exception & x ) { - if( boost::shared_ptr d=boost::get_error_info(x) ) + if( int const * d=boost::get_error_info(x) ) BOOST_TEST( 42==*d ); else BOOST_TEST(false);