diff --git a/doc/boost-exception.html b/doc/boost-exception.html index cb3f045..69051e4 100644 --- a/doc/boost-exception.html +++ b/doc/boost-exception.html @@ -26,9 +26,9 @@

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

Contents

  1. Tutorial
    1. Transporting of Arbitrary Data to the Catch Site
    2. +
    3. Diagnostic Information
    4. Integrating Boost Exception in Existing Exception Class Hierarchies
    5. Transporting of Exceptions Between Threads
    6. -
    7. Diagnostic Information
  2. Documentation
    1. Class exception
    2. @@ -95,9 +95,10 @@ boost { public: - typedef T value_type; + typedef T value_type; - error_info( value_type const & ); + error_info( value_type const & v ); + value_type const & value() const; }; template <class E, class Tag, class T> @@ -113,7 +114,7 @@ boost template <class T> ---unspecified--- enable_error_info( T const & x ); - std::string diagnostic_information( boost::exception const & x ); + std::string diagnostic_information( boost::exception const & ); class unknown_exception: @@ -191,9 +192,10 @@ boost { public: - typedef T value_type; + typedef T value_type; - error_info( value_type const & ); + error_info( value_type const & v ); + value_type const & value() const; }; }

    Requirements:

    @@ -399,13 +401,16 @@ boost
    namespace
     boost
         {
    -    std::string diagnostic_information( boost::exception const & x );
    +    std::string diagnostic_information( boost::exception const & );
         }

Returns:

-

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

-

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

-

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

-

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

+

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

+

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

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

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

Notes:

Returns:

-

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

-

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

-

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

-

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

+

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

+

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

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

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

Notes:

Requirements:

@@ -53,6 +54,9 @@ typedef boost::error_infoboost/exception/exception.hpp
boost/exception/info.hpp
diagnostic_information
+
error_info::error_info
+
error_info::value
+
error_info::value_type
exception
exception/operator<<
get_error_info
diff --git a/doc/error_info_error_info.html b/doc/error_info_error_info.html new file mode 100644 index 0000000..e576e1d --- /dev/null +++ b/doc/error_info_error_info.html @@ -0,0 +1,52 @@ + + + + + error_info::error_info + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

error_info::error_info

+
+

#include <boost/exception/info.hpp>

+
error_info( value_type const & v );
+

Effects:

+

Stores a copy of v in the error_info object.

+

Throws:

+

Any exception emitted by v's copy constructor.

+

+

See Also:

+ +
+ + + + +
+
+
+ + diff --git a/doc/error_info_value.html b/doc/error_info_value.html new file mode 100644 index 0000000..d417a47 --- /dev/null +++ b/doc/error_info_value.html @@ -0,0 +1,53 @@ + + + + + error_info::value + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

error_info::value

+
+

#include <boost/exception/info.hpp>

+
value_type const & value() const;
+

Description:

+

Returns a const reference to the copy of the value passed to error_info's constructor stored in the error_info object.

+

Throws:

+

Nothing.

+
+ + + + +
+
+
+ + diff --git a/doc/error_info_value_type.html b/doc/error_info_value_type.html new file mode 100644 index 0000000..64aebce --- /dev/null +++ b/doc/error_info_value_type.html @@ -0,0 +1,52 @@ + + + + + error_info::value_type + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

error_info::value_type

+
+

#include <boost/exception/info.hpp>

+
typedef T value_type;
+

Definition:

+

The expression error_info<Tag,T>::value_type evaluates to T.

+
+ + + + +
+
+
+ + diff --git a/doc/exception_diagnostic_information_hpp.html b/doc/exception_diagnostic_information_hpp.html index 8214df6..31af0eb 100644 --- a/doc/exception_diagnostic_information_hpp.html +++ b/doc/exception_diagnostic_information_hpp.html @@ -28,7 +28,7 @@ namespace boost { class exception; - std::string diagnostic_information( boost::exception const & x ); + std::string diagnostic_information( boost::exception const & ); }

See Also:

diff --git a/doc/exception_error_info_hpp.html b/doc/exception_error_info_hpp.html index d4a1238..1e6c045 100644 --- a/doc/exception_error_info_hpp.html +++ b/doc/exception_error_info_hpp.html @@ -35,9 +35,10 @@ boost { public: - typedef T value_type; + typedef T value_type; - error_info( value_type const & ); + error_info( value_type const & v ); + value_type const & value() const; }; template <class E, class Tag, class T> @@ -48,6 +49,9 @@ boost
diff --git a/doc/name_idx.html b/doc/name_idx.html index 013f87d..fb19386 100644 --- a/doc/name_idx.html +++ b/doc/name_idx.html @@ -49,6 +49,9 @@

enable_current_exception

enable_error_info

error_info

+

error_info::error_info

+

error_info::value

+

error_info::value_type

exception

exception/operator<<

exception::exception

