diff --git a/doc/BOOST_THROW_EXCEPTION.html b/doc/BOOST_THROW_EXCEPTION.html index f25121d..9647705 100644 --- a/doc/BOOST_THROW_EXCEPTION.html +++ b/doc/BOOST_THROW_EXCEPTION.html @@ -21,15 +21,15 @@

BOOST_THROW_EXCEPTION

-

#include <boost/throw_exception.hpp>

+

#include <boost/throw_exception.hpp>

#if !defined( BOOST_EXCEPTION_DISABLE )
-    #include <boost/exception/exception.hpp>
+    #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__) )
+        ::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
@@ -37,7 +37,7 @@
diff --git a/doc/exception_diagnostic_information_hpp.html b/doc/boost_exception_diagnostic_information_hpp.html similarity index 90% rename from doc/exception_diagnostic_information_hpp.html rename to doc/boost_exception_diagnostic_information_hpp.html index 4668585..ad550d4 100644 --- a/doc/exception_diagnostic_information_hpp.html +++ b/doc/boost_exception_diagnostic_information_hpp.html @@ -30,13 +30,15 @@ boost class exception; template <class E> - std::string diagnostic_information( E const & e ); + std::string diagnostic_information( E const & e ); + + std::string diagnostic_information( exception_ptr const & p ); std::string current_exception_diagnostic_information(); }

See Also:

-
boost/exception.hpp
+
boost/exception.hpp
current_exception_diagnostic_information
diagnostic_information
Synopsis
diff --git a/doc/exception_enable_current_exception_hpp.html b/doc/boost_exception_enable_current_exception_hpp.html similarity index 96% rename from doc/exception_enable_current_exception_hpp.html rename to doc/boost_exception_enable_current_exception_hpp.html index 2f3bf9e..7d4d7ab 100644 --- a/doc/exception_enable_current_exception_hpp.html +++ b/doc/boost_exception_enable_current_exception_hpp.html @@ -22,7 +22,7 @@

boost/exception/enable_current_exception.hpp

Synopsis

-
#include <boost/exception/exception.hpp>
+
#include <boost/exception/exception.hpp>
 
 namespace
 boost
diff --git a/doc/exception_enable_error_info_hpp.html b/doc/boost_exception_enable_error_info_hpp.html
similarity index 96%
rename from doc/exception_enable_error_info_hpp.html
rename to doc/boost_exception_enable_error_info_hpp.html
index 253b67b..2ce4c64 100644
--- a/doc/exception_enable_error_info_hpp.html
+++ b/doc/boost_exception_enable_error_info_hpp.html
@@ -22,7 +22,7 @@
 

boost/exception/enable_error_info.hpp

Synopsis

-
#include <boost/exception/exception.hpp>
+
#include <boost/exception/exception.hpp>
 
 namespace
 boost
diff --git a/doc/exception_error_info_value_hpp.html b/doc/boost_exception_error_info_hpp.html
similarity index 96%
rename from doc/exception_error_info_value_hpp.html
rename to doc/boost_exception_error_info_hpp.html
index d648cd4..d0c1a54 100644
--- a/doc/exception_error_info_value_hpp.html
+++ b/doc/boost_exception_error_info_hpp.html
@@ -30,7 +30,7 @@ boost
     }

See Also:

-
boost/exception.hpp
+
diff --git a/doc/exception_exception_hpp.html b/doc/boost_exception_exception_hpp.html similarity index 89% rename from doc/exception_exception_hpp.html rename to doc/boost_exception_exception_hpp.html index d263f7d..fbd123f 100644 --- a/doc/exception_exception_hpp.html +++ b/doc/boost_exception_exception_hpp.html @@ -45,11 +45,11 @@ boost

See Also:

diff --git a/doc/exception_get_error_info_hpp.html b/doc/boost_exception_get_error_info_hpp.html similarity index 96% rename from doc/exception_get_error_info_hpp.html rename to doc/boost_exception_get_error_info_hpp.html index cd7e26b..2312ca4 100644 --- a/doc/exception_get_error_info_hpp.html +++ b/doc/boost_exception_get_error_info_hpp.html @@ -32,7 +32,7 @@ boost }

See Also:

- diff --git a/doc/exception_hpp.html b/doc/boost_exception_hpp.html similarity index 72% rename from doc/exception_hpp.html rename to doc/boost_exception_hpp.html index 13f748b..49acadc 100644 --- a/doc/exception_hpp.html +++ b/doc/boost_exception_hpp.html @@ -22,13 +22,13 @@

boost/exception.hpp

Synopsis

-

See Also:

Diagnostic Information
diff --git a/doc/exception_error_info_hpp.html b/doc/boost_exception_info_hpp.html similarity index 93% rename from doc/exception_error_info_hpp.html rename to doc/boost_exception_info_hpp.html index 3749f76..49141bc 100644 --- a/doc/exception_error_info_hpp.html +++ b/doc/boost_exception_info_hpp.html @@ -22,7 +22,7 @@

boost/exception/info.hpp

Synopsis

-
#include <boost/exception/exception.hpp>
+
#include <boost/exception/exception.hpp>
 
 namespace
 boost
@@ -44,8 +44,8 @@ boost
     }

See Also:

-
boost/exception.hpp
-
boost/exception/info_tuple.hpp
+
boost/exception.hpp
+
boost/exception/info_tuple.hpp
error_info
error_info::error_info
error_info::value
diff --git a/doc/exception_error_info_group_hpp.html b/doc/boost_exception_info_tuple_hpp.html similarity index 94% rename from doc/exception_error_info_group_hpp.html rename to doc/boost_exception_info_tuple_hpp.html index 6998ea6..8d526fb 100644 --- a/doc/exception_error_info_group_hpp.html +++ b/doc/boost_exception_info_tuple_hpp.html @@ -22,7 +22,7 @@

boost/exception/info_tuple.hpp

Synopsis

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

See Also:

-
boost/exception.hpp
+
diff --git a/doc/exception_cloning_hpp.html b/doc/boost_exception_ptr_hpp.html similarity index 86% rename from doc/exception_cloning_hpp.html rename to doc/boost_exception_ptr_hpp.html index b4d72de..8c63f06 100644 --- a/doc/exception_cloning_hpp.html +++ b/doc/boost_exception_ptr_hpp.html @@ -22,7 +22,7 @@

boost/exception_ptr.hpp

Synopsis

-
#include <boost/exception/exception.hpp>
+
#include <boost/exception/exception.hpp>
 
 namespace
 boost
@@ -35,6 +35,8 @@ boost
         ---unspecified---
         };    
     
+    typedef error_info<struct tag_original_exception_type,std::type_info const *> original_exception_type;    
+    
     typedef ---unspecified--- exception_ptr;    
     
     template <class T>
@@ -46,10 +48,11 @@ boost
     }

See Also:

-
boost/exception.hpp
+

Synopsis

#if !defined( BOOST_EXCEPTION_DISABLE )
-    #include <boost/exception/exception.hpp>
+    #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__) )
+        ::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
diff --git a/doc/configuration_macros.html b/doc/configuration_macros.html
index a015075..83b17fd 100644
--- a/doc/configuration_macros.html
+++ b/doc/configuration_macros.html
@@ -29,7 +29,7 @@
 

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, enable_current_exception and enable_error_info are integrated directly in the throw_exception 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 boost/throw_exception.hpp.

+

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 boost/throw_exception.hpp.

BOOST_NO_EXCEPTIONS

This macro disables exception handling in Boost, forwarding all exceptions to a user-defined non-template version of boost::throw_exception. However, unless BOOST_EXCEPTION_DISABLE is also defined, users can still examine the exception object for any data added at the point of the throw, or use boost::diagnostic_information (of course under BOOST_NO_EXCEPTIONS, the user-defined boost::throw_exception is not allowed to return to the caller.)


diff --git a/doc/copy_exception.html b/doc/copy_exception.html index 6acf19b..242da3e 100644 --- a/doc/copy_exception.html +++ b/doc/copy_exception.html @@ -21,7 +21,7 @@

copy_exception

-

#include <boost/exception_ptr.hpp>

+

#include <boost/exception_ptr.hpp>

namespace
 boost
     {
@@ -41,7 +41,7 @@ catch(...)
 
diff --git a/doc/current_exception.html b/doc/current_exception.html index f19107e..da0685a 100644 --- a/doc/current_exception.html +++ b/doc/current_exception.html @@ -21,7 +21,7 @@

current_exception

-

#include <boost/exception_ptr.hpp>

+

#include <boost/exception_ptr.hpp>

namespace
 boost
     {
@@ -37,16 +37,20 @@ boost
 

Nothing.

Notes:

  • It is unspecified whether the return values of two successive calls to current_exception refer to the same exception object.
  • -
  • Correct implementation of current_exception may require compiler support, unless enable_current_exception was used at the time the currently handled exception object was passed to throw. If enable_current_exception was not used, and if the compiler does not provide the necessary support, then current_exception may return an exception_ptr that refers to an instance of unknown_exception. In this case, if the original exception object derives from boost::exception, then the boost::exception sub-object of the unknown_exception object is initialized by the boost::exception copy constructor.
  • +
  • Correct implementation of current_exception may require compiler support, unless enable_current_exception was used at the time the currently handled exception object was passed to throw. Whenever current_exception fails to properly copy the current exception object, it returns an exception_ptr to an object of type that is as close as possible to the original exception type, using unknown_exception as a final fallback. All such types derive from boost::exception, and:
    +
diff --git a/doc/current_exception_diagnostic_information.html b/doc/current_exception_diagnostic_information.html index b3bd25d..54174b7 100644 --- a/doc/current_exception_diagnostic_information.html +++ b/doc/current_exception_diagnostic_information.html @@ -21,7 +21,7 @@

current_exception_diagnostic_information

-

#include <boost/exception/diagnostic_information.hpp> 

+

#include <boost/exception/diagnostic_information.hpp> 

namespace
 boost
     {
@@ -54,7 +54,8 @@ main()
 
diff --git a/doc/diagnostic_information.html b/doc/diagnostic_information.html index 3c866c0..1ec4a97 100644 --- a/doc/diagnostic_information.html +++ b/doc/diagnostic_information.html @@ -21,15 +21,17 @@

diagnostic_information

-

#include <boost/exception/diagnostic_information.hpp> 

+

#include <boost/exception/diagnostic_information.hpp> 

namespace
 boost
     {
     template <class E>
-    std::string diagnostic_information( E const & e );
+    std::string diagnostic_information( E const & e );
+    
+    std::string diagnostic_information( exception_ptr const & p );
     }

Returns:

-

A string value that contains varying amount of implementation-specific diagnostic information about the passed exception object:

+

A string value that contains varying amount of implementation-specific diagnostic information about the passed object:


See Also:

diff --git a/doc/get_error_info.html b/doc/get_error_info.html index 427e417..8f64bc1 100644 --- a/doc/get_error_info.html +++ b/doc/get_error_info.html @@ -43,8 +43,9 @@ boost

See Also:

BOOST_THROW_EXCEPTION
Boost Exception
-
boost/exception/get_error_info.hpp
+
boost/exception/get_error_info.hpp
Configuration Macros
+
current_exception
error_info
exception
Motivation
diff --git a/doc/headers.html b/doc/headers.html index 9610f08..99f97f1 100644 --- a/doc/headers.html +++ b/doc/headers.html @@ -21,21 +21,19 @@

See Also:

Boost Exception
diff --git a/doc/original_exception_type.html b/doc/original_exception_type.html new file mode 100644 index 0000000..090de12 --- /dev/null +++ b/doc/original_exception_type.html @@ -0,0 +1,54 @@ + + + + + original_exception_type + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

original_exception_type

+
+

#include <boost/exception_ptr.hpp>

+
namespace
+boost
+    {
+    typedef error_info<struct tag_original_exception_type,std::type_info const *> original_exception_type;
+    }
+

This error_info typedef is used by current_exception if it defaults to returning an exception_ptr that refers to an object of type unknown_exception, to record in it the std::type_info of the original exception object.

+
+ + + + +
+
+
+ + diff --git a/doc/page_idx.html b/doc/page_idx.html index b9222dd..726a070 100644 --- a/doc/page_idx.html +++ b/doc/page_idx.html @@ -25,18 +25,18 @@

B

BOOST_THROW_EXCEPTION

b

-

boost/exception.hpp

+

boost/exception.hpp

boost/exception/current_exception_cast.hpp

-

boost/exception/diagnostic_information.hpp

-

boost/exception/enable_current_exception.hpp

-

boost/exception/enable_error_info.hpp

-

boost/exception/error_info.hpp

-

boost/exception/exception.hpp

-

boost/exception/get_error_info.hpp

-

boost/exception/info.hpp

-

boost/exception/info_tuple.hpp

-

boost/exception_ptr.hpp

-

boost/throw_exception.hpp

+

boost/exception/diagnostic_information.hpp

+

boost/exception/enable_current_exception.hpp

+

boost/exception/enable_error_info.hpp

+

boost/exception/error_info.hpp

+

boost/exception/exception.hpp

+

boost/exception/get_error_info.hpp

+

boost/exception/info.hpp

+

boost/exception/info_tuple.hpp

+

boost/exception_ptr.hpp

+

boost/throw_exception.hpp

C

Configuration Macros

c

@@ -74,6 +74,8 @@

M

Macros

Motivation

+

o

+

original_exception_type

r

rethrow_exception

S

diff --git a/doc/rethrow_exception.html b/doc/rethrow_exception.html index 775c913..64e0fe3 100644 --- a/doc/rethrow_exception.html +++ b/doc/rethrow_exception.html @@ -21,7 +21,7 @@

rethrow_exception

-

#include <boost/exception_ptr.hpp>

+

#include <boost/exception_ptr.hpp>

namespace
 boost
     {
@@ -34,7 +34,8 @@ boost
 
diff --git a/doc/source/boost-exception.reno b/doc/source/boost-exception.reno index cb23860..44ec9e0 100644 --- a/doc/source/boost-exception.reno +++ b/doc/source/boost-exception.reno @@ -39,7 +39,7 @@ - 56 + 57 0 @@ -48,842 +48,6 @@ 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 - - 6 - - 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 - - 7 - - 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 - - 8 - - 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 - - 9 - - reno_context - - - - - - - 1 - FC684D0DD5A9732B4130F2AB3DB6E0491D0F523E14B7FB738B2019EA2C7F8717 - 2229778754 - 631 - 319 - - - - - - 0 - ../../example/cloning_2.cpp - 0 - 0 - - - - - <string>cloning and re-throwing an exception</string> - - - cloning_and_rethrowing - - - - - - 0 - - - - - 0 - - 10 - - 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 - - 11 - - reno_context - - - - - - - 2 - 1D3204D3ADDAB7AA716BEA1489EA852A9D6B5C110243364F6931FEF1CC2E5F88 - 422052608 - 3923 - 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 - - 12 - - reno_context - - - - - - - 2 - F7633FDCF6615C0199645701EE6E7ACE5CBCD7A7CF6838573791E91ABB3C09F2 - 1668435395 - 1332 - 396 - A1F443AF571973A12005D2F7D4AE09A32AAF686FEEAE272EC21512A65EB943E8 - 3879093659 - 1300 - 26 - - - - - - 0 - ../../../../boost/exception/info_tuple.hpp - 0 - 0 - - - - - <string>tuple/operator<<</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 13 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>transporting of arbitrary data to the catch site</string> - - - tutorial_transporting_data - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 14 - - reno_context - - - - - - - 1 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>boost/exception/exception.hpp</string> - - - exception_exception_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 15 - - reno_context - - - - - - - 2 - 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 - 2533933282 - 8724 - 615 - 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 - 2078296250 - 305 - 8156 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>copy_exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 16 - - reno_context - - - - - - - 1 - 2F432507CFD796BE673F33D9AC68C535F1ED1F4FCD3A8E3AEEC320D9795FB4AE - 2319362875 - 2574 - 323 - - - - - - 0 - ../../../../boost/exception/get_error_info.hpp - 0 - 0 - - - - - <string>boost/exception/get_error_info.hpp</string> - - - exception_get_error_info_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 17 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>frequently asked questions</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 18 - - 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 - - 19 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>boost/exception/enable_current_exception.hpp</string> - - - exception_enable_current_exception_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 20 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Motivation</string> - - - motivation - - - - - - 7 - 2 - (:include include:) (:auto also explicit=" - 1 - - 0 - - 21 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>exception types as simple semantic tags</string> - - - - - - - - 2 - - 1 - - 0 - - 22 - - reno_context - - - - - - - 1 - D9B8E6AA12A4F33953B1A961FA590C5A3840234B6531CA8C04AC985AD5800835 - 2432554768 - 702 - 408 - - - - - - 0 - ../../example/enable_error_info.cpp - 0 - 0 - - - - - <string>integrating boost exception in existing exception class hierarchies</string> - - - tutorial_enable_error_info - - - - - 2 - - 1 - - 0 - - -17 - - - 2 - ":) - - - - - 0 - - -21 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -22 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 23 - - reno_context - @@ -929,7 +93,7 @@ 0 - 24 + 6 reno_context @@ -938,64 +102,11 @@ - 2 - 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 - 2533933282 - 8724 - 615 - F86EB07D04CD0D0645080D1121DA899746D0C45137E17E1D9BE605E75396F047 - 1983537541 - 1346 - 148 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>exception_ptr</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 25 - - reno_context - - - - - - - 2 + 1 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF 1282550303 9192 323 - 17E691632123EB67BA67D590B49EB8094F462F5A10A66A1C5438E1867EF1478E - 765399792 - 77 - 5917 @@ -1009,95 +120,7 @@ - <string>exception::~exception</string> - - - exception_destructor - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 26 - - reno_context - - - - - - - 1 - E444EE9697EEADFDE0767E1D0242FC0E70D98E61FB1F0FFA099648DE509B82F3 - 94503238 - 773 - 374 - - - - - - 0 - ../../example/info_tuple.cpp - 0 - 0 - - - - - <string>adding grouped data to exceptions</string> - - - grouping_data - - - - - - 0 - - - - - 0 - - 27 - - reno_context - - - - - - - 1 - 04DDC793002AFCF4F4166D250C67D09B6FE8B86224318ED7847AD6EC423B70CA - 922651615 - 433 - 1027 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - - <string>BOOST_THROW_EXCEPTION</string> + <string>boost/exception/exception.hpp</string> @@ -1115,773 +138,7 @@ 0 - 28 - - 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 - - 29 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Synopsis</string> - - - synopsis - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 30 - - 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 - - 31 - - 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> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 32 - - 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> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 33 - - 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 - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 34 - - reno_context - - - - - - - 1 - 9E8DCE3BCF462A3A332DA70F61E46FA5C2AB791B95E33D3F2AF1307F53C84B1C - 1960675522 - 6483 - 591 - - - - - - 0 - ../../example/example_io.cpp - 0 - 0 - - - - - <string>diagnostic_information example</string> - - - - - - - - - 0 - - - - - 0 - - 35 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Functions</string> - - - functions - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 36 - - reno_context - - - - - - - 2 - 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 - 2533933282 - 8724 - 615 - 9F3671DA5E8AB414F1FBA3B160D49134EAEE8DFF33E95376EDB41534E916FF38 - 2436936467 - 718 - 1496 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>unknown_exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 37 - - 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 - - 38 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>boost exception</string> - - - boost-exception - - - - - - 1 - 2 - (:include include:) - - - - - 0 - - 39 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>transporting of exceptions between threads</string> - - - tutorial_exception_ptr - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 40 - - reno_context - - - - - - - 2 - 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A - 1770110914 - 587 - 1462 - 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D - 3929437933 - 361 - 213 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - - <string>throw_exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 41 - - reno_context - - - - - - - 2 - 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 - 2533933282 - 8724 - 615 - 0E9DF8366080712A816BE91ABCEF1E2044145B63D75B0B995B537900F378189E - 1069696031 - 255 - 8463 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>rethrow_exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 42 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>using virtual inheritance in exception types</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 43 - - reno_context - - - - - - - 2 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 - 1693870740 - 2195 - 3720 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>exception</string> - - - - - - - - - 1 - 2 - (:include include:) ---- !!!See Also: (:pagelist link="backlink" except_tags="exception,member" mod="w":) - - - - - 0 - - 44 - - 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> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 45 + 7 reno_context @@ -1934,7 +191,56 @@ 0 - 46 + 8 + + reno_context + + + + + + + 2 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + 1516D0B7E11CBEB60CE4222565ACCAFF2E9857A8A505C1C26E2AE90087250581 + 3624753243 + 279 + 26 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>original_exception_type</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 9 reno_context @@ -1944,40 +250,91 @@ 1 - D10E536B909EFFF78FB09E6242AEC7C74ACDD75AE7DF32B45870422B752E5D8E - 1903336130 - 557 - 382 + 2F432507CFD796BE673F33D9AC68C535F1ED1F4FCD3A8E3AEEC320D9795FB4AE + 2319362875 + 2574 + 323 0 - ../../example/error_info_1.cpp + ../../../../boost/exception/get_error_info.hpp 0 0 - <string>adding of arbitrary data at the point of the throw</string> + <string>boost/exception/get_error_info.hpp</string> - adding_data_at_throw + - 0 + 1 + 2 + (:include include:) (:auto also:) 0 - 47 + 10 + + 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> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 11 reno_context @@ -1997,10 +354,10 @@ - <string>Types</string> + <string>frequently asked questions</string> - types + @@ -2015,7 +372,7 @@ 0 - 48 + 12 reno_context @@ -2024,41 +381,74 @@ - 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>exception types as simple semantic tags</string> - using_enable_cloning + - 0 + 1 + 2 + (:include include:) (:auto also:) 0 - 49 + 13 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Headers</string> + + + headers + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 14 reno_context @@ -2088,7 +478,7 @@ boost/exception/info_tuple.hpp - exception_error_info_group_hpp + @@ -2103,7 +493,7 @@ 0 - 50 + 15 reno_context @@ -2113,27 +503,27 @@ 1 - F647827E95C64B626A8E3751AD4E4D21237DD17482EEA6DB93A16A2C6AC79E87 - 527078204 - 446 - 227 + BEFF039468E0E9A3719E5CB51DA9710812D146B587BAF573D1670908BB97C0CA + 35548578 + 1983 + 91 0 - ../../../../boost/exception.hpp + ../../../../boost/throw_exception.hpp 0 0 - <string>boost/exception.hpp</string> + <string>boost/throw_exception.hpp</string> - exception_hpp + @@ -2148,7 +538,56 @@ 0 - 51 + 16 + + reno_context + + + + + + + 2 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 + 2078296250 + 305 + 10862 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>copy_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 17 reno_context @@ -2201,7 +640,457 @@ 0 - 52 + 18 + + 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> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 19 + + reno_context + + + + + + + 1 + 95AD55ACCB1C17C1DBA4C309BDFCBD4B66E52CD9A2F54FDAD2D642A00342D001 + 3194412598 + 4599 + 323 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + + <string>boost/exception/diagnostic_information.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 20 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>transporting of exceptions between threads</string> + + + tutorial_exception_ptr + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 21 + + 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 + + 22 + + reno_context + + + + + + + 1 + F647827E95C64B626A8E3751AD4E4D21237DD17482EEA6DB93A16A2C6AC79E87 + 527078204 + 446 + 227 + + + + + + 0 + ../../../../boost/exception.hpp + 0 + 0 + + + + + <string>boost/exception.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 23 + + 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 + + 24 + + reno_context + + + + + + + 1 + 04DDC793002AFCF4F4166D250C67D09B6FE8B86224318ED7847AD6EC423B70CA + 922651615 + 433 + 1032 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>BOOST_THROW_EXCEPTION</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 25 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Functions</string> + + + functions + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 26 + + 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> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 27 + + reno_context + + + + + + + 1 + 641BB230CEBF638811480BE0E3A96ABCB7CC9CC7E1C1A9C51FBAB296FFB6B7B1 + 4248389286 + 4113 + 323 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>boost/exception/info.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 28 reno_context @@ -2224,7 +1113,7 @@ boost/exception/enable_error_info.hpp - exception_enable_error_info_hpp + @@ -2239,7 +1128,7 @@ 0 - 53 + 29 reno_context @@ -2248,36 +1137,41 @@ - 0 + 1 + 9E8DCE3BCF462A3A332DA70F61E46FA5C2AB791B95E33D3F2AF1307F53C84B1C + 1960675522 + 6483 + 591 - 1 + 0 + ../../example/example_io.cpp + 0 + 0 - <string>Headers</string> + <string>diagnostic_information example</string> - headers + - 1 - 2 - (:include include:) (:auto also:) + 0 0 - 54 + 30 reno_context @@ -2287,31 +1181,31 @@ 2 - 9A4ECF9A49A73AED83C1565CB8C67AE1519E8AFE6818F968B4C4733CB9E86CEF - 1615599655 - 68 - 227 - 34F0583BC8DE767CE2D79721E1F956895E43E5397473B1050F59BE7E26C773DB - 805836816 - 66 - 1 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + B20A3D4631F3B2415EED1888B65FA33D7AED20F86BE196159D9297AAED115787 + 3293519666 + 117 + 11169 0 - ../../../../boost/exception/error_info.hpp + ../../../../boost/exception_ptr.hpp 0 0 - <string>boost/exception/error_info.hpp</string> + <string>rethrow_exception</string> - exception_error_info_value_hpp + @@ -2326,7 +1220,148 @@ 0 - 55 + 31 + + 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 + + 32 + + reno_context + + + + + + + 2 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + 6B3B617AC518A2177BDB89656E726B4E4D79577E289130493A61BAE24FB64838 + 3173127726 + 1101 + 2184 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>unknown_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 33 + + reno_context + + + + + + + 2 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + AF894656AC8CED6190EEEE08B051DBF2106A393E313BB5BB1C17D4808EFED761 + 1496105832 + 1753 + 429 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>exception_ptr</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 34 reno_context @@ -2364,7 +1399,7 @@ 0 - 56 + 35 reno_context @@ -2374,72 +1409,27 @@ 1 - A449DE2B3A2CDAE9DD932C06D224B3E07C95EBACBB4EA5890CA4CCF2DC74A693 - 1718307056 - 4118 - 323 + 7116AEECEA666794E31DC99390ADEC1BA6AF74B2398067A0739767B4B76FA97A + 4128134227 + 307 + 302 0 - ../../../../boost/exception/info.hpp + ../../example/logging.cpp 0 0 - <string>boost/exception/info.hpp</string> + <string>diagnostic information</string> - exception_error_info_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 57 - - reno_context - - - - - - - 1 - E127BAFA15A5B7031C0DD1817993041600F935B71E7BDE42E1F4AF50959B6AB3 - 2166367611 - 9016 - 323 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>boost/exception_ptr.hpp</string> - - - exception_cloning_hpp + tutorial_diagnostic_information @@ -2454,7 +1444,7 @@ 0 - 58 + 36 reno_context @@ -2463,11 +1453,68 @@ - 1 - 05698FEF1D553EDBC15212673561F5436DF771AA5488C8ED8164D303078DE08E - 119041194 - 1978 - 91 + 2 + 02F77B8305279514F37A75FA6454AE750E04E7AA7934D395EFB52BCC7642965E + 430535365 + 3379 + 560 + D08B74734CDA5115D9E47783E2994C2836BE241FB25E589BB4C67F2596727C03 + 24341149 + 3347 + 26 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + + <string>diagnostic_information</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 37 + + reno_context + + + + + + + 3 + 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A + 1770110914 + 587 + 1467 + 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D + 3929437933 + 361 + 213 + CD1241D84950468704F3C3F04116B8DA5162A8BEA4364F10951232F49113C5DE + 1658463867 + 121 + 238 @@ -2481,10 +1528,10 @@ - <string>boost/throw_exception.hpp</string> + <string>configuration macros</string> - throw_exception_hpp + @@ -2499,7 +1546,338 @@ 0 - 59 + 38 + + reno_context + + + + + + + 2 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + E23085202D084CBB50F289988A6A592F06D923B77D0AB25D7A98A7188DF5BE3B + 1414247481 + 766 + 10094 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>current_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 39 + + reno_context + + + + + + + 2 + 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A + 1770110914 + 587 + 1467 + 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D + 3929437933 + 361 + 213 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>throw_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 40 + + reno_context + + + + + + + 2 + 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF + 1282550303 + 9192 + 323 + 17E691632123EB67BA67D590B49EB8094F462F5A10A66A1C5438E1867EF1478E + 765399792 + 77 + 5917 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>exception::~exception</string> + + + exception_destructor + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 41 + + 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 + + 42 + + reno_context + + + + + + + 1 + E444EE9697EEADFDE0767E1D0242FC0E70D98E61FB1F0FFA099648DE509B82F3 + 94503238 + 773 + 374 + + + + + + 0 + ../../example/info_tuple.cpp + 0 + 0 + + + + + <string>adding grouped data to exceptions</string> + + + grouping_data + + + + + + 0 + + + + + 0 + + 43 + + reno_context + + + + + + + 1 + FC684D0DD5A9732B4130F2AB3DB6E0491D0F523E14B7FB738B2019EA2C7F8717 + 2229778754 + 631 + 319 + + + + + + 0 + ../../example/cloning_2.cpp + 0 + 0 + + + + + <string>cloning and re-throwing an exception</string> + + + cloning_and_rethrowing + + + + + + 0 + + + + + 0 + + 44 + + reno_context + + + + + + + 2 + AED5E79246B32BDF0E5C6CD8BDDC3370FD0BA1EFE3D4CE76C4A6D36A123F2E20 + 228982966 + 3918 + 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 + + 45 reno_context @@ -2519,10 +1897,10 @@ - <string>page index</string> + <string>using virtual inheritance in exception types</string> - page_idx + @@ -2537,7 +1915,450 @@ 0 - 60 + 46 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Synopsis</string> + + + synopsis + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 47 + + reno_context + + + + + + + 1 + D9B8E6AA12A4F33953B1A961FA590C5A3840234B6531CA8C04AC985AD5800835 + 2432554768 + 702 + 408 + + + + + + 0 + ../../example/enable_error_info.cpp + 0 + 0 + + + + + <string>integrating boost exception in existing exception class hierarchies</string> + + + tutorial_enable_error_info + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 48 + + reno_context + + + + + + + 2 + F7633FDCF6615C0199645701EE6E7ACE5CBCD7A7CF6838573791E91ABB3C09F2 + 1668435395 + 1332 + 396 + A1F443AF571973A12005D2F7D4AE09A32AAF686FEEAE272EC21512A65EB943E8 + 3879093659 + 1300 + 26 + + + + + + 0 + ../../../../boost/exception/info_tuple.hpp + 0 + 0 + + + + + <string>tuple/operator<<</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 49 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>transporting of arbitrary data to the catch site</string> + + + tutorial_transporting_data + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 50 + + reno_context + + + + + + + 2 + 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF + 1282550303 + 9192 + 323 + 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 + 1693870740 + 2195 + 3720 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>exception</string> + + + + + + + + + 1 + 2 + (:include include:) ---- !!!See Also: (:pagelist link="backlink" except_tags="exception,member" mod="w":) + + + + + 0 + + 51 + + 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 + + 52 + + reno_context + + + + + + + 2 + AED5E79246B32BDF0E5C6CD8BDDC3370FD0BA1EFE3D4CE76C4A6D36A123F2E20 + 228982966 + 3918 + 518 + D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 + 4055211476 + 525 + 3387 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>exception/operator<<</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 53 + + reno_context + + + + + + + 1 + 21E8093D2AF6946EAE135823066EF38B9DC8870432B44C81E585FF63A72F9903 + 3352783584 + 12170 + 323 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>boost/exception_ptr.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 54 + + 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> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 55 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>boost/exception/enable_current_exception.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 56 reno_context @@ -2578,6 +2399,234 @@ (:include include:) (:auto also:) + + + 0 + + 57 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>page index</string> + + + page_idx + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 58 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Motivation</string> + + + motivation + + + + + + 7 + 2 + (:include include:) (:auto also explicit=" + 1 + + 0 + + -12 + + + 2 + + 1 + + 0 + + -47 + + + 2 + + 1 + + 0 + + -11 + + + 2 + ":) + + + + + 0 + + 59 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>boost exception</string> + + + boost-exception + + + + + + 1 + 2 + (:include include:) + + + + + 0 + + 60 + + reno_context + + + + + + + 2 + D57BF77EE44CD2755E24A56DDC3E159716D04A7ABE009AE977D4926EFEC00F73 + 2498368808 + 973 + 3941 + 9432C669E21C649A86AC6DC5A34275B483A7D2D38118A462DF1C1CD7BBE5ED51 + 2535426829 + 441 + 110 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + + <string>current_exception_diagnostic_information</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 61 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Types</string> + + + types + + + + + + 1 + 2 + (:include include:) (:auto also:) + + @@ -2585,13 +2634,13 @@ def - 61 + 62 reno_layer - 56 + 57 0 @@ -2743,7 +2792,45 @@ - 0 + 9 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -18 + + + 2 + :) { public: (:include + 1 + + 0 + + -17 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -44 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -26 + + + 2 + decl pre_indent="4":) };@] @@ -3018,36 +3105,7 @@ - 7 - 2 - [@class (:link - 1 - - 0 - - -43 - - - 2 - :) { protected: (:include - 1 - - 0 - - -45 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -25 - - - 2 - decl pre_indent="4":) };@] + 0 @@ -3058,45 +3116,7 @@ - 9 - 2 - [@template <class Tag,class T> class (:link - 1 - - 0 - - -44 - - - 2 - :) { public: (:include - 1 - - 0 - - -51 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -11 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -32 - - - 2 - decl pre_indent="4":) };@] + 0 @@ -3162,7 +3182,36 @@ - 0 + 7 + 2 + [@class (:link + 1 + + 0 + + -50 + + + 2 + :) { protected: (:include + 1 + + 0 + + -7 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -40 + + + 2 + decl pre_indent="4":) };@] @@ -3275,6 +3324,17 @@ 0 + + + 0 + + -61 + + + + 0 + + @@ -3282,13 +3342,13 @@ api - 62 + 63 reno_layer - 56 + 57 0 @@ -3307,94 +3367,6 @@ -6 - - 0 - - - - - 0 - - -7 - - - - 0 - - - - - 0 - - -8 - - - - 0 - - - - - 0 - - -9 - - - - 0 - - - - - 0 - - -10 - - - - 0 - - - - - 0 - - -11 - - - - 0 - - - - - 0 - - -12 - - - - 0 - - - - - 0 - - -13 - - - - 0 - - - - - 0 - - -14 - - 11 2 @@ -3403,7 +3375,7 @@ 0 - -43 + -50 2 @@ -3412,7 +3384,7 @@ 0 - -44 + -18 2 @@ -3421,7 +3393,7 @@ 0 - -44 + -18 2 @@ -3430,7 +3402,7 @@ 0 - -44 + -18 2 @@ -3439,7 +3411,7 @@ 0 - -44 + -18 2 @@ -3450,7 +3422,7 @@ 0 - -15 + -7 @@ -3461,7 +3433,18 @@ 0 - -16 + -8 + + + + 0 + + + + + 0 + + -9 @@ -3472,13 +3455,132 @@ 0 - -37 + -23 2 decl:)@] + + + 0 + + -10 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -18 + + + 2 + decl:)@] + + + + + 0 + + -11 + + + + 0 + + + + + 0 + + -12 + + + + 0 + + + + + 0 + + -13 + + + + 0 + + + + + 0 + + -14 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -48 + + + 2 + decl:)@] + + + + + 0 + + -15 + + + + 5 + 2 + [@(:include + 1 + + 0 + + -24 + + + 2 + decl:) namespace boost { (:include + 1 + + 0 + + -39 + + + 2 + decl:) }@] + + + + + 0 + + -16 + + + + 0 + + 0 @@ -3509,14 +3611,23 @@ - 3 + 5 2 [@(:include 1 0 - -8 + -36 + + + 2 + decl:) (:include + 1 + + 0 + + -60 2 @@ -3553,7 +3664,72 @@ - 0 + 15 + 2 + [@#include <(:link + 1 + + 0 + + -19 + + + 2 + :)> #include <(:link + 1 + + 0 + + -10 + + + 2 + :)> #include <(:link + 1 + + 0 + + -6 + + + 2 + :)> #include <(:link + 1 + + 0 + + -9 + + + 2 + :)> #include <(:link + 1 + + 0 + + -27 + + + 2 + :)> #include <(:link + 1 + + 0 + + -14 + + + 2 + :)> #include <(:link + 1 + + 0 + + -53 + + + 2 + :)>@] @@ -3608,7 +3784,27 @@ - 0 + 5 + 2 + [@(:include + 1 + + 0 + + -18 + + + 2 + def:) (:include + 1 + + 0 + + -52 + + + 2 + decl:)@] @@ -3619,7 +3815,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -5 + + + 2 + decl:)@] @@ -3674,27 +3881,7 @@ - 5 - 2 - [@(:include - 1 - - 0 - - -5 - - - 2 - decl:) (:include - 1 - - 0 - - -28 - - - 2 - decl:)@] + 0 @@ -3870,18 +4057,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -12 - - - 2 - decl:)@] + 0 @@ -3892,72 +4068,7 @@ - 15 - 2 - [@#include <(:link - 1 - - 0 - - -33 - - - 2 - :)> #include <(:link - 1 - - 0 - - -54 - - - 2 - :)> #include <(:link - 1 - - 0 - - -14 - - - 2 - :)> #include <(:link - 1 - - 0 - - -16 - - - 2 - :)> #include <(:link - 1 - - 0 - - -56 - - - 2 - :)> #include <(:link - 1 - - 0 - - -49 - - - 2 - :)> #include <(:link - 1 - - 0 - - -57 - - - 2 - :)>@] + 0 @@ -3979,18 +4090,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -23 - - - 2 - decl:)@] + 0 @@ -4001,7 +4101,63 @@ - 0 + 13 + 2 + [@(:include + 1 + + 0 + + -32 + + + 2 + decl:) (:include + 1 + + 0 + + -8 + + + 2 + decl:) (:include + 1 + + 0 + + -33 + + + 2 + decl:) (:include + 1 + + 0 + + -16 + + + 2 + decl:) (:include + 1 + + 0 + + -38 + + + 2 + decl:) (:include + 1 + + 0 + + -30 + + + 2 + decl:)@] @@ -4012,18 +4168,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -44 - - - 2 - decl:)@] + 0 @@ -4034,88 +4179,10 @@ - 0 - - - - - 0 - - -56 - - - - 5 + 3 2 [@(:include 1 - - 0 - - -44 - - - 2 - def:) (:include - 1 - - 0 - - -18 - - - 2 - decl:)@] - - - - - 0 - - -57 - - - - 11 - 2 - [@(:include - 1 - - 0 - - -36 - - - 2 - decl:) (:include - 1 - - 0 - - -24 - - - 2 - decl:) (:include - 1 - - 0 - - -15 - - - 2 - decl:) (:include - 1 - - 0 - - -6 - - - 2 - decl:) (:include - 1 0 @@ -4130,31 +4197,44 @@ 0 - -58 + -56 - 5 + 3 2 [@(:include 1 0 - -27 + -54 2 - decl:) namespace boost { (:include - 1 - - 0 - - -40 - - - 2 - decl:) }@] + decl:)@] + + + + + 0 + + -57 + + + + 0 + + + + + 0 + + -58 + + + + 0 @@ -4176,18 +4256,18 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -31 - - - 2 - decl:)@] + 0 + + + + + 0 + + -61 + + + + 0 @@ -4197,13 +4277,13 @@ decl - 63 + 64 reno_layer - 56 + 57 0 @@ -4214,7 +4294,7 @@ 3 2 - [@template <class E> std::string (:link + [@template <class T> ---unspecified--- (:link 1 0 @@ -4223,7 +4303,7 @@ 2 - :)( E const & e );@] + :)( T const & x );@] @@ -4234,27 +4314,7 @@ - 5 - 2 - [@(:link - 1 - - 0 - - -24 - - - 2 - :) (:link - 1 - - 0 - - -6 - - - 2 - :)();@] + 0 @@ -4265,7 +4325,36 @@ - 0 + 7 + 2 + [@(:link + 1 + + 0 + + -7 + + + 2 + mod="m":)(); (:link + 1 + + 0 + + -7 + + + 2 + mod="m":)( (:link + 1 + + 0 + + -50 + + + 2 + :) const & x );@] @@ -4276,9 +4365,18 @@ - 3 + 5 2 - [@template <class T> ---unspecified--- (:link + [@typedef (:link + 1 + + 0 + + -18 + + + 2 + :)<struct tag_original_exception_type,std::type_info const *> 1 0 @@ -4287,7 +4385,7 @@ 2 - :)( T const & e );@] + ;@] @@ -4320,27 +4418,7 @@ - 5 - 2 - [@(:link - 1 - - 0 - - -11 - - - 2 - mod="m":)( (:link - 1 - - 0 - - -51 - - - 2 - mod="m":) const & v );@] + 0 @@ -4351,36 +4429,7 @@ - 7 - 2 - [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link - 1 - - 0 - - -12 - - - 2 - mod="/":)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link - 1 - - 0 - - -44 - - - 2 - :)<Tag1,T1>, ..., (:link - 1 - - 0 - - -44 - - - 2 - :)<TagN,TN> > const & v );@] + 0 @@ -4413,27 +4462,7 @@ - 5 - 2 - [@template <class T> (:link - 1 - - 0 - - -24 - - - 2 - :) (:link - 1 - - 0 - - -15 - - - 2 - :)( T const & e );@] + 0 @@ -4444,7 +4473,27 @@ - 0 + 5 + 2 + [@template <class T> (:link + 1 + + 0 + + -33 + + + 2 + :) (:link + 1 + + 0 + + -16 + + + 2 + :)( T const & e );@] @@ -4455,7 +4504,18 @@ - 0 + 3 + 2 + [@typedef T (:link + 1 + + 0 + + -17 + + + 2 + mod="m":);@] @@ -4466,9 +4526,9 @@ - 5 + 3 2 - [@template <class E, class Tag, class T> E const & (:link + [@template <class Tag,class T> class (:link 1 0 @@ -4477,16 +4537,7 @@ 2 - mod="/":)( E const & x, (:link - 1 - - 0 - - -44 - - - 2 - :)<Tag,T> const & v );@] + :);@] @@ -4541,9 +4592,18 @@ - 3 + 5 2 - [@template <class T> ---unspecified--- (:link + [@template <class ErrorInfo,class E> typename ErrorInfo::(:link + 1 + + 0 + + -17 + + + 2 + mod="m":) const * (:link 1 0 @@ -4552,7 +4612,7 @@ 2 - :)( T const & x );@] + :)( E const & x );@] @@ -4562,61 +4622,6 @@ -24 - - 3 - 2 - [@typedef ---unspecified--- (:link - 1 - - 0 - - -24 - - - 2 - :);@] - - - - - 0 - - -25 - - - - 3 - 2 - [@(:link - 1 - - 0 - - -25 - - - 2 - mod="m":)();@] - - - - - 0 - - -26 - - - - 0 - - - - - 0 - - -27 - - 19 2 @@ -4625,7 +4630,7 @@ 0 - -14 + -6 2 @@ -4634,7 +4639,7 @@ 0 - -27 + -24 2 @@ -4643,7 +4648,7 @@ 0 - -40 + -39 2 @@ -4652,7 +4657,7 @@ 0 - -23 + -5 2 @@ -4661,7 +4666,7 @@ 0 - -14 + -6 2 @@ -4670,7 +4675,7 @@ 0 - -14 + -6 2 @@ -4679,7 +4684,7 @@ 0 - -14 + -6 2 @@ -4688,7 +4693,7 @@ 0 - -27 + -24 2 @@ -4697,7 +4702,7 @@ 0 - -40 + -39 2 @@ -4708,22 +4713,64 @@ 0 - -28 + -25 - 3 + 0 + + + + + 0 + + -26 + + + + 5 2 - [@std::string (:link + [@(:link 1 0 - -28 + -17 2 - :)();@] + mod="m":) const & (:link + 1 + + 0 + + -26 + + + 2 + mod="m":)() const;@] + + + + + 0 + + -27 + + + + 0 + + + + + 0 + + -28 + + + + 0 @@ -4745,7 +4792,27 @@ - 0 + 5 + 2 + [@void (:link + 1 + + 0 + + -30 + + + 2 + :)( (:link + 1 + + 0 + + -33 + + + 2 + :) const & ep ); @@ -4756,18 +4823,7 @@ - 3 - 2 - [@template <class E> E * - 1 - - 0 - - -31 - - - 2 - ();@] + 0 @@ -4780,16 +4836,7 @@ 5 2 - [@(:link - 1 - - 0 - - -51 - - - 2 - mod="m":) const & (:link + [@class (:link 1 0 @@ -4798,7 +4845,16 @@ 2 - mod="m":)() const;@] + :): public std::exception public boost:: + 1 + + 0 + + -50 + + + 2 + { ---unspecified--- };@] @@ -4809,7 +4865,18 @@ - 0 + 3 + 2 + [@typedef ---unspecified--- (:link + 1 + + 0 + + -33 + + + 2 + :);@] @@ -4842,9 +4909,9 @@ - 5 + 7 2 - [@class (:link + [@template <class E> std::string (:link 1 0 @@ -4853,16 +4920,25 @@ 2 - :): public std::exception public boost:: + :)( E const & e ); std::string (:link 1 0 - -43 + -36 2 - { ---unspecified--- };@] + :)( + 1 + + 0 + + -33 + + + 2 + const & p );@] @@ -4873,27 +4949,7 @@ - 5 - 2 - [@template <class ErrorInfo,class E> typename ErrorInfo::(:link - 1 - - 0 - - -51 - - - 2 - mod="m":) const * (:link - 1 - - 0 - - -37 - - - 2 - :)( E const & x );@] + 0 @@ -4904,7 +4960,27 @@ - 0 + 5 + 2 + [@(:link + 1 + + 0 + + -33 + + + 2 + :) (:link + 1 + + 0 + + -38 + + + 2 + :)();@] @@ -4914,17 +4990,6 @@ -39 - - 0 - - - - - 0 - - -40 - - 5 2 @@ -4933,7 +4998,7 @@ 0 - -40 + -39 2 @@ -4942,13 +5007,35 @@ 0 - -40 + -39 2 :)( E const & e ); #endif@] + + + 0 + + -40 + + + + 3 + 2 + [@(:link + 1 + + 0 + + -40 + + + 2 + mod="m":)();@] + + 0 @@ -4957,9 +5044,9 @@ - 5 + 3 2 - [@void (:link + [@template <class T> ---unspecified--- (:link 1 0 @@ -4968,16 +5055,7 @@ 2 - :)( (:link - 1 - - 0 - - -24 - - - 2 - :) const & ep ); + :)( T const & e );@] @@ -4999,18 +5077,7 @@ - 3 - 2 - [@class (:link - 1 - - 0 - - -43 - - - 2 - :);@] + 0 @@ -5021,9 +5088,9 @@ - 3 + 5 2 - [@template <class Tag,class T> class (:link + [@(:link 1 0 @@ -5032,7 +5099,16 @@ 2 - :);@] + mod="m":)( (:link + 1 + + 0 + + -17 + + + 2 + mod="m":) const & v );@] @@ -5043,36 +5119,7 @@ - 7 - 2 - [@(:link - 1 - - 0 - - -45 - - - 2 - mod="m":)(); (:link - 1 - - 0 - - -45 - - - 2 - mod="m":)( (:link - 1 - - 0 - - -43 - - - 2 - :) const & x );@] + 0 @@ -5105,7 +5152,36 @@ - 0 + 7 + 2 + [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link + 1 + + 0 + + -48 + + + 2 + mod="/":)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link + 1 + + 0 + + -18 + + + 2 + :)<Tag1,T1>, ..., (:link + 1 + + 0 + + -18 + + + 2 + :)<TagN,TN> > const & v );@] @@ -5127,7 +5203,18 @@ - 0 + 3 + 2 + [@class (:link + 1 + + 0 + + -50 + + + 2 + :);@] @@ -5138,18 +5225,7 @@ - 3 - 2 - [@typedef T (:link - 1 - - 0 - - -51 - - - 2 - mod="m":);@] + 0 @@ -5160,7 +5236,27 @@ - 0 + 5 + 2 + [@template <class E, class Tag, class T> E const & (:link + 1 + + 0 + + -52 + + + 2 + mod="/":)( E const & x, (:link + 1 + + 0 + + -18 + + + 2 + :)<Tag,T> const & v );@] @@ -5182,7 +5278,18 @@ - 0 + 3 + 2 + [@template <class E> E * + 1 + + 0 + + -54 + + + 2 + ();@] @@ -5247,6 +5354,28 @@ -60 + + 3 + 2 + [@std::string (:link + 1 + + 0 + + -60 + + + 2 + :)();@] + + + + + 0 + + -61 + + 0 @@ -5258,13 +5387,13 @@ include - 64 + 65 reno_layer - 56 + 57 0 @@ -5273,135 +5402,27 @@ - 29 + 5 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 + (: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 - -43 + -50 2 - :), the returned value contains the string representations of all (: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 - -44 + -50 2 - :) objects stored in the boost::(:link - 1 - - 0 - - -43 - - - 2 - :) through (:link - 1 - - 0 - - -18 - - - 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 - - -43 - - - 2 - :); **otherwise the returned value contains the what() string. *Otherwise, the boost:: - 1 - - 0 - - -5 - - - 2 - template is not available. The string representation of each (:link - 1 - - 0 - - -44 - - - 2 - :) object is deduced by a function call that is bound at the time the (:link - 1 - - 0 - - -44 - - - 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 - - -44 - - - 2 - :)<Tag,T> (the return value is expected to be of type std::string.) #Unqualified call to to_string(x.(:link - 1 - - 0 - - -32 - - - 2 - mod="m":)()) (the return value is expected to be of type std::string.) #Unqualified call to s << x.(:link - 1 - - 0 - - -32 - - - 2 - mod="m":)(), where s is a std::ostringstream. The first successfully bound function is used at the time (:link - 1 - - 0 - - -5 - - - 2 - :) is called; if all 3 overload resolutions are unsuccessful, the system is unable to convert the (:link - 1 - - 0 - - -44 - - - 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 - - -34 - - - 2 - :) + :). The T sub-object is initialized from x by the T copy constructor. !!!!Throws: Nothing. @@ -5412,135 +5433,9 @@ - 29 + 1 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: The (:link - 1 - - 0 - - -6 - - - 2 - :) function must not be called outside of a catch block. !!!!Returns: * An (:link - 1 - - 0 - - -24 - - - 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 - - -24 - - - 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 - - -6 - - - 2 - :) refer to the same exception object. * Correct implementation of (:link - 1 - - 0 - - -6 - - - 2 - :) may require compiler support, unless (:link - 1 - - 0 - - -8 - - - 2 - :) was used at the time the currently handled exception object was passed to throw. If (:link - 1 - - 0 - - -8 - - - 2 - :) was not used, and if the compiler does not provide the necessary support, then (:link - 1 - - 0 - - -6 - - - 2 - :) may return an (:link - 1 - - 0 - - -24 - - - 2 - :) that refers to an instance of (:link - 1 - - 0 - - -36 - - - 2 - :). In this case, if the original exception object derives from boost::(:link - 1 - - 0 - - -43 - - - 2 - :), then the boost::(:link - 1 - - 0 - - -43 - - - 2 - :) sub-object of the (:link - 1 - - 0 - - -36 - - - 2 - :) object is initialized by the boost::(:link - 1 - - 0 - - -43 - - - 2 - :) copy constructor. + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -5551,90 +5446,36 @@ - 19 + 7 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 !!!:) (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link 1 0 - -37 + -50 2 - :) function template can be called with any exception type. If BOOST_NO_RTTI is defined, (:link + :) object. * Copy constructor: initializes a boost::(:link 1 0 - -37 + -50 2 - :) can be used only with objects of type boost::(:link + :) object which shares ownership with x of all data added through (:link 1 0 - -43 + -52 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 - - -8 - - - 2 - :) and (:link - 1 - - 0 - - -23 - - - 2 - :) are integrated directly in the (:link - 1 - - 0 - - -40 - - - 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 - - -58 - - - 2 - :). '''BOOST_NO_EXCEPTIONS''' This macro disables exception handling in Boost, forwarding all exceptions to a user-defined non-template version of boost:: - 1 - - 0 - - -40 - - - 2 - . However, unless BOOST_EXCEPTION_DISABLE is also defined, users can still examine the exception object for any data added at the point of the throw, or use boost:: - 1 - - 0 - - -5 - - - 2 - (of course under BOOST_NO_EXCEPTIONS, the user-defined boost::throw_exception is not allowed to return to the caller.) + mod="/":), including data that is added at a future time. !!!!Throws: Nothing. @@ -5645,99 +5486,45 @@ - 21 + 9 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 + (:auto !!!:) (:include synopsis:) This 1 0 - -24 + -18 2 - :) support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link + typedef is used by 1 0 - -8 + -38 2 - :)(my_exception());@] Unless (:link + if it defaults to returning an 1 0 - -8 + -33 2 - :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link + that refers to an object of type 1 0 - -6 + -32 2 - :) may return an (:link - 1 - - 0 - - -24 - - - 2 - :) which refers to an instance of (:link - 1 - - 0 - - -36 - - - 2 - :). See (:link - 1 - - 0 - - -6 - - - 2 - :) for details. !!!!Note: Instead of using the throw keyword directly, it is preferable to call boost::(:link - 1 - - 0 - - -40 - - - 2 - :). This is guaranteed to throw an exception that derives from boost::(:link - 1 - - 0 - - -43 - - - 2 - :) and supports the (:link - 1 - - 0 - - -24 - - - 2 - :) functionality. + , to record in it the std::type_info of the original exception object. @@ -5748,171 +5535,9 @@ - 37 + 1 2 - (:auto !!!:) When you catch an exception, you can call (:link - 1 - - 0 - - -6 - - - 2 - :) to get an (:link - 1 - - 0 - - -24 - - - 2 - :) object: [@#include <(:link - 1 - - 0 - - -57 - - - 2 - :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link - 1 - - 0 - - -43 - - - 2 - :)s void worker_thread( boost::(:link - 1 - - 0 - - -24 - - - 2 - :) & error ) { try { do_work(); error = boost::(:link - 1 - - 0 - - -24 - - - 2 - :)(); } catch( ... ) { error = boost::(:link - 1 - - 0 - - -6 - - - 2 - :)(); } }@] In the above example, note that (:link - 1 - - 0 - - -6 - - - 2 - :) captures the original type of the exception object. The exception can be thrown again using the (:link - 1 - - 0 - - -41 - - - 2 - :) function: [@// ...continued void work() { boost::(:link - 1 - - 0 - - -24 - - - 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 - - -41 - - - 2 - :)(error); }@] Note that (:link - 1 - - 0 - - -6 - - - 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 - - -24 - - - 2 - :) points to an instance of std::bad_alloc, or * if (:link - 1 - - 0 - - -8 - - - 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 - - -24 - - - 2 - :) points to an instance of (:link - 1 - - 0 - - -36 - - - 2 - :). Regardless, the use of (:link - 1 - - 0 - - -6 - - - 2 - :) and (:link - 1 - - 0 - - -41 - - - 2 - :) in the above examples is well-formed. + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -5923,90 +5548,9 @@ - 19 + 1 2 - (:auto !!:) Boost Exception provides a namespace-scope function (:link - 1 - - 0 - - -5 - - - 2 - :) which takes a boost::(:link - 1 - - 0 - - -43 - - - 2 - :). The returned string contains: *the string representation of all data objects added to the boost::(:link - 1 - - 0 - - -43 - - - 2 - :) through (:link - 1 - - 0 - - -18 - - - 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 - - -50 - - - 2 - :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link - 1 - - 0 - - -43 - - - 2 - :). void g() { try { f(); } catch( boost::(:link - 1 - - 0 - - -43 - - - 2 - :) & e ) { std::cerr << (:link - 1 - - 0 - - -5 - - - 2 - :)(e); } }@] (:include - 1 - - 0 - - -34 - - - 2 - :) + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -6017,18 +5561,297 @@ - 3 + 65 2 - (:auto !!!:) (:include synopsis:) !!!!Effects: Stores a copy of v in the + (:auto !!:) !!!Why doesn't boost::exception derive from std::exception? Despite that (:link 1 0 - -44 + -45 2 - object. (:include throws:) + |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 + + -50 + + + 2 + :) derives from std::exception, using the (:link + 1 + + 0 + + -5 + + + 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 + + -50 + + + 2 + :) should not be used to replace std::exception as a base type in exception type hierarchies. Instead, it should be included as a virtual base, in addition to std::exception (which should also be derived virtually.) !!!Why is boost::exception abstract? To prevent exception-neutral contexts from erroneously erasing the type of the original exception when adding (:link + 1 + + 0 + + -18 + + + 2 + :) to an active exception object: [@catch( boost::(:link + 1 + + 0 + + -50 + + + 2 + :) & e ) { e (:link + 1 + + 0 + + -52 + + + 2 + |<<:) foo_info(foo); throw e; //Compile error: boost::(:link + 1 + + 0 + + -50 + + + 2 + :) is abstract }@] The correct code is: [@catch( boost::(:link + 1 + + 0 + + -50 + + + 2 + :) & e ) { e (:link + 1 + + 0 + + -52 + + + 2 + |<<:) foo_info(foo); throw; //Okay, re-throwing the original exception object. }@] !!!What is the space overhead of the boost::exception base class? The space overhead for the boost::exception data members is negligible in the context of exception handling. Throwing objects that derive from boost::(:link + 1 + + 0 + + -50 + + + 2 + :) does not by itself cause dynamic memory allocations. Deriving from boost::(:link + 1 + + 0 + + -50 + + + 2 + :) enables any data to be added to exceptions, which usually does allocate memory. However, this memory is reclaimed when the exception has been handled, and since typically user code does not allocate memory during the unrolling of the stack, adding error info to exceptions should not cause memory fragmentation. !!!Should I use boost::throw_exception or BOOST_THROW_EXCEPTION or just throw? The benefit of calling boost::(:link + 1 + + 0 + + -39 + + + 2 + :) instead of using throw directly is that it ensures that the emitted exception derives from boost::(:link + 1 + + 0 + + -50 + + + 2 + :) and that it is compatible with boost::(:link + 1 + + 0 + + -38 + + + 2 + :). The (:link + 1 + + 0 + + -24 + + + 2 + :) macro also results in a call to boost::(:link + 1 + + 0 + + -39 + + + 2 + :), but in addition it records in the exception object the __FILE__ and __LINE__ of the throw, as well as the pretty name of the function that throws. This has virtually no overhead, yet enables boost::(:link + 1 + + 0 + + -36 + + + 2 + :) to compose a more useful, if not user-friendly message. Typical use of boost::(:link + 1 + + 0 + + -36 + + + 2 + :) is: [@catch( boost::exception & e ) { std::cerr << "OMG!" << boost::diagnostic_information(e); } catch( ... ) { std::cerr << "OMG!!!"; }@] This is a possible message it may display, the first line is only possible if (:link + 1 + + 0 + + -24 + + + 2 + :) is used: [@example_io.cpp(83): Throw in function void parse_file(const char *) Dynamic exception type: class file_open_error std::exception::what: example_io error [struct tag_errno_code *] = 2, OS says "No such file or directory" [struct tag_file_name *] = tmp1.xml [struct tag_function *] = fopen [struct tag_open_mode *] = rb@] !!!Why is boost::exception integrated in boost::throw_exception? The boost::(:link + 1 + + 0 + + -39 + + + 2 + :) function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::(:link + 1 + + 0 + + -50 + + + 2 + :) as a base of any exception passed to boost::(:link + 1 + + 0 + + -39 + + + 2 + :). Such concerns are dictated by the typical strict interpretation of a common principle in C and C++, that users only pay for features they actually use. The problem is that users of Boost Exception can't by themselves cause a library to throw types that derive from boost::(:link + 1 + + 0 + + -50 + + + 2 + :), and without this they can't use any of the Boost Exception facilities. For example, if a user wants to use Boost Serialization in a separate thread, it is desirable to be able to transport exceptions emitted by that library into the main thread where they can be analyzed to generate a user-friendly message. This can be easily achieved using boost::(:link + 1 + + 0 + + -33 + + + 2 + :), but this requires that Boost Serialization throws exceptions using boost::(:link + 1 + + 0 + + -41 + + + 2 + :). If Boost Serialization calls boost::(:link + 1 + + 0 + + -39 + + + 2 + :) to throw, this behavior happens automatically and transparently. The cost of this integration is: * In terms of space: a pointer and 3 ints are added to the static size of exception objects. * In terms of speed: the pointer is initialized to null at the point of the throw. * In terms of coupling: about 400 self-contained lines of C++ with no external includes. !!!Why use operator<< overload for adding info to exceptions? Before throwing an object of type that derives from boost::(:link + 1 + + 0 + + -50 + + + 2 + :), it is often desirable to add one or more (:link + 1 + + 0 + + -18 + + + 2 + :) objects in it. The syntactic sugar provided by (:link + 1 + + 0 + + -52 + + + 2 + :) allows this to be done directly in a throw expression: [@throw error() (:link + 1 + + 0 + + -52 + + + 2 + |<<:) foo_info(foo) (:link + 1 + + 0 + + -52 + + + 2 + |<<:) bar_info(bar);@] which saves typing compared to this possible alternative: [@error e; e.add(foo_info(foo)); e.add(bar_info(bar)); throw e;@] and looks better than something like: [@throw error().add(foo_info(foo)).add(bar_info(bar));@] @@ -6039,27 +5862,36 @@ - 5 + 7 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + (:auto !!!:) Deriving from boost::(:link 1 0 - -43 + -50 2 - :), or a type that derives (indirectly) from boost::(: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 - -43 + -50 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:) + :), 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 + + -50 + + + 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. @@ -6070,54 +5902,9 @@ - 11 + 1 2 - (:auto !!:) All exception types that derive from boost::(:link - 1 - - 0 - - -43 - - - 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 - - -43 - - - 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 - - -30 - - - 2 - :) (:include - 1 - - 0 - - -26 - - - 2 - :) + (:auto !!:) (:pagelist tags="hpp":) @@ -6141,27 +5928,9 @@ - 5 + 1 2 - (:auto !!!:) (:include synopsis:) !!!!Effects: As if [@try { throw - 1 - - 0 - - -8 - - - 2 - (e); } catch(...) { return (:link - 1 - - 0 - - -6 - - - 2 - :)(); }@] + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -6172,9 +5941,27 @@ - 1 + 5 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!!:) (:include synopsis:) !!!!Effects: As if [@try { throw + 1 + + 0 + + -41 + + + 2 + (e); } catch(...) { return (:link + 1 + + 0 + + -38 + + + 2 + :)(); }@] @@ -6185,63 +5972,9 @@ - 65 + 5 2 - (:auto !!:) !!!Why doesn't boost::exception derive from std::exception? Despite that (:link - 1 - - 0 - - -42 - - - 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 - - -43 - - - 2 - :) derives from std::exception, using the (:link - 1 - - 0 - - -23 - - - 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 - - -43 - - - 2 - :) should not be used to replace std::exception as a base type in exception type hierarchies. Instead, it should be included as a virtual base, in addition to std::exception (which should also be derived virtually.) !!!Why is boost::exception abstract? To prevent exception-neutral contexts from erroneously erasing the type of the original exception when adding (:link - 1 - - 0 - - -44 - - - 2 - :) to an active exception object: [@catch( boost::(:link - 1 - - 0 - - -43 - - - 2 - :) & e ) { e (:link + (:auto !!!:) (:include synopsis:) !!!!Definition: The expression 1 0 @@ -6250,232 +5983,16 @@ 2 - |<<:) foo_info(foo); throw e; //Compile error: boost::(:link + <Tag,T>::(:link 1 0 - -43 + -17 2 - :) is abstract }@] The correct code is: [@catch( boost::(:link - 1 - - 0 - - -43 - - - 2 - :) & e ) { e (:link - 1 - - 0 - - -18 - - - 2 - |<<:) foo_info(foo); throw; //Okay, re-throwing the original exception object. }@] !!!What is the space overhead of the boost::exception base class? The space overhead for the boost::exception data members is negligible in the context of exception handling. Throwing objects that derive from boost::(:link - 1 - - 0 - - -43 - - - 2 - :) does not by itself cause dynamic memory allocations. Deriving from boost::(:link - 1 - - 0 - - -43 - - - 2 - :) enables any data to be added to exceptions, which usually does allocate memory. However, this memory is reclaimed when the exception has been handled, and since typically user code does not allocate memory during the unrolling of the stack, adding error info to exceptions should not cause memory fragmentation. !!!Should I use boost::throw_exception or BOOST_THROW_EXCEPTION or just throw? The benefit of calling boost::(:link - 1 - - 0 - - -40 - - - 2 - :) instead of using throw directly is that it ensures that the emitted exception derives from boost::(:link - 1 - - 0 - - -43 - - - 2 - :) and that it is compatible with boost::(:link - 1 - - 0 - - -6 - - - 2 - :). The (:link - 1 - - 0 - - -27 - - - 2 - :) macro also results in a call to boost::(:link - 1 - - 0 - - -40 - - - 2 - :), but in addition it records in the exception object the __FILE__ and __LINE__ of the throw, as well as the pretty name of the function that throws. This has virtually no overhead, yet enables boost::(:link - 1 - - 0 - - -5 - - - 2 - :) to compose a more useful, if not user-friendly message. Typical use of boost::(:link - 1 - - 0 - - -5 - - - 2 - :) is: [@catch( boost::exception & e ) { std::cerr << "OMG!" << boost::diagnostic_information(e); } catch( ... ) { std::cerr << "OMG!!!"; }@] This is a possible message it may display, the first line is only possible if (:link - 1 - - 0 - - -27 - - - 2 - :) is used: [@example_io.cpp(83): Throw in function void parse_file(const char *) Dynamic exception type: class file_open_error std::exception::what: example_io error [struct tag_errno_code *] = 2, OS says "No such file or directory" [struct tag_file_name *] = tmp1.xml [struct tag_function *] = fopen [struct tag_open_mode *] = rb@] !!!Why is boost::exception integrated in boost::throw_exception? The boost::(:link - 1 - - 0 - - -40 - - - 2 - :) function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::(:link - 1 - - 0 - - -43 - - - 2 - :) as a base of any exception passed to boost::(:link - 1 - - 0 - - -40 - - - 2 - :). Such concerns are dictated by the typical strict interpretation of a common principle in C and C++, that users only pay for features they actually use. The problem is that users of Boost Exception can't by themselves cause a library to throw types that derive from boost::(:link - 1 - - 0 - - -43 - - - 2 - :), and without this they can't use any of the Boost Exception facilities. For example, if a user wants to use Boost Serialization in a separate thread, it is desirable to be able to transport exceptions emitted by that library into the main thread where they can be analyzed to generate a user-friendly message. This can be easily achieved using boost::(:link - 1 - - 0 - - -24 - - - 2 - :), but this requires that Boost Serialization throws exceptions using boost::(:link - 1 - - 0 - - -8 - - - 2 - :). If Boost Serialization calls boost::(:link - 1 - - 0 - - -40 - - - 2 - :) to throw, this behavior happens automatically and transparently. The cost of this integration is: * In terms of space: a pointer and 3 ints are added to the static size of exception objects. * In terms of speed: the pointer is initialized to null at the point of the throw. * In terms of coupling: about 400 self-contained lines of C++ with no external includes. !!!Why use operator<< overload for adding info to exceptions? Before throwing an object of type that derives from boost::(:link - 1 - - 0 - - -43 - - - 2 - :), it is often desirable to add one or more (:link - 1 - - 0 - - -44 - - - 2 - :) objects in it. The syntactic sugar provided by (:link - 1 - - 0 - - -18 - - - 2 - :) allows this to be done directly in a throw expression: [@throw error() (:link - 1 - - 0 - - -18 - - - 2 - |<<:) foo_info(foo) (:link - 1 - - 0 - - -18 - - - 2 - |<<:) bar_info(bar);@] which saves typing compared to this possible alternative: [@error e; e.add(foo_info(foo)); e.add(bar_info(bar)); throw e;@] and looks better than something like: [@throw error().add(foo_info(foo)).add(bar_info(bar));@] + mod="m":) evaluates to T. @@ -6486,36 +6003,171 @@ - 7 + 37 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(: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 - -43 + -18 2 - :), or a type that derives (indirectly) from boost::(:link + :)<Tag,T> can be passed to (:link 1 0 - -43 + -52 2 - :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link + mod="/":) to be stored in objects of type boost::(:link 1 0 - -44 + -50 2 - :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) + :). !!!!Usage: The header <(:link + 1 + + 0 + + -10 + + + 2 + :)> provides a declaration of the (:link + 1 + + 0 + + -18 + + + 2 + :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, for example: [@#include <(:link + 1 + + 0 + + -10 + + + 2 + :)> struct tag_errno; typedef boost::(:link + 1 + + 0 + + -18 + + + 2 + :)<tag_errno,int> errno_info;@] Or, the shorter equivalent: [@#include <(:link + 1 + + 0 + + -10 + + + 2 + :)> typedef boost::(:link + 1 + + 0 + + -18 + + + 2 + :)<struct tag_errno,int> errno_info;@] This errno_info typedef can be passed to (:link + 1 + + 0 + + -52 + + + 2 + mod="/":) (#include <(:link + 1 + + 0 + + -27 + + + 2 + :)> first) to store an int named tag_errno in exceptions of types that derive from boost::(:link + 1 + + 0 + + -50 + + + 2 + :): [@throw file_read_error() (:link + 1 + + 0 + + -52 + + + 2 + |<<:) errno_info(errno);@] It can also be passed to (:link + 1 + + 0 + + -23 + + + 2 + :) (#include <(:link + 1 + + 0 + + -9 + + + 2 + :)> first) to retrieve the tag_errno int from a boost::(:link + 1 + + 0 + + -50 + + + 2 + :): [@catch( boost::(:link + 1 + + 0 + + -50 + + + 2 + :) & x ) { if( int const * e=boost::(:link + 1 + + 0 + + -23 + + + 2 + :)<errno_info>(x) ) .... }@] @@ -6528,7 +6180,7 @@ 1 2 - (:auto !!!:) !!!Synopsis (:include synopsis:) + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -6539,9 +6191,45 @@ - 33 + 11 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 + (: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 + + -41 + + + 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 + + -39 + + + 2 + :) are guaranteed to derive from boost::(:link + 1 + + 0 + + -50 + + + 2 + :) and to support cloning. (:include + 1 + + 0 + + -21 + + + 2 + :) (:include 1 0 @@ -6550,142 +6238,7 @@ 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 - - -43 - - - 2 - :) { }; struct io_error: virtual exception_base { }; struct file_read_error: virtual io_error { }; typedef boost::(:link - 1 - - 0 - - -44 - - - 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 - - -18 - - - 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 - - -43 - - - 2 - :): [@typedef boost::(:link - 1 - - 0 - - -44 - - - 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 - - -43 - - - 2 - :) do_something(); .... } else throw file_open_error() (:link - 1 - - 0 - - -18 - - - 2 - |<<:) errno_code(errno); } catch( boost::(:link - 1 - - 0 - - -43 - - - 2 - :) & e ) { e (:link - 1 - - 0 - - -18 - - - 2 - |<<:) file_name("foo.txt"); throw; }@] Finally here is how the handler retrieves data from exceptions that derive from boost::(:link - 1 - - 0 - - -43 - - - 2 - :): [@catch( io_error & e ) { std::cerr << "I/O Error!\n"; if( std::string const * fn=(:link - 1 - - 0 - - -37 - - - 2 - :)<file_name>(e) ) std::cerr << "File name: " << *fn << "\n"; if( int const * c=(:link - 1 - - 0 - - -37 - - - 2 - :)<errno_code>(e) ) std::cerr << "OS says: " << strerror(*c) << "\n"; }@] In addition, boost::(:link - 1 - - 0 - - -5 - - - 2 - :) can be used to compose an automatic (if not user-friendly) message that contains all of the (:link - 1 - - 0 - - -44 - - - 2 - :) objects added to a boost::(:link - 1 - - 0 - - -43 - - - 2 - :). This is useful for inclusion in logs and other diagnostic objects. + :) @@ -6696,36 +6249,54 @@ - 7 + 11 2 - (:auto !!!:) Deriving from boost::(:link + (:auto !!!:) Here is how cloning can be enabled in a throw-expression (15.1): [@#include <(:link 1 0 - -43 + -27 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 + :)> #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 - -43 + -50 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 + :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::(:link 1 0 - -43 + -41 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. + :)(file_read_error()) << errno_info(errno); }@] Of course, (:link + 1 + + 0 + + -41 + + + 2 + :) may be used with any exception type; there is no requirement that it should derive from boost::(:link + 1 + + 0 + + -50 + + + 2 + :). @@ -6736,126 +6307,9 @@ - 27 + 1 2 - (:auto !!:) Some exception hierarchies can not be modified to make boost::(:link - 1 - - 0 - - -43 - - - 2 - :) a base type. In this case, the (:link - 1 - - 0 - - -23 - - - 2 - :) function template can be used to make exception objects derive from boost::(:link - 1 - - 0 - - -43 - - - 2 - :) anyway. Here is an example: [@#include <(:link - 1 - - 0 - - -50 - - - 2 - :)> #include <stdexcept> typedef boost::(:link - 1 - - 0 - - -44 - - - 2 - :)<struct tag_std_range_min,size_t> std_range_min; typedef boost::(:link - 1 - - 0 - - -44 - - - 2 - :)<struct tag_std_range_max,size_t> std_range_max; typedef boost::(:link - 1 - - 0 - - -44 - - - 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 - - -23 - - - 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 - - -23 - - - 2 - :)<T> gets us an object of ''unspecified type'' which is guaranteed to derive from both boost::(:link - 1 - - 0 - - -43 - - - 2 - :) and T. This makes it possible to use (:link - 1 - - 0 - - -18 - - - 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 - - -43 - - - 2 - :) &, so that (:link - 1 - - 0 - - -13 - - - 2 - |more information can be added to the exception at a later time:). + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -6865,193 +6319,55 @@ -23 - - 5 - 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 - 1 - - 0 - - -43 - - - 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 - 1 - - 0 - - -43 - - - 2 - :). The T sub-object is initialized from x by the T copy constructor. !!!!Throws: Nothing. - - - - - 0 - - -24 - - - - 17 - 2 - (:auto !!!:) (:include synopsis:) The (:link - 1 - - 0 - - -24 - - - 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 - - -24 - - - 2 - :)'s operations do not throw. Two instances of (:link - 1 - - 0 - - -24 - - - 2 - :) are equivalent and compare equal if and only if they refer to the same exception. The default constructor of (:link - 1 - - 0 - - -24 - - - 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 - - -24 - - - 2 - :) references to the same exception object. * It is illegal for multiple threads to modify the same (:link - 1 - - 0 - - -24 - - - 2 - :) object concurrently. * While calling (:link - 1 - - 0 - - -6 - - - 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 - - -41 - - - 2 - :) concurrently to throw the same exception object into multiple threads. - - - - - 0 - - -25 - - - - 3 - 2 - (:auto !!!:) (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link - 1 - - 0 - - -43 - - - 2 - :) object. !!!!Throws: Nothing. - - - - - 0 - - -26 - - 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 + (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link 1 0 - -49 + -18 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link + :) template. * E must be polymorphic. !!!!Returns: * If dynamic_cast<boost::(:link 1 0 - -44 + -50 2 - :)<struct tag_file_name,std::string> file_name_info; typedef 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 - -44 + -52 2 - :)<struct tag_function,char const *> function_info; typedef boost::(:link + mod="/":) to store values in exception objects.) When x is destroyed, any pointers returned by (:link 1 0 - -44 + -23 2 - :)<struct tag_errno,int> errno_info; typedef boost::tuple<function_info,errno_info> clib_failure; class file_open_error: public boost::(:link + :) become invalid. !!!!Throws: Nothing. !!!!Note: The interface of (:link 1 0 - -43 + -23 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 + :) may be affected by the build (:link 1 0 @@ -7067,7 +6383,7 @@ 0 - -27 + -24 @@ -7078,7 +6394,7 @@ 0 - -40 + -39 2 @@ -7087,7 +6403,7 @@ 0 - -37 + -23 2 @@ -7096,7 +6412,7 @@ 0 - -5 + -36 2 @@ -7107,440 +6423,7 @@ 0 - -28 - - - - 9 - 2 - (: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 - - -43 - - - 2 - :) or std::exception, this function returns the same string value returned by (:link - 1 - - 0 - - -5 - - - 2 - :) for the current exception object. Otherwise, an unspecified non-empty string is returned. Typical use is to call - 1 - - 0 - - -28 - - - 2 - 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 - - -28 - - - 2 - (); } }@] - - - - - 0 - - -29 - - - - 45 - 2 - !!Synopsis List of documented definitions, declarations and includes by header file: `#include <(:link - 1 - - 0 - - -14 - - - 2 - :)> [@(:include - 1 - - 0 - - -14 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -54 - - - 2 - :)> [@(:include - 1 - - 0 - - -54 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -56 - - - 2 - :)> [@(:include - 1 - - 0 - - -56 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -49 - - - 2 - :)> [@(:include - 1 - - 0 - - -49 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -52 - - - 2 - :)> [@(:include - 1 - - 0 - - -52 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -33 - - - 2 - :)> [@(:include - 1 - - 0 - - -33 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -60 - - - 2 - :)> [@(:include - 1 - - 0 - - -60 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -57 - - - 2 - :)> [@(:include - 1 - - 0 - - -57 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -19 - - - 2 - :)> [@(:include - 1 - - 0 - - -19 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -58 - - - 2 - :)> [@(:include - 1 - - 0 - - -58 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -50 - - - 2 - :)> (:include - 1 - - 0 - - -50 - - - 2 - synopsis:) - - - - - 0 - - -30 - - - - 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::(:link - 1 - - 0 - - -43 - - - 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 - - -50 - - - 2 - :)> #include <stdio.h> #include <errno.h> typedef boost::(:link - 1 - - 0 - - -44 - - - 2 - :)<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link - 1 - - 0 - - -43 - - - 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 - - -50 - - - 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> typedef boost::(:link - 1 - - 0 - - -44 - - - 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 - - -43 - - - 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 - - -43 - - - 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 - - -43 - - - 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 - - -31 - - - - 1 - 2 - (: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. - - - - - 0 - - -32 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) !!!!Description: Returns a const reference to the copy of the value passed to (:link - 1 - - 0 - - -44 - - - 2 - :)'s constructor stored in the (:link - 1 - - 0 - - -44 - - - 2 - :) object. !!!!Throws: Nothing. - - - - - 0 - - -33 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -34 - - - - 3 - 2 - !!!!Example: this is a possible output from the (:link - 1 - - 0 - - -5 - - - 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 - - -35 + -25 @@ -7553,62 +6436,13 @@ 0 - -36 + -26 5 2 - (:auto !!!:) (:include synopsis:) This type is used by the (:link - 1 - - 0 - - -24 - - - 2 - :) support in Boost Exception. Please see (:link - 1 - - 0 - - -6 - - - 2 - :). - - - - - 0 - - -37 - - - - 13 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link - 1 - - 0 - - -44 - - - 2 - :) template. * E must be polymorphic. !!!!Returns: * If dynamic_cast<boost::(:link - 1 - - 0 - - -43 - - - 2 - :) 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 + (:auto !!!:) (:include synopsis:) !!!!Description: Returns a const reference to the copy of the value passed to (:link 1 0 @@ -7617,164 +6451,7 @@ 2 - mod="/":) to store values in exception objects.) When x is destroyed, any pointers returned by (:link - 1 - - 0 - - -37 - - - 2 - :) become invalid. !!!!Throws: Nothing. !!!!Note: The interface of (:link - 1 - - 0 - - -37 - - - 2 - :) may be affected by the build (:link - 1 - - 0 - - -7 - - - 2 - :). - - - - - 0 - - -38 - - - - 69 - 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 - - -39 - - - 2 - |copying:) of exception objects, implemented non-intrusively and automatically by the boost::(:link - 1 - - 0 - - -40 - - - 2 - :) function. !!Contents #(:link - 1 - - 0 - - -20 - - - 2 - :) #Tutorial ##(:link - 1 - - 0 - - -13 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -22 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -39 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -21 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -42 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -10 - - - 2 - mod="w":) #Documentation ##Class (:link - 1 - - 0 - - -43 - - - 2 - :) ##Throwing Exceptions ###(:link - 1 - - 0 - - -27 - - - 2 - :) ###(:link - 1 - - 0 - - -40 - - - 2 - :) ##Transporting of Arbitrary Data to the Catch Site ###(:link - 1 - - 0 - - -44 - - - 2 - :) ###(:link + :)'s constructor stored in the (:link 1 0 @@ -7783,819 +6460,14 @@ 2 - :) ###(:link - 1 - - 0 - - -12 - - - 2 - :) ###(:link - 1 - - 0 - - -37 - - - 2 - :) ###(:link - 1 - - 0 - - -23 - - - 2 - :) ##(:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:) Transporting of Exceptions between Threads ###(:link - 1 - - 0 - - -24 - - - 2 - :) ###(:link - 1 - - 0 - - -8 - - - 2 - :) ###(:link - 1 - - 0 - - -6 - - - 2 - :) ###(:link - 1 - - 0 - - -15 - - - 2 - :) ###(:link - 1 - - 0 - - -41 - - - 2 - :) ###(:link - 1 - - 0 - - -36 - - - 2 - :) ##Diagnostic Information ###(:link - 1 - - 0 - - -5 - - - 2 - :) ###(:link - 1 - - 0 - - -28 - - - 2 - :) ##(:link - 1 - - 0 - - -31 - - - 2 - :) #API ##(:link - 1 - - 0 - - -29 - - - 2 - :) ##(:link - 1 - - 0 - - -53 - - - 2 - :) ##(:link - 1 - - 0 - - -47 - - - 2 - :) ##(:link - 1 - - 0 - - -35 - - - 2 - :) ##(:link - 1 - - 0 - - -55 - - - 2 - :) ##(:link - 1 - - 0 - - -7 - - - 2 - mod="w":) #(:link - 1 - - 0 - - -17 - - - 2 - mod="w":) #(:link - 1 - - 0 - - -59 - - - 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. + :) object. !!!!Throws: Nothing. 0 - -39 - - - - 11 - 2 - (:auto !!:) Boost Exception supports transporting of exception objects between threads through cloning. This system is similar to (:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:), but because Boost Exception can not rely on language support, the use of (:link - 1 - - 0 - - -8 - - - 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 - - -40 - - - 2 - :) are guaranteed to derive from boost::(:link - 1 - - 0 - - -43 - - - 2 - :) and to support cloning. (:include - 1 - - 0 - - -48 - - - 2 - :) (:include - 1 - - 0 - - -9 - - - 2 - :) - - - - - 0 - - -40 - - - - 17 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must derive publicly from std::exception. !!!!Effects: * If BOOST_NO_EXCEPTIONS is not defined, boost::(:link - 1 - - 0 - - -40 - - - 2 - :)(e) is equivalent to throw boost::(:link - 1 - - 0 - - -8 - - - 2 - :)(boost::(:link - 1 - - 0 - - -23 - - - 2 - :)(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::(:link - 1 - - 0 - - -40 - - - 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 - - -40 - - - 2 - :) are allowed to assume that the function never returns; therefore, if the user-defined (:link - 1 - - 0 - - -40 - - - 2 - :) returns, the behavior is undefined. !!!!Note: Under BOOST_NO_EXCEPTIONS, unless BOOST_EXCEPTION_DISABLE is also defined, users can examine the passed exception object using boost:: - 1 - - 0 - - -37 - - - 2 - , or format an automatic diagnostic message using boost:: - 1 - - 0 - - -5 - - - 2 - . - - - - - 0 - - -41 - - - - 1 - 2 - (:auto !!!:) (:include synopsis:) !!!!Precondition: ep shall not be null. !!!!Throws: The exception to which ep refers. - - - - - 0 - - -42 - - - - 5 - 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 - 1 - - 0 - - -43 - - - 2 - :) is used, because it enables exception types to be trivial structs with no members (there's nothing to initialize.) See (:link - 1 - - 0 - - -21 - - - 2 - mod="w":). - - - - - 0 - - -43 - - - - 13 - 2 - (:auto !!!:) (:include synopsis:) Class boost::(:link - 1 - - 0 - - -43 - - - 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 - - -43 - - - 2 - :) can store data of arbitrary types, using the (:link - 1 - - 0 - - -44 - - - 2 - :) wrapper and (:link - 1 - - 0 - - -18 - - - 2 - mod="/":). To retrieve data from a boost::(:link - 1 - - 0 - - -43 - - - 2 - :) object, use the (:link - 1 - - 0 - - -37 - - - 2 - :) function template. - - - - - 0 - - -44 - - - - 37 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: T must have accessible copy constructor and must not be a reference (there is no requirement that T's copy constructor does not throw.) !!!!Description: This class template is used to associate a Tag type with a value type T. Objects of type (:link - 1 - - 0 - - -44 - - - 2 - :)<Tag,T> can be passed to (:link - 1 - - 0 - - -18 - - - 2 - mod="/":) to be stored in objects of type boost::(:link - 1 - - 0 - - -43 - - - 2 - :). !!!!Usage: The header <(:link - 1 - - 0 - - -54 - - - 2 - :)> provides a declaration of the (:link - 1 - - 0 - - -44 - - - 2 - :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, for example: [@#include <(:link - 1 - - 0 - - -54 - - - 2 - :)> struct tag_errno; typedef boost::(:link - 1 - - 0 - - -44 - - - 2 - :)<tag_errno,int> errno_info;@] Or, the shorter equivalent: [@#include <(:link - 1 - - 0 - - -54 - - - 2 - :)> typedef boost::(:link - 1 - - 0 - - -44 - - - 2 - :)<struct tag_errno,int> errno_info;@] This errno_info typedef can be passed to (:link - 1 - - 0 - - -18 - - - 2 - mod="/":) (#include <(:link - 1 - - 0 - - -56 - - - 2 - :)> first) to store an int named tag_errno in exceptions of types that derive from boost::(:link - 1 - - 0 - - -43 - - - 2 - :): [@throw file_read_error() (:link - 1 - - 0 - - -18 - - - 2 - |<<:) errno_info(errno);@] It can also be passed to (:link - 1 - - 0 - - -37 - - - 2 - :) (#include <(:link - 1 - - 0 - - -16 - - - 2 - :)> first) to retrieve the tag_errno int from a boost::(:link - 1 - - 0 - - -43 - - - 2 - :): [@catch( boost::(:link - 1 - - 0 - - -43 - - - 2 - :) & x ) { if( int const * e=boost::(:link - 1 - - 0 - - -37 - - - 2 - :)<errno_info>(x) ) .... }@] - - - - - 0 - - -45 - - - - 7 - 2 - (:auto !!!:) (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link - 1 - - 0 - - -43 - - - 2 - :) object. * Copy constructor: initializes a boost::(:link - 1 - - 0 - - -43 - - - 2 - :) object which shares ownership with x of all data added through (:link - 1 - - 0 - - -18 - - - 2 - mod="/":), including data that is added at a future time. !!!!Throws: Nothing. - - - - - 0 - - -46 - - - - 17 - 2 - (:auto !!!:) The following example demonstrates how errno can be stored in exception objects using Boost Exception: [@#include <(:link - 1 - - 0 - - -50 - - - 2 - :)> #include <errno.h> #include <iostream> typedef boost::(:link - 1 - - 0 - - -44 - - - 2 - :)<struct tag_errno,int> errno_info; //(1) class my_error: public boost::(:link - 1 - - 0 - - -43 - - - 2 - :), public std::exception { }; //(2) void f() { throw my_error() << errno_info(errno); //(3) } @] First, we instantiate the (:link - 1 - - 0 - - -44 - - - 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 - - -43 - - - 2 - :). Finally, (3) illustrates how the typedef from (1) can be used with (:link - 1 - - 0 - - -18 - - - 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 - - -37 - - - 2 - :)<errno_info>(x) ) std::cerr << "Error code: " << *err; } }@] The (:link - 1 - - 0 - - -37 - - - 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 - - -47 - - - - 1 - 2 - (:auto !!:) (:pagelist fmt="index" tags="type":) - - - - - 0 - - -48 - - - - 11 - 2 - (:auto !!!:) Here is how cloning can be enabled in a throw-expression (15.1): [@#include <(:link - 1 - - 0 - - -56 - - - 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 - - -43 - - - 2 - :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::(:link - 1 - - 0 - - -8 - - - 2 - :)(file_read_error()) << errno_info(errno); }@] Of course, (:link - 1 - - 0 - - -8 - - - 2 - :) may be used with any exception type; there is no requirement that it should derive from boost::(:link - 1 - - 0 - - -43 - - - 2 - :). - - - - - 0 - - -49 + -27 @@ -8608,51 +6480,7 @@ 0 - -50 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -51 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) !!!!Definition: The expression - 1 - - 0 - - -44 - - - 2 - <Tag,T>::(:link - 1 - - 0 - - -51 - - - 2 - mod="m":) evaluates to T. - - - - - 0 - - -52 + -28 @@ -8665,20 +6493,1948 @@ 0 - -53 + -29 - 1 + 3 2 - (:auto !!:) (:pagelist fmt="index" tags="hpp" sort_prefix="6":) + !!!!Example: this is a possible output from the (:link + 1 + + 0 + + -36 + + + 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 - -54 + -30 + + + + 1 + 2 + (:auto !!!:) (:include synopsis:) !!!!Precondition: ep shall not be null. !!!!Throws: The exception to which ep refers. + + + + + 0 + + -31 + + + + 17 + 2 + (:auto !!!:) The following example demonstrates how errno can be stored in exception objects using Boost Exception: [@#include <(:link + 1 + + 0 + + -22 + + + 2 + :)> #include <errno.h> #include <iostream> typedef boost::(:link + 1 + + 0 + + -18 + + + 2 + :)<struct tag_errno,int> errno_info; //(1) class my_error: public boost::(:link + 1 + + 0 + + -50 + + + 2 + :), public std::exception { }; //(2) void f() { throw my_error() << errno_info(errno); //(3) } @] First, we instantiate the (:link + 1 + + 0 + + -18 + + + 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 + + -50 + + + 2 + :). Finally, (3) illustrates how the typedef from (1) can be used with (:link + 1 + + 0 + + -52 + + + 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 + + -23 + + + 2 + :)<errno_info>(x) ) std::cerr << "Error code: " << *err; } }@] The (:link + 1 + + 0 + + -23 + + + 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 + + -32 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) This type is used by the (:link + 1 + + 0 + + -33 + + + 2 + :) support in Boost Exception. Please see (:link + 1 + + 0 + + -38 + + + 2 + :). + + + + + 0 + + -33 + + + + 25 + 2 + (:auto !!!:) (:include synopsis:) The (:link + 1 + + 0 + + -33 + + + 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 + + -33 + + + 2 + :)'s operations do not throw. The referenced object remains valid at least as long as there is an (:link + 1 + + 0 + + -33 + + + 2 + :) object that refers to it. Two instances of (:link + 1 + + 0 + + -33 + + + 2 + :) are equivalent and compare equal if and only if they refer to the same exception. The default constructor of (:link + 1 + + 0 + + -33 + + + 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 + + -33 + + + 2 + :) references to the same exception object. * It is illegal for multiple threads to modify the same (:link + 1 + + 0 + + -33 + + + 2 + :) object concurrently. * While calling (:link + 1 + + 0 + + -38 + + + 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 + + -30 + + + 2 + :) concurrently to throw the same exception object into multiple threads. !!!!Nesting of exceptions: An (:link + 1 + + 0 + + -33 + + + 2 + :) can be added as (:link + 1 + + 0 + + -18 + + + 2 + :) to any boost::(:link + 1 + + 0 + + -50 + + + 2 + :). This is a convenient way to nest exceptions. There is no limit on the depth of the nesting, however cyclic references result in undefined behavior. + + + + + 0 + + -34 + + + + 1 + 2 + (:auto !!:) (:pagelist tags="macro":) + + + + + 0 + + -35 + + + + 19 + 2 + (:auto !!:) Boost Exception provides a namespace-scope function (:link + 1 + + 0 + + -36 + + + 2 + :) which takes a boost::(:link + 1 + + 0 + + -50 + + + 2 + :). The returned string contains: *the string representation of all data objects added to the boost::(:link + 1 + + 0 + + -50 + + + 2 + :) through (:link + 1 + + 0 + + -52 + + + 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 + + -22 + + + 2 + :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link + 1 + + 0 + + -50 + + + 2 + :). void g() { try { f(); } catch( boost::(:link + 1 + + 0 + + -50 + + + 2 + :) & e ) { std::cerr << (:link + 1 + + 0 + + -36 + + + 2 + :)(e); } }@] (:include + 1 + + 0 + + -29 + + + 2 + :) + + + + + 0 + + -36 + + + + 37 + 2 + (:auto !!!:) (:include synopsis:) !!!!Returns: A string value that contains varying amount of implementation-specific diagnostic information about the passed object: *If E can be statically converted to boost::(:link + 1 + + 0 + + -50 + + + 2 + :), the returned value contains the string representations of all (:link + 1 + + 0 + + -18 + + + 2 + :) objects stored in the boost::(:link + 1 + + 0 + + -50 + + + 2 + :) through (:link + 1 + + 0 + + -52 + + + 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 + + -50 + + + 2 + :); **otherwise the returned value contains the what() string. *Otherwise, the boost::(:link + 1 + + 0 + + -36 + + + 2 + :) template is not available. The string representation of each (:link + 1 + + 0 + + -18 + + + 2 + :) object is deduced by a function call that is bound at the time the (:link + 1 + + 0 + + -18 + + + 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 + + -18 + + + 2 + :)<Tag,T> (the return value is expected to be of type std::string.) #Unqualified call to to_string(x.(:link + 1 + + 0 + + -26 + + + 2 + mod="m":)()) (the return value is expected to be of type std::string.) #Unqualified call to s << x.(:link + 1 + + 0 + + -26 + + + 2 + mod="m":)(), where s is a std::ostringstream. The first successfully bound function is used at the time (:link + 1 + + 0 + + -36 + + + 2 + :) is called; if all 3 overload resolutions are unsuccessful, the system is unable to convert the (:link + 1 + + 0 + + -18 + + + 2 + :) object to string, and ''an unspecified stub string value is used without issuing a compile error.'' The + 1 + + 0 + + -33 + + + 2 + overload of + 1 + + 0 + + -36 + + + 2 + is equivalent to: [@if( p ) try { + 1 + + 0 + + -30 + + + 2 + (p); } catch(...) { return + 1 + + 0 + + -60 + + + 2 + (); } else return <unspecified-string-value>;@] !!!!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 + + -29 + + + 2 + :) + + + + + 0 + + -37 + + + + 19 + 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 + + -23 + + + 2 + :) function template can be called with any exception type. If BOOST_NO_RTTI is defined, (:link + 1 + + 0 + + -23 + + + 2 + :) can be used only with objects of type boost::(:link + 1 + + 0 + + -50 + + + 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 + + -41 + + + 2 + :) and (:link + 1 + + 0 + + -5 + + + 2 + :) are integrated directly in the (:link + 1 + + 0 + + -39 + + + 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 + + -15 + + + 2 + :). '''BOOST_NO_EXCEPTIONS''' This macro disables exception handling in Boost, forwarding all exceptions to a user-defined non-template version of boost:: + 1 + + 0 + + -39 + + + 2 + . However, unless BOOST_EXCEPTION_DISABLE is also defined, users can still examine the exception object for any data added at the point of the throw, or use boost:: + 1 + + 0 + + -36 + + + 2 + (of course under BOOST_NO_EXCEPTIONS, the user-defined boost::throw_exception is not allowed to return to the caller.) + + + + + 0 + + -38 + + + + 33 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: The (:link + 1 + + 0 + + -38 + + + 2 + :) function must not be called outside of a catch block. !!!!Returns: * An (:link + 1 + + 0 + + -33 + + + 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 + + -33 + + + 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 + + -38 + + + 2 + :) refer to the same exception object. * Correct implementation of (:link + 1 + + 0 + + -38 + + + 2 + :) may require compiler support, unless (:link + 1 + + 0 + + -41 + + + 2 + :) was used at the time the currently handled exception object was passed to throw. Whenever + 1 + + 0 + + -38 + + + 2 + fails to properly copy the current exception object, it returns an + 1 + + 0 + + -33 + + + 2 + to an object of type that is as close as possible to the original exception type, using + 1 + + 0 + + -32 + + + 2 + as a final fallback. All such types derive from boost:: + 1 + + 0 + + -50 + + + 2 + , and: ** if the original exception object derives from boost::(:link + 1 + + 0 + + -50 + + + 2 + :), then the boost::(:link + 1 + + 0 + + -50 + + + 2 + :) sub-object of the object referred to by the returned + 1 + + 0 + + -33 + + + 2 + is initialized by the boost::(:link + 1 + + 0 + + -50 + + + 2 + :) copy constructor; ** if available, the exception contains the std::type_info of the original exception object, accessible through + 1 + + 0 + + -23 + + + 2 + < + 1 + + 0 + + -8 + + + 2 + >. + + + + + 0 + + -39 + + + + 17 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must derive publicly from std::exception. !!!!Effects: * If BOOST_NO_EXCEPTIONS is not defined, boost::(:link + 1 + + 0 + + -39 + + + 2 + :)(e) is equivalent to throw boost::(:link + 1 + + 0 + + -41 + + + 2 + :)(boost::(:link + 1 + + 0 + + -5 + + + 2 + :)(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::(:link + 1 + + 0 + + -39 + + + 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 + + -39 + + + 2 + :) are allowed to assume that the function never returns; therefore, if the user-defined (:link + 1 + + 0 + + -39 + + + 2 + :) returns, the behavior is undefined. !!!!Note: Under BOOST_NO_EXCEPTIONS, unless BOOST_EXCEPTION_DISABLE is also defined, users can examine the passed exception object using boost:: + 1 + + 0 + + -23 + + + 2 + , or format an automatic diagnostic message using boost:: + 1 + + 0 + + -36 + + + 2 + . + + + + + 0 + + -40 + + + + 3 + 2 + (:auto !!!:) (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link + 1 + + 0 + + -50 + + + 2 + :) object. !!!!Throws: Nothing. + + + + + 0 + + -41 + + + + 21 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: * T must be a class with an accessible no-throw copy constructor. * If T has any virtual base types, those types must have an accessible default 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 + + -33 + + + 2 + :) support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link + 1 + + 0 + + -41 + + + 2 + :)(my_exception());@] Unless (:link + 1 + + 0 + + -41 + + + 2 + :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link + 1 + + 0 + + -38 + + + 2 + :) may return an (:link + 1 + + 0 + + -33 + + + 2 + :) which refers to an instance of (:link + 1 + + 0 + + -32 + + + 2 + :). See (:link + 1 + + 0 + + -38 + + + 2 + :) for details. !!!!Note: Instead of using the throw keyword directly, it is preferable to call boost::(:link + 1 + + 0 + + -39 + + + 2 + :). This is guaranteed to throw an exception that derives from boost::(:link + 1 + + 0 + + -50 + + + 2 + :) and supports the (:link + 1 + + 0 + + -33 + + + 2 + :) functionality. + + + + + 0 + + -42 + + + + 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 + + -14 + + + 2 + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link + 1 + + 0 + + -18 + + + 2 + :)<struct tag_file_name,std::string> file_name_info; typedef boost::(:link + 1 + + 0 + + -18 + + + 2 + :)<struct tag_function,char const *> function_info; typedef boost::(:link + 1 + + 0 + + -18 + + + 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 + + -50 + + + 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 + + -23 + + + 2 + :). + + + + + 0 + + -43 + + + + 37 + 2 + (:auto !!!:) When you catch an exception, you can call (:link + 1 + + 0 + + -38 + + + 2 + :) to get an (:link + 1 + + 0 + + -33 + + + 2 + :) object: [@#include <(:link + 1 + + 0 + + -53 + + + 2 + :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link + 1 + + 0 + + -50 + + + 2 + :)s void worker_thread( boost::(:link + 1 + + 0 + + -33 + + + 2 + :) & error ) { try { do_work(); error = boost::(:link + 1 + + 0 + + -33 + + + 2 + :)(); } catch( ... ) { error = boost::(:link + 1 + + 0 + + -38 + + + 2 + :)(); } }@] In the above example, note that (:link + 1 + + 0 + + -38 + + + 2 + :) captures the original type of the exception object. The exception can be thrown again using the (:link + 1 + + 0 + + -30 + + + 2 + :) function: [@// ...continued void work() { boost::(:link + 1 + + 0 + + -33 + + + 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 + + -30 + + + 2 + :)(error); }@] Note that (:link + 1 + + 0 + + -38 + + + 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 + + -33 + + + 2 + :) points to an instance of std::bad_alloc, or * if (:link + 1 + + 0 + + -41 + + + 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 + + -33 + + + 2 + :) points to an instance of (:link + 1 + + 0 + + -32 + + + 2 + :). Regardless, the use of (:link + 1 + + 0 + + -38 + + + 2 + :) and (:link + 1 + + 0 + + -30 + + + 2 + :) in the above examples is well-formed. + + + + + 0 + + -44 + + + + 3 + 2 + (:auto !!!:) (:include synopsis:) !!!!Effects: Stores a copy of v in the + 1 + + 0 + + -18 + + + 2 + object. (:include throws:) + + + + + 0 + + -45 + + + + 5 + 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 + 1 + + 0 + + -50 + + + 2 + :) is used, because it enables exception types to be trivial structs with no members (there's nothing to initialize.) See (:link + 1 + + 0 + + -12 + + + 2 + mod="w":). + + + + + 0 + + -46 + + + + 45 + 2 + !!Synopsis List of documented definitions, declarations and includes by header file: `#include <(:link + 1 + + 0 + + -6 + + + 2 + :)> [@(:include + 1 + + 0 + + -6 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -10 + + + 2 + :)> [@(:include + 1 + + 0 + + -10 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -27 + + + 2 + :)> [@(:include + 1 + + 0 + + -27 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -14 + + + 2 + :)> [@(:include + 1 + + 0 + + -14 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -28 + + + 2 + :)> [@(:include + 1 + + 0 + + -28 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -19 + + + 2 + :)> [@(:include + 1 + + 0 + + -19 + + + 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 + + -55 + + + 2 + :)> [@(:include + 1 + + 0 + + -55 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -15 + + + 2 + :)> [@(:include + 1 + + 0 + + -15 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -22 + + + 2 + :)> (:include + 1 + + 0 + + -22 + + + 2 + synopsis:) + + + + + 0 + + -47 + + + + 27 + 2 + (:auto !!:) Some exception hierarchies can not be modified to make boost::(:link + 1 + + 0 + + -50 + + + 2 + :) a base type. In this case, the (:link + 1 + + 0 + + -5 + + + 2 + :) function template can be used to make exception objects derive from boost::(:link + 1 + + 0 + + -50 + + + 2 + :) anyway. Here is an example: [@#include <(:link + 1 + + 0 + + -22 + + + 2 + :)> #include <stdexcept> typedef boost::(:link + 1 + + 0 + + -18 + + + 2 + :)<struct tag_std_range_min,size_t> std_range_min; typedef boost::(:link + 1 + + 0 + + -18 + + + 2 + :)<struct tag_std_range_max,size_t> std_range_max; typedef boost::(:link + 1 + + 0 + + -18 + + + 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 + + -5 + + + 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 + + -5 + + + 2 + :)<T> gets us an object of ''unspecified type'' which is guaranteed to derive from both boost::(:link + 1 + + 0 + + -50 + + + 2 + :) and T. This makes it possible to use (:link + 1 + + 0 + + -52 + + + 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 + + -50 + + + 2 + :) &, so that (:link + 1 + + 0 + + -49 + + + 2 + |more information can be added to the exception at a later time:). + + + + + 0 + + -48 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + 1 + + 0 + + -50 + + + 2 + :), or a type that derives (indirectly) from boost::(:link + 1 + + 0 + + -50 + + + 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 + + -49 + + + + 11 + 2 + (:auto !!:) All exception types that derive from boost::(:link + 1 + + 0 + + -50 + + + 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 + + -50 + + + 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 + + -31 + + + 2 + :) (:include + 1 + + 0 + + -51 + + + 2 + :) (:include + 1 + + 0 + + -42 + + + 2 + :) + + + + + 0 + + -50 + + + + 13 + 2 + (:auto !!!:) (:include synopsis:) Class boost::(:link + 1 + + 0 + + -50 + + + 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 + + -50 + + + 2 + :) can store data of arbitrary types, using the (:link + 1 + + 0 + + -18 + + + 2 + :) wrapper and (:link + 1 + + 0 + + -52 + + + 2 + mod="/":). To retrieve data from a boost::(:link + 1 + + 0 + + -50 + + + 2 + :) object, use the (:link + 1 + + 0 + + -23 + + + 2 + :) function template. + + + + + 0 + + -51 + + + + 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::(:link + 1 + + 0 + + -50 + + + 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 + + -22 + + + 2 + :)> #include <stdio.h> #include <errno.h> typedef boost::(:link + 1 + + 0 + + -18 + + + 2 + :)<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link + 1 + + 0 + + -50 + + + 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 + + -22 + + + 2 + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> typedef boost::(:link + 1 + + 0 + + -18 + + + 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 + + -50 + + + 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 + + -50 + + + 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 + + -50 + + + 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 + + -52 + + + + 7 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + 1 + + 0 + + -50 + + + 2 + :), or a type that derives (indirectly) from boost::(:link + 1 + + 0 + + -50 + + + 2 + :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link + 1 + + 0 + + -18 + + + 2 + :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) + + + + + 0 + + -53 @@ -8687,6 +8443,19 @@ (:auto !!:) !!!Synopsis (:include synopsis:) + + + 0 + + -54 + + + + 1 + 2 + (: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. + + 0 @@ -8697,7 +8466,7 @@ 1 2 - (:auto !!:) (:pagelist tags="macro":) + (:auto !!!:) !!!Synopsis (:include synopsis:) @@ -8723,7 +8492,7 @@ 1 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !:) This is an alphabetical list of all Boost Exception documentation pages. (:pagelist fmt="index" except_tags="index noindex" mod="w":) @@ -8734,9 +8503,153 @@ - 1 + 33 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (: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 + + -50 + + + 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 + + -50 + + + 2 + :) { }; struct io_error: virtual exception_base { }; struct file_read_error: virtual io_error { }; typedef boost::(:link + 1 + + 0 + + -18 + + + 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 + + -52 + + + 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 + + -50 + + + 2 + :): [@typedef boost::(:link + 1 + + 0 + + -18 + + + 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 + + -50 + + + 2 + :) do_something(); .... } else throw file_open_error() (:link + 1 + + 0 + + -52 + + + 2 + |<<:) errno_code(errno); } catch( boost::(:link + 1 + + 0 + + -50 + + + 2 + :) & e ) { e (:link + 1 + + 0 + + -52 + + + 2 + |<<:) file_name("foo.txt"); throw; }@] Finally here is how the handler retrieves data from exceptions that derive from boost::(:link + 1 + + 0 + + -50 + + + 2 + :): [@catch( io_error & e ) { std::cerr << "I/O Error!\n"; if( std::string const * fn=(:link + 1 + + 0 + + -23 + + + 2 + :)<file_name>(e) ) std::cerr << "File name: " << *fn << "\n"; if( int const * c=(:link + 1 + + 0 + + -23 + + + 2 + :)<errno_code>(e) ) std::cerr << "OS says: " << strerror(*c) << "\n"; }@] In addition, boost::(:link + 1 + + 0 + + -36 + + + 2 + :) can be used to compose an automatic (if not user-friendly) message that contains all of the (:link + 1 + + 0 + + -18 + + + 2 + :) objects added to a boost::(:link + 1 + + 0 + + -50 + + + 2 + :). This is useful for inclusion in logs and other diagnostic objects. @@ -8747,9 +8660,315 @@ - 1 + 69 2 - (:auto !:) This is an alphabetical list of all Boost Exception documentation pages. (:pagelist fmt="index" except_tags="index noindex" mod="w":) + !!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 + + -20 + + + 2 + |copying:) of exception objects, implemented non-intrusively and automatically by the boost::(:link + 1 + + 0 + + -39 + + + 2 + :) function. !!Contents #(:link + 1 + + 0 + + -58 + + + 2 + :) #Tutorial ##(:link + 1 + + 0 + + -49 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -47 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -20 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -12 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -45 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -35 + + + 2 + mod="w":) #Documentation ##Class (:link + 1 + + 0 + + -50 + + + 2 + :) ##Throwing Exceptions ###(:link + 1 + + 0 + + -24 + + + 2 + :) ###(:link + 1 + + 0 + + -39 + + + 2 + :) ##Transporting of Arbitrary Data to the Catch Site ###(:link + 1 + + 0 + + -18 + + + 2 + :) ###(:link + 1 + + 0 + + -52 + + + 2 + :) ###(:link + 1 + + 0 + + -48 + + + 2 + :) ###(:link + 1 + + 0 + + -23 + + + 2 + :) ###(:link + 1 + + 0 + + -5 + + + 2 + :) ##(:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:) Transporting of Exceptions between Threads ###(:link + 1 + + 0 + + -33 + + + 2 + :) ###(:link + 1 + + 0 + + -41 + + + 2 + :) ###(:link + 1 + + 0 + + -38 + + + 2 + :) ###(:link + 1 + + 0 + + -16 + + + 2 + :) ###(:link + 1 + + 0 + + -30 + + + 2 + :) ###(:link + 1 + + 0 + + -32 + + + 2 + :) ##Diagnostic Information ###(:link + 1 + + 0 + + -36 + + + 2 + :) ###(:link + 1 + + 0 + + -60 + + + 2 + :) ##(:link + 1 + + 0 + + -54 + + + 2 + :) #API ##(:link + 1 + + 0 + + -46 + + + 2 + :) ##(:link + 1 + + 0 + + -13 + + + 2 + :) ##(:link + 1 + + 0 + + -61 + + + 2 + :) ##(:link + 1 + + 0 + + -25 + + + 2 + :) ##(:link + 1 + + 0 + + -34 + + + 2 + :) ##(:link + 1 + + 0 + + -37 + + + 2 + mod="w":) #(:link + 1 + + 0 + + -11 + + + 2 + mod="w":) #(:link + 1 + + 0 + + -57 + + + 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. @@ -8759,10 +8978,59 @@ -60 + + 9 + 2 + (: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 + + -50 + + + 2 + :) or std::exception, this function returns the same string value returned by (:link + 1 + + 0 + + -36 + + + 2 + :) for the current exception object. Otherwise, an unspecified non-empty string is returned. Typical use is to call + 1 + + 0 + + -60 + + + 2 + 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 + + -60 + + + 2 + (); } }@] + + + + + 0 + + -61 + + 1 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!:) (:pagelist fmt="index" tags="type":) @@ -8772,13 +9040,13 @@ throws - 65 + 66 reno_layer - 56 + 57 0 @@ -8853,9 +9121,7 @@ - 1 - 2 - !!!!Throws: Any exception emitted by v's copy constructor. + 0 @@ -8866,9 +9132,7 @@ - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. + 0 @@ -8934,9 +9198,7 @@ - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. + 0 @@ -9222,7 +9484,9 @@ - 0 + 1 + 2 + !!!!Throws: Any exception emitted by v's copy constructor. @@ -9266,7 +9530,9 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. @@ -9310,7 +9576,9 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. @@ -9401,6 +9669,17 @@ 0 + + + 0 + + -61 + + + + 0 + + @@ -9408,13 +9687,13 @@ synopsis - 66 + 67 reno_layer - 56 + 57 0 @@ -9425,16 +9704,16 @@ 3 2 - `#include <(:link + `#include < 1 0 - -33 + -28 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + > [@namespace boost { (:include decl pre_indent="4":) }@] @@ -9445,18 +9724,9 @@ - 3 + 1 2 - `#include <(:link - 1 - - 0 - - -57 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + [@namespace boost { (:include api pre_indent="4":) }@] @@ -9485,7 +9755,7 @@ 0 - -19 + -53 2 @@ -9500,7 +9770,9 @@ - 0 + 1 + 2 + [@#include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] @@ -9511,7 +9783,9 @@ - 0 + 1 + 2 + [@namespace boost { (:include api pre_indent="4":) }@] @@ -9522,18 +9796,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -56 - - - 2 - :)> [@(:include decl:)@] + 0 @@ -9544,27 +9807,7 @@ - 5 - 2 - `#include <(:link - 1 - - 0 - - -49 - - - 2 - :)> [@namespace boost { (:include - 1 - - 0 - - -12 - - - 2 - decl pre_indent="4":) }@] + 0 @@ -9586,9 +9829,18 @@ - 1 + 3 2 - [@namespace boost { (:include api pre_indent="4":) }@] + [@#include < + 1 + + 0 + + -27 + + + 2 + > #include <boost/tuple/tuple.hpp> namespace boost { (:include api pre_indent="4":) }@] @@ -9599,18 +9851,9 @@ - 3 + 1 2 - `#include <(:link - 1 - - 0 - - -57 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + (:include api:) @@ -9621,9 +9864,18 @@ - 1 + 3 2 - [@#include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] + `#include <(:link + 1 + + 0 + + -53 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -9634,7 +9886,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -27 + + + 2 + :)> [@(:include decl:)@] @@ -9652,11 +9915,11 @@ 0 - -56 + -27 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + :)> [@namespace boost { (:include def pre_indent="4":) }@] @@ -9669,16 +9932,16 @@ 3 2 - [@#include < + [@#include <string> namespace boost { (:include 1 0 - -14 + -50 2 - > namespace boost { (:include api pre_indent="4":) }@] + decl pre_indent="4":) (:include api pre_indent="4":) }@] @@ -9711,7 +9974,9 @@ - 0 + 1 + 2 + [@(:include api:)@] @@ -9722,18 +9987,9 @@ - 3 + 1 2 - `#include < - 1 - - 0 - - -52 - - - 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] + [@namespace boost { (:include decl pre_indent="4":) }@] @@ -9746,16 +10002,16 @@ 3 2 - `#include <(:link + `#include < 1 0 - -57 + -15 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + > (:include decl:) @@ -9777,7 +10033,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -27 + + + 2 + :)> [@(:include decl:)@] @@ -9790,16 +10057,16 @@ 3 2 - `#include < + [@#include <(:link 1 0 - -58 + -6 2 - > (:include decl:) + :)> namespace boost { (:include api pre_indent="4":) }@] @@ -9812,16 +10079,16 @@ 3 2 - `#include <(:link + [@#include < 1 0 - -33 + -6 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + > namespace boost { (:include api pre_indent="4":) }@] @@ -9843,7 +10110,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -53 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -9854,18 +10132,7 @@ - 3 - 2 - `#include < - 1 - - 0 - - -60 - - - 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -9883,11 +10150,11 @@ 0 - -56 + -53 2 - :)> [@(:include decl:)@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -9900,16 +10167,16 @@ 3 2 - [@#include <string> namespace boost { (:include + `#include <(:link 1 0 - -43 + -53 2 - decl pre_indent="4":) (:include api pre_indent="4":) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -9949,11 +10216,11 @@ 0 - -57 + -19 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] @@ -9964,9 +10231,7 @@ - 1 - 2 - [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -9977,7 +10242,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -53 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -9988,7 +10264,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -15 + + + 2 + :)> [@namespace boost { (:include decl:) }@] @@ -9999,18 +10286,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -58 - - - 2 - :)> [@namespace boost { (:include decl:) }@] + 0 @@ -10023,16 +10299,16 @@ 3 2 - `#include <(:link + `#include < 1 0 - -57 + -55 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + > [@namespace boost { (:include decl pre_indent="4":) }@] @@ -10054,18 +10330,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -14 - - - 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] + 0 @@ -10083,11 +10348,11 @@ 0 - -56 + -27 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] + :)> [@(:include decl:)@] @@ -10131,7 +10396,27 @@ - 0 + 5 + 2 + `#include <(:link + 1 + + 0 + + -14 + + + 2 + :)> [@namespace boost { (:include + 1 + + 0 + + -48 + + + 2 + decl pre_indent="4":) }@] @@ -10142,18 +10427,7 @@ - 3 - 2 - [@#include < - 1 - - 0 - - -56 - - - 2 - > #include <boost/tuple/tuple.hpp> namespace boost { (:include api pre_indent="4":) }@] + 0 @@ -10164,9 +10438,18 @@ - 1 + 3 2 - [@(:include api:)@] + `#include <(:link + 1 + + 0 + + -6 + + + 2 + :)> [@namespace boost { (:include def pre_indent="4":) }@] @@ -10177,18 +10460,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -56 - - - 2 - :)> [@(:include decl:)@] + 0 @@ -10201,16 +10473,16 @@ 3 2 - [@#include < + `#include <(:link 1 0 - -14 + -27 2 - > namespace boost { (:include api pre_indent="4":) }@] + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] @@ -10221,7 +10493,18 @@ - 0 + 3 + 2 + [@#include <(:link + 1 + + 0 + + -6 + + + 2 + :)> namespace boost { (:include api pre_indent="4":) }@] @@ -10231,6 +10514,50 @@ -54 + + 3 + 2 + `#include < + 1 + + 0 + + -56 + + + 2 + > [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -55 + + + + 3 + 2 + [@#include < + 1 + + 0 + + -6 + + + 2 + > namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -56 + + 1 2 @@ -10241,57 +10568,13 @@ 0 - -55 + -57 0 - - - 0 - - -56 - - - - 3 - 2 - [@#include <(:link - 1 - - 0 - - -14 - - - 2 - :)> namespace boost { (:include api pre_indent="4":) }@] - - - - - 0 - - -57 - - - - 3 - 2 - [@#include <(:link - 1 - - 0 - - -14 - - - 2 - :)> namespace boost { (:include api pre_indent="4":) }@] - - 0 @@ -10300,9 +10583,7 @@ - 1 - 2 - (:include api:) + 0 @@ -10324,9 +10605,29 @@ - 1 + 3 2 - [@namespace boost { (:include api pre_indent="4":) }@] + `#include <(:link + 1 + + 0 + + -19 + + + 2 + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -61 + + + + 0 @@ -10339,14 +10640,14 @@ - 67 + 68 reno_context_map - 56 + 57 -5 @@ -10515,62 +10816,14 @@ -60 + + -61 + - 56 - - - - - 0 - - - - - - 1 - - - - -38 - - - - - - - 0 - - - - - - 1 - - - - -39 - - - - - - - 0 - - - - - - 1 - - - - -13 - - + 57 @@ -10588,40 +10841,6 @@ -59 - - - - - 0 - - - - - - 1 - - - - -52 - - - - - - - 0 - - - - - - 1 - - - - -19 - - @@ -10653,7 +10872,7 @@ - -42 + -49 @@ -10670,7 +10889,7 @@ - -21 + -57 @@ -10687,58 +10906,7 @@ - -17 - - - - - - - 0 - - - - - - 1 - - - - -35 - - - - - - - 0 - - - - - - 1 - - - - -53 - - - - - - - 0 - - - - - - 1 - - - - -47 + -28 @@ -10772,7 +10940,359 @@ - -29 + -58 + + + + + + + 0 + + + + + + 1 + + + + -45 + + + + + + + 0 + + + + + + 1 + + + + -12 + + + + + + + 0 + + + + + + 1 + + + + -11 + + + + + + + 0 + + + + + + 1 + + + + -25 + + + + + + + 0 + + + + + + 1 + + + + -13 + + + + + + + 0 + + + + + + 1 + + + + -61 + + + + + + + 0 + + + + + + 1 + + + + -34 + + + + + + + 0 + + + + + + 1 + + + + -46 + + + + + + + 1 + 95AD55ACCB1C17C1DBA4C309BDFCBD4B66E52CD9A2F54FDAD2D642A00342D001 + 3194412598 + 4599 + 323 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + -19 + + + + + + + 1 + 21E8093D2AF6946EAE135823066EF38B9DC8870432B44C81E585FF63A72F9903 + 3352783584 + 12170 + 323 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -53 + + + + + + + 2 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + 6B3B617AC518A2177BDB89656E726B4E4D79577E289130493A61BAE24FB64838 + 3173127726 + 1101 + 2184 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -32 + + + + + + + 2 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + E23085202D084CBB50F289988A6A592F06D923B77D0AB25D7A98A7188DF5BE3B + 1414247481 + 766 + 10094 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -38 + + + + + + + 2 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + AF894656AC8CED6190EEEE08B051DBF2106A393E313BB5BB1C17D4808EFED761 + 1496105832 + 1753 + 429 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -33 + + + + + + + 2 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + 1516D0B7E11CBEB60CE4222565ACCAFF2E9857A8A505C1C26E2AE90087250581 + 3624753243 + 279 + 26 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -8 + + + + + + + 2 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + B20A3D4631F3B2415EED1888B65FA33D7AED20F86BE196159D9297AAED115787 + 3293519666 + 117 + 11169 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -30 + + + + + + + 2 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 + 2078296250 + 305 + 10862 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -16 @@ -10796,7 +11316,7 @@ - -9 + -43 @@ -10820,7 +11340,63 @@ - -34 + -29 + + + + + + + 2 + AED5E79246B32BDF0E5C6CD8BDDC3370FD0BA1EFE3D4CE76C4A6D36A123F2E20 + 228982966 + 3918 + 518 + 6E325144EF4F41FA3A225EB30729101382C4E99B3D6160E307311E4B4E641010 + 1097215175 + 161 + 240 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + -44 + + + + + + + 2 + AED5E79246B32BDF0E5C6CD8BDDC3370FD0BA1EFE3D4CE76C4A6D36A123F2E20 + 228982966 + 3918 + 518 + D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 + 4055211476 + 525 + 3387 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + -52 @@ -10844,7 +11420,7 @@ - -22 + -47 @@ -10872,147 +11448,7 @@ - -31 - - - - - - - 2 - 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 - 2533933282 - 8724 - 615 - 9F3671DA5E8AB414F1FBA3B160D49134EAEE8DFF33E95376EDB41534E916FF38 - 2436936467 - 718 - 1496 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - -36 - - - - - - - 2 - 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 - 2533933282 - 8724 - 615 - E23085202D084CBB50F289988A6A592F06D923B77D0AB25D7A98A7188DF5BE3B - 1414247481 - 766 - 7388 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - -6 - - - - - - - 2 - 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 - 2533933282 - 8724 - 615 - F86EB07D04CD0D0645080D1121DA899746D0C45137E17E1D9BE605E75396F047 - 1983537541 - 1346 - 148 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - -24 - - - - - - - 2 - 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 - 2533933282 - 8724 - 615 - 0E9DF8366080712A816BE91ABCEF1E2044145B63D75B0B995B537900F378189E - 1069696031 - 255 - 8463 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - -41 - - - - - - - 2 - 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 - 2533933282 - 8724 - 615 - 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 - 2078296250 - 305 - 8156 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - -15 + -54 @@ -11040,7 +11476,63 @@ - -37 + -23 + + + + + + + 2 + 02F77B8305279514F37A75FA6454AE750E04E7AA7934D395EFB52BCC7642965E + 430535365 + 3379 + 560 + D08B74734CDA5115D9E47783E2994C2836BE241FB25E589BB4C67F2596727C03 + 24341149 + 3347 + 26 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + -36 + + + + + + + 2 + D57BF77EE44CD2755E24A56DDC3E159716D04A7ABE009AE977D4926EFEC00F73 + 2498368808 + 973 + 3941 + 9432C669E21C649A86AC6DC5A34275B483A7D2D38118A462DF1C1CD7BBE5ED51 + 2535426829 + 441 + 110 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + -60 @@ -11064,7 +11556,7 @@ - -10 + -35 @@ -11088,63 +11580,7 @@ - -50 - - - - - - - 2 - 1D3204D3ADDAB7AA716BEA1489EA852A9D6B5C110243364F6931FEF1CC2E5F88 - 422052608 - 3923 - 518 - 6E325144EF4F41FA3A225EB30729101382C4E99B3D6160E307311E4B4E641010 - 1097215175 - 161 - 240 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - -11 - - - - - - - 2 - 1D3204D3ADDAB7AA716BEA1489EA852A9D6B5C110243364F6931FEF1CC2E5F88 - 422052608 - 3923 - 518 - D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 - 4055211476 - 525 - 3392 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - -18 + -22 @@ -11168,55 +11604,7 @@ - -46 - - - - - - - 1 - 05698FEF1D553EDBC15212673561F5436DF771AA5488C8ED8164D303078DE08E - 119041194 - 1978 - 91 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - -58 - - - - - - - 1 - A449DE2B3A2CDAE9DD932C06D224B3E07C95EBACBB4EA5890CA4CCF2DC74A693 - 1718307056 - 4118 - 323 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - -56 + -31 @@ -11227,7 +11615,7 @@ 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A 1770110914 587 - 1462 + 1467 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D 3929437933 361 @@ -11244,7 +11632,7 @@ - -40 + -39 @@ -11255,7 +11643,7 @@ 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A 1770110914 587 - 1462 + 1467 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D 3929437933 361 @@ -11276,7 +11664,7 @@ - -7 + -37 @@ -11300,7 +11688,7 @@ - -60 + -56 @@ -11328,7 +11716,7 @@ - -44 + -18 @@ -11360,7 +11748,7 @@ - -51 + -17 @@ -11392,7 +11780,7 @@ - -32 + -26 @@ -11416,63 +11804,7 @@ - -16 - - - - - - - 2 - F7537DC10435D0F7CC368E0FC747B2B1169E1CE60FCBAE8AC86F2256667C95B2 - 3301865866 - 4151 - 557 - D747B0A0953B72747224DE7856DB793A4BFF7B73793873CF22810FCB304A7310 - 505472020 - 3665 - 26 - - - - - - 0 - ../../../../boost/exception/diagnostic_information.hpp - 0 - 0 - - - - -5 - - - - - - - 2 - F7537DC10435D0F7CC368E0FC747B2B1169E1CE60FCBAE8AC86F2256667C95B2 - 3301865866 - 4151 - 557 - 90ECFCA1DA49DBB79A23B5998A39D8A6B122632524671C56DA10F96A1BA07CD2 - 1653443895 - 452 - 3693 - - - - - - 0 - ../../../../boost/exception/diagnostic_information.hpp - 0 - 0 - - - - -28 + -9 @@ -11480,9 +11812,9 @@ 1 - E127BAFA15A5B7031C0DD1817993041600F935B71E7BDE42E1F4AF50959B6AB3 - 2166367611 - 9016 + 641BB230CEBF638811480BE0E3A96ABCB7CC9CC7E1C1A9C51FBAB296FFB6B7B1 + 4248389286 + 4113 323 @@ -11490,13 +11822,13 @@ 0 - ../../../../boost/exception_ptr.hpp + ../../../../boost/exception/info.hpp 0 0 - -57 + -27 @@ -11520,7 +11852,7 @@ - -14 + -6 @@ -11548,7 +11880,7 @@ - -25 + -40 @@ -11576,7 +11908,7 @@ - -8 + -41 @@ -11604,7 +11936,7 @@ - -23 + -5 @@ -11632,7 +11964,7 @@ - -43 + -50 @@ -11664,7 +11996,7 @@ - -45 + -7 @@ -11688,7 +12020,7 @@ - -49 + -14 @@ -11712,7 +12044,7 @@ - -48 + -21 @@ -11723,7 +12055,7 @@ 04DDC793002AFCF4F4166D250C67D09B6FE8B86224318ED7847AD6EC423B70CA 922651615 433 - 1027 + 1032 @@ -11736,7 +12068,31 @@ - -27 + -24 + + + + + + + 1 + BEFF039468E0E9A3719E5CB51DA9710812D146B587BAF573D1670908BB97C0CA + 35548578 + 1983 + 91 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + -15 @@ -11760,31 +12116,7 @@ - -30 - - - - - - - 1 - 9E3988368193B192FA2426DE2B97FA8D0DA8A9FFECAD6A010FE1B5CD9662FAE9 - 109897168 - 4491 - 227 - - - - - - 0 - ../../../../boost/exception/diagnostic_information.hpp - 0 - 0 - - - - -33 + -51 @@ -11812,7 +12144,7 @@ - -54 + -10 @@ -11840,7 +12172,7 @@ - -12 + -48 @@ -11864,7 +12196,7 @@ - -26 + -42 @@ -11874,14 +12206,14 @@ - 68 + 69 tag_index - 47 + 48 1 @@ -11895,7 +12227,7 @@ -5 - diagnostic_information free function + error_info free function @@ -11904,7 +12236,16 @@ -6 - exception_ptr free function + + + + + 0 + + -7 + + + function @@ -11913,7 +12254,7 @@ -8 - exception_ptr free function + type @@ -11922,7 +12263,7 @@ -9 - noindex tutorial + error_info @@ -11931,34 +12272,7 @@ -10 - diagnostic_information tutorial - - - - 0 - - -11 - - - function member - - - - 0 - - -12 - - - error_info free function - - - - 0 - - -13 - - - tutorial + @@ -11976,7 +12290,7 @@ -15 - exception_ptr free function + @@ -11985,7 +12299,16 @@ -16 - error_info + exception_ptr free function + + + + 0 + + -17 + + + type @@ -11994,7 +12317,7 @@ -18 - error_info free function + type @@ -12003,7 +12326,25 @@ -19 - exception_ptr + + + + + 0 + + -20 + + + tutorial + + + + 0 + + -21 + + + noindex tutorial @@ -12012,7 +12353,7 @@ -22 - tutorial + @@ -12030,16 +12371,7 @@ -24 - type - - - - 0 - - -25 - - - function + macro @@ -12048,7 +12380,7 @@ -26 - noalso noindex tutorial + function member @@ -12057,7 +12389,7 @@ -27 - macro + @@ -12066,7 +12398,7 @@ -28 - function + error_info @@ -12075,7 +12407,7 @@ -30 - noalso noindex tutorial + exception_ptr free function @@ -12084,7 +12416,7 @@ -31 - function + noalso noindex tutorial @@ -12093,7 +12425,7 @@ -32 - function member + exception_ptr type @@ -12102,7 +12434,16 @@ -33 - + type + + + + 0 + + -35 + + + diagnostic_information tutorial @@ -12111,16 +12452,7 @@ -36 - exception_ptr type - - - - 0 - - -37 - - - error_info free function + diagnostic_information free function @@ -12129,7 +12461,7 @@ -38 - noindex + exception_ptr free function @@ -12138,7 +12470,7 @@ -39 - tutorial + free function @@ -12147,7 +12479,7 @@ -40 - free function + function @@ -12165,7 +12497,7 @@ -42 - tutorial + noalso noindex tutorial @@ -12174,7 +12506,7 @@ -43 - type + noindex tutorial @@ -12183,7 +12515,7 @@ -44 - type + function member @@ -12192,16 +12524,16 @@ -45 - function + tutorial 0 - -46 + -47 - noalso noindex tutorial + tutorial @@ -12210,7 +12542,7 @@ -48 - noindex tutorial + error_info free function @@ -12219,7 +12551,7 @@ -49 - + tutorial @@ -12228,7 +12560,7 @@ -50 - + type @@ -12237,7 +12569,7 @@ -51 - type + noalso noindex tutorial @@ -12246,7 +12578,16 @@ -52 - error_info + error_info free function + + + + 0 + + -53 + + + @@ -12255,7 +12596,16 @@ -54 - + function + + + + 0 + + -55 + + + exception_ptr @@ -12275,15 +12625,6 @@ - - - 0 - - -58 - - - - 0 @@ -12291,7 +12632,7 @@ -59 - + noindex @@ -12300,7 +12641,7 @@ -60 - + function diff --git a/doc/source/html_prefix.txt b/doc/source/html_prefix.txt index adfe8f7..7c3418f 100644 --- a/doc/source/html_prefix.txt +++ b/doc/source/html_prefix.txt @@ -12,7 +12,7 @@

Boost Exception

diff --git a/doc/synopsis.html b/doc/synopsis.html index e9ecfe5..c617031 100644 --- a/doc/synopsis.html +++ b/doc/synopsis.html @@ -21,7 +21,7 @@

Synopsis

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

-

#include <boost/exception/exception.hpp>

+

#include <boost/exception/exception.hpp>

namespace
 boost
     {
@@ -42,15 +42,15 @@ boost
     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>

+

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

#include <boost/exception/info.hpp>

+
#include <boost/exception/exception.hpp>
 
 namespace
 boost
@@ -70,8 +70,8 @@ boost
     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/exception/info_tuple.hpp>

+
#include <boost/exception/info.hpp>
 #include <boost/tuple/tuple.hpp>
 
 namespace
@@ -84,8 +84,8 @@ boost
             ...,
             error_info<TagN,TN> > const & v );
     }
-

#include <boost/exception/enable_error_info.hpp>

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

#include <boost/exception/enable_error_info.hpp>

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

#include <boost/exception/diagnostic_information.hpp>

+

#include <boost/exception/diagnostic_information.hpp>

#include <string>
 
 namespace
@@ -102,7 +102,9 @@ boost
     class exception;
 
     template <class E>
-    std::string diagnostic_information( E const & e );    
+    std::string diagnostic_information( E const & e );
+    
+    std::string diagnostic_information( exception_ptr const & p );    
     
     std::string current_exception_diagnostic_information();
     }
@@ -113,8 +115,8 @@ boost template <class E> E * current_exception_cast(); }
-

#include <boost/exception_ptr.hpp>

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

#include <boost/exception_ptr.hpp>

+
#include <boost/exception/exception.hpp>
 
 namespace
 boost
@@ -127,6 +129,8 @@ boost
         ---unspecified---
         };    
     
+    typedef error_info<struct tag_original_exception_type,std::type_info const *> original_exception_type;    
+    
     typedef ---unspecified--- exception_ptr;    
     
     template <class T>
@@ -136,8 +140,8 @@ boost
     
     void rethrow_exception( exception_ptr const & ep );
     }
-

#include <boost/exception/enable_current_exception.hpp>

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

#include <boost/exception/enable_current_exception.hpp>

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

#include <boost/throw_exception.hpp>

+

#include <boost/throw_exception.hpp>

#if !defined( BOOST_EXCEPTION_DISABLE ) - #include <boost/exception/exception.hpp> + #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__) ) + ::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 @@ -168,14 +172,14 @@ boost void throw_exception( E const & e ); #endif }
-

#include <boost/exception.hpp>

-

See Also:

Boost Exception
diff --git a/doc/throw_exception.html b/doc/throw_exception.html index e75c902..895bb09 100644 --- a/doc/throw_exception.html +++ b/doc/throw_exception.html @@ -21,7 +21,7 @@

throw_exception

-

#include <boost/throw_exception.hpp>

+

#include <boost/throw_exception.hpp>

namespace
 boost
     {
@@ -44,7 +44,7 @@ boost
 

See Also:

BOOST_THROW_EXCEPTION
Boost Exception
-
boost/throw_exception.hpp
+
boost/throw_exception.hpp
Configuration Macros
enable_current_exception
Frequently Asked Questions
diff --git a/doc/tuple_operator_shl.html b/doc/tuple_operator_shl.html index 4efa9e7..4f93466 100644 --- a/doc/tuple_operator_shl.html +++ b/doc/tuple_operator_shl.html @@ -21,7 +21,7 @@

tuple/operator<<

-

#include <boost/exception/info_tuple.hpp>

+

#include <boost/exception/info_tuple.hpp>

namespace
 boost
     {
@@ -43,7 +43,7 @@ boost
 
diff --git a/doc/tutorial_diagnostic_information.html b/doc/tutorial_diagnostic_information.html index e70896d..a1ec172 100644 --- a/doc/tutorial_diagnostic_information.html +++ b/doc/tutorial_diagnostic_information.html @@ -27,7 +27,7 @@
  • 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 <boost/exception.hpp>
    +
    #include <boost/exception.hpp>
     #include <iostream>
     
     void f(); //throws unknown types that derive from boost::exception.
    diff --git a/doc/tutorial_enable_error_info.html b/doc/tutorial_enable_error_info.html
    index 56a59d5..1dceb6d 100644
    --- a/doc/tutorial_enable_error_info.html
    +++ b/doc/tutorial_enable_error_info.html
    @@ -22,7 +22,7 @@
     

    Integrating Boost Exception in Existing Exception Class Hierarchies

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

    -
    #include <boost/exception.hpp>
    +
    #include <boost/exception.hpp>
     #include <stdexcept>
     
     typedef boost::error_info<struct tag_std_range_min,size_t> std_range_min;
    diff --git a/doc/tutorial_exception_ptr.html b/doc/tutorial_exception_ptr.html
    index ad17c51..85fe37e 100644
    --- a/doc/tutorial_exception_ptr.html
    +++ b/doc/tutorial_exception_ptr.html
    @@ -27,7 +27,7 @@
     

    Using enable_current_exception at the Time of the Throw

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

    -
    #include <boost/exception/info.hpp>
    +
    #include <boost/exception/info.hpp>
     #include <stdio.h>
     #include <errno.h>
     
    @@ -46,7 +46,7 @@ file_read( FILE * f, void * buffer, size_t size )
     

    Cloning and Re-Throwing an Exception

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

    -
    #include <boost/exception_ptr.hpp>
    +
    #include <boost/exception_ptr.hpp>
     #include <boost/thread.hpp>
     #include <boost/bind.hpp>
     
    diff --git a/doc/tutorial_transporting_data.html b/doc/tutorial_transporting_data.html
    index a0f5f34..0ab9f62 100644
    --- a/doc/tutorial_transporting_data.html
    +++ b/doc/tutorial_transporting_data.html
    @@ -29,7 +29,7 @@
     

    Adding of Arbitrary Data at the Point of the Throw

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

    -
    #include <boost/exception.hpp>
    +
    #include <boost/exception.hpp>
     #include <errno.h>
     #include <iostream>
     
    @@ -75,7 +75,7 @@ file_read( FILE * f, void * buffer, size_t size )
         }

    How can the file_read function pass a file name to the exception type constructor? All it has is a FILE handle.

    Using boost::exception allows us to free the file_read function from the burden of storing the file name in exceptions it throws:

    -
    #include <boost/exception.hpp>
    +
    #include <boost/exception.hpp>
     #include <stdio.h>
     #include <errno.h>
     
    @@ -90,7 +90,7 @@ file_read( FILE * f, void * buffer, size_t size )
             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 <boost/exception.hpp>
    +
    #include <boost/exception.hpp>
     #include <boost/shared_ptr.hpp>
     #include <stdio.h>
     #include <string>
    @@ -121,7 +121,7 @@ parse_file( char const * file_name )
     

    Adding Grouped Data to Exceptions

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

    -
    #include <boost/exception/info_tuple.hpp>
    +
    #include <boost/exception/info_tuple.hpp>
     #include <boost/shared_ptr.hpp>
     #include <stdio.h>
     #include <string>
    diff --git a/doc/types.html b/doc/types.html
    index 7428c84..9505d28 100644
    --- a/doc/types.html
    +++ b/doc/types.html
    @@ -26,6 +26,8 @@
     

    error_info::value_type

    exception

    exception_ptr

    +

    o

    +

    original_exception_type

    u

    unknown_exception

    diff --git a/doc/unknown_exception.html b/doc/unknown_exception.html index 270a7d9..8d1b1f4 100644 --- a/doc/unknown_exception.html +++ b/doc/unknown_exception.html @@ -21,7 +21,7 @@

    unknown_exception

    -

    #include <boost/exception_ptr.hpp>

    +

    #include <boost/exception_ptr.hpp>

    namespace
     boost
         {
    @@ -37,9 +37,10 @@ boost
     
    diff --git a/include/boost/exception/detail/exception_ptr_base.hpp b/include/boost/exception/detail/exception_ptr_base.hpp new file mode 100644 index 0000000..1a17ff2 --- /dev/null +++ b/include/boost/exception/detail/exception_ptr_base.hpp @@ -0,0 +1,26 @@ +//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) + +#ifndef UUID_DC4208C6417811DEBF11E1EC55D89593 +#define UUID_DC4208C6417811DEBF11E1EC55D89593 + +namespace +boost + { + namespace + exception_detail + { + class + exception_ptr_base + { + public: + + virtual void _rethrow() const=0; + virtual bool _empty() const=0; + }; + } + } + +#endif diff --git a/include/boost/exception/diagnostic_information.hpp b/include/boost/exception/diagnostic_information.hpp index 2c66220..01f7b35 100644 --- a/include/boost/exception/diagnostic_information.hpp +++ b/include/boost/exception/diagnostic_information.hpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -41,16 +42,6 @@ boost 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 ) @@ -72,43 +63,41 @@ boost inline std::string - boost_diagnostic_information( exception const & x ) + diagnostic_information_impl( boost::exception const * be, std::exception const * se ) { + BOOST_ASSERT(be||se); +#ifndef BOOST_NO_RTTI + if( !se ) + se = dynamic_cast(be); + if( !be ) + be = dynamic_cast(se); +#endif std::ostringstream tmp; - if( char const * const * f=get_error_info(x) ) + if( be ) { - tmp << *f; - if( int const * l=get_error_info(x) ) - tmp << '(' << *l << "): "; + if( char const * const * f=get_error_info(*be) ) + { + tmp << *f; + if( int const * l=get_error_info(*be) ) + tmp << '(' << *l << "): "; + } + tmp << "Throw in function "; + if( char const * const * fn=get_error_info(*be) ) + tmp << *fn; + else + tmp << "(unknown)"; + tmp << '\n'; } - 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; + tmp << std::string("Dynamic exception type: ") << + (be?BOOST_EXCEPTION_DYNAMIC_TYPEID(*be):BOOST_EXCEPTION_DYNAMIC_TYPEID(*se)).name() << '\n'; #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; + if( se ) + tmp << "std::exception::what: " << se->what() << '\n'; + if( be ) + if( char const * s=exception_detail::get_diagnostic_information(*be) ) + if( *s ) + tmp << s; return tmp.str(); } } @@ -118,7 +107,7 @@ boost typename enable_if,std::string>::type diagnostic_information( T const & e ) { - return exception_detail::boost_diagnostic_information(e); + return exception_detail::diagnostic_information_impl(&e,0); } template @@ -126,7 +115,7 @@ boost typename enable_if,std::string>::type diagnostic_information( T const & e ) { - return exception_detail::std_diagnostic_information(e); + return exception_detail::diagnostic_information_impl(0,&e); } } @@ -139,14 +128,31 @@ boost std::string current_exception_diagnostic_information() { - 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); + boost::exception const * be=current_exception_cast(); + std::exception const * se=current_exception_cast(); + if( be || se ) + return exception_detail::diagnostic_information_impl(be,se); else return "No diagnostic information available."; } - } + + inline + std::string + diagnostic_information( exception_detail::exception_ptr_base const & p ) + { + if( !p._empty() ) + try + { + p._rethrow(); + } + catch( + ... ) + { + return current_exception_diagnostic_information(); + } + return ""; + } + } #endif #endif diff --git a/include/boost/exception/info.hpp b/include/boost/exception/info.hpp index 92a347e..3285638 100644 --- a/include/boost/exception/info.hpp +++ b/include/boost/exception/info.hpp @@ -106,7 +106,7 @@ boost for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i ) { shared_ptr const & x = i->second; - tmp << '[' << x->tag_typeid_name() << "] = " << x->value_as_string() << std::endl; + tmp << '[' << x->tag_typeid_name() << "] = " << x->value_as_string() << '\n'; } tmp.str().swap(diagnostic_info_str_); } diff --git a/include/boost/exception_ptr.hpp b/include/boost/exception_ptr.hpp index 2499d8a..91dce25 100644 --- a/include/boost/exception_ptr.hpp +++ b/include/boost/exception_ptr.hpp @@ -11,20 +11,35 @@ #error This header requires exception handling to be enabled. #endif #include +#include +#include #include #include #include #include +#include namespace boost { +#ifndef BOOST_NO_RTTI + typedef error_info original_exception_type; + + inline + std::string + to_string( original_exception_type const & x ) + { + return x.value()->name(); + } +#endif + class exception_ptr; exception_ptr current_exception(); void rethrow_exception( exception_ptr const & ); class - exception_ptr + exception_ptr: + public exception_detail::exception_ptr_base { typedef bool exception_ptr::*unspecified_bool_type; friend exception_ptr current_exception(); @@ -52,6 +67,22 @@ boost BOOST_ASSERT(c); } + void + _rethrow() const + { + BOOST_ASSERT(*this); + if( bad_alloc_ ) + throw enable_current_exception(std::bad_alloc()); + else + c_->rethrow(); + } + + bool + _empty() const + { + return !bad_alloc_ && !c_; + } + public: exception_ptr(): @@ -61,7 +92,7 @@ boost operator unspecified_bool_type() const { - return (bad_alloc_ || c_) ? &exception_ptr::bad_alloc_ : 0; + return _empty() ? 0 : &exception_ptr::bad_alloc_; } friend @@ -91,10 +122,17 @@ boost { } + explicit + unknown_exception( std::exception const & e ) + { + add_original_type(e); + } + explicit unknown_exception( boost::exception const & e ): boost::exception(e) { + add_original_type(e); } ~unknown_exception() throw() @@ -114,6 +152,15 @@ boost { throw*this; } + + template + void + add_original_type( E const & e ) + { +#ifndef BOOST_NO_RTTI + (*this) << original_exception_type(&typeid(e)); +#endif + } }; namespace @@ -132,12 +179,14 @@ boost current_exception_std_exception_wrapper( T const & e1 ): T(e1) { + add_original_type(e1); } current_exception_std_exception_wrapper( T const & e1, boost::exception const & e2 ): T(e1), boost::exception(e2) { + add_original_type(e1); } ~current_exception_std_exception_wrapper() throw() @@ -157,6 +206,15 @@ boost { throw *this; } + + template + void + add_original_type( E const & e ) + { +#ifndef BOOST_NO_RTTI + (*this) << original_exception_type(&typeid(e)); +#endif + } }; #ifdef BOOST_NO_RTTI @@ -193,23 +251,23 @@ boost current_exception_std_exception( T const & e1 ) { if( boost::exception const * e2 = get_boost_exception(&e1) ) - return shared_ptr(new current_exception_std_exception_wrapper(e1,*e2)); + return shared_ptr const>(new current_exception_std_exception_wrapper(e1,*e2)); else - return shared_ptr(new current_exception_std_exception_wrapper(e1)); + return shared_ptr const>(new current_exception_std_exception_wrapper(e1)); } inline shared_ptr current_exception_unknown_exception() { - return shared_ptr(new unknown_exception()); + return shared_ptr(new unknown_exception()); } inline shared_ptr current_exception_unknown_boost_exception( boost::exception const & e ) { - return shared_ptr(new unknown_exception(e)); + return shared_ptr(new unknown_exception(e)); } inline @@ -219,7 +277,7 @@ boost if( boost::exception const * be = get_boost_exception(&e) ) return current_exception_unknown_boost_exception(*be); else - return current_exception_unknown_exception(); + return shared_ptr(new unknown_exception(e)); } inline @@ -236,11 +294,21 @@ boost return shared_ptr(e.clone()); } catch( + std::domain_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( std::invalid_argument & e ) { return exception_detail::current_exception_std_exception(e); } catch( + std::length_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( std::out_of_range & e ) { return exception_detail::current_exception_std_exception(e); @@ -251,6 +319,31 @@ boost return exception_detail::current_exception_std_exception(e); } catch( + std::range_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::overflow_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::underflow_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::ios_base::failure & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::runtime_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( std::bad_alloc & e ) { return exception_detail::current_exception_std_exception(e); @@ -342,11 +435,26 @@ boost void rethrow_exception( exception_ptr const & p ) { - BOOST_ASSERT(p); - if( p.bad_alloc_ ) - throw enable_current_exception(std::bad_alloc()); - else - p.c_->rethrow(); + p._rethrow(); + } + + inline + std::string + to_string( exception_ptr const & p ) + { + std::string s='\n'+diagnostic_information(p); + std::string padding(" "); + std::string r; + bool f=false; + for( std::string::const_iterator i=s.begin(),e=s.end(); i!=e; ++i ) + { + if( f ) + r+=padding; + char c=*i; + r+=c; + f=(c=='\n'); + } + return r; } } diff --git a/test/cloning_test.cpp b/test/cloning_test.cpp index 14c772a..a54f58f 100644 --- a/test/cloning_test.cpp +++ b/test/cloning_test.cpp @@ -5,7 +5,6 @@ #include #include -#include #include #include #include @@ -14,6 +13,8 @@ struct my_tag {}; #endif +typedef boost::error_info nested_exception; + typedef boost::error_info my_info; template @@ -70,6 +71,17 @@ derives_std_boost_exception: std::exception, boost::exception { + char const * const wh_; + + derives_std_boost_exception( char const * wh="derives_std_boost_exception" ): + wh_(wh) + { + } + + char const * what() const throw() + { + return wh_; + } }; struct @@ -121,6 +133,24 @@ test_std_exception() } } catch( + ... ) + { + BOOST_TEST(false); + } + try + { + rethrow_exception(p); + BOOST_TEST(false); + } + catch( + boost::exception & x ) + { +#ifndef BOOST_NO_RTTI + std::type_info const * const * t=boost::get_error_info(x); + BOOST_TEST(t!=0 && *t!=0 && **t==typeid(T)); +#endif + } + catch( ... ) { BOOST_TEST(false); @@ -173,6 +203,24 @@ test_std_exception_what() } } catch( + ... ) + { + BOOST_TEST(false); + } + try + { + rethrow_exception(p); + BOOST_TEST(false); + } + catch( + boost::exception & x ) + { +#ifndef BOOST_NO_RTTI + std::type_info const * const * t=boost::get_error_info(x); + BOOST_TEST(t!=0 && *t!=0 && **t==typeid(T)); +#endif + } + catch( ... ) { BOOST_TEST(false); @@ -342,8 +390,12 @@ main() BOOST_TEST(false); } catch( - boost::unknown_exception & ) + boost::unknown_exception & e ) { +#ifndef BOOST_NO_RTTI + std::type_info const * const * t=boost::get_error_info(e); + BOOST_TEST(t!=0 && *t!=0 && **t==typeid(derives_std_exception)); +#endif } catch( ... ) @@ -352,15 +404,23 @@ main() } } + test_std_exception_what(); test_std_exception_what(); + test_std_exception_what(); test_std_exception_what(); test_std_exception_what(); + test_std_exception_what(); + test_std_exception_what(); + test_std_exception_what(); + test_std_exception_what(); + test_std_exception_what(); test_std_exception(); #ifndef BOOST_NO_TYPEID test_std_exception(); test_std_exception(); #endif test_std_exception(); + test_std_exception(); try { @@ -384,6 +444,12 @@ main() BOOST_TEST(boost::get_error_info(x)); if( int const * p=boost::get_error_info(x) ) BOOST_TEST(*p==42); +#ifndef BOOST_NO_RTTI + { + std::type_info const * const * t=boost::get_error_info(x); + BOOST_TEST(t && *t && **t==typeid(derives_std_boost_exception)); + } +#endif boost::exception_ptr p = boost::current_exception(); BOOST_TEST(!(p==boost::exception_ptr())); BOOST_TEST(p!=boost::exception_ptr()); @@ -399,6 +465,10 @@ main() BOOST_TEST(boost::get_error_info(x)); if( int const * p=boost::get_error_info(x) ) BOOST_TEST(*p==42); +#ifndef BOOST_NO_RTTI + std::type_info const * const * t=boost::get_error_info(x); + BOOST_TEST(t && *t && **t==typeid(derives_std_boost_exception)); +#endif } catch( ... ) @@ -435,6 +505,12 @@ main() BOOST_TEST(boost::get_error_info(x)); if( int const * p=boost::get_error_info(x) ) BOOST_TEST(*p==42); +#ifndef BOOST_NO_RTTI + { + std::type_info const * const * t=boost::get_error_info(x); + BOOST_TEST(t && *t && **t==typeid(derives_boost_exception)); + } +#endif boost::exception_ptr p = boost::current_exception(); BOOST_TEST(!(p==boost::exception_ptr())); BOOST_TEST(p!=boost::exception_ptr()); @@ -467,5 +543,30 @@ main() test_throw_on_copy(); test_throw_on_copy(); + try + { + throw boost::enable_current_exception(derives_std_boost_exception("what1")); + } + catch( + ... ) + { + boost::exception_ptr p=boost::current_exception(); + { + std::string s=diagnostic_information(p); + BOOST_TEST(s.find("what1")!=s.npos); + } + try + { + throw boost::enable_current_exception(derives_std_boost_exception("what2") << nested_exception(p) ); + } + catch( + ... ) + { + std::string s=boost::current_exception_diagnostic_information(); + BOOST_TEST(s.find("what1")!=s.npos); + BOOST_TEST(s.find("what2")!=s.npos); + } + } + BOOST_TEST(!diagnostic_information(boost::exception_ptr()).empty()); return boost::report_errors(); }