From e020b0f282ed122238f8530ba707e08484502311 Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Thu, 9 Apr 2009 05:52:31 +0000 Subject: [PATCH] documentation update [SVN r52281] --- doc/frequently_asked_questions.html | 2 +- doc/source/boost-exception.reno | 5208 +++++++++++++-------------- 2 files changed, 2605 insertions(+), 2605 deletions(-) diff --git a/doc/frequently_asked_questions.html b/doc/frequently_asked_questions.html index af81879..e776065 100644 --- a/doc/frequently_asked_questions.html +++ b/doc/frequently_asked_questions.html @@ -19,7 +19,7 @@ -

Frequently Asked Questions

+

Frequently Asked Questions

Why doesn't boost::exception derive from std::exception?

Despite that virtual inheritance should be used in deriving from base exception types, many programmers fail to follow this principle when deriving from std::exception. If boost::exception derives from std::exception, using the enable_error_info function with such user-defined types would introduce dangerous ambiguity which would break all catch(std::exception &) statements.

diff --git a/doc/source/boost-exception.reno b/doc/source/boost-exception.reno index a6a998a..64f4544 100644 --- a/doc/source/boost-exception.reno +++ b/doc/source/boost-exception.reno @@ -48,6 +48,55 @@ reno_context + + + + + + 2 + F7537DC10435D0F7CC368E0FC747B2B1169E1CE60FCBAE8AC86F2256667C95B2 + 3301865866 + 4151 + 557 + D747B0A0953B72747224DE7856DB793A4BFF7B73793873CF22810FCB304A7310 + 505472020 + 3665 + 26 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + + <string>diagnostic_information</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 6 + + reno_context + @@ -89,44 +138,6 @@ (:include include:) (:auto also:) - - - 0 - - 6 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>transporting of arbitrary data to the catch site</string> - - - tutorial_transporting_data - - - - - - 1 - 2 - (:include include:) (:auto also:) - - 0 @@ -135,100 +146,6 @@ 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 - - 8 - - reno_context - - - - - - - 2 - 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 - 2533933282 - 8724 - 615 - 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 - 2078296250 - 305 - 8156 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>copy_exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 9 - - reno_context - @@ -270,6 +187,89 @@ (:include include:) (:auto also:) + + + 0 + + 8 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>transporting of arbitrary data to the catch site</string> + + + tutorial_transporting_data + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 9 + + 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 @@ -278,6 +278,55 @@ reno_context + + + + + + 2 + 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 + 2533933282 + 8724 + 615 + 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 + 2078296250 + 305 + 8156 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>copy_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 11 + + reno_context + @@ -323,7 +372,7 @@ 0 - 11 + 12 reno_context @@ -368,7 +417,52 @@ 0 - 12 + 13 + + reno_context + + + + + + + 1 + 2F432507CFD796BE673F33D9AC68C535F1ED1F4FCD3A8E3AEEC320D9795FB4AE + 2319362875 + 2574 + 323 + + + + + + 0 + ../../../../boost/exception/get_error_info.hpp + 0 + 0 + + + + + <string>boost/exception/get_error_info.hpp</string> + + + exception_get_error_info_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 14 reno_context @@ -406,7 +500,7 @@ 0 - 13 + 15 reno_context @@ -455,7 +549,7 @@ 0 - 14 + 16 reno_context @@ -491,7 +585,7 @@ 0 - 15 + 17 reno_context @@ -525,7 +619,7 @@ 0 - 16 + 18 reno_context @@ -566,7 +660,7 @@ 0 - -12 + -14 2 @@ -577,7 +671,7 @@ 0 - -15 + -17 @@ -590,7 +684,7 @@ 0 - -16 + -18 @@ -603,7 +697,7 @@ 0 - 17 + 19 reno_context @@ -652,7 +746,7 @@ 0 - 18 + 20 reno_context @@ -701,7 +795,50 @@ 0 - 19 + 21 + + reno_context + + + + + + + 1 + E444EE9697EEADFDE0767E1D0242FC0E70D98E61FB1F0FFA099648DE509B82F3 + 94503238 + 773 + 374 + + + + + + 0 + ../../example/info_tuple.cpp + 0 + 0 + + + + + <string>adding grouped data to exceptions</string> + + + grouping_data + + + + + + 0 + + + + + 0 + + 22 reno_context @@ -744,56 +881,7 @@ 0 - 20 - - reno_context - - - - - - - 2 - F7537DC10435D0F7CC368E0FC747B2B1169E1CE60FCBAE8AC86F2256667C95B2 - 3301865866 - 4151 - 557 - D747B0A0953B72747224DE7856DB793A4BFF7B73793873CF22810FCB304A7310 - 505472020 - 3665 - 26 - - - - - - 0 - ../../../../boost/exception/diagnostic_information.hpp - 0 - 0 - - - - - <string>diagnostic_information</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 21 + 23 reno_context @@ -846,7 +934,7 @@ 0 - 22 + 24 reno_context @@ -895,7 +983,7 @@ 0 - 23 + 25 reno_context @@ -936,94 +1024,6 @@ (:include include:) (:auto also:) - - - 0 - - 24 - - reno_context - - - - - - - 1 - E444EE9697EEADFDE0767E1D0242FC0E70D98E61FB1F0FFA099648DE509B82F3 - 94503238 - 773 - 374 - - - - - - 0 - ../../example/info_tuple.cpp - 0 - 0 - - - - - <string>adding grouped data to exceptions</string> - - - grouping_data - - - - - - 0 - - - - - 0 - - 25 - - reno_context - - - - - - - 1 - 2F432507CFD796BE673F33D9AC68C535F1ED1F4FCD3A8E3AEEC320D9795FB4AE - 2319362875 - 2574 - 323 - - - - - - 0 - ../../../../boost/exception/get_error_info.hpp - 0 - 0 - - - - - <string>boost/exception/get_error_info.hpp</string> - - - exception_get_error_info_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - 0 @@ -1217,6 +1217,59 @@ 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 + @@ -1258,7 +1311,50 @@ 0 - 31 + 32 + + reno_context + + + + + + + 1 + 9E8DCE3BCF462A3A332DA70F61E46FA5C2AB791B95E33D3F2AF1307F53C84B1C + 1960675522 + 6483 + 591 + + + + + + 0 + ../../example/example_io.cpp + 0 + 0 + + + + + <string>diagnostic_information example</string> + + + + + + + + + 0 + + + + + 0 + + 33 reno_context @@ -1301,7 +1397,7 @@ 0 - 32 + 34 reno_context @@ -1350,7 +1446,7 @@ 0 - 33 + 35 reno_context @@ -1399,7 +1495,7 @@ 0 - 34 + 36 reno_context @@ -1437,7 +1533,7 @@ 0 - 35 + 37 reno_context @@ -1475,7 +1571,7 @@ 0 - 36 + 38 reno_context @@ -1524,7 +1620,7 @@ 0 - 37 + 39 reno_context @@ -1573,7 +1669,7 @@ 0 - 38 + 40 reno_context @@ -1611,7 +1707,7 @@ 0 - 39 + 41 reno_context @@ -1660,7 +1756,7 @@ 0 - 40 + 42 reno_context @@ -1709,7 +1805,7 @@ 0 - 41 + 43 reno_context @@ -1762,7 +1858,7 @@ 0 - 42 + 44 reno_context @@ -1805,7 +1901,7 @@ 0 - 43 + 45 reno_context @@ -1843,7 +1939,7 @@ 0 - 44 + 46 reno_context @@ -1882,102 +1978,6 @@ 0 - - - 0 - - 45 - - reno_context - - - - - - - 1 - 9E8DCE3BCF462A3A332DA70F61E46FA5C2AB791B95E33D3F2AF1307F53C84B1C - 1960675522 - 6483 - 591 - - - - - - 0 - ../../example/example_io.cpp - 0 - 0 - - - - - <string>diagnostic_information example</string> - - - - - - - - - 0 - - - - - 0 - - 46 - - 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 @@ -2973,6 +2973,28 @@ -39 + + 0 + + + + + 0 + + -40 + + + + 0 + + + + + 0 + + -41 + + 7 2 @@ -2981,7 +3003,7 @@ 0 - -39 + -41 2 @@ -2990,7 +3012,7 @@ 0 - -41 + -43 2 @@ -3010,7 +3032,7 @@ 0 - -40 + -42 @@ -3021,7 +3043,7 @@ 0 - -40 + -42 2 @@ -3039,7 +3061,7 @@ 0 - -10 + -11 2 @@ -3048,35 +3070,13 @@ 0 - -46 + -30 2 decl pre_indent="4":) };@] - - - 0 - - -41 - - - - 0 - - - - - 0 - - -42 - - - - 0 - - 0 @@ -3319,54 +3319,7 @@ - 11 - 2 - [@(:include - 1 - - 0 - - -39 - - - 2 - def:) (:include - 1 - - 0 - - -40 - - - 2 - decl:) typedef (:link - 1 - - 0 - - -40 - - - 2 - :)<struct tag_throw_function,char const *> throw_function; typedef (:link - 1 - - 0 - - -40 - - - 2 - :)<struct tag_throw_file,char const *> throw_file; typedef (:link - 1 - - 0 - - -40 - - - 2 - :)<struct tag_throw_line,int> throw_line;@] + 0 @@ -3388,7 +3341,54 @@ - 0 + 11 + 2 + [@(:include + 1 + + 0 + + -41 + + + 2 + def:) (:include + 1 + + 0 + + -42 + + + 2 + decl:) typedef (:link + 1 + + 0 + + -42 + + + 2 + :)<struct tag_throw_function,char const *> throw_function; typedef (:link + 1 + + 0 + + -42 + + + 2 + :)<struct tag_throw_file,char const *> throw_file; typedef (:link + 1 + + 0 + + -42 + + + 2 + :)<struct tag_throw_line,int> throw_line;@] @@ -3432,7 +3432,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -35 + + + 2 + decl:)@] @@ -3564,18 +3575,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -33 - - - 2 - decl:)@] + 0 @@ -3604,7 +3604,7 @@ 0 - -22 + -24 2 @@ -3640,6 +3640,17 @@ -30 + + 0 + + + + + 0 + + -31 + + 5 2 @@ -3648,7 +3659,7 @@ 0 - -20 + -5 2 @@ -3664,17 +3675,6 @@ decl:)@] - - - 0 - - -31 - - - - 0 - - 0 @@ -3877,7 +3877,7 @@ 0 - -9 + -7 2 @@ -3899,7 +3899,7 @@ 0 - -30 + -31 2 @@ -3917,7 +3917,7 @@ 0 - -7 + -9 2 @@ -3926,7 +3926,7 @@ 0 - -25 + -13 2 @@ -3986,7 +3986,7 @@ 0 - -17 + -19 2 @@ -4019,7 +4019,7 @@ 0 - -40 + -42 2 @@ -4052,7 +4052,7 @@ 0 - -40 + -42 2 @@ -4061,7 +4061,7 @@ 0 - -13 + -15 2 @@ -4083,7 +4083,7 @@ 0 - -32 + -34 2 @@ -4092,7 +4092,7 @@ 0 - -18 + -20 2 @@ -4101,7 +4101,7 @@ 0 - -8 + -10 2 @@ -4110,7 +4110,7 @@ 0 - -5 + -6 2 @@ -4119,7 +4119,7 @@ 0 - -37 + -39 2 @@ -4141,7 +4141,7 @@ 0 - -23 + -25 2 @@ -4150,7 +4150,7 @@ 0 - -36 + -38 2 @@ -4212,18 +4212,9 @@ - 5 + 3 2 - [@(:link - 1 - - 0 - - -18 - - - 2 - :) (:link + [@template <class E> std::string (:link 1 0 @@ -4232,7 +4223,7 @@ 2 - :)();@] + :)( E const & e );@] @@ -4243,7 +4234,27 @@ - 0 + 5 + 2 + [@(:link + 1 + + 0 + + -20 + + + 2 + :) (:link + 1 + + 0 + + -6 + + + 2 + :)();@] @@ -4254,7 +4265,36 @@ - 0 + 7 + 2 + [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link + 1 + + 0 + + -7 + + + 2 + mod="/":)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link + 1 + + 0 + + -42 + + + 2 + :)<Tag1,T1>, ..., (:link + 1 + + 0 + + -42 + + + 2 + :)<TagN,TN> > const & v );@] @@ -4265,27 +4305,7 @@ - 5 - 2 - [@template <class T> (:link - 1 - - 0 - - -18 - - - 2 - :) (:link - 1 - - 0 - - -8 - - - 2 - :)( T const & e );@] + 0 @@ -4296,36 +4316,7 @@ - 7 - 2 - [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link - 1 - - 0 - - -9 - - - 2 - mod="/":)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link - 1 - - 0 - - -40 - - - 2 - :)<Tag1,T1>, ..., (:link - 1 - - 0 - - -40 - - - 2 - :)<TagN,TN> > const & v );@] + 0 @@ -4338,7 +4329,16 @@ 5 2 - [@(:link + [@template <class T> (:link + 1 + + 0 + + -20 + + + 2 + :) (:link 1 0 @@ -4347,6 +4347,28 @@ 2 + :)( T const & e );@] + + + + + 0 + + -11 + + + + 5 + 2 + [@(:link + 1 + + 0 + + -11 + + + 2 mod="m":)( (:link 1 @@ -4359,17 +4381,6 @@ mod="m":) const & v );@] - - - 0 - - -11 - - - - 0 - - 0 @@ -4389,27 +4400,7 @@ - 5 - 2 - [@template <class E, class Tag, class T> E const & (:link - 1 - - 0 - - -13 - - - 2 - mod="/":)( E const & x, (:link - 1 - - 0 - - -40 - - - 2 - :)<Tag,T> const & v );@] + 0 @@ -4431,7 +4422,27 @@ - 0 + 5 + 2 + [@template <class E, class Tag, class T> E const & (:link + 1 + + 0 + + -15 + + + 2 + mod="/":)( E const & x, (:link + 1 + + 0 + + -42 + + + 2 + :)<Tag,T> const & v );@] @@ -4453,18 +4464,7 @@ - 3 - 2 - [@template <class T> ---unspecified--- (:link - 1 - - 0 - - -17 - - - 2 - :)( T const & x );@] + 0 @@ -4475,18 +4475,7 @@ - 3 - 2 - [@typedef ---unspecified--- (:link - 1 - - 0 - - -18 - - - 2 - :);@] + 0 @@ -4497,7 +4486,18 @@ - 0 + 3 + 2 + [@template <class T> ---unspecified--- (:link + 1 + + 0 + + -19 + + + 2 + :)( T const & x );@] @@ -4510,7 +4510,7 @@ 3 2 - [@template <class E> std::string (:link + [@typedef ---unspecified--- (:link 1 0 @@ -4519,7 +4519,7 @@ 2 - :)( E const & e );@] + :);@] @@ -4541,18 +4541,7 @@ - 3 - 2 - [@template <class T> ---unspecified--- (:link - 1 - - 0 - - -22 - - - 2 - :)( T const & e );@] + 0 @@ -4563,90 +4552,7 @@ - 19 - 2 - [@#if !defined( BOOST_EXCEPTION_DISABLE ) #include <(:link - 1 - - 0 - - -7 - - - 2 - :)> #include <boost/current_function.hpp> #define (:link - 1 - - 0 - - -23 - - - 2 - :)(x)\ ::boost::(:link - 1 - - 0 - - -36 - - - 2 - :)( ::boost::(:link - 1 - - 0 - - -17 - - - 2 - :)(x) <<\ ::boost::(:link - 1 - - 0 - - -7 - - - 2 - |throw_function:)(BOOST_CURRENT_FUNCTION) <<\ ::boost::(:link - 1 - - 0 - - -7 - - - 2 - |throw_file:)(__FILE__) <<\ ::boost::(:link - 1 - - 0 - - -7 - - - 2 - |throw_line:)((int)__LINE__) ) #else #define (:link - 1 - - 0 - - -23 - - - 2 - :)(x) ::boost::(:link - 1 - - 0 - - -36 - - - 2 - :)(x) #endif@] + 0 @@ -4657,7 +4563,18 @@ - 0 + 3 + 2 + [@template <class T> ---unspecified--- (:link + 1 + + 0 + + -24 + + + 2 + :)( T const & e );@] @@ -4668,7 +4585,90 @@ - 0 + 19 + 2 + [@#if !defined( BOOST_EXCEPTION_DISABLE ) #include <(:link + 1 + + 0 + + -9 + + + 2 + :)> #include <boost/current_function.hpp> #define (:link + 1 + + 0 + + -25 + + + 2 + :)(x)\ ::boost::(:link + 1 + + 0 + + -38 + + + 2 + :)( ::boost::(:link + 1 + + 0 + + -19 + + + 2 + :)(x) <<\ ::boost::(:link + 1 + + 0 + + -9 + + + 2 + |throw_function:)(BOOST_CURRENT_FUNCTION) <<\ ::boost::(:link + 1 + + 0 + + -9 + + + 2 + |throw_file:)(__FILE__) <<\ ::boost::(:link + 1 + + 0 + + -9 + + + 2 + |throw_line:)((int)__LINE__) ) #else #define (:link + 1 + + 0 + + -25 + + + 2 + :)(x) ::boost::(:link + 1 + + 0 + + -38 + + + 2 + :)(x) #endif@] @@ -4756,7 +4756,27 @@ - 0 + 5 + 2 + [@(:link + 1 + + 0 + + -51 + + + 2 + mod="m":) const & (:link + 1 + + 0 + + -30 + + + 2 + mod="m":)() const;@] @@ -4777,6 +4797,28 @@ -32 + + 0 + + + + + 0 + + -33 + + + + 0 + + + + + 0 + + -34 + + 5 2 @@ -4785,7 +4827,7 @@ 0 - -32 + -34 2 @@ -4794,7 +4836,7 @@ 0 - -39 + -41 2 @@ -4805,7 +4847,7 @@ 0 - -33 + -35 @@ -4825,35 +4867,13 @@ 0 - -33 + -35 2 :)( E const & x );@] - - - 0 - - -34 - - - - 0 - - - - - 0 - - -35 - - - - 0 - - 0 @@ -4862,27 +4882,7 @@ - 5 - 2 - [@#ifdef BOOST_NO_EXCEPTIONS void (:link - 1 - - 0 - - -36 - - - 2 - :)( std::exception const & e ); // user defined #else template <class E> void (:link - 1 - - 0 - - -36 - - - 2 - :)( E const & e ); #endif@] + 0 @@ -4893,27 +4893,7 @@ - 5 - 2 - [@void (:link - 1 - - 0 - - -37 - - - 2 - :)( (:link - 1 - - 0 - - -18 - - - 2 - :) const & ep ); + 0 @@ -4924,7 +4904,27 @@ - 0 + 5 + 2 + [@#ifdef BOOST_NO_EXCEPTIONS void (:link + 1 + + 0 + + -38 + + + 2 + :)( std::exception const & e ); // user defined #else template <class E> void (:link + 1 + + 0 + + -38 + + + 2 + :)( E const & e ); #endif@] @@ -4935,9 +4935,9 @@ - 3 + 5 2 - [@class (:link + [@void (:link 1 0 @@ -4946,7 +4946,16 @@ 2 - :);@] + :)( (:link + 1 + + 0 + + -20 + + + 2 + :) const & ep ); @@ -4957,18 +4966,7 @@ - 3 - 2 - [@template <class Tag,class T> class (:link - 1 - - 0 - - -40 - - - 2 - :);@] + 0 @@ -4979,9 +4977,9 @@ - 7 + 3 2 - [@(:link + [@class (:link 1 0 @@ -4990,25 +4988,7 @@ 2 - mod="m":)(); (:link - 1 - - 0 - - -41 - - - 2 - mod="m":)( (:link - 1 - - 0 - - -39 - - - 2 - :) const & x );@] + :);@] @@ -5019,7 +4999,18 @@ - 0 + 3 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -42 + + + 2 + :);@] @@ -5030,7 +5021,36 @@ - 0 + 7 + 2 + [@(:link + 1 + + 0 + + -43 + + + 2 + mod="m":)(); (:link + 1 + + 0 + + -43 + + + 2 + mod="m":)( (:link + 1 + + 0 + + -41 + + + 2 + :) const & x );@] @@ -5063,27 +5083,7 @@ - 5 - 2 - [@(:link - 1 - - 0 - - -51 - - - 2 - mod="m":) const & (:link - 1 - - 0 - - -46 - - - 2 - mod="m":)() const;@] + 0 @@ -5275,7 +5275,52 @@ 29 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: The (:link + (:auto !!!:) (:include synopsis:) !!!!Returns: A string value that contains varying amount of implementation-specific diagnostic information about the passed exception object: *If E can be statically converted to boost::(:link + 1 + + 0 + + -41 + + + 2 + :), the returned value contains the string representations of all (:link + 1 + + 0 + + -42 + + + 2 + :) objects stored in the boost::(:link + 1 + + 0 + + -41 + + + 2 + :) through (:link + 1 + + 0 + + -15 + + + 2 + mod="/":), along with other diagnostic information relevant to the exception. If e can be dynamically converted to std::exception, the returned value also contains the what() string. *Otherwise, if E can be statically converted std::exception: **if e can be dynamically converted to boost::exception, the returned value is the same as if E could be statically converted to boost::(:link + 1 + + 0 + + -41 + + + 2 + :); **otherwise the returned value contains the what() string. *Otherwise, the boost:: 1 0 @@ -5284,25 +5329,52 @@ 2 - :) function must not be called outside of a catch block. !!!!Returns: * An (:link + template is not available. The string representation of each (:link 1 0 - -18 + -42 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 + :) object is deduced by a function call that is bound at the time the (:link 1 0 - -18 + -42 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 + :)<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 + + -42 + + + 2 + :)<Tag,T> (the return value is expected to be of type std::string.) #Unqualified call to to_string(x.(:link + 1 + + 0 + + -30 + + + 2 + mod="m":)()) (the return value is expected to be of type std::string.) #Unqualified call to s << x.(:link + 1 + + 0 + + -30 + + + 2 + mod="m":)(), where s is a std::ostringstream. The first successfully bound function is used at the time (:link 1 0 @@ -5311,52 +5383,16 @@ 2 - :) refer to the same exception object. * Correct implementation of (:link + :) is called; if all 3 overload resolutions are unsuccessful, the system is unable to convert the (:link 1 0 - -5 + -42 2 - :) may require compiler support, unless (:link - 1 - - 0 - - -22 - - - 2 - :) was used at the time the currently handled exception object was passed to throw. If (:link - 1 - - 0 - - -22 - - - 2 - :) was not used, and if the compiler does not provide the necessary support, then (:link - 1 - - 0 - - -5 - - - 2 - :) may return an (:link - 1 - - 0 - - -18 - - - 2 - :) that refers to an instance of (:link + :) object to string, and ''an unspecified stub string value is used without issuing a compile error.'' !!!!Notes: *The format of the returned string is unspecified. *The returned string is ''not'' user-friendly. *The returned string may include additional platform-specific diagnostic information. (:include 1 0 @@ -5365,43 +5401,7 @@ 2 - :). In this case, if the original exception object derives from boost::(:link - 1 - - 0 - - -39 - - - 2 - :), then the boost::(:link - 1 - - 0 - - -39 - - - 2 - :) sub-object of the (:link - 1 - - 0 - - -32 - - - 2 - :) object is initialized by the boost::(:link - 1 - - 0 - - -39 - - - 2 - :) copy constructor. + :) @@ -5411,6 +5411,176 @@ -6 + + 29 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: The (:link + 1 + + 0 + + -6 + + + 2 + :) function must not be called outside of a catch block. !!!!Returns: * An (:link + 1 + + 0 + + -20 + + + 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 + + -20 + + + 2 + :) that refers to an instance of std::bad_alloc. !!!!Throws: Nothing. !!!!Notes: * It is unspecified whether the return values of two successive calls to (:link + 1 + + 0 + + -6 + + + 2 + :) refer to the same exception object. * Correct implementation of (:link + 1 + + 0 + + -6 + + + 2 + :) may require compiler support, unless (:link + 1 + + 0 + + -24 + + + 2 + :) was used at the time the currently handled exception object was passed to throw. If (:link + 1 + + 0 + + -24 + + + 2 + :) was not used, and if the compiler does not provide the necessary support, then (:link + 1 + + 0 + + -6 + + + 2 + :) may return an (:link + 1 + + 0 + + -20 + + + 2 + :) that refers to an instance of (:link + 1 + + 0 + + -34 + + + 2 + :). In this case, if the original exception object derives from boost::(:link + 1 + + 0 + + -41 + + + 2 + :), then the boost::(:link + 1 + + 0 + + -41 + + + 2 + :) sub-object of the (:link + 1 + + 0 + + -34 + + + 2 + :) object is initialized by the boost::(:link + 1 + + 0 + + -41 + + + 2 + :) copy constructor. + + + + + 0 + + -7 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + 1 + + 0 + + -41 + + + 2 + :), or a type that derives (indirectly) from boost::(:link + 1 + + 0 + + -41 + + + 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 + + -8 + + 11 2 @@ -5419,7 +5589,7 @@ 0 - -39 + -41 2 @@ -5428,7 +5598,7 @@ 0 - -39 + -41 2 @@ -5437,7 +5607,7 @@ 0 - -42 + -44 2 @@ -5446,7 +5616,7 @@ 0 - -31 + -33 2 @@ -5455,7 +5625,7 @@ 0 - -24 + -21 2 @@ -5466,7 +5636,7 @@ 0 - -7 + -9 @@ -5479,7 +5649,7 @@ 0 - -8 + -10 @@ -5490,7 +5660,7 @@ 0 - -22 + -24 2 @@ -5499,7 +5669,7 @@ 0 - -5 + -6 2 @@ -5510,38 +5680,7 @@ 0 - -9 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link - 1 - - 0 - - -39 - - - 2 - :), or a type that derives (indirectly) from boost::(:link - 1 - - 0 - - -39 - - - 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 - - -10 + -11 @@ -5552,7 +5691,7 @@ 0 - -40 + -42 2 @@ -5563,7 +5702,7 @@ 0 - -11 + -12 @@ -5574,7 +5713,7 @@ 0 - -20 + -5 2 @@ -5583,7 +5722,7 @@ 0 - -39 + -41 2 @@ -5592,7 +5731,7 @@ 0 - -39 + -41 2 @@ -5601,7 +5740,7 @@ 0 - -13 + -15 2 @@ -5619,7 +5758,7 @@ 0 - -39 + -41 2 @@ -5628,7 +5767,7 @@ 0 - -39 + -41 2 @@ -5637,7 +5776,7 @@ 0 - -20 + -5 2 @@ -5646,314 +5785,13 @@ 0 - -45 + -32 2 :) - - - 0 - - -12 - - - - 65 - 2 - (:auto !!!:) !!!Why doesn't boost::exception derive from std::exception? Despite that (:link - 1 - - 0 - - -38 - - - 2 - |virtual inheritance should be used in deriving from base exception types:), many programmers fail to follow this principle when deriving from std::exception. If boost::(:link - 1 - - 0 - - -39 - - - 2 - :) derives from std::exception, using the (:link - 1 - - 0 - - -17 - - - 2 - :) function with such user-defined types would introduce dangerous ambiguity which would break all catch(std::exception &) statements. Of course, boost::(:link - 1 - - 0 - - -39 - - - 2 - :) should not be used to replace std::exception as a base type in exception type hierarchies. Instead, it should be included as a virtual base, in addition to std::exception (which should also be derived virtually.) !!!Why is boost::exception abstract? To prevent exception-neutral contexts from erroneously erasing the type of the original exception when adding (:link - 1 - - 0 - - -40 - - - 2 - :) to an active exception object: [@catch( boost::(:link - 1 - - 0 - - -39 - - - 2 - :) & e ) { e (:link - 1 - - 0 - - -13 - - - 2 - |<<:) foo_info(foo); throw e; //Compile error: boost::(:link - 1 - - 0 - - -39 - - - 2 - :) is abstract }@] The correct code is: [@catch( boost::(:link - 1 - - 0 - - -39 - - - 2 - :) & e ) { e (:link - 1 - - 0 - - -13 - - - 2 - |<<:) foo_info(foo); throw; //Okay, re-throwing the original exception object. }@] !!!What is the space overhead of the boost::exception base class? The space overhead for the boost::exception data members is negligible in the context of exception handling. Throwing objects that derive from boost::(:link - 1 - - 0 - - -39 - - - 2 - :) does not by itself cause dynamic memory allocations. Deriving from boost::(:link - 1 - - 0 - - -39 - - - 2 - :) enables any data to be added to exceptions, which usually does allocate memory. However, this memory is reclaimed when the exception has been handled, and since typically user code does not allocate memory during the unrolling of the stack, adding error info to exceptions should not cause memory fragmentation. !!!Should I use boost::throw_exception or BOOST_THROW_EXCEPTION or just throw? The benefit of calling boost::(:link - 1 - - 0 - - -36 - - - 2 - :) instead of using throw directly is that it ensures that the emitted exception derives from boost::(:link - 1 - - 0 - - -39 - - - 2 - :) and that it is compatible with boost::(:link - 1 - - 0 - - -5 - - - 2 - :). The (:link - 1 - - 0 - - -23 - - - 2 - :) macro also results in a call to boost::(:link - 1 - - 0 - - -36 - - - 2 - :), but in addition it records in the exception object the __FILE__ and __LINE__ of the throw, as well as the pretty name of the function that throws. This has virtually no overhead, yet enables boost::(:link - 1 - - 0 - - -20 - - - 2 - :) to compose a more useful, if not user-friendly message. Typical use of boost::(:link - 1 - - 0 - - -20 - - - 2 - :) is: [@catch( boost::exception & e ) { std::cerr << "OMG!" << boost::diagnostic_information(e); } catch( ... ) { std::cerr << "OMG!!!"; }@] This is a possible message it may display, the first line is only possible if (:link - 1 - - 0 - - -23 - - - 2 - :) is used: [@example_io.cpp(83): Throw in function void parse_file(const char *) Dynamic exception type: class file_open_error std::exception::what: example_io error [struct tag_errno_code *] = 2, OS says "No such file or directory" [struct tag_file_name *] = tmp1.xml [struct tag_function *] = fopen [struct tag_open_mode *] = rb@] !!!Why is boost::exception integrated in boost::throw_exception? The boost::(:link - 1 - - 0 - - -36 - - - 2 - :) function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::(:link - 1 - - 0 - - -39 - - - 2 - :) as a base of any exception passed to boost::(:link - 1 - - 0 - - -36 - - - 2 - :). Such concerns are dictated by the typical strict interpretation of a common principle in C and C++, that users only pay for features they actually use. The problem is that users of Boost Exception can't by themselves cause a library to throw types that derive from boost::(:link - 1 - - 0 - - -39 - - - 2 - :), and without this they can't use any of the Boost Exception facilities. For example, if a user wants to use Boost Serialization in a separate thread, it is desirable to be able to transport exceptions emitted by that library into the main thread where they can be analyzed to generate a user-friendly message. This can be easily achieved using boost::(:link - 1 - - 0 - - -18 - - - 2 - :), but this requires that Boost Serialization throws exceptions using boost::(:link - 1 - - 0 - - -22 - - - 2 - :). If Boost Serialization calls boost::(:link - 1 - - 0 - - -36 - - - 2 - :) to throw, this behavior happens automatically and transparently. The cost of this integration is: * In terms of space: a pointer and 3 ints are added to the static size of exception objects. * In terms of speed: the pointer is initialized to null at the point of the throw. * In terms of coupling: about 400 self-contained lines of C++ with no external includes. !!!Why use operator<< overload for adding info to exceptions? Before throwing an object of type that derives from boost::(:link - 1 - - 0 - - -39 - - - 2 - :), it is often desirable to add one or more (:link - 1 - - 0 - - -40 - - - 2 - :) objects in it. The syntactic sugar provided by (:link - 1 - - 0 - - -13 - - - 2 - :) allows this to be done directly in a throw expression: [@throw error() (:link - 1 - - 0 - - -13 - - - 2 - |<<:) foo_info(foo) (:link - 1 - - 0 - - -13 - - - 2 - |<<:) bar_info(bar);@] which saves typing compared to this possible alternative: [@error e; e.add(foo_info(foo)); e.add(bar_info(bar)); throw e;@] and looks better than something like: [@throw error().add(foo_info(foo)).add(bar_info(bar));@] - - 0 @@ -5962,36 +5800,9 @@ - 7 + 1 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link - 1 - - 0 - - -39 - - - 2 - :), or a type that derives (indirectly) from boost::(:link - 1 - - 0 - - -39 - - - 2 - :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link - 1 - - 0 - - -40 - - - 2 - :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -6002,27 +5813,9 @@ - 33 + 65 2 - (:auto !!!:) Traditionally, when using exceptions to report failures, the throw site: *creates an exception object of the appropriate type, and *stuffs it with data relevant to the detected error. A higher context in the program contains a catch statement which: *selects failures based on exception types, and *inspects exception objects for data required to deal with the problem. The main issue with this "traditional" approach is that often, the data available at the point of the throw is insufficient for the catch site to handle the failure. Here is an example of a catch statement: [@catch( file_read_error & e ) { std::cerr << e.file_name(); }@] And here is a possible matching throw: [@void read_file( FILE * f ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error(???); .... }@] Clearly, the problem is that the handler requires a file name but the read_file function does not have a file name to put in the exception object; all it has is a FILE pointer! In an attempt to deal with this problem, we could modify read_file to accept a file name: [@void read_file( FILE * f, char const * name ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error(name); .... }@] This is not a real solution: it simply shifts the burden of supplying a file name to the immediate caller of the read_file function. ->''In general, the data required to handle a given library-emitted exception depends on the program that links to it. Many contexts between the throw and the catch may have relevant information which must be transported to the exception handler.'' !!!Exception wrapping The idea of exception wrapping is to catch an exception from a lower level function (such as the read_file function above), and throw a new exception object that contains the original exception (and also carries a file name.) This method seems to be particularly popular with C++ programmers with Java background. Exception wrapping leads to the following problems: *To wrap an exception object it must be copied, which may result in slicing. *Wrapping is practically impossible to use in generic contexts. The second point is actually special case of violating the exception neutrality principle. Most contexts in a program can not handle exceptions; such contexts should not interfere with the process of exception handling. !!!The boost::exception solution *Simply derive your exception types from boost::(:link - 1 - - 0 - - -39 - - - 2 - :). *Confidently limit the throw site to provide only data that is available naturally. *Use exception-neutral contexts between the throw and the catch to augment exceptions with more relevant data as they bubble up. For example, in the throw statement below we only add the errno code, since this is the only failure-relevant information available in this context: [@struct exception_base: virtual std::exception, virtual boost::(:link - 1 - - 0 - - -39 - - - 2 - :) { }; struct io_error: virtual exception_base { }; struct file_read_error: virtual io_error { }; typedef boost::(:link + (:auto !!:) !!!Why doesn't boost::exception derive from std::exception? Despite that (:link 1 0 @@ -6031,57 +5824,48 @@ 2 - :)<struct tag_errno_code,int> errno_code; void read_file( FILE * f ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error() (:link + |virtual inheritance should be used in deriving from base exception types:), many programmers fail to follow this principle when deriving from std::exception. If boost::(:link 1 0 - -13 + -41 2 - |<<:) errno_code(errno); .... }@] In a higher exception-neutral context, we add the file name to ''any'' exception that derives from boost::(:link + :) derives from std::exception, using the (:link 1 0 - -39 + -19 2 - :): [@typedef boost::(:link + :) function with such user-defined types would introduce dangerous ambiguity which would break all catch(std::exception &) statements. Of course, boost::(:link 1 0 - -40 + -41 2 - :)<struct tag_file_name,std::string> file_name; .... try { if( FILE * fp=fopen("foo.txt","rt") ) { shared_ptr<FILE> f(fp,fclose); .... read_file(fp); //throws types deriving from boost::(:link + :) should not be used to replace std::exception as a base type in exception type hierarchies. Instead, it should be included as a virtual base, in addition to std::exception (which should also be derived virtually.) !!!Why is boost::exception abstract? To prevent exception-neutral contexts from erroneously erasing the type of the original exception when adding (:link 1 0 - -39 + -42 2 - :) do_something(); .... } else throw file_open_error() (:link + :) to an active exception object: [@catch( boost::(:link 1 0 - -13 - - - 2 - |<<:) errno_code(errno); } catch( boost::(:link - 1 - - 0 - - -39 + -41 2 @@ -6090,38 +5874,164 @@ 0 - -13 + -15 2 - |<<:) file_name("foo.txt"); throw; }@] Finally here is how the handler retrieves data from exceptions that derive from boost::(:link + |<<:) foo_info(foo); throw e; //Compile error: boost::(:link 1 0 - -39 + -41 2 - :): [@catch( io_error & e ) { std::cerr << "I/O Error!\n"; if( std::string const * fn=(:link + :) is abstract }@] The correct code is: [@catch( boost::(:link 1 0 - -33 + -41 2 - :)<file_name>(e) ) std::cerr << "File name: " << *fn << "\n"; if( int const * c=(:link + :) & e ) { e (:link 1 0 - -33 + -15 2 - :)<errno_code>(e) ) std::cerr << "OS says: " << strerror(*c) << "\n"; }@] In addition, boost::(:link + |<<:) foo_info(foo); throw; //Okay, re-throwing the original exception object. }@] !!!What is the space overhead of the boost::exception base class? The space overhead for the boost::exception data members is negligible in the context of exception handling. Throwing objects that derive from boost::(:link + 1 + + 0 + + -41 + + + 2 + :) does not by itself cause dynamic memory allocations. Deriving from boost::(:link + 1 + + 0 + + -41 + + + 2 + :) enables any data to be added to exceptions, which usually does allocate memory. However, this memory is reclaimed when the exception has been handled, and since typically user code does not allocate memory during the unrolling of the stack, adding error info to exceptions should not cause memory fragmentation. !!!Should I use boost::throw_exception or BOOST_THROW_EXCEPTION or just throw? The benefit of calling boost::(:link + 1 + + 0 + + -38 + + + 2 + :) instead of using throw directly is that it ensures that the emitted exception derives from boost::(:link + 1 + + 0 + + -41 + + + 2 + :) and that it is compatible with boost::(:link + 1 + + 0 + + -6 + + + 2 + :). The (:link + 1 + + 0 + + -25 + + + 2 + :) macro also results in a call to boost::(:link + 1 + + 0 + + -38 + + + 2 + :), but in addition it records in the exception object the __FILE__ and __LINE__ of the throw, as well as the pretty name of the function that throws. This has virtually no overhead, yet enables boost::(:link + 1 + + 0 + + -5 + + + 2 + :) to compose a more useful, if not user-friendly message. Typical use of boost::(:link + 1 + + 0 + + -5 + + + 2 + :) is: [@catch( boost::exception & e ) { std::cerr << "OMG!" << boost::diagnostic_information(e); } catch( ... ) { std::cerr << "OMG!!!"; }@] This is a possible message it may display, the first line is only possible if (:link + 1 + + 0 + + -25 + + + 2 + :) is used: [@example_io.cpp(83): Throw in function void parse_file(const char *) Dynamic exception type: class file_open_error std::exception::what: example_io error [struct tag_errno_code *] = 2, OS says "No such file or directory" [struct tag_file_name *] = tmp1.xml [struct tag_function *] = fopen [struct tag_open_mode *] = rb@] !!!Why is boost::exception integrated in boost::throw_exception? The boost::(:link + 1 + + 0 + + -38 + + + 2 + :) function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::(:link + 1 + + 0 + + -41 + + + 2 + :) as a base of any exception passed to boost::(:link + 1 + + 0 + + -38 + + + 2 + :). Such concerns are dictated by the typical strict interpretation of a common principle in C and C++, that users only pay for features they actually use. The problem is that users of Boost Exception can't by themselves cause a library to throw types that derive from boost::(:link + 1 + + 0 + + -41 + + + 2 + :), and without this they can't use any of the Boost Exception facilities. For example, if a user wants to use Boost Serialization in a separate thread, it is desirable to be able to transport exceptions emitted by that library into the main thread where they can be analyzed to generate a user-friendly message. This can be easily achieved using boost::(:link 1 0 @@ -6130,25 +6040,70 @@ 2 - :) can be used to compose an automatic (if not user-friendly) message that contains all of the (:link + :), but this requires that Boost Serialization throws exceptions using boost::(:link 1 0 - -40 + -24 2 - :) objects added to a boost::(:link + :). If Boost Serialization calls boost::(:link 1 0 - -39 + -38 2 - :). This is useful for inclusion in logs and other diagnostic objects. + :) to throw, this behavior happens automatically and transparently. The cost of this integration is: * In terms of space: a pointer and 3 ints are added to the static size of exception objects. * In terms of speed: the pointer is initialized to null at the point of the throw. * In terms of coupling: about 400 self-contained lines of C++ with no external includes. !!!Why use operator<< overload for adding info to exceptions? Before throwing an object of type that derives from boost::(:link + 1 + + 0 + + -41 + + + 2 + :), it is often desirable to add one or more (:link + 1 + + 0 + + -42 + + + 2 + :) objects in it. The syntactic sugar provided by (:link + 1 + + 0 + + -15 + + + 2 + :) allows this to be done directly in a throw expression: [@throw error() (:link + 1 + + 0 + + -15 + + + 2 + |<<:) foo_info(foo) (:link + 1 + + 0 + + -15 + + + 2 + |<<:) bar_info(bar);@] which saves typing compared to this possible alternative: [@error e; e.add(foo_info(foo)); e.add(bar_info(bar)); throw e;@] and looks better than something like: [@throw error().add(foo_info(foo)).add(bar_info(bar));@] @@ -6161,34 +6116,34 @@ 7 2 - (:auto !!!:) Deriving from boost::(:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link 1 0 - -39 + -41 2 - :) effectively decouples the semantics of a failure from the information that is relevant to each individual instance of reporting a failure with a given semantic. In other words: with boost::(:link + :), or a type that derives (indirectly) from boost::(:link 1 0 - -39 + -41 2 - :), what data a given exception object transports depends primarily on the context in which failures are reported (not on its type.) Since exception types need no members, it becomes very natural to throw exceptions that derive from more than one type to indicate multiple appropriate semantics: [@struct exception_base: virtual std::exception, virtual boost::(:link + :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link 1 0 - -39 + -42 2 - :) { }; struct io_error: virtual exception_base { }; struct file_error: virtual io_error { }; struct read_error: virtual io_error { }; struct file_read_error: virtual file_error, virtual read_error { };@] Using this approach, exception types become a simple tagging system for categorizing errors and selecting failures in exception handlers. + :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) @@ -6198,6 +6153,203 @@ -16 + + 33 + 2 + (:auto !!!:) Traditionally, when using exceptions to report failures, the throw site: *creates an exception object of the appropriate type, and *stuffs it with data relevant to the detected error. A higher context in the program contains a catch statement which: *selects failures based on exception types, and *inspects exception objects for data required to deal with the problem. The main issue with this "traditional" approach is that often, the data available at the point of the throw is insufficient for the catch site to handle the failure. Here is an example of a catch statement: [@catch( file_read_error & e ) { std::cerr << e.file_name(); }@] And here is a possible matching throw: [@void read_file( FILE * f ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error(???); .... }@] Clearly, the problem is that the handler requires a file name but the read_file function does not have a file name to put in the exception object; all it has is a FILE pointer! In an attempt to deal with this problem, we could modify read_file to accept a file name: [@void read_file( FILE * f, char const * name ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error(name); .... }@] This is not a real solution: it simply shifts the burden of supplying a file name to the immediate caller of the read_file function. ->''In general, the data required to handle a given library-emitted exception depends on the program that links to it. Many contexts between the throw and the catch may have relevant information which must be transported to the exception handler.'' !!!Exception wrapping The idea of exception wrapping is to catch an exception from a lower level function (such as the read_file function above), and throw a new exception object that contains the original exception (and also carries a file name.) This method seems to be particularly popular with C++ programmers with Java background. Exception wrapping leads to the following problems: *To wrap an exception object it must be copied, which may result in slicing. *Wrapping is practically impossible to use in generic contexts. The second point is actually special case of violating the exception neutrality principle. Most contexts in a program can not handle exceptions; such contexts should not interfere with the process of exception handling. !!!The boost::exception solution *Simply derive your exception types from boost::(:link + 1 + + 0 + + -41 + + + 2 + :). *Confidently limit the throw site to provide only data that is available naturally. *Use exception-neutral contexts between the throw and the catch to augment exceptions with more relevant data as they bubble up. For example, in the throw statement below we only add the errno code, since this is the only failure-relevant information available in this context: [@struct exception_base: virtual std::exception, virtual boost::(:link + 1 + + 0 + + -41 + + + 2 + :) { }; struct io_error: virtual exception_base { }; struct file_read_error: virtual io_error { }; typedef boost::(:link + 1 + + 0 + + -42 + + + 2 + :)<struct tag_errno_code,int> errno_code; void read_file( FILE * f ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error() (:link + 1 + + 0 + + -15 + + + 2 + |<<:) errno_code(errno); .... }@] In a higher exception-neutral context, we add the file name to ''any'' exception that derives from boost::(:link + 1 + + 0 + + -41 + + + 2 + :): [@typedef boost::(:link + 1 + + 0 + + -42 + + + 2 + :)<struct tag_file_name,std::string> file_name; .... try { if( FILE * fp=fopen("foo.txt","rt") ) { shared_ptr<FILE> f(fp,fclose); .... read_file(fp); //throws types deriving from boost::(:link + 1 + + 0 + + -41 + + + 2 + :) do_something(); .... } else throw file_open_error() (:link + 1 + + 0 + + -15 + + + 2 + |<<:) errno_code(errno); } catch( boost::(:link + 1 + + 0 + + -41 + + + 2 + :) & e ) { e (:link + 1 + + 0 + + -15 + + + 2 + |<<:) file_name("foo.txt"); throw; }@] Finally here is how the handler retrieves data from exceptions that derive from boost::(:link + 1 + + 0 + + -41 + + + 2 + :): [@catch( io_error & e ) { std::cerr << "I/O Error!\n"; if( std::string const * fn=(:link + 1 + + 0 + + -35 + + + 2 + :)<file_name>(e) ) std::cerr << "File name: " << *fn << "\n"; if( int const * c=(:link + 1 + + 0 + + -35 + + + 2 + :)<errno_code>(e) ) std::cerr << "OS says: " << strerror(*c) << "\n"; }@] In addition, boost::(:link + 1 + + 0 + + -5 + + + 2 + :) can be used to compose an automatic (if not user-friendly) message that contains all of the (:link + 1 + + 0 + + -42 + + + 2 + :) objects added to a boost::(:link + 1 + + 0 + + -41 + + + 2 + :). This is useful for inclusion in logs and other diagnostic objects. + + + + + 0 + + -17 + + + + 7 + 2 + (:auto !!!:) Deriving from boost::(:link + 1 + + 0 + + -41 + + + 2 + :) effectively decouples the semantics of a failure from the information that is relevant to each individual instance of reporting a failure with a given semantic. In other words: with boost::(:link + 1 + + 0 + + -41 + + + 2 + :), what data a given exception object transports depends primarily on the context in which failures are reported (not on its type.) Since exception types need no members, it becomes very natural to throw exceptions that derive from more than one type to indicate multiple appropriate semantics: [@struct exception_base: virtual std::exception, virtual boost::(:link + 1 + + 0 + + -41 + + + 2 + :) { }; struct io_error: virtual exception_base { }; struct file_error: virtual io_error { }; struct read_error: virtual io_error { }; struct file_read_error: virtual file_error, virtual read_error { };@] Using this approach, exception types become a simple tagging system for categorizing errors and selecting failures in exception handlers. + + + + + 0 + + -18 + + 27 2 @@ -6206,7 +6358,7 @@ 0 - -39 + -41 2 @@ -6215,7 +6367,7 @@ 0 - -17 + -19 2 @@ -6224,7 +6376,7 @@ 0 - -39 + -41 2 @@ -6242,7 +6394,7 @@ 0 - -40 + -42 2 @@ -6251,7 +6403,7 @@ 0 - -40 + -42 2 @@ -6260,7 +6412,7 @@ 0 - -40 + -42 2 @@ -6269,7 +6421,7 @@ 0 - -17 + -19 2 @@ -6278,7 +6430,7 @@ 0 - -17 + -19 2 @@ -6287,7 +6439,7 @@ 0 - -39 + -41 2 @@ -6296,7 +6448,7 @@ 0 - -13 + -15 2 @@ -6305,7 +6457,7 @@ 0 - -39 + -41 2 @@ -6314,7 +6466,7 @@ 0 - -6 + -8 2 @@ -6325,7 +6477,7 @@ 0 - -17 + -19 @@ -6336,7 +6488,7 @@ 0 - -39 + -41 2 @@ -6345,7 +6497,7 @@ 0 - -39 + -41 2 @@ -6356,7 +6508,7 @@ 0 - -18 + -20 @@ -6367,7 +6519,7 @@ 0 - -18 + -20 2 @@ -6376,7 +6528,7 @@ 0 - -18 + -20 2 @@ -6385,7 +6537,7 @@ 0 - -18 + -20 2 @@ -6394,7 +6546,7 @@ 0 - -18 + -20 2 @@ -6403,7 +6555,7 @@ 0 - -18 + -20 2 @@ -6412,7 +6564,7 @@ 0 - -18 + -20 2 @@ -6421,7 +6573,7 @@ 0 - -5 + -6 2 @@ -6430,327 +6582,13 @@ 0 - -37 + -39 2 :) concurrently to throw the same exception object into multiple threads. - - - 0 - - -19 - - - - 37 - 2 - (:auto !!!:) When you catch an exception, you can call (:link - 1 - - 0 - - -5 - - - 2 - :) to get an (:link - 1 - - 0 - - -18 - - - 2 - :) object: [@#include <(:link - 1 - - 0 - - -57 - - - 2 - :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link - 1 - - 0 - - -39 - - - 2 - :)s void worker_thread( boost::(:link - 1 - - 0 - - -18 - - - 2 - :) & error ) { try { do_work(); error = boost::(:link - 1 - - 0 - - -18 - - - 2 - :)(); } catch( ... ) { error = boost::(:link - 1 - - 0 - - -5 - - - 2 - :)(); } }@] In the above example, note that (:link - 1 - - 0 - - -5 - - - 2 - :) captures the original type of the exception object. The exception can be thrown again using the (:link - 1 - - 0 - - -37 - - - 2 - :) function: [@// ...continued void work() { boost::(:link - 1 - - 0 - - -18 - - - 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 - - -37 - - - 2 - :)(error); }@] Note that (:link - 1 - - 0 - - -5 - - - 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 - - -18 - - - 2 - :) points to an instance of std::bad_alloc, or * if (:link - 1 - - 0 - - -22 - - - 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 - - -18 - - - 2 - :) points to an instance of (:link - 1 - - 0 - - -32 - - - 2 - :). Regardless, the use of (:link - 1 - - 0 - - -5 - - - 2 - :) and (:link - 1 - - 0 - - -37 - - - 2 - :) in the above examples is well-formed. - - - - - 0 - - -20 - - - - 29 - 2 - (:auto !!!:) (:include synopsis:) !!!!Returns: A string value that contains varying amount of implementation-specific diagnostic information about the passed exception object: *If E can be statically converted to boost::(:link - 1 - - 0 - - -39 - - - 2 - :), the returned value contains the string representations of all (:link - 1 - - 0 - - -40 - - - 2 - :) objects stored in the boost::(:link - 1 - - 0 - - -39 - - - 2 - :) through (:link - 1 - - 0 - - -13 - - - 2 - mod="/":), along with other diagnostic information relevant to the exception. If e can be dynamically converted to std::exception, the returned value also contains the what() string. *Otherwise, if E can be statically converted std::exception: **if e can be dynamically converted to boost::exception, the returned value is the same as if E could be statically converted to boost::(:link - 1 - - 0 - - -39 - - - 2 - :); **otherwise the returned value contains the what() string. *Otherwise, the boost:: - 1 - - 0 - - -20 - - - 2 - template is not available. The string representation of each (:link - 1 - - 0 - - -40 - - - 2 - :) object is deduced by a function call that is bound at the time the (:link - 1 - - 0 - - -40 - - - 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 - - -40 - - - 2 - :)<Tag,T> (the return value is expected to be of type std::string.) #Unqualified call to to_string(x.(:link - 1 - - 0 - - -46 - - - 2 - mod="m":)()) (the return value is expected to be of type std::string.) #Unqualified call to s << x.(:link - 1 - - 0 - - -46 - - - 2 - mod="m":)(), where s is a std::ostringstream. The first successfully bound function is used at the time (:link - 1 - - 0 - - -20 - - - 2 - :) is called; if all 3 overload resolutions are unsuccessful, the system is unable to convert the (:link - 1 - - 0 - - -40 - - - 2 - :) object to string, and ''an unspecified stub string value is used without issuing a compile error.'' !!!!Notes: *The format of the returned string is unspecified. *The returned string is ''not'' user-friendly. *The returned string may include additional platform-specific diagnostic information. (:include - 1 - - 0 - - -45 - - - 2 - :) - - 0 @@ -6758,243 +6596,6 @@ -21 - - 19 - 2 - (:auto !!:) Boost Exception responds to the following configuration macros: '''BOOST_NO_RTTI'''\\ '''BOOST_NO_TYPEID''' The first macro prevents Boost Exception from using dynamic_cast and dynamic typeid. If the second macro is also defined, Boost Exception does not use static typeid either. There are no observable degrading effects on the library functionality, except for the following: ->By default, the (:link - 1 - - 0 - - -33 - - - 2 - :) function template can be called with any exception type. If BOOST_NO_RTTI is defined, (:link - 1 - - 0 - - -33 - - - 2 - :) can be used only with objects of type boost::(:link - 1 - - 0 - - -39 - - - 2 - :). !!!!Note: The library needs RTTI functionality. Disabling the language RTTI support enables an internal RTTI system, which may have more or less overhead depending on the platform. '''BOOST_EXCEPTION_DISABLE''' By default, (:link - 1 - - 0 - - -22 - - - 2 - :) and (:link - 1 - - 0 - - -17 - - - 2 - :) are integrated directly in the (:link - 1 - - 0 - - -36 - - - 2 - :) function. Defining BOOST_EXCEPTION_DISABLE disables this integration. Note that on some non-conformant compilers, for example MSVC 7.0 and older, as well as BCC, BOOST_EXCEPTION_DISABLE is implicitly defined in (:link - 1 - - 0 - - -58 - - - 2 - :). '''BOOST_NO_EXCEPTIONS''' This macro disables exception handling in Boost, forwarding all exceptions to a user-defined non-template version of boost:: - 1 - - 0 - - -36 - - - 2 - . However, unless BOOST_EXCEPTION_DISABLE is also defined, users can still examine the exception object for any data added at the point of the throw, or use boost:: - 1 - - 0 - - -20 - - - 2 - (of course under BOOST_NO_EXCEPTIONS, the user-defined boost::throw_exception is not allowed to return to the caller.) - - - - - 0 - - -22 - - - - 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 - - -18 - - - 2 - :) support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link - 1 - - 0 - - -22 - - - 2 - :)(my_exception());@] Unless (:link - 1 - - 0 - - -22 - - - 2 - :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link - 1 - - 0 - - -5 - - - 2 - :) may return an (:link - 1 - - 0 - - -18 - - - 2 - :) which refers to an instance of (:link - 1 - - 0 - - -32 - - - 2 - :). See (:link - 1 - - 0 - - -5 - - - 2 - :) for details. !!!!Note: Instead of using the throw keyword directly, it is preferable to call boost::(:link - 1 - - 0 - - -36 - - - 2 - :). This is guaranteed to throw an exception that derives from boost::(:link - 1 - - 0 - - -39 - - - 2 - :) and supports the (:link - 1 - - 0 - - -18 - - - 2 - :) functionality. - - - - - 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 - - -36 - - - 2 - . To recover this information at the catch site, use - 1 - - 0 - - -33 - - - 2 - ; the information is also included in the message returned by - 1 - - 0 - - -20 - - - 2 - . - - - - - 0 - - -24 - - 13 2 @@ -7012,7 +6613,7 @@ 0 - -40 + -42 2 @@ -7021,7 +6622,7 @@ 0 - -40 + -42 2 @@ -7030,7 +6631,7 @@ 0 - -40 + -42 2 @@ -7039,7 +6640,7 @@ 0 - -39 + -41 2 @@ -7048,13 +6649,385 @@ 0 - -33 + -35 2 :). + + + 0 + + -22 + + + + 37 + 2 + (:auto !!!:) When you catch an exception, you can call (:link + 1 + + 0 + + -6 + + + 2 + :) to get an (:link + 1 + + 0 + + -20 + + + 2 + :) object: [@#include <(:link + 1 + + 0 + + -57 + + + 2 + :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link + 1 + + 0 + + -41 + + + 2 + :)s void worker_thread( boost::(:link + 1 + + 0 + + -20 + + + 2 + :) & error ) { try { do_work(); error = boost::(:link + 1 + + 0 + + -20 + + + 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 + + -39 + + + 2 + :) function: [@// ...continued void work() { boost::(:link + 1 + + 0 + + -20 + + + 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 + + -39 + + + 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 + + -20 + + + 2 + :) points to an instance of std::bad_alloc, or * if (:link + 1 + + 0 + + -24 + + + 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 + + -20 + + + 2 + :) points to an instance of (:link + 1 + + 0 + + -34 + + + 2 + :). Regardless, the use of (:link + 1 + + 0 + + -6 + + + 2 + :) and (:link + 1 + + 0 + + -39 + + + 2 + :) in the above examples is well-formed. + + + + + 0 + + -23 + + + + 19 + 2 + (:auto !!:) Boost Exception responds to the following configuration macros: '''BOOST_NO_RTTI'''\\ '''BOOST_NO_TYPEID''' The first macro prevents Boost Exception from using dynamic_cast and dynamic typeid. If the second macro is also defined, Boost Exception does not use static typeid either. There are no observable degrading effects on the library functionality, except for the following: ->By default, the (:link + 1 + + 0 + + -35 + + + 2 + :) function template can be called with any exception type. If BOOST_NO_RTTI is defined, (:link + 1 + + 0 + + -35 + + + 2 + :) can be used only with objects of type boost::(:link + 1 + + 0 + + -41 + + + 2 + :). !!!!Note: The library needs RTTI functionality. Disabling the language RTTI support enables an internal RTTI system, which may have more or less overhead depending on the platform. '''BOOST_EXCEPTION_DISABLE''' By default, (:link + 1 + + 0 + + -24 + + + 2 + :) and (:link + 1 + + 0 + + -19 + + + 2 + :) are integrated directly in the (:link + 1 + + 0 + + -38 + + + 2 + :) function. Defining BOOST_EXCEPTION_DISABLE disables this integration. Note that on some non-conformant compilers, for example MSVC 7.0 and older, as well as BCC, BOOST_EXCEPTION_DISABLE is implicitly defined in (:link + 1 + + 0 + + -58 + + + 2 + :). '''BOOST_NO_EXCEPTIONS''' This macro disables exception handling in Boost, forwarding all exceptions to a user-defined non-template version of boost:: + 1 + + 0 + + -38 + + + 2 + . However, unless BOOST_EXCEPTION_DISABLE is also defined, users can still examine the exception object for any data added at the point of the throw, or use boost:: + 1 + + 0 + + -5 + + + 2 + (of course under BOOST_NO_EXCEPTIONS, the user-defined boost::throw_exception is not allowed to return to the caller.) + + + + + 0 + + -24 + + + + 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 + + -20 + + + 2 + :) support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link + 1 + + 0 + + -24 + + + 2 + :)(my_exception());@] Unless (:link + 1 + + 0 + + -24 + + + 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 + + -20 + + + 2 + :) which refers to an instance of (:link + 1 + + 0 + + -34 + + + 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 + + -38 + + + 2 + :). This is guaranteed to throw an exception that derives from boost::(:link + 1 + + 0 + + -41 + + + 2 + :) and supports the (:link + 1 + + 0 + + -20 + + + 2 + :) functionality. + + 0 @@ -7063,9 +7036,36 @@ - 1 + 7 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!!:) (:include synopsis:) This macro takes an exception object, records BOOST_CURRENT_FUNCTION, __FILE__ and __LINE__ in it, and forwards it to + 1 + + 0 + + -38 + + + 2 + . To recover this information at the catch site, use + 1 + + 0 + + -35 + + + 2 + ; the information is also included in the message returned by + 1 + + 0 + + -5 + + + 2 + . @@ -7083,7 +7083,7 @@ 0 - -39 + -41 2 @@ -7118,7 +7118,7 @@ 0 - -39 + -41 2 @@ -7127,7 +7127,7 @@ 0 - -20 + -5 2 @@ -7173,9 +7173,27 @@ - 1 + 5 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!!:) (:include synopsis:) !!!!Description: Returns a const reference to the copy of the value passed to (:link + 1 + + 0 + + -42 + + + 2 + :)'s constructor stored in the (:link + 1 + + 0 + + -42 + + + 2 + :) object. !!!!Throws: Nothing. @@ -7185,6 +7203,41 @@ -31 + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -32 + + + + 3 + 2 + !!!!Example: this is a possible output from the (:link + 1 + + 0 + + -5 + + + 2 + :) function, as used in ''libs/exception/example/example_io.cpp:'' [@example_io.cpp(83): Throw in function class boost::shared_ptr<struct _iobuf> __cdecl my_fopen(const char *,const char *) Dynamic exception type: class boost::exception_detail::clone_impl<class fopen_error> std::exception::what: example_io error [struct tag_errno *] = 2, OS says "No such file or directory" [struct tag_file_name *] = tmp1.txt [struct tag_function *] = fopen [struct tag_open_mode *] = rb@] + + + + + 0 + + -33 + + 19 2 @@ -7193,7 +7246,7 @@ 0 - -39 + -41 2 @@ -7211,7 +7264,7 @@ 0 - -40 + -42 2 @@ -7220,7 +7273,7 @@ 0 - -39 + -41 2 @@ -7238,7 +7291,7 @@ 0 - -40 + -42 2 @@ -7247,7 +7300,7 @@ 0 - -39 + -41 2 @@ -7256,7 +7309,7 @@ 0 - -39 + -41 2 @@ -7265,7 +7318,7 @@ 0 - -39 + -41 2 @@ -7276,7 +7329,7 @@ 0 - -32 + -34 @@ -7287,7 +7340,7 @@ 0 - -18 + -20 2 @@ -7296,7 +7349,7 @@ 0 - -5 + -6 2 @@ -7307,7 +7360,7 @@ 0 - -33 + -35 @@ -7318,7 +7371,7 @@ 0 - -40 + -42 2 @@ -7327,7 +7380,7 @@ 0 - -39 + -41 2 @@ -7336,7 +7389,7 @@ 0 - -13 + -15 2 @@ -7345,7 +7398,7 @@ 0 - -33 + -35 2 @@ -7354,7 +7407,7 @@ 0 - -33 + -35 2 @@ -7363,7 +7416,7 @@ 0 - -21 + -23 2 @@ -7374,7 +7427,7 @@ 0 - -34 + -36 @@ -7385,7 +7438,7 @@ 0 - -35 + -37 2 @@ -7394,7 +7447,7 @@ 0 - -36 + -38 2 @@ -7403,7 +7456,7 @@ 0 - -14 + -16 2 @@ -7412,129 +7465,12 @@ 0 - -6 + -8 2 mod="w":) ##(:link 1 - - 0 - - -16 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -35 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -15 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -38 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -11 - - - 2 - mod="w":) #Documentation ##Class (:link - 1 - - 0 - - -39 - - - 2 - :) ##Throwing Exceptions ###(:link - 1 - - 0 - - -23 - - - 2 - :) ###(:link - 1 - - 0 - - -36 - - - 2 - :) ##Transporting of Arbitrary Data to the Catch Site ###(:link - 1 - - 0 - - -40 - - - 2 - :) ###(:link - 1 - - 0 - - -13 - - - 2 - :) ###(:link - 1 - - 0 - - -9 - - - 2 - :) ###(:link - 1 - - 0 - - -33 - - - 2 - :) ###(:link - 1 - - 0 - - -17 - - - 2 - :) ##(:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:) Transporting of Exceptions between Threads ###(:link - 1 0 @@ -7542,34 +7478,7 @@ 2 - :) ###(:link - 1 - - 0 - - -22 - - - 2 - :) ###(:link - 1 - - 0 - - -5 - - - 2 - :) ###(:link - 1 - - 0 - - -8 - - - 2 - :) ###(:link + mod="w":) ##(:link 1 0 @@ -7578,12 +7487,156 @@ 2 + mod="w":) ##(:link + 1 + + 0 + + -17 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -40 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -12 + + + 2 + mod="w":) #Documentation ##Class (:link + 1 + + 0 + + -41 + + + 2 + :) ##Throwing Exceptions ###(:link + 1 + + 0 + + -25 + + + 2 :) ###(:link 1 0 - -32 + -38 + + + 2 + :) ##Transporting of Arbitrary Data to the Catch Site ###(:link + 1 + + 0 + + -42 + + + 2 + :) ###(:link + 1 + + 0 + + -15 + + + 2 + :) ###(:link + 1 + + 0 + + -7 + + + 2 + :) ###(:link + 1 + + 0 + + -35 + + + 2 + :) ###(:link + 1 + + 0 + + -19 + + + 2 + :) ##(:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:) Transporting of Exceptions between Threads ###(:link + 1 + + 0 + + -20 + + + 2 + :) ###(:link + 1 + + 0 + + -24 + + + 2 + :) ###(:link + 1 + + 0 + + -6 + + + 2 + :) ###(:link + 1 + + 0 + + -10 + + + 2 + :) ###(:link + 1 + + 0 + + -39 + + + 2 + :) ###(:link + 1 + + 0 + + -34 2 @@ -7592,7 +7645,7 @@ 0 - -20 + -5 2 @@ -7637,7 +7690,7 @@ 0 - -43 + -45 2 @@ -7664,7 +7717,7 @@ 0 - -21 + -23 2 @@ -7673,7 +7726,7 @@ 0 - -12 + -14 2 @@ -7693,7 +7746,7 @@ 0 - -35 + -37 @@ -7704,7 +7757,7 @@ 0 - -22 + -24 2 @@ -7713,7 +7766,7 @@ 0 - -36 + -38 2 @@ -7722,7 +7775,7 @@ 0 - -39 + -41 2 @@ -7731,7 +7784,7 @@ 0 - -44 + -46 2 @@ -7740,7 +7793,7 @@ 0 - -19 + -22 2 @@ -7751,7 +7804,7 @@ 0 - -36 + -38 @@ -7762,7 +7815,7 @@ 0 - -36 + -38 2 @@ -7771,7 +7824,7 @@ 0 - -22 + -24 2 @@ -7780,7 +7833,7 @@ 0 - -17 + -19 2 @@ -7789,7 +7842,7 @@ 0 - -36 + -38 2 @@ -7798,7 +7851,7 @@ 0 - -36 + -38 2 @@ -7807,7 +7860,7 @@ 0 - -36 + -38 2 @@ -7816,7 +7869,7 @@ 0 - -33 + -35 2 @@ -7825,7 +7878,7 @@ 0 - -20 + -5 2 @@ -7836,7 +7889,7 @@ 0 - -37 + -39 @@ -7849,7 +7902,7 @@ 0 - -38 + -40 @@ -7860,7 +7913,7 @@ 0 - -39 + -41 2 @@ -7869,7 +7922,7 @@ 0 - -15 + -17 2 @@ -7880,7 +7933,7 @@ 0 - -39 + -41 @@ -7891,7 +7944,7 @@ 0 - -39 + -41 2 @@ -7900,7 +7953,7 @@ 0 - -39 + -41 2 @@ -7909,7 +7962,7 @@ 0 - -40 + -42 2 @@ -7918,7 +7971,7 @@ 0 - -13 + -15 2 @@ -7927,7 +7980,7 @@ 0 - -39 + -41 2 @@ -7936,7 +7989,7 @@ 0 - -33 + -35 2 @@ -7947,7 +8000,7 @@ 0 - -40 + -42 @@ -7958,7 +8011,7 @@ 0 - -40 + -42 2 @@ -7967,7 +8020,7 @@ 0 - -13 + -15 2 @@ -7976,7 +8029,7 @@ 0 - -39 + -41 2 @@ -7994,7 +8047,7 @@ 0 - -40 + -42 2 @@ -8012,7 +8065,7 @@ 0 - -40 + -42 2 @@ -8030,7 +8083,7 @@ 0 - -40 + -42 2 @@ -8039,7 +8092,7 @@ 0 - -13 + -15 2 @@ -8057,7 +8110,7 @@ 0 - -39 + -41 2 @@ -8066,7 +8119,7 @@ 0 - -13 + -15 2 @@ -8075,7 +8128,7 @@ 0 - -33 + -35 2 @@ -8084,7 +8137,7 @@ 0 - -25 + -13 2 @@ -8093,7 +8146,7 @@ 0 - -39 + -41 2 @@ -8102,7 +8155,7 @@ 0 - -39 + -41 2 @@ -8111,7 +8164,7 @@ 0 - -33 + -35 2 @@ -8122,7 +8175,7 @@ 0 - -41 + -43 @@ -8133,7 +8186,7 @@ 0 - -39 + -41 2 @@ -8142,7 +8195,7 @@ 0 - -39 + -41 2 @@ -8151,7 +8204,7 @@ 0 - -13 + -15 2 @@ -8162,7 +8215,7 @@ 0 - -42 + -44 @@ -8182,7 +8235,7 @@ 0 - -40 + -42 2 @@ -8191,7 +8244,7 @@ 0 - -39 + -41 2 @@ -8200,7 +8253,7 @@ 0 - -40 + -42 2 @@ -8209,7 +8262,7 @@ 0 - -39 + -41 2 @@ -8218,7 +8271,7 @@ 0 - -13 + -15 2 @@ -8227,7 +8280,7 @@ 0 - -33 + -35 2 @@ -8236,7 +8289,7 @@ 0 - -33 + -35 2 @@ -8247,7 +8300,7 @@ 0 - -43 + -45 @@ -8260,7 +8313,7 @@ 0 - -44 + -46 @@ -8280,7 +8333,7 @@ 0 - -39 + -41 2 @@ -8289,7 +8342,7 @@ 0 - -22 + -24 2 @@ -8298,7 +8351,7 @@ 0 - -22 + -24 2 @@ -8307,66 +8360,13 @@ 0 - -39 + -41 2 :). - - - 0 - - -45 - - - - 3 - 2 - !!!!Example: this is a possible output from the (:link - 1 - - 0 - - -20 - - - 2 - :) function, as used in ''libs/exception/example/example_io.cpp:'' [@example_io.cpp(83): Throw in function class boost::shared_ptr<struct _iobuf> __cdecl my_fopen(const char *,const char *) Dynamic exception type: class boost::exception_detail::clone_impl<class fopen_error> std::exception::what: example_io error [struct tag_errno *] = 2, OS says "No such file or directory" [struct tag_file_name *] = tmp1.txt [struct tag_function *] = fopen [struct tag_open_mode *] = rb@] - - - - - 0 - - -46 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) !!!!Description: Returns a const reference to the copy of the value passed to (:link - 1 - - 0 - - -40 - - - 2 - :)'s constructor stored in the (:link - 1 - - 0 - - -40 - - - 2 - :) object. !!!!Throws: Nothing. - - 0 @@ -8382,7 +8382,7 @@ 0 - -7 + -9 2 @@ -8391,7 +8391,7 @@ 0 - -7 + -9 2 @@ -8472,7 +8472,7 @@ 0 - -30 + -31 2 @@ -8481,7 +8481,7 @@ 0 - -30 + -31 2 @@ -8632,7 +8632,7 @@ 0 - -40 + -42 2 @@ -8809,7 +8809,9 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. @@ -8831,9 +8833,7 @@ - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. + 0 @@ -8844,9 +8844,7 @@ - 1 - 2 - !!!!Throws: Any exception emitted by v's copy constructor. + 0 @@ -8857,7 +8855,9 @@ - 0 + 1 + 2 + !!!!Throws: Any exception emitted by v's copy constructor. @@ -8879,9 +8879,7 @@ - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. + 0 @@ -8903,7 +8901,9 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. @@ -9430,11 +9430,11 @@ 0 - -57 + -31 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] @@ -9444,30 +9444,6 @@ -6 - - 0 - - - - - 0 - - -7 - - - - 1 - 2 - [@namespace boost { (:include api pre_indent="4":) }@] - - - - - 0 - - -8 - - 3 2 @@ -9487,7 +9463,7 @@ 0 - -9 + -7 @@ -9507,13 +9483,37 @@ 0 - -9 + -7 2 decl pre_indent="4":) }@] + + + 0 + + -8 + + + + 0 + + + + + 0 + + -9 + + + + 1 + 2 + [@namespace boost { (:include api pre_indent="4":) }@] + + 0 @@ -9521,6 +9521,28 @@ -10 + + 3 + 2 + `#include <(:link + 1 + + 0 + + -57 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -11 + + 3 2 @@ -9536,17 +9558,6 @@ :)> [@(:include decl:)@] - - - 0 - - -11 - - - - 0 - - 0 @@ -9566,18 +9577,9 @@ - 3 + 1 2 - `#include <(:link - 1 - - 0 - - -56 - - - 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + [@#include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] @@ -9599,7 +9601,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -56 + + + 2 + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] @@ -9620,6 +9633,28 @@ -17 + + 0 + + + + + 0 + + -18 + + + + 0 + + + + + 0 + + -19 + + 3 2 @@ -9639,7 +9674,7 @@ 0 - -18 + -20 @@ -9657,39 +9692,6 @@ :)> [@namespace boost { (:include decl pre_indent="4":) }@] - - - 0 - - -19 - - - - 0 - - - - - 0 - - -20 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -30 - - - 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] - - 0 @@ -9708,6 +9710,28 @@ -22 + + 0 + + + + + 0 + + -23 + + + + 0 + + + + + 0 + + -24 + + 3 2 @@ -9727,7 +9751,7 @@ 0 - -23 + -25 @@ -9745,30 +9769,6 @@ > (:include decl:) - - - 0 - - -24 - - - - 0 - - - - - 0 - - -25 - - - - 1 - 2 - [@#include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] - - 0 @@ -9795,7 +9795,7 @@ 0 - -7 + -9 2 @@ -9817,7 +9817,7 @@ 0 - -30 + -31 2 @@ -9847,16 +9847,16 @@ 3 2 - [@#include <string> namespace boost { (:include + `#include <(:link 1 0 - -39 + -56 2 - decl pre_indent="4":) (:include api pre_indent="4":) }@] + :)> [@(:include decl:)@] @@ -9867,7 +9867,18 @@ - 0 + 3 + 2 + [@#include <string> namespace boost { (:include + 1 + + 0 + + -41 + + + 2 + decl pre_indent="4":) (:include api pre_indent="4":) }@] @@ -9877,6 +9888,28 @@ -32 + + 0 + + + + + 0 + + -33 + + + + 0 + + + + + 0 + + -34 + + 3 2 @@ -9896,7 +9929,7 @@ 0 - -33 + -35 @@ -9905,28 +9938,6 @@ [@namespace boost { (:include decl pre_indent="4":) }@] - - - 0 - - -34 - - - - 0 - - - - - 0 - - -35 - - - - 0 - - 0 @@ -9934,6 +9945,28 @@ -36 + + 0 + + + + + 0 + + -37 + + + + 0 + + + + + 0 + + -38 + + 3 2 @@ -9953,7 +9986,7 @@ 0 - -37 + -39 @@ -9975,7 +10008,7 @@ 0 - -38 + -40 @@ -9986,7 +10019,7 @@ 0 - -39 + -41 @@ -9997,7 +10030,7 @@ 0 - -7 + -9 2 @@ -10008,7 +10041,7 @@ 0 - -40 + -42 @@ -10026,28 +10059,6 @@ :)> [@namespace boost { (:include def pre_indent="4":) }@] - - - 0 - - -41 - - - - 0 - - - - - 0 - - -42 - - - - 0 - - 0 @@ -10089,18 +10100,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -56 - - - 2 - :)> [@(:include decl:)@] + 0 @@ -10197,7 +10197,7 @@ 0 - -7 + -9 2 @@ -10254,7 +10254,7 @@ 0 - -7 + -9 2 @@ -10276,7 +10276,7 @@ 0 - -7 + -9 2 @@ -10525,7 +10525,7 @@ - -34 + -36 @@ -10542,7 +10542,7 @@ - -35 + -37 @@ -10559,7 +10559,7 @@ - -6 + -8 @@ -10613,6 +10613,57 @@ -27 + + + + + 0 + + + + + + 1 + + + + -16 + + + + + + + 0 + + + + + + 1 + + + + -40 + + + + + + + 0 + + + + + + 1 + + + + -17 + + @@ -10630,57 +10681,6 @@ -14 - - - - - 0 - - - - - - 1 - - - - -38 - - - - - - - 0 - - - - - - 1 - - - - -15 - - - - - - - 0 - - - - - - 1 - - - - -12 - - @@ -10729,7 +10729,7 @@ - -43 + -45 @@ -10787,7 +10787,7 @@ - -19 + -22 @@ -10811,7 +10811,7 @@ - -45 + -32 @@ -10835,7 +10835,7 @@ - -16 + -18 @@ -10891,7 +10891,7 @@ - -32 + -34 @@ -10919,7 +10919,7 @@ - -5 + -6 @@ -10947,7 +10947,7 @@ - -18 + -20 @@ -10975,7 +10975,7 @@ - -37 + -39 @@ -11003,7 +11003,7 @@ - -8 + -10 @@ -11031,7 +11031,7 @@ - -33 + -35 @@ -11055,7 +11055,7 @@ - -11 + -12 @@ -11107,7 +11107,7 @@ - -10 + -11 @@ -11135,7 +11135,7 @@ - -13 + -15 @@ -11159,7 +11159,7 @@ - -42 + -44 @@ -11235,7 +11235,7 @@ - -36 + -38 @@ -11267,7 +11267,7 @@ - -21 + -23 @@ -11319,7 +11319,7 @@ - -40 + -42 @@ -11383,7 +11383,7 @@ - -46 + -30 @@ -11407,7 +11407,7 @@ - -25 + -13 @@ -11435,7 +11435,7 @@ - -20 + -5 @@ -11511,7 +11511,7 @@ - -7 + -9 @@ -11567,7 +11567,7 @@ - -22 + -24 @@ -11595,7 +11595,7 @@ - -17 + -19 @@ -11623,7 +11623,7 @@ - -39 + -41 @@ -11655,7 +11655,7 @@ - -41 + -43 @@ -11703,7 +11703,7 @@ - -44 + -46 @@ -11727,7 +11727,7 @@ - -23 + -25 @@ -11751,7 +11751,7 @@ - -31 + -33 @@ -11775,7 +11775,7 @@ - -30 + -31 @@ -11831,7 +11831,7 @@ - -9 + -7 @@ -11855,7 +11855,7 @@ - -24 + -21 @@ -11886,7 +11886,7 @@ -5 - exception_ptr free function + diagnostic_information free function @@ -11895,7 +11895,7 @@ -6 - tutorial + exception_ptr free function @@ -11904,7 +11904,7 @@ -7 - + error_info free function @@ -11913,7 +11913,7 @@ -8 - exception_ptr free function + tutorial @@ -11922,7 +11922,7 @@ -9 - error_info free function + @@ -11931,7 +11931,7 @@ -10 - function member + exception_ptr free function @@ -11940,6 +11940,15 @@ -11 + function member + + + + 0 + + -12 + + diagnostic_information tutorial @@ -11949,22 +11958,13 @@ -13 - error_info free function + error_info 0 - -16 - - - tutorial - - - - 0 - - -17 + -15 error_info free function @@ -11976,7 +11976,7 @@ -18 - type + tutorial @@ -11985,7 +11985,7 @@ -19 - noindex tutorial + error_info free function @@ -11994,35 +11994,35 @@ -20 - diagnostic_information free function + type 0 - -22 - - - exception_ptr free function - - - - 0 - - -23 - - - macro - - - - 0 - - -24 + -21 noalso noindex tutorial + + + 0 + + -22 + + + noindex tutorial + + + + 0 + + -24 + + + exception_ptr free function + 0 @@ -12030,7 +12030,7 @@ -25 - error_info + macro @@ -12075,7 +12075,7 @@ -30 - + function member @@ -12084,16 +12084,7 @@ -31 - noalso noindex tutorial - - - - 0 - - -32 - - - exception_ptr type + @@ -12102,7 +12093,7 @@ -33 - error_info free function + noalso noindex tutorial @@ -12111,7 +12102,7 @@ -34 - noindex + exception_ptr type @@ -12120,7 +12111,7 @@ -35 - tutorial + error_info free function @@ -12129,7 +12120,7 @@ -36 - free function + noindex @@ -12138,7 +12129,7 @@ -37 - exception_ptr free function + tutorial @@ -12147,7 +12138,7 @@ -38 - tutorial + free function @@ -12156,7 +12147,7 @@ -39 - type + exception_ptr free function @@ -12165,7 +12156,7 @@ -40 - type + tutorial @@ -12174,7 +12165,7 @@ -41 - function + type @@ -12183,7 +12174,16 @@ -42 - noalso noindex tutorial + type + + + + 0 + + -43 + + + function @@ -12192,7 +12192,7 @@ -44 - noindex tutorial + noalso noindex tutorial @@ -12201,7 +12201,7 @@ -46 - function member + noindex tutorial