diff --git a/doc/source/boost-exception.reno b/doc/source/boost-exception.reno index 3d104a9..f995d43 100644 --- a/doc/source/boost-exception.reno +++ b/doc/source/boost-exception.reno @@ -39,7 +39,7 @@ - 40 + 43 0 @@ -54,28 +54,28 @@ 2 - 8C77439A1F52A50CF8C4131A44CC7FA9CF5E02508CB32C4FF40B565613A396F4 - 476106477 - 3812 - 518 - D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 - 4055211476 - 525 - 3281 + 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A + 1770110914 + 587 + 1497 + 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D + 3929437933 + 361 + 213 0 - ../../../../boost/exception/info.hpp + ../../../../boost/throw_exception.hpp 0 0 - <string>exception/operator<<</string> + <string>throw_exception</string> @@ -97,59 +97,6 @@ reno_context - - - - - - 3 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 - 1693870740 - 2195 - 3720 - DA154372D8C23BD9EDC30005CA7959CE686D198891097A837D006B5222F04DE9 - 2768248809 - 143 - 60 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>exception::exception</string> - - - exception_constructors - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 7 - - reno_context - @@ -191,6 +138,55 @@ (:include include:) (:auto also:) + + + 0 + + 7 + + reno_context + + + + + + + 2 + 808CABE6CCA47C52CC9DD21911BF0B42284A5DD55AC3E665B29ED2B5F16AF7DA + 3660693492 + 8718 + 487 + 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 + 2078296250 + 305 + 8150 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>copy_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + 0 @@ -204,33 +200,29 @@ - 3 - 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A - 1770110914 - 587 - 1497 - 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D - 3929437933 - 361 - 213 - CD1241D84950468704F3C3F04116B8DA5162A8BEA4364F10951232F49113C5DE - 1658463867 - 121 - 238 + 2 + 808CABE6CCA47C52CC9DD21911BF0B42284A5DD55AC3E665B29ED2B5F16AF7DA + 3660693492 + 8718 + 487 + 0E9DF8366080712A816BE91ABCEF1E2044145B63D75B0B995B537900F378189E + 1069696031 + 255 + 8457 0 - ../../../../boost/throw_exception.hpp + ../../../../boost/exception_ptr.hpp 0 0 - <string>configuration macros</string> + <string>rethrow_exception</string> @@ -258,28 +250,28 @@ 2 - 126BB1D8971585CBE7D78EF3C12259D72FD5E973A84626AA9FC3234220A11CAB - 3471702891 - 969 - 344 - A7FD310E1340E103081DA2A7899DA0E213C696C84D52C17ADA09F6942EE97D47 - 2978648279 - 530 - 433 + 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF + 1282550303 + 9192 + 323 + DF9EA87B0140AACF4422F1B76F6A6A409C15F32858BBBA85A35981A824C56BA9 + 1137981799 + 192 + 8994 0 - ../../../../boost/exception/detail/error_info_impl.hpp + ../../../../boost/exception/exception.hpp 0 0 - <string>error_info</string> + <string>enable_current_exception</string> @@ -307,9 +299,9 @@ 1 - 8DC5E3F51F580F74905ADF7542CBFBE23989808ACFF69E8C2B98B5092C633B42 - 378737885 - 4007 + 265AFB67CCEF87EC9B58DB910ED23C0B1A5546C44767E2FFD6829ABADAF4828B + 1235989793 + 1632 323 @@ -317,17 +309,17 @@ 0 - ../../../../boost/exception/info.hpp + ../../../../boost/exception/diagnostic_information.hpp 0 0 - <string>boost/exception/info.hpp</string> + <string>boost/exception/diagnostic_information.hpp</string> - exception_error_info_hpp + exception_diagnostic_information_hpp @@ -335,7 +327,7 @@ 1 2 - (:include include:) (:auto also:) + (:include include:) (:auto also:) @@ -346,6 +338,180 @@ reno_context + + + + + + 0 + + + + + + 1 + + + + + <string>boost/exception/enable_error_info.hpp</string> + + + exception_enable_error_info_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 12 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>boost/exception/enable_current_exception.hpp</string> + + + exception_enable_current_exception_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 13 + + reno_context + + + + + + + 3 + 126BB1D8971585CBE7D78EF3C12259D72FD5E973A84626AA9FC3234220A11CAB + 3471702891 + 969 + 344 + A7FD310E1340E103081DA2A7899DA0E213C696C84D52C17ADA09F6942EE97D47 + 2978648279 + 530 + 433 + 38B566F2C6678B8724D18086A6F76E077DC2ADC1BB69A4B83BF0A2C3B7D31B50 + 2218658069 + 31 + 143 + + + + + + 0 + ../../../../boost/exception/detail/error_info_impl.hpp + 0 + 0 + + + + + <string>error_info::value_type</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 14 + + reno_context + + + + + + + 1 + 67D64FAD0AB7CA6B2173A14F363D19B27F59EEBDB5C1076F8BCCA1B54D4CCD7D + 2241687287 + 303 + 323 + + + + + + 0 + ../../../../boost/exception.hpp + 0 + 0 + + + + + <string>boost/exception.hpp</string> + + + exception_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 15 + + reno_context + @@ -391,7 +557,139 @@ 0 - 12 + 16 + + reno_context + + + + + + + 2 + 00067869F918D0E8905D8A464C17FA9DAD9F497B3A172EB360239EEB5778A206 + 3465219615 + 4025 + 518 + 6E325144EF4F41FA3A225EB30729101382C4E99B3D6160E307311E4B4E641010 + 1097215175 + 161 + 240 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>error_info::error_info</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 17 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Index</string> + + + name_idx + + + + + + 1 + 2 + (:auto !:) (:pagelist fmt="index" except_tags="index,noindex" mod="w":) + + + + + 0 + + 18 + + 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 + + 19 reno_context @@ -436,318 +734,6 @@ (:include include:) (:auto also:) - - - 0 - - 13 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>transporting of exceptions between threads</string> - - - tutorial_exception_ptr - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 14 - - reno_context - - - - - - - 1 - 17FF6C63843EE64ED66CB038DD95B4C4D6BA1B0FD36B27BEFD84A909161D2853 - 1237535165 - 231 - 1186 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - - <string>BOOST_THROW_EXCEPTION</string> - - - - - - - - - 1 - 2 - (:include include:) (:pagelist link="backlink":) - - - - - 0 - - 15 - - reno_context - - - - - - - 2 - 439278045C9E304238B86C5BD4DA9CA64630D4CC73D442089068A186A28CA55A - 3686240039 - 1522 - 433 - 6FE1F0AF570A010E8FDA1647DE61E0CC3AA979C8A8638722DAACDF8FBC4790D2 - 1246830037 - 1023 - 493 - - - - - - 0 - ../../../../boost/exception/diagnostic_information.hpp - 0 - 0 - - - - - <string>diagnostic_information</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 16 - - 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 - - 17 - - 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 - - 18 - - 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 - - 19 - - reno_context - - - - - - - 1 - CAD6C404CB725D336A44920D2341ECA131149AB02C368B59028F8147F16737BF - 2258638601 - 94 - 227 - - - - - - 0 - ../../../../boost/exception/info_tuple.hpp - 0 - 0 - - - - - <string>boost/exception/info_tuple.hpp</string> - - - exception_error_info_group_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - 0 @@ -762,35 +748,33 @@ 1 - FBC69CDA5E19FA40270F3855A8B99B2F77572439353F9DC5D15386F3520BC616 - 1405483403 - 8882 - 323 + 4ED9709788BBAB4DE7CF336561606B8C0B41F70877A3395F4EE026F4AEB66CC6 + 743998427 + 409 + 307 0 - ../../../../boost/exception_ptr.hpp + ../../example/cloning_1.cpp 0 0 - <string>boost/exception_ptr.hpp</string> + <string>using enable_current_exception at the time of the throw</string> - exception_cloning_hpp + using_enable_cloning - 1 - 2 - (:include include:) (:auto also:) + 0 @@ -855,29 +839,72 @@ - 2 - 808CABE6CCA47C52CC9DD21911BF0B42284A5DD55AC3E665B29ED2B5F16AF7DA - 3660693492 - 8718 - 487 - F86EB07D04CD0D0645080D1121DA899746D0C45137E17E1D9BE605E75396F047 - 1983537541 - 1346 - 148 + 1 + E444EE9697EEADFDE0767E1D0242FC0E70D98E61FB1F0FFA099648DE509B82F3 + 94503238 + 773 + 374 0 - ../../../../boost/exception_ptr.hpp + ../../example/info_tuple.cpp 0 0 - <string>exception_ptr</string> + <string>adding grouped data to exceptions</string> + + + grouping_data + + + + + + 0 + + + + + 0 + + 23 + + 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> @@ -895,7 +922,109 @@ 0 - 23 + 24 + + reno_context + + + + + + + 3 + 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A + 1770110914 + 587 + 1497 + 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D + 3929437933 + 361 + 213 + CD1241D84950468704F3C3F04116B8DA5162A8BEA4364F10951232F49113C5DE + 1658463867 + 121 + 238 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>configuration macros</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 25 + + reno_context + + + + + + + 2 + 439278045C9E304238B86C5BD4DA9CA64630D4CC73D442089068A186A28CA55A + 3686240039 + 1522 + 433 + 6FE1F0AF570A010E8FDA1647DE61E0CC3AA979C8A8638722DAACDF8FBC4790D2 + 1246830037 + 1023 + 493 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + + <string>diagnostic_information</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 26 reno_context @@ -936,139 +1065,6 @@ (:include include:) (:auto also:) - - - 0 - - 24 - - 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 - - 25 - - reno_context - - - - - - - 1 - 187BFD2B78A0DD006717B5B06FFD465E2468F521C32A86FB793F7A68AB5417F3 - 4276724153 - 574 - 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 - - 26 - - 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 @@ -1083,28 +1079,28 @@ 2 - 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A - 1770110914 - 587 - 1497 - 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D - 3929437933 - 361 - 213 + 00067869F918D0E8905D8A464C17FA9DAD9F497B3A172EB360239EEB5778A206 + 3465219615 + 4025 + 518 + D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 + 4055211476 + 525 + 3494 0 - ../../../../boost/throw_exception.hpp + ../../../../boost/exception/info.hpp 0 0 - <string>throw_exception</string> + <string>exception/operator<<</string> @@ -1131,21 +1127,32 @@ - 0 + 2 + 808CABE6CCA47C52CC9DD21911BF0B42284A5DD55AC3E665B29ED2B5F16AF7DA + 3660693492 + 8718 + 487 + F86EB07D04CD0D0645080D1121DA899746D0C45137E17E1D9BE605E75396F047 + 1983537541 + 1346 + 148 - 1 + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 - <string>transporting of arbitrary data to the catch site</string> + <string>exception_ptr</string> - tutorial_transporting_data + @@ -1164,6 +1171,149 @@ reno_context + + + + + + 1 + FBC69CDA5E19FA40270F3855A8B99B2F77572439353F9DC5D15386F3520BC616 + 1405483403 + 8882 + 323 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>boost/exception_ptr.hpp</string> + + + exception_cloning_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 30 + + 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 + + 31 + + reno_context + + + + + + + 1 + F6C6B72C2CDEBC5E3EAA924F637563A8F8A95684AF6EEF39FE2260C86C77F531 + 2151348977 + 3846 + 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 + + 32 + + reno_context + @@ -1205,7 +1355,193 @@ 0 - 30 + 33 + + reno_context + + + + + + + 2 + 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF + 1282550303 + 9192 + 323 + F3FB15CD82336271C6E875BC620385322777D16F0B7C233300783CE35710CCBF + 3292878997 + 282 + 7305 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>enable_error_info</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 34 + + reno_context + + + + + + + 1 + 187BFD2B78A0DD006717B5B06FFD465E2468F521C32A86FB793F7A68AB5417F3 + 4276724153 + 574 + 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 + + 35 + + 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 + + 36 + + 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 + + 37 reno_context @@ -1254,171 +1590,7 @@ 0 - 31 - - 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 - - 32 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Index</string> - - - name_idx - - - - - - 1 - 2 - (:auto !:) (:pagelist fmt="index" except_tags="index,noindex" mod="w":) - - - - - 0 - - 33 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>boost/exception/enable_current_exception.hpp</string> - - - exception_enable_current_exception_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 34 - - reno_context - - - - - - - 1 - 7CAF5D62B1ED0802B65B428119DBDD84C352A24A98EB167E1B0681F3E8DD7628 - 3711957388 - 3837 - 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 - - 35 + 38 reno_context @@ -1454,7 +1626,32 @@ 0 - -13 + 39 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>transporting of exceptions between threads</string> + + + tutorial_exception_ptr + + 2 @@ -1463,7 +1660,7 @@ 0 - -27 + -5 2 @@ -1472,7 +1669,32 @@ 0 - -28 + 40 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>transporting of arbitrary data to the catch site</string> + + + tutorial_transporting_data + + 2 @@ -1481,7 +1703,7 @@ 0 - -26 + -32 2 @@ -1490,7 +1712,7 @@ 0 - -13 + -36 2 @@ -1499,7 +1721,7 @@ 0 - -29 + -39 2 @@ -1508,7 +1730,7 @@ 0 - -30 + -37 2 @@ -1517,7 +1739,7 @@ 0 - -9 + -23 2 @@ -1526,7 +1748,7 @@ 0 - -5 + -27 2 @@ -1535,7 +1757,7 @@ 0 - -18 + -35 2 @@ -1544,7 +1766,7 @@ 0 - 36 + 41 reno_context @@ -1554,14 +1776,14 @@ 2 - 391956879B098B05CB774BAD3285881434482FD633818A579F7183052E6BAD09 - 1787869209 - 3656 + E8AFD260BD0196A516F0E29A9FE6D09BF84B37D31E228910E3370365CAA4AB43 + 3229661566 + 3665 504 BB8AF986C96801345719855FEA083AF5684FBC349F6520E150F19A6370019265 3731478139 686 - 2964 + 2973 @@ -1589,43 +1811,7 @@ 0 - 37 - - reno_context - - - - - - - 2 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - F3FB15CD82336271C6E875BC620385322777D16F0B7C233300783CE35710CCBF - 3292878997 - 282 - 7305 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>enable_error_info</string> - - - - - + -33 2 @@ -1634,7 +1820,7 @@ 0 - -22 + -28 2 @@ -1643,43 +1829,16 @@ 0 - 38 - - reno_context - - - - - - - 2 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - DF9EA87B0140AACF4422F1B76F6A6A409C15F32858BBBA85A35981A824C56BA9 - 1137981799 - 192 - 8994 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>enable_current_exception</string> - - - - - + -9 + + + 2 + :) ###(:link + 1 + + 0 + + -6 2 @@ -1697,102 +1856,12 @@ 0 - 39 - - reno_context - - - - - - - 2 - 808CABE6CCA47C52CC9DD21911BF0B42284A5DD55AC3E665B29ED2B5F16AF7DA - 3660693492 - 8718 - 487 - 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 - 2078296250 - 305 - 8150 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>copy_exception</string> - - - - - + -8 2 :) ###(:link 1 - - 0 - - 40 - - reno_context - - - - - - - 2 - 808CABE6CCA47C52CC9DD21911BF0B42284A5DD55AC3E665B29ED2B5F16AF7DA - 3660693492 - 8718 - 487 - 0E9DF8366080712A816BE91ABCEF1E2044145B63D75B0B995B537900F378189E - 1069696031 - 255 - 8457 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>rethrow_exception</string> - - - - - - - - 2 - :) ###(:link - 1 - - 0 - - -11 - - - 2 - :) ##(:link - 1 0 @@ -1805,16 +1874,7 @@ 0 - -27 - - - 2 - :), (:link - 1 - - 0 - - -14 + -25 2 @@ -1823,52 +1883,11 @@ 0 - -8 + -5 2 - mod="w":) ##Headers ###(:link - 1 - - 0 - - 41 - - reno_context - - - - - - - 1 - 67D64FAD0AB7CA6B2173A14F363D19B27F59EEBDB5C1076F8BCCA1B54D4CCD7D - 2241687287 - 303 - 323 - - - - - - 0 - ../../../../boost/exception.hpp - 0 - 0 - - - - - <string>boost/exception.hpp</string> - - - exception_hpp - - - - - 2 - :) ###(:link + :), (:link 1 0 @@ -1883,38 +1902,101 @@ 1 - 265AFB67CCEF87EC9B58DB910ED23C0B1A5546C44767E2FFD6829ABADAF4828B - 1235989793 - 1632 - 323 + 17FF6C63843EE64ED66CB038DD95B4C4D6BA1B0FD36B27BEFD84A909161D2853 + 1237535165 + 231 + 1186 0 - ../../../../boost/exception/diagnostic_information.hpp + ../../../../boost/throw_exception.hpp 0 0 - <string>boost/exception/diagnostic_information.hpp</string> + <string>BOOST_THROW_EXCEPTION</string> - exception_diagnostic_information_hpp + 2 + :) ##(:link + 1 + + 0 + + -24 + + + 2 + mod="w":) ##Headers ###(:link + 1 + + 0 + + -14 + + + 2 :) ###(:link 1 0 - -33 + -10 + + + 2 + :) ###(:link + 1 + + 0 + + -12 + + + 2 + :) ###(:link + 1 + + 0 + + -11 + + + 2 + :) ###(:link + 1 + + 0 + + -21 + + + 2 + :) ###(:link + 1 + + 0 + + -18 + + + 2 + :) ###(:link + 1 + + 0 + + -31 2 @@ -1932,21 +2014,28 @@ - 0 + 1 + 3D40DD88A1E41D75BC79CA8DACC35BEE2A16A64422AC8E6BE0D61169D9360EF7 + 4184757263 + 4220 + 323 - 1 + 0 + ../../../../boost/exception/info.hpp + 0 + 0 - <string>boost/exception/enable_error_info.hpp</string> + <string>boost/exception/info.hpp</string> - exception_enable_error_info_hpp + exception_error_info_hpp @@ -1957,7 +2046,39 @@ 0 - -21 + 44 + + reno_context + + + + + + + 1 + CAD6C404CB725D336A44920D2341ECA131149AB02C368B59028F8147F16737BF + 2258638601 + 94 + 227 + + + + + + 0 + ../../../../boost/exception/info_tuple.hpp + 0 + 0 + + + + + <string>boost/exception/info_tuple.hpp</string> + + + exception_error_info_group_hpp + + 2 @@ -1966,7 +2087,7 @@ 0 - -24 + -29 2 @@ -1975,43 +2096,7 @@ 0 - -34 - - - 2 - :) ###(:link - 1 - - 0 - - -10 - - - 2 - :) ###(:link - 1 - - 0 - - -19 - - - 2 - :) ###(:link - 1 - - 0 - - -20 - - - 2 - :) ###(:link - 1 - - 0 - - -23 + -26 2 @@ -2020,7 +2105,7 @@ 0 - -32 + -17 2 @@ -2029,7 +2114,7 @@ 0 - -41 + -14 2 @@ -2038,25 +2123,7 @@ 0 - -24 - - - 2 - api pre_indent="4":) (:include - 1 - - 0 - - -10 - - - 2 - api pre_indent="4":) (:include - 1 - - 0 - - -19 + -18 2 @@ -2074,7 +2141,7 @@ 0 - -42 + -44 2 @@ -2083,7 +2150,7 @@ 0 - -20 + -11 2 @@ -2092,7 +2159,25 @@ 0 - -33 + -10 + + + 2 + api pre_indent="4":) (:include + 1 + + 0 + + -29 + + + 2 + api pre_indent="4":) (:include + 1 + + 0 + + -12 2 @@ -2101,7 +2186,7 @@ 0 - -23 + -26 2 @@ -2110,7 +2195,7 @@ 0 - -23 + -26 2 @@ -2119,12 +2204,66 @@ 0 - -30 + -37 2 :) !!Transporting of Arbitrary Data to the Catch Site (:include 1 + + 0 + + -23 + + + 2 + :) (:include + 1 + + 0 + + -27 + + + 2 + :) (:include + 1 + + 0 + + -35 + + + 2 + :) (:include + 1 + + 0 + + -41 + + + 2 + :) (:include + 1 + + 0 + + -33 + + + 2 + :) !!Transporting of Exceptions between Threads (:include + 1 + + 0 + + -28 + + + 2 + :) (:include + 1 0 @@ -2137,52 +2276,7 @@ 0 - -5 - - - 2 - :) (:include - 1 - - 0 - - -18 - - - 2 - :) (:include - 1 - - 0 - - -36 - - - 2 - :) (:include - 1 - - 0 - - -37 - - - 2 - :) !!Transporting of Exceptions between Threads (:include - 1 - - 0 - - -22 - - - 2 - :) (:include - 1 - - 0 - - -38 + -6 2 @@ -2200,30 +2294,12 @@ 0 - -39 + -8 2 :) (:include 1 - - 0 - - -40 - - - 2 - :) (:include - 1 - - 0 - - -11 - - - 2 - :) !!Printing Diagnostic Information (:include - 1 0 @@ -2231,31 +2307,27 @@ 2 + :) !!Printing Diagnostic Information (:include + 1 + + 0 + + -25 + + + 2 :) !!Throwing Exceptions (:include 1 0 - -27 + -5 2 :) !!Acknowledgements Peter Dimov has been continuously influencing the design and evolution of Boost Exception. Also thanks to Tobias Schwinger, Tom Brinkman, Pavel Vozenilek and everyone who participated in the review process. - - - 0 - - -39 - - - - 1 - 2 - (:include include:) (:auto also:) - - 0 @@ -2273,7 +2345,47 @@ 0 - -38 + 45 + + reno_context + + + + + + + 3 + 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF + 1282550303 + 9192 + 323 + 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 + 1693870740 + 2195 + 3720 + DA154372D8C23BD9EDC30005CA7959CE686D198891097A837D006B5222F04DE9 + 2768248809 + 143 + 60 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>exception::exception</string> + + + exception_constructors + + @@ -2295,32 +2407,6 @@ (:include include:) (:auto also:) - - - 0 - - -43 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -37 - - - - 1 - 2 - (:include include:) (:auto also:) - - 0 @@ -2331,14 +2417,14 @@ 1 2 - (:include include:) (:auto also:) + (:include include:) (:pagelist link="backlink":) 0 - -36 + -39 @@ -2351,7 +2437,7 @@ 0 - 44 + 46 reno_context @@ -2361,27 +2447,96 @@ 1 - E444EE9697EEADFDE0767E1D0242FC0E70D98E61FB1F0FFA099648DE509B82F3 - 94503238 - 773 - 374 + FC684D0DD5A9732B4130F2AB3DB6E0491D0F523E14B7FB738B2019EA2C7F8717 + 2229778754 + 631 + 319 0 - ../../example/info_tuple.cpp + ../../example/cloning_2.cpp 0 0 - <string>adding grouped data to exceptions</string> + <string>cloning and re-throwing an exception</string> - grouping_data + cloning_and_rethrowing + + + + + + 0 + + + + + 0 + + -44 + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + -43 + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 47 + + 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 @@ -2397,13 +2552,13 @@ def - 45 + 48 reno_layer - 40 + 43 0 @@ -2456,18 +2611,7 @@ - 3 - 2 - [@template <class Tag,class T> class (:link - 1 - - 0 - - -9 - - - 2 - :) { public: typedef T value_type; error_info( value_type const & ); };@] + 0 @@ -2621,7 +2765,45 @@ - 0 + 9 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -23 + + + 2 + :) { public: (:include + 1 + + 0 + + -13 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -16 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -30 + + + 2 + decl pre_indent="4":) };@] @@ -2698,36 +2880,7 @@ - 7 - 2 - [@class (:link - 1 - - 0 - - -30 - - - 2 - :) { protected: (:include - 1 - - 0 - - -6 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -12 - - - 2 - decl pre_indent="4":) };@] + 0 @@ -2789,7 +2942,58 @@ 0 - -39 + -36 + + + + 0 + + + + + 0 + + -37 + + + + 7 + 2 + [@class (:link + 1 + + 0 + + -37 + + + 2 + :) { protected: (:include + 1 + + 0 + + -45 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -19 + + + 2 + decl pre_indent="4":) };@] + + + + + 0 + + -38 @@ -2811,7 +3015,7 @@ 0 - -38 + -45 @@ -2829,28 +3033,6 @@ 0 - - - 0 - - -43 - - - - 0 - - - - - 0 - - -37 - - - - 0 - - 0 @@ -2866,7 +3048,18 @@ 0 - -36 + -39 + + + + 0 + + + + + 0 + + -46 @@ -2884,6 +3077,28 @@ 0 + + + 0 + + -43 + + + + 0 + + + + + 0 + + -47 + + + + 0 + + @@ -2891,13 +3106,13 @@ api - 46 + 49 reno_layer - 40 + 43 0 @@ -2961,23 +3176,14 @@ - 5 + 3 2 [@(:include 1 0 - -9 - - - 2 - def:) (:include - 1 - - 0 - - -5 + -25 2 @@ -2992,7 +3198,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -33 + + + 2 + decl:)@] @@ -3003,7 +3220,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -9 + + + 2 + decl:)@] @@ -3024,439 +3252,6 @@ -14 - - 0 - - - - - 0 - - -15 - - - - 0 - - - - - 0 - - -16 - - - - 0 - - - - - 0 - - -17 - - - - 0 - - - - - 0 - - -18 - - - - 0 - - - - - 0 - - -19 - - - - 3 - 2 - [@(:include - 1 - - 0 - - -18 - - - 2 - decl:)@] - - - - - 0 - - -20 - - - - 11 - 2 - [@(:include - 1 - - 0 - - -11 - - - 2 - decl:) (:include - 1 - - 0 - - -22 - - - 2 - decl:) (:include - 1 - - 0 - - -39 - - - 2 - decl:) (:include - 1 - - 0 - - -7 - - - 2 - decl:) (:include - 1 - - 0 - - -40 - - - 2 - decl:)@] - - - - - 0 - - -21 - - - - 3 - 2 - [@(:include - 1 - - 0 - - -9 - - - 2 - decl:)@] - - - - - 0 - - -22 - - - - 0 - - - - - 0 - - -23 - - - - 5 - 2 - [@(:include - 1 - - 0 - - -14 - - - 2 - decl:) namespace boost { (:include - 1 - - 0 - - -27 - - - 2 - decl:) }@] - - - - - 0 - - -24 - - - - 11 - 2 - [@(:include - 1 - - 0 - - -30 - - - 2 - def:) (:include - 1 - - 0 - - -9 - - - 2 - decl:) typedef (:link - 1 - - 0 - - -9 - - - 2 - :)<struct tag_throw_function,char const *> throw_function; typedef (:link - 1 - - 0 - - -9 - - - 2 - :)<struct tag_throw_file,char const *> throw_file; typedef (:link - 1 - - 0 - - -9 - - - 2 - :)<struct tag_throw_line,int> throw_line;@] - - - - - 0 - - -25 - - - - 0 - - - - - 0 - - -26 - - - - 0 - - - - - 0 - - -27 - - - - 0 - - - - - 0 - - -28 - - - - 0 - - - - - 0 - - -29 - - - - 0 - - - - - 0 - - -30 - - - - 0 - - - - - 0 - - -31 - - - - 0 - - - - - 0 - - -32 - - - - 0 - - - - - 0 - - -33 - - - - 3 - 2 - [@(:include - 1 - - 0 - - -38 - - - 2 - decl:)@] - - - - - 0 - - -34 - - - - 3 - 2 - [@(:include - 1 - - 0 - - -36 - - - 2 - decl:)@] - - - - - 0 - - -35 - - - - 0 - - - - - 0 - - -39 - - - - 0 - - - - - 0 - - -40 - - - - 0 - - - - - 0 - - -38 - - - - 0 - - - - - 0 - - -41 - - 15 2 @@ -3465,7 +3260,7 @@ 0 - -42 + -10 2 @@ -3483,7 +3278,7 @@ 0 - -24 + -18 2 @@ -3492,7 +3287,7 @@ 0 - -34 + -31 2 @@ -3501,7 +3296,7 @@ 0 - -10 + -43 2 @@ -3510,7 +3305,7 @@ 0 - -19 + -44 2 @@ -3519,408 +3314,13 @@ 0 - -20 + -29 2 :)>@] - - - 0 - - -43 - - - - 3 - 2 - [@(:include - 1 - - 0 - - -37 - - - 2 - decl:)@] - - - - - 0 - - -37 - - - - 0 - - - - - 0 - - -42 - - - - 3 - 2 - [@(:include - 1 - - 0 - - -15 - - - 2 - decl:)@] - - - - - 0 - - -36 - - - - 0 - - - - - 0 - - -44 - - - - 0 - - - - - - - - decl - - 47 - - reno_layer - - - - 40 - - - 0 - - -5 - - - - 5 - 2 - [@template <class E, class Tag, class T> E const & (:link - 1 - - 0 - - -5 - - - 2 - mod="/":)( E const & x, (:link - 1 - - 0 - - -9 - - - 2 - :)<Tag,T> const & v );@] - - - - - 0 - - -6 - - - - 7 - 2 - [@(:link - 1 - - 0 - - -6 - - - 2 - mod="m":)(); (:link - 1 - - 0 - - -6 - - - 2 - mod="m":)( (:link - 1 - - 0 - - -30 - - - 2 - :) const & x );@] - - - - - 0 - - -7 - - - - 5 - 2 - [@(:link - 1 - - 0 - - -22 - - - 2 - :) (:link - 1 - - 0 - - -7 - - - 2 - :)();@] - - - - - 0 - - -8 - - - - 0 - - - - - 0 - - -9 - - - - 3 - 2 - [@template <class Tag,class T> class (:link - 1 - - 0 - - -9 - - - 2 - :);@] - - - - - 0 - - -10 - - - - 0 - - - - - 0 - - -11 - - - - 5 - 2 - [@class (:link - 1 - - 0 - - -11 - - - 2 - :): public std::exception public boost:: - 1 - - 0 - - -30 - - - 2 - { ---unspecified--- };@] - - - - - 0 - - -12 - - - - 3 - 2 - [@(:link - 1 - - 0 - - -12 - - - 2 - mod="m":)();@] - - - - - 0 - - -13 - - - - 0 - - - - - 0 - - -14 - - - - 19 - 2 - [@#if !defined( BOOST_NO_EXCEPTIONS ) && !defined( BOOST_EXCEPTION_DISABLE ) #include < - 1 - - 0 - - -24 - - - 2 - > #include <boost/current_function.hpp> #define - 1 - - 0 - - -14 - - - 2 - (x)\ ::boost:: - 1 - - 0 - - -27 - - - 2 - ( ::boost:: - 1 - - 0 - - -37 - - - 2 - (x) <<\ ::boost::(:link - 1 - - 0 - - -24 - - - 2 - |throw_function:)(BOOST_CURRENT_FUNCTION) <<\ ::boost::(:link - 1 - - 0 - - -24 - - - 2 - |throw_file:)(__FILE__) <<\ ::boost::(:link - 1 - - 0 - - -24 - - - 2 - |throw_line:)((int)__LINE__) ) #else #define - 1 - - 0 - - -14 - - - 2 - (x) ::boost:: - 1 - - 0 - - -27 - - - 2 - (x) #endif@] - - 0 @@ -3929,27 +3329,7 @@ - 5 - 2 - [@std::string (:link - 1 - - 0 - - -15 - - - 2 - :)( boost::(:link - 1 - - 0 - - -30 - - - 2 - :) const & x );@] + 0 @@ -3982,36 +3362,54 @@ - 7 + 11 2 - [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link + [@(:include 1 0 - -18 + -37 2 - mod="/":)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link + def:) (:include 1 0 - -9 + -23 2 - :)<Tag1,T1>, ..., (:link + decl:) typedef (:link 1 0 - -9 + -23 2 - :)<TagN,TN> > const & v );@] + :)<struct tag_throw_function,char const *> throw_function; typedef (:link + 1 + + 0 + + -23 + + + 2 + :)<struct tag_throw_file,char const *> throw_file; typedef (:link + 1 + + 0 + + -23 + + + 2 + :)<struct tag_throw_line,int> throw_line;@] @@ -4044,7 +3442,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -23 + + + 2 + decl:)@] @@ -4055,18 +3464,7 @@ - 3 - 2 - [@typedef ---unspecified--- (:link - 1 - - 0 - - -22 - - - 2 - :);@] + 0 @@ -4110,7 +3508,27 @@ - 0 + 5 + 2 + [@(:include + 1 + + 0 + + -42 + + + 2 + decl:) namespace boost { (:include + 1 + + 0 + + -5 + + + 2 + decl:) }@] @@ -4121,27 +3539,7 @@ - 5 - 2 - [@#ifdef BOOST_NO_EXCEPTIONS void (:link - 1 - - 0 - - -27 - - - 2 - :)( std::exception const & e ); // user defined #else template <class E> void (:link - 1 - - 0 - - -27 - - - 2 - :)( E const & e ); #endif@] + 0 @@ -4163,7 +3561,54 @@ - 0 + 11 + 2 + [@(:include + 1 + + 0 + + -15 + + + 2 + decl:) (:include + 1 + + 0 + + -28 + + + 2 + decl:) (:include + 1 + + 0 + + -7 + + + 2 + decl:) (:include + 1 + + 0 + + -6 + + + 2 + decl:) (:include + 1 + + 0 + + -8 + + + 2 + decl:)@] @@ -4174,18 +3619,7 @@ - 3 - 2 - [@class (:link - 1 - - 0 - - -30 - - - 2 - :);@] + 0 @@ -4196,7 +3630,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -41 + + + 2 + decl:)@] @@ -4247,62 +3692,22 @@ 0 - -39 + -36 - 5 - 2 - [@template <class T> (:link - 1 - - 0 - - -22 - - - 2 - :) (:link - 1 - - 0 - - -39 - - - 2 - :)( T const & e );@] + 0 0 - -40 + -37 - 5 - 2 - [@void (:link - 1 - - 0 - - -40 - - - 2 - :)( (:link - 1 - - 0 - - -22 - - - 2 - :) const & ep ); + 0 @@ -4312,21 +3717,865 @@ -38 + + 0 + + + + + 0 + + -40 + + + + 0 + + + + + 0 + + -45 + + + + 0 + + + + + 0 + + -41 + + + + 0 + + + + + 0 + + -42 + + + + 0 + + + + + 0 + + -39 + + + + 0 + + + + + 0 + + -46 + + + + 0 + + + + + 0 + + -44 + + 3 2 - [@template <class T> ---unspecified--- (:link + [@(:include 1 0 - -38 + -35 + + + 2 + decl:)@] + + + + + 0 + + -43 + + + + 5 + 2 + [@(:include + 1 + + 0 + + -23 + + + 2 + def:) (:include + 1 + + 0 + + -27 + + + 2 + decl:)@] + + + + + 0 + + -47 + + + + 0 + + + + + + + + decl + + 50 + + reno_layer + + + + 43 + + + 0 + + -5 + + + + 5 + 2 + [@#ifdef BOOST_NO_EXCEPTIONS void (:link + 1 + + 0 + + -5 + + + 2 + :)( std::exception const & e ); // user defined #else template <class E> void (:link + 1 + + 0 + + -5 + + + 2 + :)( E const & e ); #endif@] + + + + + 0 + + -6 + + + + 5 + 2 + [@(:link + 1 + + 0 + + -28 + + + 2 + :) (:link + 1 + + 0 + + -6 + + + 2 + :)();@] + + + + + 0 + + -7 + + + + 5 + 2 + [@template <class T> (:link + 1 + + 0 + + -28 + + + 2 + :) (:link + 1 + + 0 + + -7 2 :)( T const & e );@] + + + 0 + + -8 + + + + 5 + 2 + [@void (:link + 1 + + 0 + + -8 + + + 2 + :)( (:link + 1 + + 0 + + -28 + + + 2 + :) const & ep ); + + + + + 0 + + -9 + + + + 3 + 2 + [@template <class T> ---unspecified--- (:link + 1 + + 0 + + -9 + + + 2 + :)( T const & e );@] + + + + + 0 + + -10 + + + + 0 + + + + + 0 + + -11 + + + + 0 + + + + + 0 + + -12 + + + + 0 + + + + + 0 + + -13 + + + + 3 + 2 + [@typedef T (:link + 1 + + 0 + + -13 + + + 2 + mod="m":);@] + + + + + 0 + + -14 + + + + 0 + + + + + 0 + + -15 + + + + 5 + 2 + [@class (:link + 1 + + 0 + + -15 + + + 2 + :): public std::exception public boost:: + 1 + + 0 + + -37 + + + 2 + { ---unspecified--- };@] + + + + + 0 + + -16 + + + + 5 + 2 + [@(:link + 1 + + 0 + + -16 + + + 2 + mod="m":)( (:link + 1 + + 0 + + -13 + + + 2 + mod="m":) const & v );@] + + + + + 0 + + -17 + + + + 0 + + + + + 0 + + -18 + + + + 0 + + + + + 0 + + -19 + + + + 3 + 2 + [@(:link + 1 + + 0 + + -19 + + + 2 + mod="m":)();@] + + + + + 0 + + -20 + + + + 0 + + + + + 0 + + -21 + + + + 0 + + + + + 0 + + -22 + + + + 0 + + + + + 0 + + -23 + + + + 3 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -23 + + + 2 + :);@] + + + + + 0 + + -24 + + + + 0 + + + + + 0 + + -25 + + + + 5 + 2 + [@std::string (:link + 1 + + 0 + + -25 + + + 2 + :)( boost::(:link + 1 + + 0 + + -37 + + + 2 + :) const & );@] + + + + + 0 + + -26 + + + + 0 + + + + + 0 + + -27 + + + + 5 + 2 + [@template <class E, class Tag, class T> E const & (:link + 1 + + 0 + + -27 + + + 2 + mod="/":)( E const & x, (:link + 1 + + 0 + + -23 + + + 2 + :)<Tag,T> const & v );@] + + + + + 0 + + -28 + + + + 3 + 2 + [@typedef ---unspecified--- (:link + 1 + + 0 + + -28 + + + 2 + :);@] + + + + + 0 + + -29 + + + + 0 + + + + + 0 + + -30 + + + + 5 + 2 + [@(:link + 1 + + 0 + + -13 + + + 2 + mod="m":) const & (:link + 1 + + 0 + + -30 + + + 2 + mod="m":)() const;@] + + + + + 0 + + -31 + + + + 0 + + + + + 0 + + -32 + + + + 0 + + + + + 0 + + -33 + + + + 3 + 2 + [@template <class T> ---unspecified--- (:link + 1 + + 0 + + -33 + + + 2 + :)( T const & x );@] + + + + + 0 + + -34 + + + + 0 + + + + + 0 + + -35 + + + + 7 + 2 + [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link + 1 + + 0 + + -35 + + + 2 + mod="/":)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link + 1 + + 0 + + -23 + + + 2 + :)<Tag1,T1>, ..., (:link + 1 + + 0 + + -23 + + + 2 + :)<TagN,TN> > const & v );@] + + + + + 0 + + -36 + + + + 0 + + + + + 0 + + -37 + + + + 3 + 2 + [@class (:link + 1 + + 0 + + -37 + + + 2 + :);@] + + + + + 0 + + -38 + + + + 0 + + + + + 0 + + -40 + + + + 0 + + + + + 0 + + -45 + + + + 7 + 2 + [@(:link + 1 + + 0 + + -45 + + + 2 + mod="m":)(); (:link + 1 + + 0 + + -45 + + + 2 + mod="m":)( (:link + 1 + + 0 + + -37 + + + 2 + :) const & x );@] + + 0 @@ -4334,6 +4583,144 @@ -41 + + 3 + 2 + [@template <class ErrorInfo,class E> (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:)<typename ErrorInfo::value_type const> (:link + 1 + + 0 + + -41 + + + 2 + :)( E const & x );@] + + + + + 0 + + -42 + + + + 19 + 2 + [@#if !defined( BOOST_NO_EXCEPTIONS ) && !defined( BOOST_EXCEPTION_DISABLE ) #include < + 1 + + 0 + + -18 + + + 2 + > #include <boost/current_function.hpp> #define + 1 + + 0 + + -42 + + + 2 + (x)\ ::boost:: + 1 + + 0 + + -5 + + + 2 + ( ::boost:: + 1 + + 0 + + -33 + + + 2 + (x) <<\ ::boost::(:link + 1 + + 0 + + -18 + + + 2 + |throw_function:)(BOOST_CURRENT_FUNCTION) <<\ ::boost::(:link + 1 + + 0 + + -18 + + + 2 + |throw_file:)(__FILE__) <<\ ::boost::(:link + 1 + + 0 + + -18 + + + 2 + |throw_line:)((int)__LINE__) ) #else #define + 1 + + 0 + + -42 + + + 2 + (x) ::boost:: + 1 + + 0 + + -5 + + + 2 + (x) #endif@] + + + + + 0 + + -39 + + + + 0 + + + + + 0 + + -46 + + + + 0 + + + + + 0 + + -44 + + 0 @@ -4353,62 +4740,7 @@ 0 - -37 - - - - 3 - 2 - [@template <class T> ---unspecified--- (:link - 1 - - 0 - - -37 - - - 2 - :)( T const & x );@] - - - - - 0 - - -42 - - - - 0 - - - - - 0 - - -36 - - - - 3 - 2 - [@template <class ErrorInfo,class E> (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:)<typename ErrorInfo::value_type const> (:link - 1 - - 0 - - -36 - - - 2 - :)( E const & x );@] - - - - - 0 - - -44 + -47 @@ -4422,13 +4754,13 @@ include - 48 + 51 reno_layer - 40 + 43 0 @@ -4437,27 +4769,18 @@ - 7 + 13 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must derive publicly from std::exception. !!!!Effects: * If BOOST_NO_EXCEPTIONS is not defined, boost::(:link 1 0 - -30 + -5 2 - :), or a type that derives (indirectly) from boost::(:link - 1 - - 0 - - -30 - - - 2 - :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link + :)(e) is equivalent to throw boost::(:link 1 0 @@ -4466,7 +4789,43 @@ 2 - :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) + :)(boost::(:link + 1 + + 0 + + -33 + + + 2 + :)(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::(:link + 1 + + 0 + + -5 + + + 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 + + -5 + + + 2 + :) are allowed to assume that the function never returns; therefore, if the user-defined (:link + 1 + + 0 + + -5 + + + 2 + :) returns, the behavior is undefined. @@ -4476,46 +4835,6 @@ -6 - - 7 - 2 - (:auto !!!:) (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link - 1 - - 0 - - -30 - - - 2 - :) object. * Copy constructor: initializes a boost::(:link - 1 - - 0 - - -30 - - - 2 - :) object which shares ownership with x of all data added through (:link - 1 - - 0 - - -5 - - - 2 - mod="/":), including data that is added at a future time. !!!!Throws: Nothing. - - - - - 0 - - -7 - - 29 2 @@ -4524,7 +4843,7 @@ 0 - -7 + -6 2 @@ -4533,7 +4852,7 @@ 0 - -22 + -28 2 @@ -4542,7 +4861,7 @@ 0 - -22 + -28 2 @@ -4551,7 +4870,7 @@ 0 - -7 + -6 2 @@ -4560,7 +4879,7 @@ 0 - -7 + -6 2 @@ -4569,7 +4888,7 @@ 0 - -38 + -9 2 @@ -4578,7 +4897,7 @@ 0 - -38 + -9 2 @@ -4587,7 +4906,7 @@ 0 - -7 + -6 2 @@ -4596,7 +4915,7 @@ 0 - -22 + -28 2 @@ -4605,7 +4924,7 @@ 0 - -11 + -15 2 @@ -4614,7 +4933,7 @@ 0 - -30 + -37 2 @@ -4623,7 +4942,7 @@ 0 - -30 + -37 2 @@ -4632,7 +4951,7 @@ 0 - -11 + -15 2 @@ -4641,13 +4960,44 @@ 0 - -30 + -37 2 :) copy constructor. + + + 0 + + -7 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) !!!!Effects: As if [@try { throw + 1 + + 0 + + -9 + + + 2 + (e); } catch(...) { return (:link + 1 + + 0 + + -6 + + + 2 + :)(); }@] + + 0 @@ -4656,72 +5006,9 @@ - 15 + 1 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 - - -36 - - - 2 - :) function template can be called with any exception type. If BOOST_NO_RTTI is defined, (:link - 1 - - 0 - - -36 - - - 2 - :) can be used only with objects of type boost::(:link - 1 - - 0 - - -30 - - - 2 - :). '''BOOST_EXCEPTION_DISABLE''' By default, (:link - 1 - - 0 - - -38 - - - 2 - :) and (:link - 1 - - 0 - - -37 - - - 2 - :) are integrated directly in the (:link - 1 - - 0 - - -27 - - - 2 - :) function. Defining BOOST_EXCEPTION_DISABLE disables this integration. Note that on some non-conformant compilers, for example MSVC 7.0 and older, as well as BCC, BOOST_EXCEPTION_DISABLE is implicitly defined in (:link - 1 - - 0 - - -23 - - - 2 - :). + (:auto !!!:) (:include synopsis:) !!!!Precondition: ep shall not be null. !!!!Throws: The exception to which ep refers. @@ -4732,9 +5019,18 @@ - 25 + 21 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: T must have accessible copy constructor and must not be a reference (there is no requirement that T's copy constructor does not throw.) !!!!Description: This class template is used to associate a Tag type with a value type T. Objects of type (:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: T must be a class with an accessible no-throw copy constructor. !!!!Returns: An object of ''unspecified'' type which derives publicly from T. That is, the returned object can be intercepted by a catch(T &). !!!!Description: This function is designed to be used directly in a throw-expression to enable the (:link + 1 + + 0 + + -28 + + + 2 + :) support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link 1 0 @@ -4743,7 +5039,52 @@ 2 - :)<Tag,T> can be passed to (:link + :)(my_exception());@] Unless (:link + 1 + + 0 + + -9 + + + 2 + :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link + 1 + + 0 + + -6 + + + 2 + :) may return an (:link + 1 + + 0 + + -28 + + + 2 + :) which refers to an instance of (:link + 1 + + 0 + + -15 + + + 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 @@ -4752,12 +5093,381 @@ 2 + :). This is guaranteed to throw an exception that derives from boost::(:link + 1 + + 0 + + -37 + + + 2 + :) and supports the (:link + 1 + + 0 + + -28 + + + 2 + :) functionality. + + + + + 0 + + -10 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -11 + + + + 1 + 2 + (:auto !!!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -12 + + + + 1 + 2 + (:auto !!!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -13 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) !!!!Definition: The expression + 1 + + 0 + + -23 + + + 2 + <Tag,T>::(:link + 1 + + 0 + + -13 + + + 2 + mod="m":) evaluates to T. + + + + + 0 + + -14 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -15 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) This type is used by the (:link + 1 + + 0 + + -28 + + + 2 + :) support in Boost Exception. Please see (:link + 1 + + 0 + + -6 + + + 2 + :). + + + + + 0 + + -16 + + + + 3 + 2 + (:auto !!!:) (:include synopsis:) !!!!Effects: Stores a copy of v in the + 1 + + 0 + + -23 + + + 2 + object. (:include throws:) + + + + + 0 + + -17 + + + + 0 + + + + + 0 + + -18 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -19 + + + + 3 + 2 + (:auto !!!:) (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link + 1 + + 0 + + -37 + + + 2 + :) object. !!!!Throws: Nothing. + + + + + 0 + + -20 + + + + 11 + 2 + (:auto !!!:) Here is how cloning can be enabled in a throw-expression (15.1): [@#include <(:link + 1 + + 0 + + -43 + + + 2 + :)> #include <stdio.h> #include <errno.h> typedef boost::error_info<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link + 1 + + 0 + + -37 + + + 2 + :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::(:link + 1 + + 0 + + -9 + + + 2 + :)(file_read_error()) << errno_info(errno); }@] Of course, (:link + 1 + + 0 + + -9 + + + 2 + :) may be used with any exception type; there is no requirement that it should derive from boost::(:link + 1 + + 0 + + -37 + + + 2 + :). + + + + + 0 + + -21 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -22 + + + + 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 + + -44 + + + 2 + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link + 1 + + 0 + + -23 + + + 2 + :)<struct tag_file_name,std::string> file_name_info; typedef boost::(:link + 1 + + 0 + + -23 + + + 2 + :)<struct tag_function,char const *> function_info; typedef boost::(:link + 1 + + 0 + + -23 + + + 2 + :)<struct tag_errno,int> errno_info; typedef boost::tuple<function_info,errno_info> clib_failure; class file_open_error: public boost::(:link + 1 + + 0 + + -37 + + + 2 + :) { }; boost::shared_ptr<FILE> file_open( char const * name, char const * mode ) { if( FILE * f=fopen(name,mode) ) return boost::shared_ptr<FILE>(f,fclose); else throw file_open_error() << file_name_info(name) << clib_failure("fopen",errno); }@] Note that the members of a boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) are stored separately in exception objects; they can only be retrieved individually, using (:link + 1 + + 0 + + -41 + + + 2 + :). + + + + + 0 + + -23 + + + + 25 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: T must have accessible copy constructor and must not be a reference (there is no requirement that T's copy constructor does not throw.) !!!!Description: This class template is used to associate a Tag type with a value type T. Objects of type (:link + 1 + + 0 + + -23 + + + 2 + :)<Tag,T> can be passed to (:link + 1 + + 0 + + -27 + + + 2 mod="/":) to be stored in objects of type boost::(:link 1 0 - -30 + -37 2 @@ -4775,7 +5485,7 @@ 0 - -9 + -23 2 @@ -4793,7 +5503,7 @@ 0 - -9 + -23 2 @@ -4802,7 +5512,7 @@ 0 - -9 + -23 2 @@ -4811,7 +5521,7 @@ 0 - -30 + -37 2 @@ -4820,7 +5530,7 @@ 0 - -5 + -27 2 @@ -4829,7 +5539,7 @@ 0 - -36 + -41 2 @@ -4838,7 +5548,7 @@ 0 - -10 + -43 2 @@ -4849,195 +5559,40 @@ 0 - -10 + -24 - 1 + 15 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -11 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) This type is used by the (:link + (: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 - -22 + -41 2 - :) support in Boost Exception. Please see (:link + :) function template can be called with any exception type. If BOOST_NO_RTTI is defined, (:link 1 0 - -7 + -41 2 - :). - - - - - 0 - - -12 - - - - 3 - 2 - (:auto !!!:) (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link + :) can be used only with objects of type boost::(:link 1 0 - -30 + -37 2 - :) object. !!!!Throws: Nothing. - - - - - 0 - - -13 - - - - 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 - - -38 - - - 2 - :) at the time of the throw is required in order to use cloning. !!!!Note: All exceptions emitted by the familiar function boost::(:link - 1 - - 0 - - -27 - - - 2 - :) are guaranteed to derive from boost::(:link - 1 - - 0 - - -30 - - - 2 - :) and to support cloning. (:include - 1 - - 0 - - -31 - - - 2 - :) (:include - 1 - - 0 - - -16 - - - 2 - :) - - - - - 0 - - -14 - - - - 7 - 2 - (:auto !!!:) (:include synopsis:) This macro takes an exception object, records BOOST_CURRENT_FUNCTION, __FILE__ and __LINE__ in it, and forwards it to - 1 - - 0 - - -27 - - - 2 - . To recover this information at the catch site, use - 1 - - 0 - - -36 - - - 2 - ; the information is also included in the message returned by - 1 - - 0 - - -15 - - - 2 - . - - - - - 0 - - -15 - - - - 7 - 2 - (:auto !!!:) (:include synopsis:) !!!!Returns: This function iterates over all data objects stored in the boost::(:link - 1 - - 0 - - -30 - - - 2 - :) through (:link - 1 - - 0 - - -5 - - - 2 - mod="/":). The returned string is constructed by converting each data object to string and then concatenating these strings together. When the (:link + :). '''BOOST_EXCEPTION_DISABLE''' By default, (:link 1 0 @@ -5046,468 +5601,36 @@ 2 - :)<Tag,T> template is instantiated, the system attempts overload resolution for an unqualified call to to_string(x), where x is of type T. If this is successful, the to_string overload is expected to return std::string and is used to convert objects of type T to string. Otherwise, the system attempts overload resolution for s << x, where s is a std::ostringstream and x is of type T. If this is successful, the operator<< overload is used to convert objects of type T to string. Otherwise the system is unable to convert objects of type T to string, and an unspecified stub string value is used without issuing a compile error. !!!!Notes: *The format of the returned string is unspecified. *The returned string is ''not'' user-friendly. *If dynamic_cast<std::exception const *>(&x) is not null, the returned string includes the output from std::exception::what. *The returned string may include additional platform-specific diagnostic information. - - - - - 0 - - -16 - - - - 37 - 2 - (:auto !!!:) When you catch an exception, you can call (:link - 1 - - 0 - - -7 - - - 2 - :) to get an (:link - 1 - - 0 - - -22 - - - 2 - :) object: [@#include <(:link - 1 - - 0 - - -20 - - - 2 - :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link - 1 - - 0 - - -30 - - - 2 - :)s void worker_thread( boost::(:link - 1 - - 0 - - -22 - - - 2 - :) & error ) { try { do_work(); error = boost::(:link - 1 - - 0 - - -22 - - - 2 - :)(); } catch( ... ) { error = boost::(:link - 1 - - 0 - - -7 - - - 2 - :)(); } }@] In the above example, note that (:link - 1 - - 0 - - -7 - - - 2 - :) captures the original type of the exception object. The exception can be thrown again using the (:link - 1 - - 0 - - -40 - - - 2 - :) function: [@// ...continued void work() { boost::(:link - 1 - - 0 - - -22 - - - 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 - - -40 - - - 2 - :)(error); }@] Note that (:link - 1 - - 0 - - -7 - - - 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 - - -22 - - - 2 - :) points to an instance of std::bad_alloc, or * if (:link - 1 - - 0 - - -38 - - - 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 - - -22 - - - 2 - :) points to an instance of (:link - 1 - - 0 - - -11 - - - 2 - :). Regardless, the use of (:link - 1 - - 0 - - -7 - - - 2 :) and (:link 1 0 - -40 + -33 2 - :) in the above examples is well-formed. - - - - - 0 - - -17 - - - - 21 - 2 - (:auto !!!:) Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Here is an example: [@#include <stdio.h> #include <string> class file_read_error { public: explicit file_read_error( std::string const & fn ): fn_(fn) { }; std::string const & file_name() const { return fn_; } private: std::string fn_; }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error("????"); }@] We have defined an exception class file_read_error which can store a file name, so that when we catch a file_read_error object, we know which file the failure is related to. However, the file_read function does not have the file name at the time of the throw; all it has is a FILE handle. One possible solution is to not use FILE handles directly. We could have our own class file which stores both a FILE handle and a file name, and pass that to file_read. However, this could be problematic if we communicate with 3rd party code that does not use our class file (probably because they have their own similar class.) A better solution is to make class file_read_error derive (possibly indirectly) from boost::(:link + :) are integrated directly in the (:link 1 0 - -30 + -5 2 - :), and free the file_read function from the burden of storing the file name in exceptions it throws: [@#include <(:link + :) 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 - -41 - - - 2 - :)> #include <stdio.h> #include <errno.h> typedef boost::(:link - 1 - - 0 - - -9 - - - 2 - :)<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link - 1 - - 0 - - -30 - - - 2 - :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error() << errno_info(errno); }@] If file_read detects a failure, it throws an exception which contains the information that is available at the time, namely the errno. Other relevant information, such as the file name, can be added in a context higher up the call stack, where it is known naturally: [@#include <(:link - 1 - - 0 - - -41 - - - 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> typedef boost::(:link - 1 - - 0 - - -9 - - - 2 - :)<struct tag_file_name,std::string> file_name_info; boost::shared_ptr<FILE> file_open( char const * file_name, char const * mode ); void file_read( FILE * f, void * buffer, size_t size ); void parse_file( char const * file_name ) { boost::shared_ptr<FILE> f = file_open(file_name,"rb"); assert(f); try { char buf[1024]; file_read( f.get(), buf, sizeof(buf) ); } catch( boost::(:link - 1 - - 0 - - -30 - - - 2 - :) & e ) { e << file_name_info(file_name); throw; } }@] The above function is (almost) exception-neutral -- if an exception is emitted by any function call within the try block, parse_file does not need to do any real work, but it intercepts any boost::(:link - 1 - - 0 - - -30 - - - 2 - :) object, stores the file name, and re-throws using a throw-expression with no operand (15.1.6). The rationale for catching any boost::(:link - 1 - - 0 - - -30 - - - 2 - :) object is that the file name is relevant to any failure that occurs in parse_file, ''even if the failure is unrelated to file I/O''. As usual, the stored data can be retrieved using (:link - 1 - - 0 - - -36 + -26 2 :). - - - 0 - - -18 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link - 1 - - 0 - - -30 - - - 2 - :), or a type that derives (indirectly) from boost::(:link - 1 - - 0 - - -30 - - - 2 - :). !!!!Effects: 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 - - -19 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -20 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -21 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -22 - - - - 17 - 2 - (:auto !!!:) (:include synopsis:) The (:link - 1 - - 0 - - -22 - - - 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 - - -22 - - - 2 - :)'s operations do not throw. Two instances of (:link - 1 - - 0 - - -22 - - - 2 - :) are equivalent and compare equal if and only if they refer to the same exception. The default constructor of (:link - 1 - - 0 - - -22 - - - 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 - - -22 - - - 2 - :) references to the same exception object. * It is illegal for multiple threads to modify the same (:link - 1 - - 0 - - -22 - - - 2 - :) object concurrently. * While calling (:link - 1 - - 0 - - -7 - - - 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 - - -40 - - - 2 - :) concurrently to throw the same exception object into multiple threads. - - - - - 0 - - -23 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -24 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - 0 @@ -5516,103 +5639,18 @@ - 17 + 21 2 - (:auto !!!:) The following example demonstrates how errno can be stored in exception objects using Boost Exception: [@#include <(:link + (:auto !!!:) (:include synopsis:) !!!!Returns: This function returns a string value that is automatically composed from the string representations of all 1 0 - -41 + -23 2 - :)> #include <errno.h> #include <iostream> typedef boost::(:link - 1 - - 0 - - -9 - - - 2 - :)<struct tag_errno,int> errno_info; //(1) class my_error: public boost::(:link - 1 - - 0 - - -30 - - - 2 - :), public std::exception { }; //(2) void f() { throw my_error() << errno_info(errno); //(3) } @] First, we instantiate the (:link - 1 - - 0 - - -9 - - - 2 - :) template using a unique identifier -- tag_errno, and the type of the info it identifies -- int. This provides compile-time type safety for the various values stored in exception objects. Second, we define class my_error, which derives from boost::(:link - 1 - - 0 - - -30 - - - 2 - :). Finally, (3) illustrates how the typedef from (1) can be used with (:link - 1 - - 0 - - -5 - - - 2 - |operator<<:) to store values in exception objects at the point of the throw. The stored errno value can be recovered at a later time like this: [@// ...continued void g() { try { f(); } catch( my_error & x ) { if( boost::shared_ptr<int const> err=boost::(:link - 1 - - 0 - - -36 - - - 2 - :)<errno_info>(x) ) std::cerr << "Error code: " << *err; } }@] The (:link - 1 - - 0 - - -36 - - - 2 - :) function template is instantiated with the typedef from (1), and is passed an exception object of a polymorphic type. If the exception object contains the requested value, the returned (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:) will point to it; otherwise an empty (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:) is returned. - - - - - 0 - - -26 - - - - 27 - 2 - (:auto !!:) Some exception hierarchies can not be modified to make boost::(:link - 1 - - 0 - - -30 - - - 2 - :) a base type. In this case, the (:link + objects stored in a boost::(:link 1 0 @@ -5621,289 +5659,43 @@ 2 - :) function template can be used to make exception objects derive from boost::(:link - 1 - - 0 - - -30 - - - 2 - :) anyway. Here is an example: [@#include <(:link - 1 - - 0 - - -41 - - - 2 - :)> #include <stdexcept> typedef boost::(:link - 1 - - 0 - - -9 - - - 2 - :)<struct tag_std_range_min,size_t> std_range_min; typedef boost::(:link - 1 - - 0 - - -9 - - - 2 - :)<struct tag_std_range_max,size_t> std_range_max; typedef boost::(:link - 1 - - 0 - - -9 - - - 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 - - -37 - - - 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 - - -37 - - - 2 - :)<T> gets us an object of ''unspecified type'' which is guaranteed to derive from both boost::(:link - 1 - - 0 - - -30 - - - 2 - :) and T. This makes it possible to use (:link - 1 - - 0 - - -5 - - - 2 - mod="/":) to store additional information in the exception object. The exception can be intercepted as T &, so existing exception handling will not break. It can also be intercepted as boost::(:link - 1 - - 0 - - -30 - - - 2 - :) &, so that (:link - 1 - - 0 - - -28 - - - 2 - |more information can be added to the exception at a later time:). - - - - - 0 - - -27 - - - - 13 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must derive publicly from std::exception. !!!!Effects: * If BOOST_NO_EXCEPTIONS is not defined, boost::(:link - 1 - - 0 - - -27 - - - 2 - :)(e) is equivalent to throw boost::(:link - 1 - - 0 - - -38 - - - 2 - :)(boost::(:link - 1 - - 0 - - -37 - - - 2 - :)(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::(:link - 1 - - 0 - - -27 - - - 2 - :)(e) is equivalent to throw e; * If BOOST_NO_EXCEPTIONS is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of (:link - 1 - - 0 - - -27 - - - 2 - :) are allowed to assume that the function never returns; therefore, if the user-defined (:link - 1 - - 0 - - -27 - - - 2 - :) returns, the behavior is undefined. - - - - - 0 - - -28 - - - - 11 - 2 - (:auto !!:) All exception types that derive from boost::(:link - 1 - - 0 - - -30 - - - 2 - :) can be used as type-safe containers of arbitrary data objects, while complying with the no-throw requirements (15.5.1) of the ANSI C++ standard for exception types. Data can be added to a boost::(:link - 1 - - 0 - - -30 - - - 2 - :) at the time of the throw, or at a later time. (:include - 1 - - 0 - - -25 - - - 2 - :) (:include - 1 - - 0 - - -17 - - - 2 - :) (:include - 1 - - 0 - - -44 - - - 2 - :) - - - - - 0 - - -29 - - - - 17 - 2 - (:auto !!:) Boost Exception provides a namespace-scope function (:link - 1 - - 0 - - -15 - - - 2 - :) which takes a boost::(:link - 1 - - 0 - - -30 - - - 2 - :). The returned string contains: *the string representation of all data objects added to the boost::(:link - 1 - - 0 - - -30 - - - 2 :) through (:link 1 0 - -5 + -27 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 + mod="/":), along with other diagnostic information relevant to the exception. The string representation of each 1 0 - -41 + -23 2 - :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link + object is deduced by a function call that is bound at the time the (:link + 1 + + 0 + + -23 + + + 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 + + -23 + + + 2 + :)<Tag,T> (the return value is expected to be of type std::string.) #Unqualified call to to_string(x.(:link 1 0 @@ -5912,7 +5704,7 @@ 2 - :). void g() { try { f(); } catch( boost::(:link + mod="m":)()) (the return value is expected to be of type std::string.) #Unqualified call to s << x.(:link 1 0 @@ -5921,172 +5713,32 @@ 2 - :) & e ) { std::cerr << (:link + mod="m":)(), where s is a std::ostringstream. The first successfully bound function is used at the time 1 0 - -15 + -25 2 - :)(e); } }@] + is called; if all 3 overload resolutions are unsuccessful, the system is unable to convert the + 1 + + 0 + + -23 + + + 2 + object to string, and ''an unspecified stub string value is used without issuing a compile error.'' !!!!Notes: *The format of the returned string is unspecified. *The returned string is ''not'' user-friendly. *If dynamic_cast<std::exception const *>(&x) is not null, the returned string includes the output from std::exception::what. *The returned string may include additional platform-specific diagnostic information. 0 - -30 - - - - 13 - 2 - (:auto !!!:) (:include synopsis:) Class boost::(:link - 1 - - 0 - - -30 - - - 2 - :) is designed to be used as a universal base for user-defined exception types. An object of any type deriving from boost::(:link - 1 - - 0 - - -30 - - - 2 - :) can store data of arbitrary types, using the (:link - 1 - - 0 - - -9 - - - 2 - :) wrapper and (:link - 1 - - 0 - - -5 - - - 2 - mod="/":). To retrieve data from a boost::(:link - 1 - - 0 - - -30 - - - 2 - :) object, use the (:link - 1 - - 0 - - -36 - - - 2 - :) function template. - - - - - 0 - - -31 - - - - 11 - 2 - (:auto !!!:) Here is how cloning can be enabled in a throw-expression (15.1): [@#include <(:link - 1 - - 0 - - -10 - - - 2 - :)> #include <stdio.h> #include <errno.h> typedef boost::error_info<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link - 1 - - 0 - - -30 - - - 2 - :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::(:link - 1 - - 0 - - -38 - - - 2 - :)(file_read_error()) << errno_info(errno); }@] Of course, (:link - 1 - - 0 - - -38 - - - 2 - :) may be used with any exception type; there is no requirement that it should derive from boost::(:link - 1 - - 0 - - -30 - - - 2 - :). - - - - - 0 - - -32 - - - - 0 - - - - - 0 - - -33 - - - - 1 - 2 - (:auto !!!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -34 + -26 @@ -6099,55 +5751,611 @@ 0 - -35 + -27 - 0 + 7 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + 1 + + 0 + + -37 + + + 2 + :), or a type that derives (indirectly) from boost::(:link + 1 + + 0 + + -37 + + + 2 + :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link + 1 + + 0 + + -23 + + + 2 + :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) 0 - -39 + -28 - 5 + 17 2 - (:auto !!!:) (:include synopsis:) !!!!Effects: As if [@try { throw + (:auto !!!:) (:include synopsis:) The (:link 1 0 - -38 + -28 2 - (e); } catch(...) { return (:link + :) type can be used to refer to a copy of an exception object. It is Default Constructible, Copy Constructible, Assignable and Equality Comparable; (:link 1 0 - -7 + -28 2 - :)(); }@] + :)'s operations do not throw. Two instances of (:link + 1 + + 0 + + -28 + + + 2 + :) are equivalent and compare equal if and only if they refer to the same exception. The default constructor of (:link + 1 + + 0 + + -28 + + + 2 + :) produces the null value of the type. The null value is equivalent only to itself. !!!!Thread safety * It is legal for multiple threads to hold (:link + 1 + + 0 + + -28 + + + 2 + :) references to the same exception object. * It is illegal for multiple threads to modify the same (:link + 1 + + 0 + + -28 + + + 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 + + -8 + + + 2 + :) concurrently to throw the same exception object into multiple threads. 0 - -40 + -29 1 2 - (:auto !!!:) (:include synopsis:) !!!!Precondition: ep shall not be null. !!!!Throws: The exception to which ep refers. + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -30 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) !!!!Description: Returns a const reference to the copy of the value passed to (:link + 1 + + 0 + + -23 + + + 2 + :)'s constructor stored in the (:link + 1 + + 0 + + -23 + + + 2 + :) object. !!!!Throws: Nothing. + + + + + 0 + + -31 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -32 + + + + 17 + 2 + (:auto !!:) Boost Exception provides a namespace-scope function (:link + 1 + + 0 + + -25 + + + 2 + :) which takes a boost::(:link + 1 + + 0 + + -37 + + + 2 + :). The returned string contains: *the string representation of all data objects added to the boost::(:link + 1 + + 0 + + -37 + + + 2 + :) through (:link + 1 + + 0 + + -27 + + + 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 + + -14 + + + 2 + :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link + 1 + + 0 + + -37 + + + 2 + :). void g() { try { f(); } catch( boost::(:link + 1 + + 0 + + -37 + + + 2 + :) & e ) { std::cerr << (:link + 1 + + 0 + + -25 + + + 2 + :)(e); } }@] + + + + + 0 + + -33 + + + + 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 + + -37 + + + 2 + :), the returned object is of type T and is a copy of x. * Otherwise, the returned object is of an unspecified type that derives publicly from both T and boost::(:link + 1 + + 0 + + -37 + + + 2 + :). The T sub-object is initialized from x by the T copy constructor. !!!!Throws: Nothing. + + + + + 0 + + -34 + + + + 17 + 2 + (:auto !!!:) The following example demonstrates how errno can be stored in exception objects using Boost Exception: [@#include <(:link + 1 + + 0 + + -14 + + + 2 + :)> #include <errno.h> #include <iostream> typedef boost::(:link + 1 + + 0 + + -23 + + + 2 + :)<struct tag_errno,int> errno_info; //(1) class my_error: public boost::(:link + 1 + + 0 + + -37 + + + 2 + :), public std::exception { }; //(2) void f() { throw my_error() << errno_info(errno); //(3) } @] First, we instantiate the (:link + 1 + + 0 + + -23 + + + 2 + :) template using a unique identifier -- tag_errno, and the type of the info it identifies -- int. This provides compile-time type safety for the various values stored in exception objects. Second, we define class my_error, which derives from boost::(:link + 1 + + 0 + + -37 + + + 2 + :). Finally, (3) illustrates how the typedef from (1) can be used with (:link + 1 + + 0 + + -27 + + + 2 + |operator<<:) to store values in exception objects at the point of the throw. The stored errno value can be recovered at a later time like this: [@// ...continued void g() { try { f(); } catch( my_error & x ) { if( boost::shared_ptr<int const> err=boost::(:link + 1 + + 0 + + -41 + + + 2 + :)<errno_info>(x) ) std::cerr << "Error code: " << *err; } }@] The (:link + 1 + + 0 + + -41 + + + 2 + :) function template is instantiated with the typedef from (1), and is passed an exception object of a polymorphic type. If the exception object contains the requested value, the returned (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:) will point to it; otherwise an empty (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:) is returned. + + + + + 0 + + -35 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + 1 + + 0 + + -37 + + + 2 + :), or a type that derives (indirectly) from boost::(:link + 1 + + 0 + + -37 + + + 2 + :). !!!!Effects: Equivalent to x << v.(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements|get:)<0>() << ... << v.(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements|get:)<N>(). !!!!Returns: x. (:include throws:) + + + + + 0 + + -36 + + + + 27 + 2 + (:auto !!:) Some exception hierarchies can not be modified to make boost::(:link + 1 + + 0 + + -37 + + + 2 + :) a base type. In this case, the (:link + 1 + + 0 + + -33 + + + 2 + :) function template can be used to make exception objects derive from boost::(:link + 1 + + 0 + + -37 + + + 2 + :) anyway. Here is an example: [@#include <(:link + 1 + + 0 + + -14 + + + 2 + :)> #include <stdexcept> typedef boost::(:link + 1 + + 0 + + -23 + + + 2 + :)<struct tag_std_range_min,size_t> std_range_min; typedef boost::(:link + 1 + + 0 + + -23 + + + 2 + :)<struct tag_std_range_max,size_t> std_range_max; typedef boost::(:link + 1 + + 0 + + -23 + + + 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 + + -33 + + + 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 + + -33 + + + 2 + :)<T> gets us an object of ''unspecified type'' which is guaranteed to derive from both boost::(:link + 1 + + 0 + + -37 + + + 2 + :) and T. This makes it possible to use (:link + 1 + + 0 + + -27 + + + 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 + + -37 + + + 2 + :) &, so that (:link + 1 + + 0 + + -40 + + + 2 + |more information can be added to the exception at a later time:). + + + + + 0 + + -37 + + + + 13 + 2 + (:auto !!!:) (:include synopsis:) Class boost::(:link + 1 + + 0 + + -37 + + + 2 + :) is designed to be used as a universal base for user-defined exception types. An object of any type deriving from boost::(:link + 1 + + 0 + + -37 + + + 2 + :) can store data of arbitrary types, using the (:link + 1 + + 0 + + -23 + + + 2 + :) wrapper and (:link + 1 + + 0 + + -27 + + + 2 + mod="/":). To retrieve data from a boost::(:link + 1 + + 0 + + -37 + + + 2 + :) object, use the (:link + 1 + + 0 + + -41 + + + 2 + :) function template. @@ -6158,9 +6366,56 @@ - 21 + 0 + + + + + 0 + + -40 + + + + 11 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 !!:) All exception types that derive from boost::(:link + 1 + + 0 + + -37 + + + 2 + :) can be used as type-safe containers of arbitrary data objects, while complying with the no-throw requirements (15.5.1) of the ANSI C++ standard for exception types. Data can be added to a boost::(:link + 1 + + 0 + + -37 + + + 2 + :) at the time of the throw, or at a later time. (:include + 1 + + 0 + + -34 + + + 2 + :) (:include + 1 + + 0 + + -47 + + + 2 + :) (:include 1 0 @@ -6169,61 +6424,38 @@ 2 - :) support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link + :) + + + + + 0 + + -45 + + + + 7 + 2 + (:auto !!!:) (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link 1 0 - -38 + -37 2 - :)(my_exception());@] Unless (:link + :) object. * Copy constructor: initializes a boost::(:link 1 0 - -38 + -37 2 - :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link - 1 - - 0 - - -7 - - - 2 - :) may return an (:link - 1 - - 0 - - -22 - - - 2 - :) which refers to an instance of (:link - 1 - - 0 - - -11 - - - 2 - :). See (:link - 1 - - 0 - - -7 - - - 2 - :) for details. !!!!Note: Instead of using the throw keyword directly, it is preferable to call boost::(:link + :) object which shares ownership with x of all data added through (:link 1 0 @@ -6232,25 +6464,7 @@ 2 - :). This is guaranteed to throw an exception that derives from boost::(:link - 1 - - 0 - - -30 - - - 2 - :) and supports the (:link - 1 - - 0 - - -22 - - - 2 - :) functionality. + mod="/":), including data that is added at a future time. !!!!Throws: Nothing. @@ -6260,6 +6474,346 @@ -41 + + 13 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link + 1 + + 0 + + -23 + + + 2 + :) template. * E must be polymorphic. * The (:link + 1 + + 0 + + -41 + + + 2 + :) function must not be called outside of a catch block. !!!!Returns: * If dynamic_cast<boost::(:link + 1 + + 0 + + -37 + + + 2 + :) const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is an empty shared_ptr. * Otherwise, the returned shared_ptr points to the stored value (use (:link + 1 + + 0 + + -27 + + + 2 + mod="/":) to store values in exception objects.) The shared_ptr is valid even after x has been destroyed. !!!!Throws: Nothing. !!!!Note: The interface of (:link + 1 + + 0 + + -41 + + + 2 + :) may be affected by the build (:link + 1 + + 0 + + -24 + + + 2 + :). + + + + + 0 + + -42 + + + + 7 + 2 + (:auto !!!:) (:include synopsis:) This macro takes an exception object, records BOOST_CURRENT_FUNCTION, __FILE__ and __LINE__ in it, and forwards it to + 1 + + 0 + + -5 + + + 2 + . To recover this information at the catch site, use + 1 + + 0 + + -41 + + + 2 + ; the information is also included in the message returned by + 1 + + 0 + + -25 + + + 2 + . + + + + + 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 + + -9 + + + 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 + + -5 + + + 2 + :) are guaranteed to derive from boost::(:link + 1 + + 0 + + -37 + + + 2 + :) and to support cloning. (:include + 1 + + 0 + + -20 + + + 2 + :) (:include + 1 + + 0 + + -46 + + + 2 + :) + + + + + 0 + + -46 + + + + 37 + 2 + (:auto !!!:) When you catch an exception, you can call (:link + 1 + + 0 + + -6 + + + 2 + :) to get an (:link + 1 + + 0 + + -28 + + + 2 + :) object: [@#include <(:link + 1 + + 0 + + -29 + + + 2 + :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link + 1 + + 0 + + -37 + + + 2 + :)s void worker_thread( boost::(:link + 1 + + 0 + + -28 + + + 2 + :) & error ) { try { do_work(); error = boost::(:link + 1 + + 0 + + -28 + + + 2 + :)(); } catch( ... ) { error = boost::(:link + 1 + + 0 + + -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 + + -8 + + + 2 + :) function: [@// ...continued void work() { boost::(:link + 1 + + 0 + + -28 + + + 2 + :) error; boost::(:link http://www.boost.org/doc/html/boost/thread.html|thread:) t( boost::(:link http://www.boost.org/libs/bind/bind.html|bind:)(worker_thread,boost::(:link http://www.boost.org/doc/html/ref.html|ref:)(error)) ); t.(:link http://www.boost.org/doc/html/boost/thread.html|join:)(); if( error ) boost::(:link + 1 + + 0 + + -8 + + + 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 + + -28 + + + 2 + :) points to an instance of std::bad_alloc, or * if (:link + 1 + + 0 + + -9 + + + 2 + :) was not used in the throw-expression passed to the original throw statement and the current implementation does not have the necessary compiler-specific support to copy the exception automatically, in which case the returned (:link + 1 + + 0 + + -28 + + + 2 + :) points to an instance of (:link + 1 + + 0 + + -15 + + + 2 + :). Regardless, the use of (:link + 1 + + 0 + + -6 + + + 2 + :) and (:link + 1 + + 0 + + -8 + + + 2 + :) in the above examples is well-formed. + + + + + 0 + + -44 + + 1 2 @@ -6273,50 +6827,6 @@ -43 - - 1 - 2 - (:auto !!!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -37 - - - - 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 - - -30 - - - 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 - - -30 - - - 2 - :). The T sub-object is initialized from x by the T copy constructor. !!!!Throws: Nothing. - - - - - 0 - - -42 - - 1 2 @@ -6327,134 +6837,94 @@ 0 - -36 + -47 - 13 + 19 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link + (:auto !!!:) Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Let's say we have an exception type file_read_error, which takes a file name in its constructor. Consider the following function: [@void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error(????); }@] How can the file_read function pass a file name to the exception type constructor? All it has is a FILE handle. Using boost:: 1 0 - -9 + -37 2 - :) template. * E must be polymorphic. * The (:link + allows us to free the file_read function from the burden of storing the file name in exceptions it throws: [@#include <(:link 1 0 - -36 + -14 2 - :) function must not be called outside of a catch block. !!!!Returns: * If dynamic_cast<boost::(:link + :)> #include <stdio.h> #include <errno.h> typedef boost::(:link 1 0 - -30 + -23 2 - :) const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is an empty shared_ptr. * Otherwise, the returned shared_ptr points to the stored value (use (:link + :)<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link 1 0 - -5 + -37 2 - mod="/":) to store values in exception objects.) The shared_ptr is valid even after x has been destroyed. !!!!Throws: Nothing. !!!!Note: The interface of (:link + :) { }; 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 - -36 + -14 2 - :) may be affected by the build (:link + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> typedef boost::(:link 1 0 - -8 + -23 2 - :). - - - - - 0 - - -44 - - - - 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 + :)<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 - -19 + -37 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link + :) & 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 - -9 + -37 2 - :)<struct tag_file_name,std::string> file_name_info; typedef boost::(:link + :) 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 - -9 + -37 2 - :)<struct tag_function,char const *> function_info; typedef boost::(:link - 1 - - 0 - - -9 - - - 2 - :)<struct tag_errno,int> errno_info; typedef boost::tuple<function_info,errno_info> clib_failure; class file_open_error: public boost::(:link - 1 - - 0 - - -30 - - - 2 - :) { }; boost::shared_ptr<FILE> file_open( char const * name, char const * mode ) { if( FILE * f=fopen(name,mode) ) return boost::shared_ptr<FILE>(f,fclose); else throw file_open_error() << file_name_info(name) << clib_failure("fopen",errno); }@] Note that the members of a boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) are stored separately in exception objects; they can only be retrieved individually, using (:link - 1 - - 0 - - -36 - - - 2 - :). + :) object is that the file name is relevant to any failure that occurs in parse_file, ''even if the failure is unrelated to file I/O''. @@ -6464,13 +6934,13 @@ throws - 49 + 52 reno_layer - 40 + 43 0 @@ -6479,9 +6949,7 @@ - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. + 0 @@ -6602,7 +7070,9 @@ - 0 + 1 + 2 + !!!!Throws: Any exception emitted by v's copy constructor. @@ -6624,9 +7094,7 @@ - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. + 0 @@ -6725,7 +7193,9 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. @@ -6813,58 +7283,16 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. 0 - -39 - - - - 0 - - - - - 0 - - -40 - - - - 0 - - - - - 0 - - -38 - - - - 0 - - - - - 0 - - -41 - - - - 0 - - - - - 0 - - -43 + -36 @@ -6882,6 +7310,50 @@ 0 + + + 0 + + -38 + + + + 0 + + + + + 0 + + -40 + + + + 0 + + + + + 0 + + -45 + + + + 0 + + + + + 0 + + -41 + + + + 0 + + 0 @@ -6897,7 +7369,18 @@ 0 - -36 + -39 + + + + 0 + + + + + 0 + + -46 @@ -6915,6 +7398,28 @@ 0 + + + 0 + + -43 + + + + 0 + + + + + 0 + + -47 + + + + 0 + + @@ -6922,13 +7427,13 @@ synopsis - 50 + 53 reno_layer - 40 + 43 0 @@ -6944,11 +7449,11 @@ 0 - -10 + -26 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + :)> [@namespace boost { (:include decl:) }@] @@ -6959,7 +7464,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -29 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -6977,7 +7493,7 @@ 0 - -20 + -29 2 @@ -6992,7 +7508,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -29 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7005,16 +7532,16 @@ 3 2 - `#include <(:link + `#include < 1 0 - -10 + -12 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] + > [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7027,16 +7554,16 @@ 3 2 - [@#include <(:link + [@#include <string> namespace boost { (:include 1 0 - -24 + -37 2 - :)> #include <boost/current_function.hpp> #include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] + decl pre_indent="4":) (:include api pre_indent="4":) }@] @@ -7049,16 +7576,16 @@ 3 2 - `#include <(:link + [@#include < 1 0 - -20 + -18 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + > namespace boost { (:include api pre_indent="4":) }@] @@ -7069,7 +7596,18 @@ - 0 + 3 + 2 + [@#include < + 1 + + 0 + + -18 + + + 2 + > namespace boost { (:include api pre_indent="4":) }@] @@ -7080,7 +7618,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -43 + + + 2 + :)> [@(:include decl:)@] @@ -7091,18 +7640,9 @@ - 3 + 1 2 - `#include < - 1 - - 0 - - -23 - - - 2 - > (:include decl:) + [@(:include api:)@] @@ -7120,11 +7660,11 @@ 0 - -42 + -29 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7135,7 +7675,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -43 + + + 2 + :)> [@(:include decl:)@] @@ -7157,27 +7708,9 @@ - 5 + 1 2 - `#include <(:link - 1 - - 0 - - -19 - - - 2 - :)> [@namespace boost { (:include - 1 - - 0 - - -18 - - - 2 - decl pre_indent="4":) }@] + [@namespace boost { (:include api pre_indent="4":) }@] @@ -7188,9 +7721,7 @@ - 1 - 2 - [@#include <boost/tuple/tuple.hpp> namespace boost { (:include api pre_indent="4":) }@] + 0 @@ -7201,18 +7732,7 @@ - 3 - 2 - [@#include <(:link - 1 - - 0 - - -24 - - - 2 - :)> namespace boost { (:include api pre_indent="4":) }@] + 0 @@ -7236,18 +7756,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -20 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -7258,9 +7767,18 @@ - 1 + 3 2 - (:include api:) + `#include <(:link + 1 + + 0 + + -43 + + + 2 + :)> [@namespace boost { (:include def pre_indent="4":) }@] @@ -7271,9 +7789,7 @@ - 1 - 2 - [@namespace boost { (:include api pre_indent="4":) }@] + 0 @@ -7284,7 +7800,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -10 + + + 2 + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7295,7 +7822,9 @@ - 0 + 1 + 2 + (:include api:) @@ -7313,11 +7842,11 @@ 0 - -23 + -43 2 - :)> [@namespace boost { (:include decl:) }@] + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7328,7 +7857,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -29 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7339,7 +7879,18 @@ - 0 + 3 + 2 + [@#include <(:link + 1 + + 0 + + -18 + + + 2 + :)> namespace boost { (:include api pre_indent="4":) }@] @@ -7357,11 +7908,11 @@ 0 - -24 + -43 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] + :)> [@(:include decl:)@] @@ -7372,7 +7923,9 @@ - 0 + 1 + 2 + [@#include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] @@ -7393,96 +7946,6 @@ -33 - - 3 - 2 - [@#include < - 1 - - 0 - - -24 - - - 2 - > namespace boost { (:include api pre_indent="4":) }@] - - - - - 0 - - -34 - - - - 1 - 2 - [@#include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] - - - - - 0 - - -35 - - - - 0 - - - - - 0 - - -39 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -20 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -40 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -20 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -38 - - 3 2 @@ -7491,7 +7954,7 @@ 0 - -33 + -11 2 @@ -7502,35 +7965,53 @@ 0 - -41 + -34 - 1 - 2 - [@(:include api:)@] + 0 0 - -43 + -35 - 3 + 5 2 - [@#include < + `#include <(:link 1 0 - -24 + -44 2 - > namespace boost { (:include api pre_indent="4":) }@] + :)> [@namespace boost { (:include + 1 + + 0 + + -35 + + + 2 + decl pre_indent="4":) }@] + + + + + 0 + + -36 + + + + 0 @@ -7540,6 +8021,61 @@ -37 + + 3 + 2 + `#include <(:link + 1 + + 0 + + -18 + + + 2 + :)> [@namespace boost { (:include def pre_indent="4":) }@] + + + + + 0 + + -38 + + + + 0 + + + + + 0 + + -40 + + + + 0 + + + + + 0 + + -45 + + + + 0 + + + + + 0 + + -41 + + 3 2 @@ -7548,7 +8084,7 @@ 0 - -43 + -31 2 @@ -7565,38 +8101,38 @@ 3 2 - [@#include <string> namespace boost { (:include + `#include < 1 0 - -30 + -26 2 - decl pre_indent="4":) (:include api pre_indent="4":) }@] + > (:include decl:) 0 - -36 + -39 - 3 - 2 - `#include < - 1 - - 0 - - -34 - - - 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] + 0 + + + + + 0 + + -46 + + + + 0 @@ -7606,6 +8142,41 @@ -44 + + 1 + 2 + [@#include <boost/tuple/tuple.hpp> namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -43 + + + + 3 + 2 + [@#include <(:link + 1 + + 0 + + -18 + + + 2 + :)> #include <boost/current_function.hpp> #include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -47 + + 0 @@ -7620,14 +8191,14 @@ - 51 + 54 reno_context_map - 40 + 43 -5 @@ -7722,37 +8293,46 @@ -35 - -39 - - - -40 - - - -38 - - - -41 - - - -43 + -36 -37 + + -38 + + + -40 + + + -45 + + + -41 + -42 - -36 + -39 + + + -46 -44 + + -43 + + + -47 + - 40 + 43 @@ -7767,7 +8347,7 @@ - -35 + -38 @@ -7784,7 +8364,7 @@ - -13 + -39 @@ -7801,7 +8381,7 @@ - -28 + -40 @@ -7818,7 +8398,7 @@ - -32 + -17 @@ -7835,7 +8415,7 @@ - -43 + -11 @@ -7852,7 +8432,7 @@ - -33 + -12 @@ -7860,27 +8440,55 @@ 2 - 391956879B098B05CB774BAD3285881434482FD633818A579F7183052E6BAD09 - 1787869209 - 3656 - 504 - BB8AF986C96801345719855FEA083AF5684FBC349F6520E150F19A6370019265 - 3731478139 - 686 - 2964 + 00067869F918D0E8905D8A464C17FA9DAD9F497B3A172EB360239EEB5778A206 + 3465219615 + 4025 + 518 + 6E325144EF4F41FA3A225EB30729101382C4E99B3D6160E307311E4B4E641010 + 1097215175 + 161 + 240 0 - ../../../../boost/exception/get_error_info.hpp + ../../../../boost/exception/info.hpp 0 0 - -36 + -16 + + + + + + + 2 + 00067869F918D0E8905D8A464C17FA9DAD9F497B3A172EB360239EEB5778A206 + 3465219615 + 4025 + 518 + D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 + 4055211476 + 525 + 3494 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + -27 @@ -7904,7 +8512,7 @@ - -20 + -29 @@ -7928,7 +8536,7 @@ - -16 + -46 @@ -7936,9 +8544,9 @@ 1 - 7CAF5D62B1ED0802B65B428119DBDD84C352A24A98EB167E1B0681F3E8DD7628 - 3711957388 - 3837 + F6C6B72C2CDEBC5E3EAA924F637563A8F8A95684AF6EEF39FE2260C86C77F531 + 2151348977 + 3846 323 @@ -7952,7 +8560,7 @@ - -34 + -31 @@ -7976,31 +8584,35 @@ - -26 + -36 - 1 - 8DC5E3F51F580F74905ADF7542CBFBE23989808ACFF69E8C2B98B5092C633B42 - 378737885 - 4007 - 323 + 2 + E8AFD260BD0196A516F0E29A9FE6D09BF84B37D31E228910E3370365CAA4AB43 + 3229661566 + 3665 + 504 + BB8AF986C96801345719855FEA083AF5684FBC349F6520E150F19A6370019265 + 3731478139 + 686 + 2973 0 - ../../../../boost/exception/info.hpp + ../../../../boost/exception/get_error_info.hpp 0 0 - -10 + -41 @@ -8024,7 +8636,7 @@ - -14 + -42 @@ -8052,7 +8664,7 @@ - -15 + -25 @@ -8076,7 +8688,7 @@ - -29 + -32 @@ -8100,7 +8712,7 @@ - -41 + -14 @@ -8124,7 +8736,7 @@ - -42 + -10 @@ -8152,7 +8764,7 @@ - -27 + -5 @@ -8184,7 +8796,7 @@ - -8 + -24 @@ -8212,7 +8824,71 @@ - -9 + -23 + + + + + + + 3 + 126BB1D8971585CBE7D78EF3C12259D72FD5E973A84626AA9FC3234220A11CAB + 3471702891 + 969 + 344 + A7FD310E1340E103081DA2A7899DA0E213C696C84D52C17ADA09F6942EE97D47 + 2978648279 + 530 + 433 + 38B566F2C6678B8724D18086A6F76E077DC2ADC1BB69A4B83BF0A2C3B7D31B50 + 2218658069 + 31 + 143 + + + + + + 0 + ../../../../boost/exception/detail/error_info_impl.hpp + 0 + 0 + + + + -13 + + + + + + + 3 + 126BB1D8971585CBE7D78EF3C12259D72FD5E973A84626AA9FC3234220A11CAB + 3471702891 + 969 + 344 + A7FD310E1340E103081DA2A7899DA0E213C696C84D52C17ADA09F6942EE97D47 + 2978648279 + 530 + 433 + 02372FA6B987EAC15E78C5A12036F203A92B3D4C857C02985B1BF0A24008D976 + 2987989218 + 109 + 259 + + + + + + 0 + ../../../../boost/exception/detail/error_info_impl.hpp + 0 + 0 + + + + -30 @@ -8236,7 +8912,7 @@ - -24 + -18 @@ -8264,7 +8940,7 @@ - -12 + -19 @@ -8292,7 +8968,7 @@ - -38 + -9 @@ -8320,7 +8996,7 @@ - -37 + -33 @@ -8348,7 +9024,7 @@ - -30 + -37 @@ -8380,7 +9056,7 @@ - -6 + -45 @@ -8404,7 +9080,7 @@ - -19 + -44 @@ -8428,7 +9104,7 @@ - -23 + -26 @@ -8452,7 +9128,7 @@ - -31 + -20 @@ -8476,7 +9152,7 @@ - -17 + -47 @@ -8504,7 +9180,7 @@ - -7 + -6 @@ -8532,7 +9208,7 @@ - -22 + -28 @@ -8560,7 +9236,7 @@ - -11 + -15 @@ -8588,7 +9264,7 @@ - -40 + -8 @@ -8616,7 +9292,7 @@ - -39 + -7 @@ -8672,7 +9348,7 @@ - -18 + -35 @@ -8696,7 +9372,7 @@ - -25 + -34 @@ -8720,22 +9396,18 @@ - -44 + -22 - 2 - 8C77439A1F52A50CF8C4131A44CC7FA9CF5E02508CB32C4FF40B565613A396F4 - 476106477 - 3812 - 518 - D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 - 4055211476 - 525 - 3281 + 1 + 3D40DD88A1E41D75BC79CA8DACC35BEE2A16A64422AC8E6BE0D61169D9360EF7 + 4184757263 + 4220 + 323 @@ -8748,7 +9420,7 @@ - -5 + -43 @@ -8758,14 +9430,14 @@ - 52 + 55 tag_index - 40 + 43 1 @@ -8779,7 +9451,7 @@ -5 - error_info free function + free function @@ -8788,7 +9460,7 @@ -6 - function + exception_ptr free function @@ -8799,6 +9471,15 @@ exception_ptr free function + + + 0 + + -8 + + + exception_ptr free function + 0 @@ -8806,7 +9487,7 @@ -9 - type + exception_ptr free function @@ -8824,7 +9505,7 @@ -11 - exception_ptr type + error_info @@ -8833,7 +9514,7 @@ -12 - function + exception_ptr @@ -8842,7 +9523,7 @@ -13 - tutorial + type @@ -8860,7 +9541,7 @@ -15 - diagnostic_information free function + exception_ptr type @@ -8869,7 +9550,7 @@ -16 - noalso noindex tutorial + function member @@ -8878,7 +9559,7 @@ -17 - noalso noindex tutorial + index noindex @@ -8887,7 +9568,7 @@ -18 - error_info free function + @@ -8896,7 +9577,7 @@ -19 - + function @@ -8905,7 +9586,7 @@ -20 - + noalso noindex tutorial @@ -8923,7 +9604,7 @@ -22 - type + noalso noindex tutorial @@ -8932,16 +9613,7 @@ -23 - - - - - 0 - - -24 - - - + type @@ -8950,7 +9622,7 @@ -25 - noalso noindex tutorial + diagnostic_information free function @@ -8959,7 +9631,7 @@ -26 - tutorial + @@ -8968,7 +9640,7 @@ -27 - free function + error_info free function @@ -8977,7 +9649,7 @@ -28 - tutorial + type @@ -8986,7 +9658,7 @@ -29 - diagnostic_information tutorial + @@ -8995,7 +9667,7 @@ -30 - type + function member @@ -9004,7 +9676,7 @@ -31 - noalso noindex tutorial + error_info @@ -9013,7 +9685,7 @@ -32 - index noindex + diagnostic_information tutorial @@ -9022,7 +9694,7 @@ -33 - exception_ptr + error_info free function @@ -9031,7 +9703,7 @@ -34 - error_info + noalso noindex tutorial @@ -9040,25 +9712,25 @@ -35 - noindex + error_info free function 0 - -39 + -36 - exception_ptr free function + tutorial 0 - -40 + -37 - exception_ptr free function + type @@ -9067,7 +9739,25 @@ -38 - exception_ptr free function + noindex + + + + 0 + + -40 + + + tutorial + + + + 0 + + -45 + + + function @@ -9076,24 +9766,6 @@ -41 - - - - - 0 - - -43 - - - error_info - - - - 0 - - -37 - - error_info free function @@ -9109,10 +9781,19 @@ 0 - -36 + -39 - error_info free function + tutorial + + + + 0 + + -46 + + + noalso noindex tutorial @@ -9121,6 +9802,24 @@ -44 + + + + + 0 + + -43 + + + + + + + 0 + + -47 + + noalso noindex tutorial diff --git a/doc/tutorial_transporting_data.html b/doc/tutorial_transporting_data.html index 59b1189..f874bf6 100644 --- a/doc/tutorial_transporting_data.html +++ b/doc/tutorial_transporting_data.html @@ -62,41 +62,15 @@ g()

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

Adding of Arbitrary Data to Active Exception Objects

-

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

-
#include <stdio.h>
-#include <string>
-        
-class
-file_read_error
-    {
-    public:
-
-    explicit
-    file_read_error( std::string const & fn ):
-        fn_(fn)
-        {
-        };
-
-    std::string const &
-    file_name() const
-        {
-        return fn_;
-        }
-
-    private:
-
-    std::string fn_;
-    };
-
-void
+

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("????");
+        throw file_read_error(????);
     }
-

We have defined an exception class file_read_error which can store a file name, so that when we catch a file_read_error object, we know which file the failure is related to. However, the file_read function does not have the file name at the time of the throw; all it has is a FILE handle.

-

One possible solution is to not use FILE handles directly. We could have our own class file which stores both a FILE handle and a file name, and pass that to file_read. However, this could be problematic if we communicate with 3rd party code that does not use our class file (probably because they have their own similar class.)

-

A better solution is to make class file_read_error derive (possibly indirectly) from boost::exception, and free the file_read function from the burden of storing the file name in exceptions it throws:

+

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 <stdio.h>
 #include <errno.h>
@@ -140,7 +114,6 @@ parse_file( char const * file_name )
         }
     }

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

-

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

Adding Grouped Data to Exceptions

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: