diff --git a/doc/Configuration.html b/doc/Configuration.html new file mode 100644 index 0000000..096904c --- /dev/null +++ b/doc/Configuration.html @@ -0,0 +1,55 @@ + + + + + Configuration + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

Configuration

+
+

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. Defining either macro does not have an observable degrading effect on the library functionality, except for the following:

+

By default, the get_error_info function template can be called with any exception type. If BOOST_NO_RTTI is defined, get_error_info can be used only with objects of type boost::exception.

+

Note: the configuration where BOOST_NO_RTTI is defined but BOOST_NO_TYPEID is not defined is specific for MSVC compilers; it reduces RTTI overhead without fully disabling std::type_info. For most (all?) other compilers, to use Boost Exception without RTTI, both BOOST_NO_RTTI and BOOST_NO_TYPEID must be defined.

+

BOOST_EXCEPTION_DISABLE

+

By default, enable_current_exception and enable_error_info are integrated directly in the throw_exception function. Defining BOOST_EXCEPTION_DISABLE disables this integration.

+

Note that on some non-conformant compilers, for example MSVC 7.0 and older, as well as BCC, BOOST_EXCEPTION_DISABLE is implicitly defined in boost/throw_exception.hpp.

+
+ + + + +
+
+
+ + diff --git a/doc/boost-exception.html b/doc/boost-exception.html index ca85896..5a39d5a 100644 --- a/doc/boost-exception.html +++ b/doc/boost-exception.html @@ -49,6 +49,7 @@
  • diagnostic_information
  • throw_exception, BOOST_THROW_EXCEPTION
  • +
  • Configuration
  • Headers
    1. boost/exception.hpp
    2. boost/exception/diagnostic_information.hpp
    3. boost/exception/error_info.hpp
    4. @@ -262,6 +263,8 @@ boost

    Throws:

    Nothing.

    +

    Note:

    +

    The interface of get_error_info may be affected by the build Configuration.

    enable_error_info

    #include <boost/exception/exception.hpp>

    diff --git a/doc/enable_current_exception.html b/doc/enable_current_exception.html index 4bfe80e..decb0ff 100644 --- a/doc/enable_current_exception.html +++ b/doc/enable_current_exception.html @@ -49,6 +49,7 @@ throw boost::enab

    See Also:


    See Also:

    diff --git a/doc/name_idx.html b/doc/name_idx.html index c697a35..3a3554f 100644 --- a/doc/name_idx.html +++ b/doc/name_idx.html @@ -34,6 +34,8 @@

    boost/exception/info_tuple.hpp

    boost/exception_ptr.hpp

    boost/throw_exception.hpp

    +

    C

    +

    Configuration

    c

    copy_exception

    current_exception

    diff --git a/doc/source/boost-exception.reno b/doc/source/boost-exception.reno index a3507ea..01e1547 100644 --- a/doc/source/boost-exception.reno +++ b/doc/source/boost-exception.reno @@ -39,7 +39,7 @@ - 37 + 38 0 @@ -48,6 +48,102 @@ reno_context + + + + + + 3 + 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A + 1770110914 + 587 + 1566 + 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D + 3929437933 + 361 + 213 + CD1241D84950468704F3C3F04116B8DA5162A8BEA4364F10951232F49113C5DE + 1658463867 + 121 + 238 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>Configuration</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 6 + + 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 + + 7 + + reno_context + @@ -93,7 +189,56 @@ 0 - 6 + 8 + + reno_context + + + + + + + 2 + 86E1196533E771AEFD141DA43FCD980AE3D7689A45EDD54A2DF28B1943E0E7DB + 941210061 + 8706 + 487 + 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 + 2078296250 + 305 + 8138 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>copy_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 9 reno_context @@ -142,7 +287,7 @@ 0 - 7 + 10 reno_context @@ -191,7 +336,7 @@ 0 - 8 + 11 reno_context @@ -240,7 +385,7 @@ 0 - 9 + 12 reno_context @@ -285,7 +430,7 @@ 0 - 10 + 13 reno_context @@ -330,7 +475,7 @@ 0 - 11 + 14 reno_context @@ -379,7 +524,7 @@ 0 - 12 + 15 reno_context @@ -428,7 +573,7 @@ 0 - 13 + 16 reno_context @@ -477,7 +622,7 @@ 0 - 14 + 17 reno_context @@ -520,7 +665,7 @@ 0 - 15 + 18 reno_context @@ -530,40 +675,42 @@ 1 - F4C951B28F7DE500973AA3DFAA99F2BADA6EDAFA2B406C30BEF3B7FBE6FD57D7 - 2263754923 - 982 - 306 + 50E48ABD58B427E16B2EFA345D5FE67159057CB90F19AA1AD52C11991FD8500E + 4076172629 + 8577 + 323 0 - ../../example/error_info_2.cpp + ../../../../boost/exception/exception.hpp 0 0 - <string>adding of arbitrary data to active exception objects</string> + <string>boost/exception/exception.hpp</string> - adding_data_later + exception_exception_hpp - 0 + 1 + 2 + (:include include:) (:auto also:) 0 - 16 + 19 reno_context @@ -612,7 +759,52 @@ 0 - 17 + 20 + + 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 + + 21 reno_context @@ -650,7 +842,7 @@ 0 - 18 + 22 reno_context @@ -699,7 +891,52 @@ 0 - 19 + 23 + + reno_context + + + + + + + 1 + 17FF6C63843EE64ED66CB038DD95B4C4D6BA1B0FD36B27BEFD84A909161D2853 + 1237535165 + 231 + 1255 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>BOOST_THROW_EXCEPTION</string> + + + + + + + + + 1 + 2 + (:include include:) (:pagelist link="backlink":) + + + + + 0 + + 24 reno_context @@ -748,7 +985,7 @@ 0 - 20 + 25 reno_context @@ -801,7 +1038,7 @@ 0 - 21 + 26 reno_context @@ -850,7 +1087,7 @@ 0 - 22 + 27 reno_context @@ -895,7 +1132,7 @@ 0 - 23 + 28 reno_context @@ -924,14 +1161,14 @@ - 107 + 109 2 !!Introduction The purpose of Boost Exception is to ease the design of exception class hierarchies and to help write exception handling and error reporting code. It supports transporting of arbitrary data to the catch site, which is otherwise tricky due to the no-throw requirements (15.5.1) for exception types. Data can be added to any exception object, either directly in the throw-expression (15.1), or at a later time as the exception object propagates up the call stack. The ability to add data to exception objects after they have been passed to throw is important, because often some of the information needed to handle an exception is unavailable in the context where the failure is detected. Boost Exception also supports (:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:)-style (:link 1 0 - 24 + 29 reno_context @@ -965,7 +1202,7 @@ 0 - 25 + 30 reno_context @@ -1010,7 +1247,7 @@ 0 - -17 + -21 2 @@ -1019,39 +1256,7 @@ 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 - - + -20 2 @@ -1060,7 +1265,7 @@ 0 - -24 + -29 2 @@ -1069,7 +1274,7 @@ 0 - -10 + -13 2 @@ -1078,7 +1283,7 @@ 0 - 27 + 31 reno_context @@ -1123,7 +1328,7 @@ 0 - 28 + 32 reno_context @@ -1165,6 +1370,15 @@ 2 :) ###(:link 1 + + 0 + + -10 + + + 2 + :) ###(:link + 1 0 @@ -1177,7 +1391,7 @@ 0 - -5 + -26 2 @@ -1186,11 +1400,11 @@ 0 - -21 + -24 2 - :) ###(:link + :) ##(:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:) Transporting of Exceptions between Threads ###(:link 1 0 @@ -1199,7 +1413,34 @@ 2 - :) ##(:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:) Transporting of Exceptions between Threads ###(:link + :) ###(:link + 1 + + 0 + + -14 + + + 2 + :) ###(:link + 1 + + 0 + + -15 + + + 2 + :) ###(:link + 1 + + 0 + + -8 + + + 2 + :) ###(:link 1 0 @@ -1213,11 +1454,47 @@ 0 - -11 + -22 2 - :) ###(:link + :) ##(:link + 1 + + 0 + + -9 + + + 2 + :) ##(:link + 1 + + 0 + + -30 + + + 2 + :), (:link + 1 + + 0 + + -23 + + + 2 + :) ##(:link + 1 + + 0 + + -5 + + + 2 + :) ##Headers ###(:link 1 0 @@ -1231,138 +1508,7 @@ 0 - 29 - - reno_context - - - - - - - 2 - 86E1196533E771AEFD141DA43FCD980AE3D7689A45EDD54A2DF28B1943E0E7DB - 941210061 - 8706 - 487 - 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 - 2078296250 - 305 - 8138 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>copy_exception</string> - - - - - - - - 2 - :) ###(:link - 1 - - 0 - - -13 - - - 2 - :) ###(:link - 1 - - 0 - - -18 - - - 2 - :) ##(:link - 1 - - 0 - - -6 - - - 2 - :) ##(:link - 1 - - 0 - - -25 - - - 2 - :), (:link - 1 - - 0 - - 30 - - reno_context - - - - - - - 1 - 17FF6C63843EE64ED66CB038DD95B4C4D6BA1B0FD36B27BEFD84A909161D2853 - 1237535165 - 231 - 1255 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - - <string>BOOST_THROW_EXCEPTION</string> - - - - - - - - 2 - :) ##Headers ###(:link - 1 - - 0 - - -9 - - - 2 - :) ###(:link - 1 - - 0 - - 31 + 33 reno_context @@ -1403,7 +1549,7 @@ 0 - -8 + -11 2 @@ -1412,39 +1558,7 @@ 0 - 32 - - reno_context - - - - - - - 1 - 50E48ABD58B427E16B2EFA345D5FE67159057CB90F19AA1AD52C11991FD8500E - 4076172629 - 8577 - 323 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>boost/exception/exception.hpp</string> - - - exception_exception_hpp - - + -18 2 @@ -1453,7 +1567,7 @@ 0 - 33 + 34 reno_context @@ -1494,7 +1608,7 @@ 0 - 34 + 35 reno_context @@ -1535,7 +1649,7 @@ 0 - -22 + -27 2 @@ -1544,7 +1658,7 @@ 0 - 35 + 36 reno_context @@ -1585,7 +1699,7 @@ 0 - 36 + 37 reno_context @@ -1626,7 +1740,7 @@ 0 - 37 + 38 reno_context @@ -1660,7 +1774,7 @@ 0 - -9 + -12 2 @@ -1669,34 +1783,7 @@ 0 - -32 - - - 2 - api pre_indent="4":) (:include - 1 - - 0 - - -34 - - - 2 - api pre_indent="4":) (:include - 1 - - 0 - - -22 - - - 2 - api pre_indent="4":) (:include - 1 - - 0 - - -31 + -18 2 @@ -1709,25 +1796,7 @@ 2 - api pre_indent="4":) }@] `#include <(:link - 1 - - 0 - - -36 - - - 2 - :)> [@(:include - 1 - - 0 - - -36 - - - 2 - api:)@] !!Class exception (:include + api pre_indent="4":) (:include 1 0 @@ -1736,12 +1805,66 @@ 2 + api pre_indent="4":) (:include + 1 + + 0 + + -33 + + + 2 + api pre_indent="4":) (:include + 1 + + 0 + + -36 + + + 2 + api pre_indent="4":) }@] `#include <(:link + 1 + + 0 + + -37 + + + 2 + :)> [@(:include + 1 + + 0 + + -37 + + + 2 + api:)@] !!Class exception (:include + 1 + + 0 + + -31 + + + 2 :) !!Transporting of Arbitrary Data to the Catch Site (:include 1 0 - -28 + -32 + + + 2 + :) (:include + 1 + + 0 + + -10 2 @@ -1759,7 +1882,7 @@ 0 - -5 + -26 2 @@ -1768,11 +1891,11 @@ 0 - -21 + -24 2 - :) (:include + :) !!Transporting of Exceptions between Threads (:include 1 0 @@ -1781,7 +1904,34 @@ 2 - :) !!Transporting of Exceptions between Threads (:include + :) (:include + 1 + + 0 + + -14 + + + 2 + :) (:include + 1 + + 0 + + -15 + + + 2 + :) (:include + 1 + + 0 + + -8 + + + 2 + :) (:include 1 0 @@ -1795,43 +1945,7 @@ 0 - -11 - - - 2 - :) (:include - 1 - - 0 - - -12 - - - 2 - :) (:include - 1 - - 0 - - -29 - - - 2 - :) (:include - 1 - - 0 - - -13 - - - 2 - :) (:include - 1 - - 0 - - -18 + -22 2 @@ -1840,7 +1954,7 @@ 0 - -6 + -9 2 @@ -1849,7 +1963,7 @@ 0 - -25 + -30 2 @@ -1860,20 +1974,7 @@ 0 - -24 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -25 + -29 @@ -1892,14 +1993,14 @@ 1 2 - (:include include:) (:pagelist link="backlink":) + (:include include:) (:auto also:) 0 - -26 + -33 @@ -1912,7 +2013,7 @@ 0 - -27 + -31 @@ -1925,7 +2026,7 @@ 0 - -28 + -32 @@ -1938,7 +2039,158 @@ 0 - 38 + 39 + + 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 + + 40 + + 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 + + -34 + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + -35 + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + -36 + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + -37 + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + -38 + + + + 1 + 2 + (:auto !:) (:pagelist fmt="index" except_tags="index,noindex" mod="w":) + + + + + 0 + + 41 reno_context @@ -1987,111 +2239,7 @@ 0 - -31 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -29 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -32 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -33 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -34 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -35 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -36 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -37 - - - - 1 - 2 - (:auto !:) (:pagelist fmt="index" except_tags="index,noindex" mod="w":) - - - - - 0 - - 39 + 42 reno_context @@ -2130,92 +2278,6 @@ 0 - - - 0 - - 40 - - 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 - - 41 - - 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 - - @@ -2223,13 +2285,13 @@ def - 42 + 43 reno_layer - 37 + 38 0 @@ -2461,17 +2523,6 @@ 0 - - - 0 - - -30 - - - - 0 - - 0 @@ -2490,68 +2541,6 @@ -27 - - 7 - 2 - [@class (:link - 1 - - 0 - - -27 - - - 2 - :) { protected: (:include - 1 - - 0 - - -20 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -38 - - - 2 - decl pre_indent="4":) };@] - - - - - 0 - - -28 - - - - 3 - 2 - [@template <class Tag,class T> class (:link - 1 - - 0 - - -28 - - - 2 - :) { public: typedef T value_type; error_info( value_type const & ); };@] - - - - - 0 - - -38 - - 0 @@ -2560,7 +2549,7 @@ 0 - -31 + -28 @@ -2582,7 +2571,7 @@ 0 - -32 + -30 @@ -2600,6 +2589,90 @@ 0 + + + 0 + + -31 + + + + 7 + 2 + [@class (:link + 1 + + 0 + + -31 + + + 2 + :) { protected: (:include + 1 + + 0 + + -25 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -41 + + + 2 + decl pre_indent="4":) };@] + + + + + 0 + + -32 + + + + 3 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -32 + + + 2 + :) { public: typedef T value_type; error_info( value_type const & ); };@] + + + + + 0 + + -39 + + + + 0 + + + + + 0 + + -40 + + + + 0 + + 0 @@ -2648,18 +2721,7 @@ 0 - -39 - - - - 0 - - - - - 0 - - -40 + -38 @@ -2677,6 +2739,17 @@ 0 + + + 0 + + -42 + + + + 0 + + @@ -2684,13 +2757,13 @@ api - 43 + 44 reno_layer - 37 + 38 0 @@ -2732,18 +2805,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -28 - - - 2 - decl:)@] + 0 @@ -2754,27 +2816,31 @@ - 15 + 0 + + + + + 0 + + -10 + + + + 0 + + + + + 0 + + -11 + + + + 3 2 - [@#include <(:link - 1 - - 0 - - -31 - - - 2 - :)> #include <(:link - 1 - - 0 - - -8 - - - 2 - :)> #include <(:link + [@(:include 1 0 @@ -2783,7 +2849,20 @@ 2 - :)> #include <(:link + decl:)@] + + + + + 0 + + -12 + + + + 15 + 2 + [@#include <(:link 1 0 @@ -2797,7 +2876,7 @@ 0 - -34 + -11 2 @@ -2806,7 +2885,16 @@ 0 - -22 + -18 + + + 2 + :)> #include <(:link + 1 + + 0 + + -34 2 @@ -2819,42 +2907,27 @@ 2 + :)> #include <(:link + 1 + + 0 + + -27 + + + 2 + :)> #include <(:link + 1 + + 0 + + -36 + + + 2 :)>@] - - - 0 - - -10 - - - - 0 - - - - - 0 - - -11 - - - - 0 - - - - - 0 - - -12 - - - - 0 - - 0 @@ -2918,7 +2991,72 @@ - 0 + 15 + 2 + [@(:include + 1 + + 0 + + -31 + + + 2 + def:) (:include + 1 + + 0 + + -32 + + + 2 + decl:) typedef (:link + 1 + + 0 + + -32 + + + 2 + :)<struct tag_throw_function,char const *> throw_function; typedef (:link + 1 + + 0 + + -32 + + + 2 + :)<struct tag_throw_file,char const *> throw_file; typedef (:link + 1 + + 0 + + -32 + + + 2 + :)<struct tag_throw_line,int> throw_line; (:include + 1 + + 0 + + -24 + + + 2 + decl:) (:include + 1 + + 0 + + -14 + + + 2 + decl:)@] @@ -2962,18 +3100,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -5 - - - 2 - decl:)@] + 0 @@ -3009,17 +3136,6 @@ 0 - - - 0 - - -30 - - - - 0 - - 0 @@ -3039,7 +3155,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -7 + + + 2 + decl:)@] @@ -3053,48 +3180,6 @@ 0 - - - 0 - - -38 - - - - 0 - - - - - 0 - - -31 - - - - 5 - 2 - [@(:include - 1 - - 0 - - -27 - - - 2 - decl:) (:include - 1 - - 0 - - -6 - - - 2 - decl:)@] - - 0 @@ -3110,76 +3195,11 @@ 0 - -32 + -30 - 15 - 2 - [@(:include - 1 - - 0 - - -27 - - - 2 - def:) (:include - 1 - - 0 - - -28 - - - 2 - decl:) typedef (:link - 1 - - 0 - - -28 - - - 2 - :)<struct tag_throw_function,char const *> throw_function; typedef (:link - 1 - - 0 - - -28 - - - 2 - :)<struct tag_throw_file,char const *> throw_file; typedef (:link - 1 - - 0 - - -28 - - - 2 - :)<struct tag_throw_line,int> throw_line; (:include - 1 - - 0 - - -19 - - - 2 - decl:) (:include - 1 - - 0 - - -11 - - - 2 - decl:)@] + 0 @@ -3189,28 +3209,6 @@ -33 - - 3 - 2 - [@(:include - 1 - - 0 - - -21 - - - 2 - decl:)@] - - - - - 0 - - -34 - - 5 2 @@ -3219,16 +3217,16 @@ 0 - -28 + -31 2 - def:) (:include + decl:) (:include 1 0 - -7 + -9 2 @@ -3239,96 +3237,18 @@ 0 - -35 + -31 - 11 - 2 - [@(:include - 1 - - 0 - - -18 - - - 2 - decl:) (:include - 1 - - 0 - - -16 - - - 2 - decl:) (:include - 1 - - 0 - - -29 - - - 2 - decl:) (:include - 1 - - 0 - - -12 - - - 2 - decl:) (:include - 1 - - 0 - - -13 - - - 2 - decl:)@] + 0 0 - -36 - - - - 5 - 2 - [@(:include - 1 - - 0 - - -30 - - - 2 - decl:) namespace boost { (:include - 1 - - 0 - - -25 - - - 2 - decl:) }@] - - - - - 0 - - -37 + -32 @@ -3357,6 +3277,159 @@ 0 + + + 0 + + -34 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -26 + + + 2 + decl:)@] + + + + + 0 + + -35 + + + + 5 + 2 + [@(:include + 1 + + 0 + + -32 + + + 2 + def:) (:include + 1 + + 0 + + -10 + + + 2 + decl:)@] + + + + + 0 + + -36 + + + + 11 + 2 + [@(:include + 1 + + 0 + + -22 + + + 2 + decl:) (:include + 1 + + 0 + + -19 + + + 2 + decl:) (:include + 1 + + 0 + + -8 + + + 2 + decl:) (:include + 1 + + 0 + + -15 + + + 2 + decl:) (:include + 1 + + 0 + + -16 + + + 2 + decl:)@] + + + + + 0 + + -37 + + + + 5 + 2 + [@(:include + 1 + + 0 + + -23 + + + 2 + decl:) namespace boost { (:include + 1 + + 0 + + -30 + + + 2 + decl:) }@] + + + + + 0 + + -38 + + + + 0 + + 0 @@ -3368,6 +3441,17 @@ 0 + + + 0 + + -42 + + + + 0 + + @@ -3375,13 +3459,13 @@ decl - 44 + 45 reno_layer - 37 + 38 0 @@ -3390,36 +3474,7 @@ - 7 - 2 - [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link - 1 - - 0 - - -5 - - - 2 - |operator<<:)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link - 1 - - 0 - - -28 - - - 2 - :)<Tag1,T1>, ..., (:link - 1 - - 0 - - -28 - - - 2 - :)<TagN,TN> > const & v );@] + 0 @@ -3430,27 +3485,7 @@ - 5 - 2 - [@std::string (:link - 1 - - 0 - - -6 - - - 2 - :)( boost:: - 1 - - 0 - - -27 - - - 2 - const & x );@] + 0 @@ -3461,9 +3496,9 @@ - 5 + 7 2 - [@template <class E, class Tag, class T> E const & (:link + [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link 1 0 @@ -3472,16 +3507,25 @@ 2 - |operator<<:)( E const & x, (:link + |operator<<:)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link 1 0 - -28 + -32 2 - :)<Tag,T> const & v );@] + :)<Tag1,T1>, ..., (:link + 1 + + 0 + + -32 + + + 2 + :)<TagN,TN> > const & v );@] @@ -3492,47 +3536,23 @@ - 0 - - - - - 0 - - -9 - - - - 0 - - - - - 0 - - -10 - - - - 0 - - - - - 0 - - -11 - - - - 3 + 5 2 - [@template <class T> ---unspecified--- (:link + [@template <class T> (:link 1 0 - -11 + -19 + + + 2 + :) (:link + 1 + + 0 + + -8 2 @@ -3543,31 +3563,84 @@ 0 - -12 + -9 5 2 - [@(:link + [@std::string (:link 1 0 - -16 + -9 2 - :) (:link + :)( boost:: 1 0 - -12 + -31 2 - :)();@] + const & x );@] + + + + + 0 + + -10 + + + + 5 + 2 + [@template <class E, class Tag, class T> E const & (:link + 1 + + 0 + + -10 + + + 2 + |operator<<:)( E const & x, (:link + 1 + + 0 + + -32 + + + 2 + :)<Tag,T> const & v );@] + + + + + 0 + + -11 + + + + 0 + + + + + 0 + + -12 + + + + 0 @@ -3578,27 +3651,7 @@ - 5 - 2 - [@void (:link - 1 - - 0 - - -13 - - - 2 - :)( (:link - 1 - - 0 - - -16 - - - 2 - :) const & ep ); + 0 @@ -3609,7 +3662,18 @@ - 0 + 3 + 2 + [@template <class T> ---unspecified--- (:link + 1 + + 0 + + -14 + + + 2 + :)( T const & e );@] @@ -3620,7 +3684,27 @@ - 0 + 5 + 2 + [@(:link + 1 + + 0 + + -19 + + + 2 + :) (:link + 1 + + 0 + + -15 + + + 2 + :)();@] @@ -3631,9 +3715,9 @@ - 3 + 5 2 - [@typedef ---unspecified--- (:link + [@void (:link 1 0 @@ -3642,7 +3726,16 @@ 2 - :);@] + :)( (:link + 1 + + 0 + + -19 + + + 2 + :) const & ep ); @@ -3664,27 +3757,7 @@ - 5 - 2 - [@class (:link - 1 - - 0 - - -18 - - - 2 - :): public std::exception public boost:: - 1 - - 0 - - -27 - - - 2 - { ---unspecified--- };@] + 0 @@ -3697,7 +3770,7 @@ 3 2 - [@template <class T> ---unspecified--- (:link + [@typedef ---unspecified--- (:link 1 0 @@ -3706,7 +3779,7 @@ 2 - :)( T const & x );@] + :);@] @@ -3717,36 +3790,7 @@ - 7 - 2 - [@(:link - 1 - - 0 - - -20 - - - 2 - mod="m":)(); (:link - 1 - - 0 - - -20 - - - 2 - mod="m":)( (:link - 1 - - 0 - - -27 - - - 2 - :) const & x );@] + 0 @@ -3757,18 +3801,7 @@ - 3 - 2 - [@template <class ErrorInfo,class E> (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:)<typename ErrorInfo::value_type const> (:link - 1 - - 0 - - -21 - - - 2 - :)( E const & x );@] + 0 @@ -3779,7 +3812,27 @@ - 0 + 5 + 2 + [@class (:link + 1 + + 0 + + -22 + + + 2 + :): public std::exception public boost:: + 1 + + 0 + + -31 + + + 2 + { ---unspecified--- };@] @@ -3789,59 +3842,6 @@ -23 - - 0 - - - - - 0 - - -24 - - - - 0 - - - - - 0 - - -25 - - - - 5 - 2 - [@#ifdef BOOST_NO_EXCEPTIONS void (:link - 1 - - 0 - - -25 - - - 2 - :)( std::exception const & e ); // user defined #else template <class E> void (:link - 1 - - 0 - - -25 - - - 2 - :)( E const & e ); #endif@] - - - - - 0 - - -30 - - 19 2 @@ -3850,7 +3850,7 @@ 0 - -32 + -18 2 @@ -3859,7 +3859,7 @@ 0 - -30 + -23 2 @@ -3868,7 +3868,7 @@ 0 - -25 + -30 2 @@ -3877,7 +3877,7 @@ 0 - -19 + -24 2 @@ -3886,7 +3886,7 @@ 0 - -32 + -18 2 @@ -3895,7 +3895,7 @@ 0 - -32 + -18 2 @@ -3904,7 +3904,7 @@ 0 - -32 + -18 2 @@ -3913,7 +3913,7 @@ 0 - -30 + -23 2 @@ -3922,13 +3922,75 @@ 0 - -25 + -30 2 (x) #endif@] + + + 0 + + -24 + + + + 3 + 2 + [@template <class T> ---unspecified--- (:link + 1 + + 0 + + -24 + + + 2 + :)( T const & x );@] + + + + + 0 + + -25 + + + + 7 + 2 + [@(:link + 1 + + 0 + + -25 + + + 2 + mod="m":)(); (:link + 1 + + 0 + + -25 + + + 2 + mod="m":)( (:link + 1 + + 0 + + -31 + + + 2 + :) const & x );@] + + 0 @@ -3937,7 +3999,18 @@ - 0 + 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 + + -26 + + + 2 + :)( E const & x );@] @@ -3948,18 +4021,7 @@ - 3 - 2 - [@class (:link - 1 - - 0 - - -27 - - - 2 - :);@] + 0 @@ -3969,50 +4031,6 @@ -28 - - 3 - 2 - [@template <class Tag,class T> class (:link - 1 - - 0 - - -28 - - - 2 - :);@] - - - - - 0 - - -38 - - - - 3 - 2 - [@(:link - 1 - - 0 - - -38 - - - 2 - mod="m":)();@] - - - - - 0 - - -31 - - 0 @@ -4025,34 +4043,45 @@ - 5 - 2 - [@template <class T> (:link - 1 - - 0 - - -16 - - - 2 - :) (:link - 1 - - 0 - - -29 - - - 2 - :)( T const & e );@] + 0 0 - -32 + -30 + + + + 5 + 2 + [@#ifdef BOOST_NO_EXCEPTIONS void (:link + 1 + + 0 + + -30 + + + 2 + :)( std::exception const & e ); // user defined #else template <class E> void (:link + 1 + + 0 + + -30 + + + 2 + :)( E const & e ); #endif@] + + + + + 0 + + -33 @@ -4063,7 +4092,62 @@ 0 - -33 + -31 + + + + 3 + 2 + [@class (:link + 1 + + 0 + + -31 + + + 2 + :);@] + + + + + 0 + + -32 + + + + 3 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -32 + + + 2 + :);@] + + + + + 0 + + -39 + + + + 0 + + + + + 0 + + -40 @@ -4118,18 +4202,7 @@ 0 - -39 - - - - 0 - - - - - 0 - - -40 + -38 @@ -4143,6 +4216,28 @@ -41 + + 3 + 2 + [@(:link + 1 + + 0 + + -41 + + + 2 + mod="m":)();@] + + + + + 0 + + -42 + + 0 @@ -4154,13 +4249,13 @@ include - 45 + 46 reno_layer - 37 + 38 0 @@ -4169,27 +4264,72 @@ - 5 + 15 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(: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. Defining either macro does not have an observable degrading effect on the library functionality, except for the following: ->By default, the 1 0 - -27 + -26 2 - :), or a type that derives (indirectly) from boost::(:link + function template can be called with any exception type. If BOOST_NO_RTTI is defined, 1 0 - -27 + -26 2 - :). !!!!Effects: Equivalent to x << v.(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements|get:)<0>() << ... << v.(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements|get:)<N>(). !!!!Returns: x. (:include throws:) + can be used only with objects of type boost:: + 1 + + 0 + + -31 + + + 2 + . ''Note: the configuration where BOOST_NO_RTTI is defined but BOOST_NO_TYPEID is not defined is specific for MSVC compilers; it reduces RTTI overhead without fully disabling std::type_info. For most (all?) other compilers, to use Boost Exception without RTTI, both BOOST_NO_RTTI and BOOST_NO_TYPEID must be defined.'' '''BOOST_EXCEPTION_DISABLE''' By default, + 1 + + 0 + + -14 + + + 2 + and + 1 + + 0 + + -24 + + + 2 + are integrated directly in the + 1 + + 0 + + -30 + + + 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 + 1 + + 0 + + -37 + + + 2 + . @@ -4200,36 +4340,99 @@ - 7 + 21 2 - (:auto !!!:) (:include synopsis:) !!!!Returns: This function iterates over all data objects stored in the boost::(: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. Here is an example: [@#include <stdio.h> #include <string> class file_read_error { public: explicit file_read_error( std::string const & fn ): fn_(fn) { }; std::string const & file_name() const { return fn_; } private: std::string fn_; }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error("????"); }@] We have defined an exception class file_read_error which can store a file name, so that when we catch a file_read_error object, we know which file the failure is related to. However, the file_read function does not have the file name at the time of the throw; all it has is a FILE handle. One possible solution is to not use FILE handles directly. We could have our own class file which stores both a FILE handle and a file name, and pass that to file_read. However, this could be problematic if we communicate with 3rd party code that does not use our class file (probably because they have their own similar class.) A better solution is to make class file_read_error derive (possibly indirectly) from boost::(:link 1 0 - -27 + -31 2 - :) through (:link + :), and free the file_read function from the burden of storing the file name in exceptions it throws: [@#include <(:link 1 0 - -7 + -12 2 - |operator<<:). The returned string is constructed by converting each data object to string and then concatenating these strings together. When the (:link + :)> #include <stdio.h> #include <errno.h> typedef boost::(:link 1 0 - -28 + -32 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. + :)<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link + 1 + + 0 + + -31 + + + 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 + + -12 + + + 2 + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> typedef boost::(:link + 1 + + 0 + + -32 + + + 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 + + -31 + + + 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 + + -31 + + + 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 + + -31 + + + 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 + + -26 + + + 2 + :). @@ -4240,14 +4443,14 @@ - 7 + 5 2 (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link 1 0 - -27 + -31 2 @@ -4256,20 +4459,11 @@ 0 - -27 + -31 2 - :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link - 1 - - 0 - - -28 - - - 2 - :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) + :). !!!!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:) @@ -4280,9 +4474,27 @@ - 1 + 5 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!!:) (:include synopsis:) !!!!Effects: As if [@try { throw + 1 + + 0 + + -14 + + + 2 + (e); } catch(...) { return (:link + 1 + + 0 + + -15 + + + 2 + :)(); }@] @@ -4293,9 +4505,36 @@ - 1 + 7 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!!:) (:include synopsis:) !!!!Returns: This function iterates over all data objects stored in the boost::(:link + 1 + + 0 + + -31 + + + 2 + :) through (:link + 1 + + 0 + + -10 + + + 2 + |operator<<:). The returned string is constructed by converting each data object to string and then concatenating these strings together. When the (:link + 1 + + 0 + + -32 + + + 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. @@ -4306,81 +4545,36 @@ - 17 + 7 2 - (:auto !!:) Boost Exception provides a namespace-scope function (:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link 1 0 - -6 + -31 2 - :) which takes a boost::(:link + :), or a type that derives (indirectly) from boost::(:link 1 0 - -27 + -31 2 - :). The returned string contains: *the string representation of all data objects added to the boost::(:link + :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link 1 0 - -27 + -32 2 - :) through (:link - 1 - - 0 - - -7 - - - 2 - |operator<<:); *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 - - -9 - - - 2 - :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link - 1 - - 0 - - -27 - - - 2 - :). void g() { try { f(); } catch( boost::(:link - 1 - - 0 - - -27 - - - 2 - :) & e ) { std::cerr << (:link - 1 - - 0 - - -6 - - - 2 - :)(e); } }@] + :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) @@ -4391,99 +4585,9 @@ - 21 + 1 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: T must be a class with an accessible no-throw copy constructor. !!!!Returns: An object of ''unspecified'' type which derives publicly from T. That is, the returned object can be intercepted by a catch(T &). !!!!Description: This function is designed to be used directly in a throw-expression to enable the (:link - 1 - - 0 - - -16 - - - 2 - :) support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link - 1 - - 0 - - -11 - - - 2 - :)(my_exception());@] Unless (:link - 1 - - 0 - - -11 - - - 2 - :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link - 1 - - 0 - - -12 - - - 2 - :) may return an (:link - 1 - - 0 - - -16 - - - 2 - :) which refers to an instance of (:link - 1 - - 0 - - -18 - - - 2 - :). See (:link - 1 - - 0 - - -12 - - - 2 - :) for details. !!!!Note: Instead of using the throw keyword directly, it is preferable to call boost::(:link - 1 - - 0 - - -25 - - - 2 - :). This is guaranteed to throw an exception that derives from boost::(:link - 1 - - 0 - - -27 - - - 2 - :) and supports the (:link - 1 - - 0 - - -16 - - - 2 - :) functionality. + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -4494,9 +4598,58 @@ - 29 + 1 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: The (:link + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -13 + + + + 17 + 2 + (:auto !!:) Boost Exception provides a namespace-scope function (:link + 1 + + 0 + + -9 + + + 2 + :) which takes a boost::(:link + 1 + + 0 + + -31 + + + 2 + :). The returned string contains: *the string representation of all data objects added to the boost::(:link + 1 + + 0 + + -31 + + + 2 + :) through (:link + 1 + + 0 + + -10 + + + 2 + |operator<<:); *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 @@ -4505,66 +4658,79 @@ 2 - :) function must not be called outside of a catch block. !!!!Returns: * An (:link + :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link 1 0 - -16 + -31 2 - :) that refers to the currently handled exception or a copy of the currently handled exception. * If the function needs to allocate memory and the attempt fails, it returns an (:link + :). void g() { try { f(); } catch( boost::(:link 1 0 - -16 + -31 2 - :) that refers to an instance of std::bad_alloc. !!!!Throws: Nothing. !!!!Notes: * It is unspecified whether the return values of two successive calls to (:link + :) & e ) { std::cerr << (:link 1 0 - -12 + -9 2 - :) refer to the same exception object. * Correct implementation of (:link + :)(e); } }@] + + + + + 0 + + -14 + + + + 21 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: T must be a class with an accessible no-throw copy constructor. !!!!Returns: An object of ''unspecified'' type which derives publicly from T. That is, the returned object can be intercepted by a catch(T &). !!!!Description: This function is designed to be used directly in a throw-expression to enable the (:link 1 0 - -12 + -19 2 - :) may require compiler support, unless (:link + :) support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link 1 0 - -11 + -14 2 - :) was used at the time the currently handled exception object was passed to throw. If (:link + :)(my_exception());@] Unless (:link 1 0 - -11 + -14 2 - :) was not used, and if the compiler does not provide the necessary support, then (:link + :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link 1 0 - -12 + -15 2 @@ -4573,7 +4739,146 @@ 0 - -16 + -19 + + + 2 + :) which refers to an instance of (:link + 1 + + 0 + + -22 + + + 2 + :). See (:link + 1 + + 0 + + -15 + + + 2 + :) for details. !!!!Note: Instead of using the throw keyword directly, it is preferable to call boost::(:link + 1 + + 0 + + -30 + + + 2 + :). This is guaranteed to throw an exception that derives from boost::(:link + 1 + + 0 + + -31 + + + 2 + :) and supports the (:link + 1 + + 0 + + -19 + + + 2 + :) functionality. + + + + + 0 + + -15 + + + + 29 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: The (:link + 1 + + 0 + + -15 + + + 2 + :) function must not be called outside of a catch block. !!!!Returns: * An (:link + 1 + + 0 + + -19 + + + 2 + :) that refers to the currently handled exception or a copy of the currently handled exception. * If the function needs to allocate memory and the attempt fails, it returns an (:link + 1 + + 0 + + -19 + + + 2 + :) that refers to an instance of std::bad_alloc. !!!!Throws: Nothing. !!!!Notes: * It is unspecified whether the return values of two successive calls to (:link + 1 + + 0 + + -15 + + + 2 + :) refer to the same exception object. * Correct implementation of (:link + 1 + + 0 + + -15 + + + 2 + :) may require compiler support, unless (:link + 1 + + 0 + + -14 + + + 2 + :) was used at the time the currently handled exception object was passed to throw. If (:link + 1 + + 0 + + -14 + + + 2 + :) was not used, and if the compiler does not provide the necessary support, then (:link + 1 + + 0 + + -15 + + + 2 + :) may return an (:link + 1 + + 0 + + -19 2 @@ -4582,7 +4887,7 @@ 0 - -18 + -22 2 @@ -4591,7 +4896,7 @@ 0 - -27 + -31 2 @@ -4600,7 +4905,7 @@ 0 - -27 + -31 2 @@ -4609,7 +4914,7 @@ 0 - -18 + -22 2 @@ -4618,7 +4923,7 @@ 0 - -27 + -31 2 @@ -4629,7 +4934,7 @@ 0 - -13 + -16 @@ -4642,7 +4947,7 @@ 0 - -14 + -17 @@ -4653,7 +4958,7 @@ 0 - -34 + -35 2 @@ -4662,7 +4967,7 @@ 0 - -27 + -31 2 @@ -4671,7 +4976,7 @@ 0 - -11 + -14 2 @@ -4680,7 +4985,7 @@ 0 - -11 + -14 2 @@ -4689,7 +4994,7 @@ 0 - -27 + -31 2 @@ -4700,110 +5005,20 @@ 0 - -15 + -18 - 21 + 1 2 - (:auto !!!:) Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Here is an example: [@#include <stdio.h> #include <string> class file_read_error { public: explicit file_read_error( std::string const & fn ): fn_(fn) { }; std::string const & file_name() const { return fn_; } private: std::string fn_; }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error("????"); }@] We have defined an exception class file_read_error which can store a file name, so that when we catch a file_read_error object, we know which file the failure is related to. However, the file_read function does not have the file name at the time of the throw; all it has is a FILE handle. One possible solution is to not use FILE handles directly. We could have our own class file which stores both a FILE handle and a file name, and pass that to file_read. However, this could be problematic if we communicate with 3rd party code that does not use our class file (probably because they have their own similar class.) A better solution is to make class file_read_error derive (possibly indirectly) from boost::(:link - 1 - - 0 - - -27 - - - 2 - :), and free the file_read function from the burden of storing the file name in exceptions it throws: [@#include <(:link - 1 - - 0 - - -9 - - - 2 - :)> #include <stdio.h> #include <errno.h> typedef boost::(:link - 1 - - 0 - - -28 - - - 2 - :)<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link - 1 - - 0 - - -27 - - - 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 - - -9 - - - 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> typedef boost::(:link - 1 - - 0 - - -28 - - - 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 - - -27 - - - 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 - - -27 - - - 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 - - -27 - - - 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 - - -21 - - - 2 - :). + (:auto !!:) !!!Synopsis (:include synopsis:) 0 - -16 + -19 @@ -4814,7 +5029,7 @@ 0 - -16 + -19 2 @@ -4823,7 +5038,7 @@ 0 - -16 + -19 2 @@ -4832,7 +5047,7 @@ 0 - -16 + -19 2 @@ -4841,7 +5056,7 @@ 0 - -16 + -19 2 @@ -4850,7 +5065,7 @@ 0 - -16 + -19 2 @@ -4859,7 +5074,7 @@ 0 - -16 + -19 2 @@ -4868,7 +5083,7 @@ 0 - -12 + -15 2 @@ -4877,7 +5092,7 @@ 0 - -13 + -16 2 @@ -4888,7 +5103,137 @@ 0 - -17 + -20 + + + + 27 + 2 + (:auto !!:) Some exception hierarchies can not be modified to make boost::(:link + 1 + + 0 + + -31 + + + 2 + :) a base type. In this case, the (:link + 1 + + 0 + + -24 + + + 2 + :) function template can be used to make exception objects derive from boost::(:link + 1 + + 0 + + -31 + + + 2 + :) anyway. Here is an example: [@#include <(:link + 1 + + 0 + + -12 + + + 2 + :)> #include <stdexcept> typedef boost::(:link + 1 + + 0 + + -32 + + + 2 + :)<struct tag_std_range_min,size_t> std_range_min; typedef boost::(:link + 1 + + 0 + + -32 + + + 2 + :)<struct tag_std_range_max,size_t> std_range_max; typedef boost::(:link + 1 + + 0 + + -32 + + + 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 + + -24 + + + 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 + + -24 + + + 2 + :)<T> gets us an object of ''unspecified type'' which is guaranteed to derive from both boost::(:link + 1 + + 0 + + -31 + + + 2 + :) and T. This makes it possible to use (:link + 1 + + 0 + + -10 + + + 2 + |operator<<:) to store additional information in the exception object. The exception can be intercepted as T &, so existing exception handling will not break. It can also be intercepted as boost::(:link + 1 + + 0 + + -31 + + + 2 + :) &, so that (:link + 1 + + 0 + + -21 + + + 2 + |more information can be added to the exception at a later time:). + + + + + 0 + + -21 @@ -4899,7 +5244,7 @@ 0 - -27 + -31 2 @@ -4908,7 +5253,7 @@ 0 - -27 + -31 2 @@ -4917,12 +5262,52 @@ 0 - -41 + -40 2 :) (:include 1 + + 0 + + -6 + + + 2 + :) (:include + 1 + + 0 + + -42 + + + 2 + :) + + + + + 0 + + -22 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) This type is used by the (:link + 1 + + 0 + + -19 + + + 2 + :) support in Boost Exception. Please see (:link + 1 0 @@ -4930,6 +5315,257 @@ 2 + :). + + + + + 0 + + -23 + + + + 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 + + -30 + + + 2 + . To recover this information at the catch site, use + 1 + + 0 + + -26 + + + 2 + ; the information is also included in the message returned by + 1 + + 0 + + -9 + + + 2 + . + + + + + 0 + + -24 + + + + 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 + + -31 + + + 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 + + -31 + + + 2 + :). The T sub-object is initialized from x by the T copy constructor. !!!!Throws: Nothing. + + + + + 0 + + -25 + + + + 7 + 2 + (:auto !!!:) (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link + 1 + + 0 + + -31 + + + 2 + :) object. * Copy constructor: initializes a boost::(:link + 1 + + 0 + + -31 + + + 2 + :) object which shares ownership with x of all data added through (:link + 1 + + 0 + + -10 + + + 2 + |operator<<:), including data that is added at a future time. !!!!Throws: Nothing. + + + + + 0 + + -26 + + + + 13 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link + 1 + + 0 + + -32 + + + 2 + :) template. * E must be polymorphic. * The (:link + 1 + + 0 + + -26 + + + 2 + :) function must not be called outside of a catch block. !!!!Returns: * If dynamic_cast<boost::(:link + 1 + + 0 + + -31 + + + 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 + + -10 + + + 2 + |operator<<:) to store values in exception objects.) The shared_ptr is valid even after x has been destroyed. !!!!Throws: Nothing. !!!!Note: The interface of + 1 + + 0 + + -26 + + + 2 + may be affected by the build + 1 + + 0 + + -5 + + + 2 + . + + + + + 0 + + -27 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -28 + + + + 0 + + + + + 0 + + -29 + + + + 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 + + -14 + + + 2 + :) at the time of the throw is required in order to use cloning. !!!!Note: All exceptions emitted by the familiar function boost::(:link + 1 + + 0 + + -30 + + + 2 + :) are guaranteed to derive from boost::(:link + 1 + + 0 + + -31 + + + 2 + :) and to support cloning. (:include + 1 + + 0 + + -17 + + + 2 :) (:include 1 @@ -4946,240 +5582,7 @@ 0 - -18 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) This type is used by the (:link - 1 - - 0 - - -16 - - - 2 - :) support in Boost Exception. Please see (:link - 1 - - 0 - - -12 - - - 2 - :). - - - - - 0 - - -19 - - - - 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 - - -27 - - - 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 - - -27 - - - 2 - :). The T sub-object is initialized from x by the T copy constructor. !!!!Throws: Nothing. - - - - - 0 - - -20 - - - - 7 - 2 - (:auto !!!:) (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link - 1 - - 0 - - -27 - - - 2 - :) object. * Copy constructor: initializes a boost::(:link - 1 - - 0 - - -27 - - - 2 - :) object which shares ownership with x of all data added through (:link - 1 - - 0 - - -7 - - - 2 - |operator<<:), including data that is added at a future time. !!!!Throws: Nothing. - - - - - 0 - - -21 - - - - 9 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link - 1 - - 0 - - -28 - - - 2 - :) template. * E must be polymorphic. * The - 1 - - 0 - - -21 - - - 2 - function must not be called outside of a catch block. !!!!Returns: * If dynamic_cast<boost::(:link - 1 - - 0 - - -27 - - - 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 - - -7 - - - 2 - |operator<<:) to store values in exception objects.) The shared_ptr is valid even after x has been destroyed. !!!!Throws: Nothing. - - - - - 0 - - -22 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -23 - - - - 0 - - - - - 0 - - -24 - - - - 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 - - -11 - - - 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 - - -25 - - - 2 - :) are guaranteed to derive from boost::(:link - 1 - - 0 - - -27 - - - 2 - :) and to support cloning. (:include - 1 - - 0 - - -14 - - - 2 - :) (:include - 1 - - 0 - - -40 - - - 2 - :) - - - - - 0 - - -25 + -30 @@ -5190,7 +5593,7 @@ 0 - -25 + -30 2 @@ -5199,7 +5602,7 @@ 0 - -11 + -14 2 @@ -5208,7 +5611,7 @@ 0 - -19 + -24 2 @@ -5217,7 +5620,7 @@ 0 - -25 + -30 2 @@ -5226,7 +5629,7 @@ 0 - -25 + -30 2 @@ -5235,450 +5638,13 @@ 0 - -25 + -30 2 :) returns, the behavior is undefined. - - - 0 - - -30 - - - - 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 - - -25 - - - 2 - . To recover this information at the catch site, use - 1 - - 0 - - -21 - - - 2 - ; the information is also included in the message returned by - 1 - - 0 - - -6 - - - 2 - . - - - - - 0 - - -26 - - - - 27 - 2 - (:auto !!:) Some exception hierarchies can not be modified to make boost::(:link - 1 - - 0 - - -27 - - - 2 - :) a base type. In this case, the (:link - 1 - - 0 - - -19 - - - 2 - :) function template can be used to make exception objects derive from boost::(:link - 1 - - 0 - - -27 - - - 2 - :) anyway. Here is an example: [@#include <(:link - 1 - - 0 - - -9 - - - 2 - :)> #include <stdexcept> typedef boost::(:link - 1 - - 0 - - -28 - - - 2 - :)<struct tag_std_range_min,size_t> std_range_min; typedef boost::(:link - 1 - - 0 - - -28 - - - 2 - :)<struct tag_std_range_max,size_t> std_range_max; typedef boost::(:link - 1 - - 0 - - -28 - - - 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 - - -19 - - - 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 - - -19 - - - 2 - :)<T> gets us an object of ''unspecified type'' which is guaranteed to derive from both boost::(:link - 1 - - 0 - - -27 - - - 2 - :) and T. This makes it possible to use (:link - 1 - - 0 - - -7 - - - 2 - |operator<<:) to store additional information in the exception object. The exception can be intercepted as T &, so existing exception handling will not break. It can also be intercepted as boost::(:link - 1 - - 0 - - -27 - - - 2 - :) &, so that (:link - 1 - - 0 - - -17 - - - 2 - |more information can be added to the exception at a later time:). - - - - - 0 - - -27 - - - - 13 - 2 - (:auto !!!:) (:include synopsis:) Class boost::(:link - 1 - - 0 - - -27 - - - 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 - - -27 - - - 2 - :) can store data of arbitrary types, using the (:link - 1 - - 0 - - -28 - - - 2 - :) wrapper and (:link - 1 - - 0 - - -7 - - - 2 - |operator<<:). To retrieve data from a boost::(:link - 1 - - 0 - - -27 - - - 2 - :) object, use the (:link - 1 - - 0 - - -21 - - - 2 - :) function template. - - - - - 0 - - -28 - - - - 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 - - -28 - - - 2 - :)<Tag,T> can be passed to (:link - 1 - - 0 - - -7 - - - 2 - |operator<<:) to be stored in objects of type boost::(:link - 1 - - 0 - - -27 - - - 2 - :). !!!!Note: The header <(:link - 1 - - 0 - - -8 - - - 2 - :)> provides a declaration of the (:link - 1 - - 0 - - -28 - - - 2 - :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, like this: [@#include <(:link - 1 - - 0 - - -8 - - - 2 - :)> typedef boost::(:link - 1 - - 0 - - -28 - - - 2 - :)<struct tag_errno,int> errno_info;@] Of course, to actually add an (:link - 1 - - 0 - - -28 - - - 2 - :) object to (:link - 1 - - 0 - - -27 - - - 2 - mod="p":) using (:link - 1 - - 0 - - -7 - - - 2 - |operator<<:), or to retrieve it using (:link - 1 - - 0 - - -21 - - - 2 - :), you must first #include <(:link - 1 - - 0 - - -34 - - - 2 - :)>. - - - - - 0 - - -38 - - - - 3 - 2 - (:auto !!!:) (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link - 1 - - 0 - - -27 - - - 2 - :) object. !!!!Throws: Nothing. - - - - - 0 - - -31 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -29 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) !!!!Effects: As if [@try { throw - 1 - - 0 - - -11 - - - 2 - (e); } catch(...) { return (:link - 1 - - 0 - - -12 - - - 2 - :)(); }@] - - - - - 0 - - -32 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - 0 @@ -5692,6 +5658,454 @@ (:auto !!:) !!!Synopsis (:include synopsis:) + + + 0 + + -31 + + + + 13 + 2 + (:auto !!!:) (:include synopsis:) Class boost::(:link + 1 + + 0 + + -31 + + + 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 + + -31 + + + 2 + :) can store data of arbitrary types, using the (:link + 1 + + 0 + + -32 + + + 2 + :) wrapper and (:link + 1 + + 0 + + -10 + + + 2 + |operator<<:). To retrieve data from a boost::(:link + 1 + + 0 + + -31 + + + 2 + :) object, use the (:link + 1 + + 0 + + -26 + + + 2 + :) function template. + + + + + 0 + + -32 + + + + 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 + + -32 + + + 2 + :)<Tag,T> can be passed to (:link + 1 + + 0 + + -10 + + + 2 + |operator<<:) to be stored in objects of type boost::(:link + 1 + + 0 + + -31 + + + 2 + :). !!!!Note: The header <(:link + 1 + + 0 + + -11 + + + 2 + :)> provides a declaration of the (:link + 1 + + 0 + + -32 + + + 2 + :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, like this: [@#include <(:link + 1 + + 0 + + -11 + + + 2 + :)> typedef boost::(:link + 1 + + 0 + + -32 + + + 2 + :)<struct tag_errno,int> errno_info;@] Of course, to actually add an (:link + 1 + + 0 + + -32 + + + 2 + :) object to (:link + 1 + + 0 + + -31 + + + 2 + mod="p":) using (:link + 1 + + 0 + + -10 + + + 2 + |operator<<:), or to retrieve it using (:link + 1 + + 0 + + -26 + + + 2 + :), you must first #include <(:link + 1 + + 0 + + -35 + + + 2 + :)>. + + + + + 0 + + -39 + + + + 37 + 2 + (:auto !!!:) When you catch an exception, you can call (:link + 1 + + 0 + + -15 + + + 2 + :) to get an (:link + 1 + + 0 + + -19 + + + 2 + :) object: [@#include <(:link + 1 + + 0 + + -36 + + + 2 + :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link + 1 + + 0 + + -31 + + + 2 + :)s void worker_thread( boost::(:link + 1 + + 0 + + -19 + + + 2 + :) & error ) { try { do_work(); error = boost::(:link + 1 + + 0 + + -19 + + + 2 + :)(); } catch( ... ) { error = boost::(:link + 1 + + 0 + + -15 + + + 2 + :)(); } }@] In the above example, note that (:link + 1 + + 0 + + -15 + + + 2 + :) captures the original type of the exception object. The exception can be thrown again using the (:link + 1 + + 0 + + -16 + + + 2 + :) function: [@// ...continued void work() { boost::(:link + 1 + + 0 + + -19 + + + 2 + :) error; boost::(:link http://www.boost.org/doc/html/boost/thread.html|thread:) t( boost::(:link http://www.boost.org/libs/bind/bind.html|bind:)(worker_thread,boost::(:link http://www.boost.org/doc/html/ref.html|ref:)(error)) ); t.(:link http://www.boost.org/doc/html/boost/thread.html|join:)(); if( error ) boost::(:link + 1 + + 0 + + -16 + + + 2 + :)(error); }@] Note that (:link + 1 + + 0 + + -15 + + + 2 + :) could fail to copy the original exception object in the following cases: * if there is not enough memory, in which case the returned (:link + 1 + + 0 + + -19 + + + 2 + :) points to an instance of std::bad_alloc, or * if (:link + 1 + + 0 + + -14 + + + 2 + :) was not used in the throw-expression passed to the original throw statement and the current implementation does not have the necessary compiler-specific support to copy the exception automatically, in which case the returned (:link + 1 + + 0 + + -19 + + + 2 + :) points to an instance of (:link + 1 + + 0 + + -22 + + + 2 + :). Regardless, the use of (:link + 1 + + 0 + + -15 + + + 2 + :) and (:link + 1 + + 0 + + -16 + + + 2 + :) in the above examples is well-formed. + + + + + 0 + + -40 + + + + 17 + 2 + (:auto !!!:) The following example demonstrates how errno can be stored in exception objects using Boost Exception: [@#include <(:link + 1 + + 0 + + -12 + + + 2 + :)> #include <errno.h> #include <iostream> typedef boost::(:link + 1 + + 0 + + -32 + + + 2 + :)<struct tag_errno,int> errno_info; //(1) class my_error: public boost::(:link + 1 + + 0 + + -31 + + + 2 + :), public std::exception { }; //(2) void f() { throw my_error() << errno_info(errno); //(3) } @] First, we instantiate the (:link + 1 + + 0 + + -32 + + + 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 + + -31 + + + 2 + :). Finally, (3) illustrates how the typedef from (1) can be used with (:link + 1 + + 0 + + -10 + + + 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 + + -26 + + + 2 + :)<errno_info>(x) ) std::cerr << "Error code: " << *err; } }@] The (:link + 1 + + 0 + + -26 + + + 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 @@ -5738,252 +6152,23 @@ -37 + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -38 + + 0 - - - 0 - - -39 - - - - 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 - - -22 - - - 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link - 1 - - 0 - - -28 - - - 2 - :)<struct tag_file_name,std::string> file_name_info; typedef boost::(:link - 1 - - 0 - - -28 - - - 2 - :)<struct tag_function,char const *> function_info; typedef boost::(:link - 1 - - 0 - - -28 - - - 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 - - -27 - - - 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 - - -21 - - - 2 - :). - - - - - 0 - - -40 - - - - 37 - 2 - (:auto !!!:) When you catch an exception, you can call (:link - 1 - - 0 - - -12 - - - 2 - :) to get an (:link - 1 - - 0 - - -16 - - - 2 - :) object: [@#include <(:link - 1 - - 0 - - -35 - - - 2 - :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link - 1 - - 0 - - -27 - - - 2 - :)s void worker_thread( boost::(:link - 1 - - 0 - - -16 - - - 2 - :) & error ) { try { do_work(); error = boost::(:link - 1 - - 0 - - -16 - - - 2 - :)(); } catch( ... ) { error = boost::(:link - 1 - - 0 - - -12 - - - 2 - :)(); } }@] In the above example, note that (:link - 1 - - 0 - - -12 - - - 2 - :) captures the original type of the exception object. The exception can be thrown again using the (:link - 1 - - 0 - - -13 - - - 2 - :) function: [@// ...continued void work() { boost::(:link - 1 - - 0 - - -16 - - - 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 - - -13 - - - 2 - :)(error); }@] Note that (:link - 1 - - 0 - - -12 - - - 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 - - -16 - - - 2 - :) points to an instance of std::bad_alloc, or * if (:link - 1 - - 0 - - -11 - - - 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 - - -16 - - - 2 - :) points to an instance of (:link - 1 - - 0 - - -18 - - - 2 - :). Regardless, the use of (:link - 1 - - 0 - - -12 - - - 2 - :) and (:link - 1 - - 0 - - -13 - - - 2 - :) in the above examples is well-formed. - - 0 @@ -5992,27 +6177,31 @@ - 17 + 3 2 - (:auto !!!:) The following example demonstrates how errno can be stored in exception objects using Boost Exception: [@#include <(:link + (:auto !!!:) (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link 1 0 - -9 + -31 2 - :)> #include <errno.h> #include <iostream> typedef boost::(:link - 1 - - 0 - - -28 - - + :) object. !!!!Throws: Nothing. + + + + + 0 + + -42 + + + + 13 2 - :)<struct tag_errno,int> errno_info; //(1) class my_error: public boost::(:link + (: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 @@ -6021,52 +6210,52 @@ 2 - :), public std::exception { }; //(2) void f() { throw my_error() << errno_info(errno); //(3) } @] First, we instantiate the (:link + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link 1 0 - -28 + -32 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 + :)<struct tag_file_name,std::string> file_name_info; typedef boost::(:link 1 0 - -27 + -32 2 - :). Finally, (3) illustrates how the typedef from (1) can be used with (:link + :)<struct tag_function,char const *> function_info; typedef boost::(:link 1 0 - -7 + -32 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 + :)<struct tag_errno,int> errno_info; typedef boost::tuple<function_info,errno_info> clib_failure; class file_open_error: public boost::(:link 1 0 - -21 + -31 2 - :)<errno_info>(x) ) std::cerr << "Error code: " << *err; } }@] The (:link + :) { }; 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 - -21 + -26 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. + :). @@ -6076,13 +6265,13 @@ throws - 46 + 47 reno_layer - 37 + 38 0 @@ -6091,9 +6280,7 @@ - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. + 0 @@ -6117,7 +6304,7 @@ 1 2 - !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. + !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. @@ -6150,7 +6337,9 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. @@ -6318,17 +6507,6 @@ 0 - - - 0 - - -30 - - - - 0 - - 0 @@ -6366,7 +6544,29 @@ 0 - -38 + -29 + + + + 0 + + + + + 0 + + -30 + + + + 0 + + + + + 0 + + -33 @@ -6384,17 +6584,6 @@ 0 - - - 0 - - -29 - - - - 0 - - 0 @@ -6410,7 +6599,18 @@ 0 - -33 + -39 + + + + 0 + + + + + 0 + + -40 @@ -6465,18 +6665,7 @@ 0 - -39 - - - - 0 - - - - - 0 - - -40 + -38 @@ -6494,6 +6683,17 @@ 0 + + + 0 + + -42 + + + + 0 + + @@ -6501,13 +6701,13 @@ synopsis - 47 + 48 reno_layer - 37 + 38 0 @@ -6516,27 +6716,7 @@ - 5 - 2 - `#include <(:link - 1 - - 0 - - -22 - - - 2 - :)> [@namespace boost { (:include - 1 - - 0 - - -5 - - - 2 - decl pre_indent="4":) }@] + 0 @@ -6547,18 +6727,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -31 - - - 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -6568,6 +6737,37 @@ -7 + + 5 + 2 + `#include <(:link + 1 + + 0 + + -27 + + + 2 + :)> [@namespace boost { (:include + 1 + + 0 + + -7 + + + 2 + decl pre_indent="4":) }@] + + + + + 0 + + -8 + + 3 2 @@ -6576,7 +6776,29 @@ 0 - -34 + -36 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -9 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -33 2 @@ -6587,7 +6809,29 @@ 0 - -8 + -10 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -35 + + + 2 + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -11 @@ -6600,7 +6844,7 @@ 0 - -9 + -12 @@ -6609,61 +6853,6 @@ [@(:include api:)@] - - - 0 - - -10 - - - - 0 - - - - - 0 - - -11 - - - - 3 - 2 - `#include < - 1 - - 0 - - -32 - - - 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -12 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -35 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] - - 0 @@ -6672,18 +6861,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -35 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -6694,7 +6872,18 @@ - 0 + 3 + 2 + `#include < + 1 + + 0 + + -18 + + + 2 + > [@namespace boost { (:include decl pre_indent="4":) }@] @@ -6705,7 +6894,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -36 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -6723,7 +6923,7 @@ 0 - -35 + -36 2 @@ -6749,18 +6949,9 @@ - 3 + 1 2 - `#include <(:link - 1 - - 0 - - -35 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + [@namespace boost { (:include api pre_indent="4":) }@] @@ -6773,16 +6964,16 @@ 3 2 - `#include < + `#include <(:link 1 0 - -32 + -36 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -6803,6 +6994,39 @@ -21 + + 0 + + + + + 0 + + -22 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -36 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -23 + + 3 2 @@ -6811,7 +7035,29 @@ 0 - -33 + -37 + + + 2 + > (:include decl:) + + + + + 0 + + -24 + + + + 3 + 2 + `#include < + 1 + + 0 + + -18 2 @@ -6822,7 +7068,40 @@ 0 - -22 + -25 + + + + 0 + + + + + 0 + + -26 + + + + 3 + 2 + `#include < + 1 + + 0 + + -34 + + + 2 + > [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -27 @@ -6835,7 +7114,7 @@ 0 - -23 + -28 @@ -6846,35 +7125,13 @@ 0 - -24 + -29 0 - - - 0 - - -25 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -36 - - - 2 - :)> [@namespace boost { (:include decl:) }@] - - 0 @@ -6882,39 +7139,6 @@ -30 - - 3 - 2 - `#include < - 1 - - 0 - - -36 - - - 2 - > (:include decl:) - - - - - 0 - - -26 - - - - 0 - - - - - 0 - - -27 - - 3 2 @@ -6923,51 +7147,18 @@ 0 - -32 + -37 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] + :)> [@namespace boost { (:include decl:) }@] 0 - -28 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -34 - - - 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] - - - - - 0 - - -38 - - - - 0 - - - - - 0 - - -31 + -33 @@ -6980,7 +7171,29 @@ 0 - -29 + -31 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -18 + + + 2 + :)> [@namespace boost { (:include def pre_indent="4":) }@] + + + + + 0 + + -32 @@ -6995,101 +7208,7 @@ 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -32 - - - - 1 - 2 - [@namespace boost { (:include api pre_indent="4":) }@] - - - - - 0 - - -33 - - - - 1 - 2 - [@#include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] - - - - - 0 - - -34 - - - - 3 - 2 - [@#include <(:link - 1 - - 0 - - -32 - - - 2 - :)> #include <boost/current_function.hpp> #include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] - - - - - 0 - - -35 - - - - 3 - 2 - [@#include <(:link - 1 - - 0 - - -32 - - - 2 - :)> namespace boost { (:include api pre_indent="4":) }@] - - - - - 0 - - -36 - - - - 1 - 2 - (:include api:) - - - - - 0 - - -37 - - - - 0 + :)> [@namespace boost { (:include def pre_indent="4":) }@] @@ -7114,6 +7233,87 @@ 0 + + + 0 + + -34 + + + + 1 + 2 + [@#include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -35 + + + + 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 + + -36 + + + + 3 + 2 + [@#include <(:link + 1 + + 0 + + -18 + + + 2 + :)> namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -37 + + + + 1 + 2 + (:include api:) + + + + + 0 + + -38 + + + + 0 + + 0 @@ -7125,6 +7325,17 @@ 0 + + + 0 + + -42 + + + + 0 + + @@ -7135,14 +7346,14 @@ - 48 + 49 reno_context_map - 37 + 38 -5 @@ -7206,9 +7417,6 @@ -25 - - -30 - -26 @@ -7219,19 +7427,25 @@ -28 - -38 + -29 + + + -30 + + + -33 -31 - - -29 - -32 - -33 + -39 + + + -40 -34 @@ -7246,19 +7460,19 @@ -37 - -39 - - - -40 + -38 -41 + + -42 + - 37 + 38 @@ -7273,7 +7487,7 @@ - -23 + -28 @@ -7290,7 +7504,7 @@ - -24 + -29 @@ -7307,7 +7521,7 @@ - -17 + -21 @@ -7324,7 +7538,7 @@ - -37 + -38 @@ -7348,7 +7562,7 @@ - -32 + -18 @@ -7376,7 +7590,7 @@ - -27 + -31 @@ -7408,7 +7622,7 @@ - -20 + -25 @@ -7436,7 +7650,7 @@ - -38 + -41 @@ -7464,7 +7678,7 @@ - -11 + -14 @@ -7492,7 +7706,7 @@ - -19 + -24 @@ -7520,7 +7734,7 @@ - -7 + -10 @@ -7544,7 +7758,7 @@ - -40 + -39 @@ -7568,7 +7782,7 @@ - -31 + -33 @@ -7592,7 +7806,7 @@ - -26 + -20 @@ -7616,7 +7830,7 @@ - -30 + -23 @@ -7640,7 +7854,7 @@ - -34 + -35 @@ -7664,7 +7878,7 @@ - -10 + -13 @@ -7688,7 +7902,7 @@ - -33 + -34 @@ -7712,7 +7926,7 @@ - -9 + -12 @@ -7740,7 +7954,39 @@ - -25 + -30 + + + + + + + 3 + 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A + 1770110914 + 587 + 1566 + 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D + 3929437933 + 361 + 213 + CD1241D84950468704F3C3F04116B8DA5162A8BEA4364F10951232F49113C5DE + 1658463867 + 121 + 238 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + -5 @@ -7768,7 +8014,7 @@ - -21 + -26 @@ -7796,7 +8042,7 @@ - -28 + -32 @@ -7820,7 +8066,7 @@ - -22 + -27 @@ -7844,7 +8090,7 @@ - -14 + -17 @@ -7868,7 +8114,7 @@ - -35 + -36 @@ -7892,7 +8138,7 @@ - -15 + -6 @@ -7920,7 +8166,7 @@ - -12 + -15 @@ -7948,7 +8194,7 @@ - -16 + -19 @@ -7976,7 +8222,7 @@ - -18 + -22 @@ -8004,7 +8250,7 @@ - -13 + -16 @@ -8032,7 +8278,7 @@ - -29 + -8 @@ -8060,7 +8306,7 @@ - -6 + -9 @@ -8084,7 +8330,7 @@ - -36 + -37 @@ -8112,7 +8358,7 @@ - -8 + -11 @@ -8140,7 +8386,7 @@ - -5 + -7 @@ -8164,7 +8410,7 @@ - -41 + -40 @@ -8188,7 +8434,7 @@ - -39 + -42 @@ -8198,7 +8444,7 @@ - 49 + 50 tag_index @@ -8212,15 +8458,6 @@ - - - 0 - - -5 - - - error_info free function - 0 @@ -8228,7 +8465,7 @@ -6 - diagnostic_information free function + noalso noindex tutorial @@ -8246,7 +8483,7 @@ -8 - + exception_ptr free function @@ -8255,7 +8492,7 @@ -9 - + diagnostic_information free function @@ -8264,7 +8501,7 @@ -10 - diagnostic_information tutorial + error_info free function @@ -8273,7 +8510,7 @@ -11 - exception_ptr free function + @@ -8282,7 +8519,7 @@ -12 - exception_ptr free function + @@ -8291,7 +8528,7 @@ -13 - exception_ptr free function + diagnostic_information tutorial @@ -8300,7 +8537,7 @@ -14 - noalso noindex tutorial + exception_ptr free function @@ -8309,7 +8546,7 @@ -15 - noalso noindex tutorial + exception_ptr free function @@ -8318,7 +8555,7 @@ -16 - type + exception_ptr free function @@ -8327,7 +8564,7 @@ -17 - tutorial + noalso noindex tutorial @@ -8336,7 +8573,7 @@ -18 - exception_ptr type + @@ -8345,7 +8582,7 @@ -19 - error_info free function + type @@ -8354,7 +8591,7 @@ -20 - function + tutorial @@ -8363,7 +8600,7 @@ -21 - error_info free function + tutorial @@ -8372,7 +8609,7 @@ -22 - + exception_ptr type @@ -8381,7 +8618,7 @@ -23 - noindex + @@ -8390,7 +8627,7 @@ -24 - tutorial + error_info free function @@ -8399,16 +8636,7 @@ -25 - free function - - - - 0 - - -30 - - - + function @@ -8417,7 +8645,7 @@ -26 - tutorial + error_info free function @@ -8426,7 +8654,7 @@ -27 - type + @@ -8435,25 +8663,7 @@ -28 - type - - - - 0 - - -38 - - - function - - - - 0 - - -31 - - - + noindex @@ -8462,16 +8672,16 @@ -29 - exception_ptr free function + tutorial 0 - -32 + -30 - + free function @@ -8480,7 +8690,43 @@ -33 - error_info + + + + + 0 + + -31 + + + type + + + + 0 + + -32 + + + type + + + + 0 + + -39 + + + noalso noindex tutorial + + + + 0 + + -40 + + + noalso noindex tutorial @@ -8489,7 +8735,7 @@ -34 - + error_info @@ -8516,26 +8762,17 @@ -37 + + + + + 0 + + -38 + + index noindex - - - 0 - - -39 - - - noalso noindex tutorial - - - - 0 - - -40 - - - noalso noindex tutorial - 0 @@ -8543,6 +8780,15 @@ -41 + function + + + + 0 + + -42 + + noalso noindex tutorial diff --git a/doc/throw_exception.html b/doc/throw_exception.html index ab789e9..32229c2 100644 --- a/doc/throw_exception.html +++ b/doc/throw_exception.html @@ -43,6 +43,7 @@ boost diff --git a/doc/throw_exception_hpp.html b/doc/throw_exception_hpp.html index 659f4cd..8efa28d 100644 --- a/doc/throw_exception_hpp.html +++ b/doc/throw_exception_hpp.html @@ -48,6 +48,7 @@ boost

    See Also: