From 9cee59551d09a48b4c9e56e23b0535b08b514f25 Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Fri, 15 May 2009 22:42:32 +0000 Subject: [PATCH] documentation typo [SVN r53039] --- doc/exception_ptr.html | 2 +- doc/source/boost-exception.reno | 7472 +++++++++++++++---------------- 2 files changed, 3737 insertions(+), 3737 deletions(-) diff --git a/doc/exception_ptr.html b/doc/exception_ptr.html index dd216a6..90f330a 100644 --- a/doc/exception_ptr.html +++ b/doc/exception_ptr.html @@ -36,7 +36,7 @@ boost
  • It is illegal for multiple threads to modify the same exception_ptr object concurrently.
  • While calling current_exception makes a copy of the current exception object, it is still possible for the two copies to share internal state. Therefore, in general it is not safe to call rethrow_exception concurrently to throw the same exception object into multiple threads.
  • -

    Nesting of exceptions

    +

    Nesting of exceptions:

    An exception_ptr can be added as error_info to any boost::exception. This is a convenient way to nest exceptions. There is no limit on the depth of the nesting, however cyclic references result in undefined behavior.


    See Also:

    diff --git a/doc/source/boost-exception.reno b/doc/source/boost-exception.reno index 828a09e..3d784a0 100644 --- a/doc/source/boost-exception.reno +++ b/doc/source/boost-exception.reno @@ -48,89 +48,6 @@ reno_context - - - - - - 1 - BEFF039468E0E9A3719E5CB51DA9710812D146B587BAF573D1670908BB97C0CA - 35548578 - 1983 - 91 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - - <string>boost/throw_exception.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 6 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>boost/exception/enable_current_exception.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 7 - - reno_context - @@ -176,7 +93,45 @@ 0 - 8 + 6 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>frequently asked questions</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 7 reno_context @@ -210,6 +165,44 @@ (:include include:) (:auto also:) + + + 0 + + 8 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Headers</string> + + + headers + + + + + + 1 + 2 + (:include include:) (:auto also:) + + 0 @@ -268,21 +261,28 @@ - 0 + 1 + BEFF039468E0E9A3719E5CB51DA9710812D146B587BAF573D1670908BB97C0CA + 35548578 + 1983 + 91 - 1 + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 - <string>Macros</string> + <string>boost/throw_exception.hpp</string> - macros + @@ -301,327 +301,6 @@ reno_context - - - - - - 1 - 641BB230CEBF638811480BE0E3A96ABCB7CC9CC7E1C1A9C51FBAB296FFB6B7B1 - 4248389286 - 4113 - 323 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - - <string>boost/exception/info.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 12 - - reno_context - - - - - - - 1 - 21E8093D2AF6946EAE135823066EF38B9DC8870432B44C81E585FF63A72F9903 - 3352783584 - 12170 - 323 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>boost/exception_ptr.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 13 - - reno_context - - - - - - - 1 - A14B5595A6DD87562792D402B48500AAD71FA1ABD75C14EDF089FCC7318CBB9B - 3469762901 - 468 - 227 - - - - - - 0 - ../../../../boost/exception/current_exception_cast.hpp - 0 - 0 - - - - - <string>boost/exception/current_exception_cast.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 14 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>page index</string> - - - page_idx - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 15 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Motivation</string> - - - motivation - - - - - - 7 - 2 - (:include include:) (:auto also explicit=" - 1 - - 0 - - -8 - - - 2 - - 1 - - 0 - - 16 - - reno_context - - - - - - - 1 - D9B8E6AA12A4F33953B1A961FA590C5A3840234B6531CA8C04AC985AD5800835 - 2432554768 - 702 - 408 - - - - - - 0 - ../../example/enable_error_info.cpp - 0 - 0 - - - - - <string>integrating boost exception in existing exception class hierarchies</string> - - - tutorial_enable_error_info - - - - - 2 - - 1 - - 0 - - 17 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>frequently asked questions</string> - - - - - - - - 2 - ":) - - - - - 0 - - -16 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -17 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 18 - - reno_context - @@ -667,7 +346,248 @@ 0 - 19 + 12 + + reno_context + + + + + + + 2 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 + 2078296250 + 305 + 10862 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>copy_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 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> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 14 + + reno_context + + + + + + + 2 + 126BB1D8971585CBE7D78EF3C12259D72FD5E973A84626AA9FC3234220A11CAB + 3471702891 + 969 + 344 + A7FD310E1340E103081DA2A7899DA0E213C696C84D52C17ADA09F6942EE97D47 + 2978648279 + 530 + 433 + + + + + + 0 + ../../../../boost/exception/detail/error_info_impl.hpp + 0 + 0 + + + + + <string>error_info</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 15 + + reno_context + + + + + + + 1 + 95AD55ACCB1C17C1DBA4C309BDFCBD4B66E52CD9A2F54FDAD2D642A00342D001 + 3194412598 + 4599 + 323 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + + <string>boost/exception/diagnostic_information.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 16 + + reno_context + + + + + + + 3 + 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF + 1282550303 + 9192 + 323 + 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 + 1693870740 + 2195 + 3720 + DA154372D8C23BD9EDC30005CA7959CE686D198891097A837D006B5222F04DE9 + 2768248809 + 143 + 60 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>exception::exception</string> + + + exception_constructors + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 17 reno_context @@ -687,10 +607,10 @@ - <string>Headers</string> + <string>transporting of exceptions between threads</string> - headers + tutorial_exception_ptr @@ -705,45 +625,7 @@ 0 - 20 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Types</string> - - - types - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 21 + 18 reno_context @@ -786,7 +668,52 @@ 0 - 22 + 19 + + reno_context + + + + + + + 1 + 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF + 1282550303 + 9192 + 323 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>boost/exception/exception.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 20 reno_context @@ -831,7 +758,7 @@ 0 - 23 + 21 reno_context @@ -880,6 +807,108 @@ (:include include:) (:auto also:) + + + 0 + + 22 + + 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 + + 23 + + reno_context + + + + + + + 2 + FEABD2D011FBCE667D26BAD68A1C65D81E98DD40081CC70F2738AC3151A8FC4A + 4260129224 + 2393 + 504 + C708EDCAC3964E2F3C3A081700112C5F15C7BF7A61FDF2EF39D112FC9B987CE3 + 1739153824 + 2361 + 26 + + + + + + 0 + ../../../../boost/exception/get_error_info.hpp + 0 + 0 + + + + + <string>get_error_info</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + 0 @@ -1110,6 +1139,44 @@ reno_context + + + + + + 0 + + + + + + 1 + + + + + <string>Macros</string> + + + macros + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 30 + + reno_context + @@ -1151,7 +1218,7 @@ 0 - 30 + 31 reno_context @@ -1200,7 +1267,7 @@ 0 - 31 + 32 reno_context @@ -1253,7 +1320,7 @@ 0 - 32 + 33 reno_context @@ -1298,7 +1365,7 @@ 0 - 33 + 34 reno_context @@ -1347,7 +1414,7 @@ 0 - 34 + 35 reno_context @@ -1396,7 +1463,7 @@ 0 - 35 + 36 reno_context @@ -1445,7 +1512,7 @@ 0 - 36 + 37 reno_context @@ -1494,7 +1561,7 @@ 0 - 37 + 38 reno_context @@ -1543,7 +1610,7 @@ 0 - 38 + 39 reno_context @@ -1586,7 +1653,7 @@ 0 - 39 + 40 reno_context @@ -1635,7 +1702,7 @@ 0 - 40 + 41 reno_context @@ -1678,7 +1745,52 @@ 0 - 41 + 42 + + reno_context + + + + + + + 1 + 641BB230CEBF638811480BE0E3A96ABCB7CC9CC7E1C1A9C51FBAB296FFB6B7B1 + 4248389286 + 4113 + 323 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>boost/exception/info.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 43 reno_context @@ -1716,7 +1828,7 @@ 0 - 42 + 44 reno_context @@ -1765,7 +1877,7 @@ 0 - 43 + 45 reno_context @@ -1803,7 +1915,7 @@ 0 - 44 + 46 reno_context @@ -1841,7 +1953,52 @@ 0 - 45 + 47 + + reno_context + + + + + + + 1 + D9B8E6AA12A4F33953B1A961FA590C5A3840234B6531CA8C04AC985AD5800835 + 2432554768 + 702 + 408 + + + + + + 0 + ../../example/enable_error_info.cpp + 0 + 0 + + + + + <string>integrating boost exception in existing exception class hierarchies</string> + + + tutorial_enable_error_info + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 48 reno_context @@ -1890,7 +2047,7 @@ 0 - 46 + 49 reno_context @@ -1928,7 +2085,7 @@ 0 - 47 + 50 reno_context @@ -1977,7 +2134,7 @@ 0 - 48 + 51 reno_context @@ -2016,149 +2173,6 @@ 0 - - - 0 - - 49 - - reno_context - - - - - - - 1 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>boost/exception/exception.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 50 - - reno_context - - - - - - - 2 - 6FB85B536F965F137409D5B5D34786DCBF0B9957A7C251D271B717A1156B823D - 1090406464 - 362 - 323 - D16DAEA8B1792A019AF7FCA362FDC6EFD381AF4C43C076A01C029ECE51F994A6 - 3172941848 - 330 - 26 - - - - - - 0 - ../../../../boost/exception/current_exception_cast.hpp - 0 - 0 - - - - - <string>current_exception_cast</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 51 - - reno_context - - - - - - - 2 - CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 - 1114955626 - 11770 - 723 - 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 - 2078296250 - 305 - 10862 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>copy_exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - 0 @@ -2167,191 +2181,6 @@ reno_context - - - - - - 2 - 126BB1D8971585CBE7D78EF3C12259D72FD5E973A84626AA9FC3234220A11CAB - 3471702891 - 969 - 344 - A7FD310E1340E103081DA2A7899DA0E213C696C84D52C17ADA09F6942EE97D47 - 2978648279 - 530 - 433 - - - - - - 0 - ../../../../boost/exception/detail/error_info_impl.hpp - 0 - 0 - - - - - <string>error_info</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 53 - - reno_context - - - - - - - 1 - 2F432507CFD796BE673F33D9AC68C535F1ED1F4FCD3A8E3AEEC320D9795FB4AE - 2319362875 - 2574 - 323 - - - - - - 0 - ../../../../boost/exception/get_error_info.hpp - 0 - 0 - - - - - <string>boost/exception/get_error_info.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 54 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>boost exception</string> - - - boost-exception - - - - - - 1 - 2 - (:include include:) - - - - - 0 - - 55 - - 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 - - 56 - - reno_context - @@ -2397,7 +2226,52 @@ 0 - 57 + 53 + + reno_context + + + + + + + 1 + 21E8093D2AF6946EAE135823066EF38B9DC8870432B44C81E585FF63A72F9903 + 3352783584 + 12170 + 323 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>boost/exception_ptr.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 54 reno_context @@ -2407,13 +2281,13 @@ 2 - FEABD2D011FBCE667D26BAD68A1C65D81E98DD40081CC70F2738AC3151A8FC4A - 4260129224 - 2393 - 504 - C708EDCAC3964E2F3C3A081700112C5F15C7BF7A61FDF2EF39D112FC9B987CE3 - 1739153824 - 2361 + 6FB85B536F965F137409D5B5D34786DCBF0B9957A7C251D271B717A1156B823D + 1090406464 + 362 + 323 + D16DAEA8B1792A019AF7FCA362FDC6EFD381AF4C43C076A01C029ECE51F994A6 + 3172941848 + 330 26 @@ -2421,14 +2295,14 @@ 0 - ../../../../boost/exception/get_error_info.hpp + ../../../../boost/exception/current_exception_cast.hpp 0 0 - <string>get_error_info</string> + <string>current_exception_cast</string> @@ -2442,6 +2316,127 @@ (:include include:) (:auto also:) + + + 0 + + 55 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>boost/exception/enable_current_exception.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 56 + + reno_context + + + + + + + 1 + A14B5595A6DD87562792D402B48500AAD71FA1ABD75C14EDF089FCC7318CBB9B + 3469762901 + 468 + 227 + + + + + + 0 + ../../../../boost/exception/current_exception_cast.hpp + 0 + 0 + + + + + <string>boost/exception/current_exception_cast.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 57 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>page index</string> + + + page_idx + + + + + + 1 + 2 + (:include include:) (:auto also:) + + 0 @@ -2455,36 +2450,56 @@ - 1 - 95AD55ACCB1C17C1DBA4C309BDFCBD4B66E52CD9A2F54FDAD2D642A00342D001 - 3194412598 - 4599 - 323 + 0 - 0 - ../../../../boost/exception/diagnostic_information.hpp - 0 - 0 + 1 - <string>boost/exception/diagnostic_information.hpp</string> + <string>Motivation</string> - + motivation - 1 + 7 2 - (:include include:) (:auto also:) + (:include include:) (:auto also explicit=" + 1 + + 0 + + -7 + + + 2 + + 1 + + 0 + + -47 + + + 2 + + 1 + + 0 + + -6 + + + 2 + ":) @@ -2495,59 +2510,6 @@ reno_context - - - - - - 3 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 - 1693870740 - 2195 - 3720 - DA154372D8C23BD9EDC30005CA7959CE686D198891097A837D006B5222F04DE9 - 2768248809 - 143 - 60 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>exception::exception</string> - - - exception_constructors - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 60 - - reno_context - @@ -2564,10 +2526,10 @@ - <string>transporting of exceptions between threads</string> + <string>boost exception</string> - tutorial_exception_ptr + boost-exception @@ -2575,14 +2537,14 @@ 1 2 - (:include include:) (:auto also:) + (:include include:) 0 - 61 + 60 reno_context @@ -2627,6 +2589,44 @@ (:include include:) (:auto also:) + + + 0 + + 61 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Types</string> + + + types + + + + + + 1 + 2 + (:include include:) (:auto also:) + + @@ -2748,7 +2748,45 @@ - 0 + 9 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -14 + + + 2 + :) { public: (:include + 1 + + 0 + + -21 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -44 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -22 + + + 2 + decl pre_indent="4":) };@] @@ -3111,36 +3149,7 @@ - 7 - 2 - [@class (:link - 1 - - 0 - - -47 - - - 2 - :) { protected: (:include - 1 - - 0 - - -59 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -36 - - - 2 - decl pre_indent="4":) };@] + 0 @@ -3173,7 +3182,36 @@ - 0 + 7 + 2 + [@class (:link + 1 + + 0 + + -50 + + + 2 + :) { protected: (:include + 1 + + 0 + + -16 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -37 + + + 2 + decl pre_indent="4":) };@] @@ -3195,45 +3233,7 @@ - 9 - 2 - [@template <class Tag,class T> class (:link - 1 - - 0 - - -52 - - - 2 - :) { public: (:include - 1 - - 0 - - -23 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -42 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -55 - - - 2 - decl pre_indent="4":) };@] + 0 @@ -3357,27 +3357,18 @@ - 5 + 3 2 [@(:include 1 0 - -32 + -14 2 - decl:) namespace boost { (:include - 1 - - 0 - - -35 - - - 2 - decl:) }@] + decl:)@] @@ -3388,18 +3379,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -37 - - - 2 - decl:)@] + 0 @@ -3410,18 +3390,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -52 - - - 2 - decl:)@] + 0 @@ -3450,7 +3419,7 @@ 0 - -45 + -48 2 @@ -3465,7 +3434,27 @@ - 0 + 5 + 2 + [@(:include + 1 + + 0 + + -33 + + + 2 + decl:) namespace boost { (:include + 1 + + 0 + + -36 + + + 2 + decl:) }@] @@ -3476,27 +3465,7 @@ - 5 - 2 - [@(:include - 1 - - 0 - - -52 - - - 2 - def:) (:include - 1 - - 0 - - -56 - - - 2 - decl:)@] + 0 @@ -3507,63 +3476,7 @@ - 13 - 2 - [@(:include - 1 - - 0 - - -28 - - - 2 - decl:) (:include - 1 - - 0 - - -18 - - - 2 - decl:) (:include - 1 - - 0 - - -33 - - - 2 - decl:) (:include - 1 - - 0 - - -51 - - - 2 - decl:) (:include - 1 - - 0 - - -34 - - - 2 - decl:) (:include - 1 - - 0 - - -39 - - - 2 - decl:)@] + 0 @@ -3581,7 +3494,7 @@ 0 - -50 + -23 2 @@ -3607,7 +3520,27 @@ - 0 + 5 + 2 + [@(:include + 1 + + 0 + + -31 + + + 2 + decl:) (:include + 1 + + 0 + + -60 + + + 2 + decl:)@] @@ -3651,7 +3584,54 @@ - 0 + 11 + 2 + [@(:include + 1 + + 0 + + -50 + + + 2 + def:) (:include + 1 + + 0 + + -14 + + + 2 + decl:) typedef (:link + 1 + + 0 + + -14 + + + 2 + :)<struct tag_throw_function,char const *> throw_function; typedef (:link + 1 + + 0 + + -14 + + + 2 + :)<struct tag_throw_file,char const *> throw_file; typedef (:link + 1 + + 0 + + -14 + + + 2 + :)<struct tag_throw_line,int> throw_line;@] @@ -3662,7 +3642,72 @@ - 0 + 15 + 2 + [@#include <(:link + 1 + + 0 + + -15 + + + 2 + :)> #include <(:link + 1 + + 0 + + -5 + + + 2 + :)> #include <(:link + 1 + + 0 + + -19 + + + 2 + :)> #include <(:link + 1 + + 0 + + -13 + + + 2 + :)> #include <(:link + 1 + + 0 + + -42 + + + 2 + :)> #include <(:link + 1 + + 0 + + -9 + + + 2 + :)> #include <(:link + 1 + + 0 + + -53 + + + 2 + :)>@] @@ -3684,72 +3729,7 @@ - 15 - 2 - [@#include <(:link - 1 - - 0 - - -58 - - - 2 - :)> #include <(:link - 1 - - 0 - - -7 - - - 2 - :)> #include <(:link - 1 - - 0 - - -49 - - - 2 - :)> #include <(:link - 1 - - 0 - - -53 - - - 2 - :)> #include <(:link - 1 - - 0 - - -11 - - - 2 - :)> #include <(:link - 1 - - 0 - - -9 - - - 2 - :)> #include <(:link - 1 - - 0 - - -12 - - - 2 - :)>@] + 0 @@ -3980,7 +3960,27 @@ - 0 + 5 + 2 + [@(:include + 1 + + 0 + + -14 + + + 2 + def:) (:include + 1 + + 0 + + -52 + + + 2 + decl:)@] @@ -4057,54 +4057,7 @@ - 11 - 2 - [@(:include - 1 - - 0 - - -47 - - - 2 - def:) (:include - 1 - - 0 - - -52 - - - 2 - decl:) typedef (:link - 1 - - 0 - - -52 - - - 2 - :)<struct tag_throw_function,char const *> throw_function; typedef (:link - 1 - - 0 - - -52 - - - 2 - :)<struct tag_throw_file,char const *> throw_file; typedef (:link - 1 - - 0 - - -52 - - - 2 - :)<struct tag_throw_line,int> throw_line;@] + 0 @@ -4148,14 +4101,59 @@ - 3 + 13 2 [@(:include 1 0 - -57 + -28 + + + 2 + decl:) (:include + 1 + + 0 + + -11 + + + 2 + decl:) (:include + 1 + + 0 + + -34 + + + 2 + decl:) (:include + 1 + + 0 + + -12 + + + 2 + decl:) (:include + 1 + + 0 + + -35 + + + 2 + decl:) (:include + 1 + + 0 + + -40 2 @@ -4181,7 +4179,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -38 + + + 2 + decl:)@] @@ -4192,7 +4201,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -54 + + + 2 + decl:)@] @@ -4214,27 +4234,7 @@ - 5 - 2 - [@(:include - 1 - - 0 - - -30 - - - 2 - decl:) (:include - 1 - - 0 - - -61 - - - 2 - decl:)@] + 0 @@ -4358,7 +4358,27 @@ - 0 + 5 + 2 + [@typedef (:link + 1 + + 0 + + -14 + + + 2 + :)<struct tag_original_exception_type,std::type_info const *> + 1 + + 0 + + -11 + + + 2 + ;@] @@ -4369,7 +4389,27 @@ - 0 + 5 + 2 + [@template <class T> (:link + 1 + + 0 + + -34 + + + 2 + :) (:link + 1 + + 0 + + -12 + + + 2 + :)( T const & e );@] @@ -4391,7 +4431,18 @@ - 0 + 3 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -14 + + + 2 + :);@] @@ -4413,7 +4464,36 @@ - 0 + 7 + 2 + [@(:link + 1 + + 0 + + -16 + + + 2 + mod="m":)(); (:link + 1 + + 0 + + -16 + + + 2 + mod="m":)( (:link + 1 + + 0 + + -50 + + + 2 + :) const & x );@] @@ -4435,27 +4515,7 @@ - 5 - 2 - [@typedef (:link - 1 - - 0 - - -52 - - - 2 - :)<struct tag_original_exception_type,std::type_info const *> - 1 - - 0 - - -18 - - - 2 - ;@] + 0 @@ -4488,7 +4548,18 @@ - 0 + 3 + 2 + [@typedef T (:link + 1 + + 0 + + -21 + + + 2 + mod="m":);@] @@ -4499,7 +4570,27 @@ - 0 + 5 + 2 + [@(:link + 1 + + 0 + + -21 + + + 2 + mod="m":) const & (:link + 1 + + 0 + + -22 + + + 2 + mod="m":)() const;@] @@ -4510,9 +4601,18 @@ - 3 + 5 2 - [@typedef T (:link + [@template <class ErrorInfo,class E> typename ErrorInfo::(:link + 1 + + 0 + + -21 + + + 2 + mod="m":) const * (:link 1 0 @@ -4521,7 +4621,7 @@ 2 - mod="m":);@] + :)( E const & x );@] @@ -4603,7 +4703,7 @@ 0 - -47 + -50 2 @@ -4629,18 +4729,7 @@ - 3 - 2 - [@template <class E> std::string (:link - 1 - - 0 - - -30 - - - 2 - :)( E const & e );@] + 0 @@ -4651,7 +4740,18 @@ - 0 + 3 + 2 + [@template <class E> std::string (:link + 1 + + 0 + + -31 + + + 2 + :)( E const & e );@] @@ -4661,6 +4761,17 @@ -32 + + 0 + + + + + 0 + + -33 + + 19 2 @@ -4669,7 +4780,7 @@ 0 - -49 + -19 2 @@ -4678,7 +4789,7 @@ 0 - -32 + -33 2 @@ -4687,7 +4798,7 @@ 0 - -35 + -36 2 @@ -4705,7 +4816,7 @@ 0 - -49 + -19 2 @@ -4714,7 +4825,7 @@ 0 - -49 + -19 2 @@ -4723,7 +4834,7 @@ 0 - -49 + -19 2 @@ -4732,7 +4843,7 @@ 0 - -32 + -33 2 @@ -4741,7 +4852,7 @@ 0 - -35 + -36 2 @@ -4752,7 +4863,7 @@ 0 - -33 + -34 @@ -4760,37 +4871,6 @@ 2 [@typedef ---unspecified--- (:link 1 - - 0 - - -33 - - - 2 - :);@] - - - - - 0 - - -34 - - - - 5 - 2 - [@(:link - 1 - - 0 - - -33 - - - 2 - :) (:link - 1 0 @@ -4798,7 +4878,7 @@ 2 - :)();@] + :);@] @@ -4811,7 +4891,16 @@ 5 2 - [@#ifdef BOOST_NO_EXCEPTIONS void (:link + [@(:link + 1 + + 0 + + -34 + + + 2 + :) (:link 1 0 @@ -4820,16 +4909,7 @@ 2 - :)( std::exception const & e ); // user defined #else template <class E> void (:link - 1 - - 0 - - -35 - - - 2 - :)( E const & e ); #endif@] + :)();@] @@ -4840,9 +4920,9 @@ - 3 + 5 2 - [@(:link + [@#ifdef BOOST_NO_EXCEPTIONS void (:link 1 0 @@ -4851,7 +4931,16 @@ 2 - mod="m":)();@] + :)( std::exception const & e ); // user defined #else template <class E> void (:link + 1 + + 0 + + -36 + + + 2 + :)( E const & e ); #endif@] @@ -4864,7 +4953,7 @@ 3 2 - [@template <class T> ---unspecified--- (:link + [@(:link 1 0 @@ -4873,7 +4962,7 @@ 2 - :)( T const & e );@] + mod="m":)();@] @@ -4884,7 +4973,18 @@ - 0 + 3 + 2 + [@template <class T> ---unspecified--- (:link + 1 + + 0 + + -38 + + + 2 + :)( T const & e );@] @@ -4895,27 +4995,7 @@ - 5 - 2 - [@void (:link - 1 - - 0 - - -39 - - - 2 - :)( (:link - 1 - - 0 - - -33 - - - 2 - :) const & ep ); + 0 @@ -4926,7 +5006,27 @@ - 0 + 5 + 2 + [@void (:link + 1 + + 0 + + -40 + + + 2 + :)( (:link + 1 + + 0 + + -34 + + + 2 + :) const & ep ); @@ -4948,27 +5048,7 @@ - 5 - 2 - [@(:link - 1 - - 0 - - -42 - - - 2 - mod="m":)( (:link - 1 - - 0 - - -23 - - - 2 - mod="m":) const & v );@] + 0 @@ -4990,7 +5070,27 @@ - 0 + 5 + 2 + [@(:link + 1 + + 0 + + -44 + + + 2 + mod="m":)( (:link + 1 + + 0 + + -21 + + + 2 + mod="m":) const & v );@] @@ -5001,36 +5101,7 @@ - 7 - 2 - [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link - 1 - - 0 - - -45 - - - 2 - mod="/":)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link - 1 - - 0 - - -52 - - - 2 - :)<Tag1,T1>, ..., (:link - 1 - - 0 - - -52 - - - 2 - :)<TagN,TN> > const & v );@] + 0 @@ -5052,18 +5123,7 @@ - 3 - 2 - [@class (:link - 1 - - 0 - - -47 - - - 2 - :);@] + 0 @@ -5074,7 +5134,36 @@ - 0 + 7 + 2 + [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link + 1 + + 0 + + -48 + + + 2 + mod="/":)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link + 1 + + 0 + + -14 + + + 2 + :)<Tag1,T1>, ..., (:link + 1 + + 0 + + -14 + + + 2 + :)<TagN,TN> > const & v );@] @@ -5098,7 +5187,7 @@ 3 2 - [@template <class E> E * + [@class (:link 1 0 @@ -5107,7 +5196,7 @@ 2 - ();@] + :);@] @@ -5118,27 +5207,7 @@ - 5 - 2 - [@template <class T> (:link - 1 - - 0 - - -33 - - - 2 - :) (:link - 1 - - 0 - - -51 - - - 2 - :)( T const & e );@] + 0 @@ -5149,9 +5218,9 @@ - 3 + 5 2 - [@template <class Tag,class T> class (:link + [@template <class E, class Tag, class T> E const & (:link 1 0 @@ -5160,7 +5229,16 @@ 2 - :);@] + mod="/":)( E const & x, (:link + 1 + + 0 + + -14 + + + 2 + :)<Tag,T> const & v );@] @@ -5182,7 +5260,18 @@ - 0 + 3 + 2 + [@template <class E> E * + 1 + + 0 + + -54 + + + 2 + ();@] @@ -5193,27 +5282,7 @@ - 5 - 2 - [@(:link - 1 - - 0 - - -23 - - - 2 - mod="m":) const & (:link - 1 - - 0 - - -55 - - - 2 - mod="m":)() const;@] + 0 @@ -5224,27 +5293,7 @@ - 5 - 2 - [@template <class E, class Tag, class T> E const & (:link - 1 - - 0 - - -56 - - - 2 - mod="/":)( E const & x, (:link - 1 - - 0 - - -52 - - - 2 - :)<Tag,T> const & v );@] + 0 @@ -5255,27 +5304,7 @@ - 5 - 2 - [@template <class ErrorInfo,class E> typename ErrorInfo::(:link - 1 - - 0 - - -23 - - - 2 - mod="m":) const * (:link - 1 - - 0 - - -57 - - - 2 - :)( E const & x );@] + 0 @@ -5297,36 +5326,7 @@ - 7 - 2 - [@(:link - 1 - - 0 - - -59 - - - 2 - mod="m":)(); (:link - 1 - - 0 - - -59 - - - 2 - mod="m":)( (:link - 1 - - 0 - - -47 - - - 2 - :) const & x );@] + 0 @@ -5337,7 +5337,18 @@ - 0 + 3 + 2 + [@std::string (:link + 1 + + 0 + + -60 + + + 2 + :)();@] @@ -5348,18 +5359,7 @@ - 3 - 2 - [@std::string (:link - 1 - - 0 - - -61 - - - 2 - :)();@] + 0 @@ -5397,9 +5397,297 @@ - 1 + 65 2 - (:auto !!!:) !!!Synopsis (:include synopsis:) + (:auto !!:) !!!Why doesn't boost::exception derive from std::exception? Despite that (:link + 1 + + 0 + + -45 + + + 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 + + -50 + + + 2 + :) derives from std::exception, using the (:link + 1 + + 0 + + -26 + + + 2 + :) function with such user-defined types would introduce dangerous ambiguity which would break all catch(std::exception &) statements. Of course, boost::(:link + 1 + + 0 + + -50 + + + 2 + :) should not be used to replace std::exception as a base type in exception type hierarchies. Instead, it should be included as a virtual base, in addition to std::exception (which should also be derived virtually.) !!!Why is boost::exception abstract? To prevent exception-neutral contexts from erroneously erasing the type of the original exception when adding (:link + 1 + + 0 + + -14 + + + 2 + :) to an active exception object: [@catch( boost::(:link + 1 + + 0 + + -50 + + + 2 + :) & e ) { e (:link + 1 + + 0 + + -52 + + + 2 + |<<:) foo_info(foo); throw e; //Compile error: boost::(:link + 1 + + 0 + + -50 + + + 2 + :) is abstract }@] The correct code is: [@catch( boost::(:link + 1 + + 0 + + -50 + + + 2 + :) & e ) { e (:link + 1 + + 0 + + -52 + + + 2 + |<<:) foo_info(foo); throw; //Okay, re-throwing the original exception object. }@] !!!What is the space overhead of the boost::exception base class? The space overhead for the boost::exception data members is negligible in the context of exception handling. Throwing objects that derive from boost::(:link + 1 + + 0 + + -50 + + + 2 + :) does not by itself cause dynamic memory allocations. Deriving from boost::(:link + 1 + + 0 + + -50 + + + 2 + :) enables any data to be added to exceptions, which usually does allocate memory. However, this memory is reclaimed when the exception has been handled, and since typically user code does not allocate memory during the unrolling of the stack, adding error info to exceptions should not cause memory fragmentation. !!!Should I use boost::throw_exception or BOOST_THROW_EXCEPTION or just throw? The benefit of calling boost::(:link + 1 + + 0 + + -36 + + + 2 + :) instead of using throw directly is that it ensures that the emitted exception derives from boost::(:link + 1 + + 0 + + -50 + + + 2 + :) and that it is compatible with boost::(:link + 1 + + 0 + + -35 + + + 2 + :). The (:link + 1 + + 0 + + -33 + + + 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 + + -31 + + + 2 + :) to compose a more useful, if not user-friendly message. Typical use of boost::(:link + 1 + + 0 + + -31 + + + 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 + + -33 + + + 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 + + -50 + + + 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 + + -50 + + + 2 + :), and without this they can't use any of the Boost Exception facilities. For example, if a user wants to use Boost Serialization in a separate thread, it is desirable to be able to transport exceptions emitted by that library into the main thread where they can be analyzed to generate a user-friendly message. This can be easily achieved using boost::(:link + 1 + + 0 + + -34 + + + 2 + :), but this requires that Boost Serialization throws exceptions using boost::(:link + 1 + + 0 + + -38 + + + 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 + + -50 + + + 2 + :), it is often desirable to add one or more (:link + 1 + + 0 + + -14 + + + 2 + :) objects in it. The syntactic sugar provided by (:link + 1 + + 0 + + -52 + + + 2 + :) allows this to be done directly in a throw expression: [@throw error() (:link + 1 + + 0 + + -52 + + + 2 + |<<:) foo_info(foo) (:link + 1 + + 0 + + -52 + + + 2 + |<<:) bar_info(bar);@] which saves typing compared to this possible alternative: [@error e; e.add(foo_info(foo)); e.add(bar_info(bar)); throw e;@] and looks better than something like: [@throw error().add(foo_info(foo)).add(bar_info(bar));@] @@ -5410,9 +5698,36 @@ - 1 + 7 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!!:) Deriving from boost::(:link + 1 + + 0 + + -50 + + + 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 + + -50 + + + 2 + :), what data a given exception object transports depends primarily on the context in which failures are reported (not on its type.) Since exception types need no members, it becomes very natural to throw exceptions that derive from more than one type to indicate multiple appropriate semantics: [@struct exception_base: virtual std::exception, virtual boost::(:link + 1 + + 0 + + -50 + + + 2 + :) { }; struct io_error: virtual exception_base { }; struct file_error: virtual io_error { }; struct read_error: virtual io_error { }; struct file_read_error: virtual file_error, virtual read_error { };@] Using this approach, exception types become a simple tagging system for categorizing errors and selecting failures in exception handlers. @@ -5423,36 +5738,9 @@ - 7 + 1 2 - (:auto !!!:) Deriving from boost::(:link - 1 - - 0 - - -47 - - - 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 - - -47 - - - 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 - - -47 - - - 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. + (:auto !!:) (:pagelist fmt="index" tags="hpp" sort_prefix="6":) @@ -5478,7 +5766,7 @@ 1 2 - (:auto !!:) (:pagelist tags="macro":) + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -5489,9 +5777,45 @@ - 1 + 9 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!!:) (:include synopsis:) This + 1 + + 0 + + -14 + + + 2 + typedef is used by + 1 + + 0 + + -35 + + + 2 + if it defaults to returning an + 1 + + 0 + + -34 + + + 2 + that refers to an object of type + 1 + + 0 + + -28 + + + 2 + , to record in it the std::type_info of the original exception object. @@ -5502,9 +5826,27 @@ - 1 + 5 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!!:) (:include synopsis:) !!!!Effects: As if [@try { throw + 1 + + 0 + + -38 + + + 2 + (e); } catch(...) { return (:link + 1 + + 0 + + -35 + + + 2 + :)(); }@] @@ -5528,9 +5870,171 @@ - 1 + 37 2 - (:auto !:) This is an alphabetical list of all Boost Exception documentation pages. (:pagelist fmt="index" except_tags="index noindex" mod="w":) + (: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 + + -14 + + + 2 + :)<Tag,T> can be passed to (:link + 1 + + 0 + + -52 + + + 2 + mod="/":) to be stored in objects of type boost::(:link + 1 + + 0 + + -50 + + + 2 + :). !!!!Usage: The header <(:link + 1 + + 0 + + -5 + + + 2 + :)> provides a declaration of the (:link + 1 + + 0 + + -14 + + + 2 + :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, for example: [@#include <(:link + 1 + + 0 + + -5 + + + 2 + :)> struct tag_errno; typedef boost::(:link + 1 + + 0 + + -14 + + + 2 + :)<tag_errno,int> errno_info;@] Or, the shorter equivalent: [@#include <(:link + 1 + + 0 + + -5 + + + 2 + :)> typedef boost::(:link + 1 + + 0 + + -14 + + + 2 + :)<struct tag_errno,int> errno_info;@] This errno_info typedef can be passed to (:link + 1 + + 0 + + -52 + + + 2 + mod="/":) (#include <(:link + 1 + + 0 + + -42 + + + 2 + :)> first) to store an int named tag_errno in exceptions of types that derive from boost::(:link + 1 + + 0 + + -50 + + + 2 + :): [@throw file_read_error() (:link + 1 + + 0 + + -52 + + + 2 + |<<:) errno_info(errno);@] It can also be passed to (:link + 1 + + 0 + + -23 + + + 2 + :) (#include <(:link + 1 + + 0 + + -13 + + + 2 + :)> first) to retrieve the tag_errno int from a boost::(:link + 1 + + 0 + + -50 + + + 2 + :): [@catch( boost::(:link + 1 + + 0 + + -50 + + + 2 + :) & x ) { if( int const * e=boost::(:link + 1 + + 0 + + -23 + + + 2 + :)<errno_info>(x) ) .... }@] @@ -5540,727 +6044,6 @@ -15 - - 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 - - -47 - - - 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 - - -47 - - - 2 - :) { }; struct io_error: virtual exception_base { }; struct file_read_error: virtual io_error { }; typedef boost::(:link - 1 - - 0 - - -52 - - - 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 - - -56 - - - 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 - - -47 - - - 2 - :): [@typedef boost::(:link - 1 - - 0 - - -52 - - - 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 - - -47 - - - 2 - :) do_something(); .... } else throw file_open_error() (:link - 1 - - 0 - - -56 - - - 2 - |<<:) errno_code(errno); } catch( boost::(:link - 1 - - 0 - - -47 - - - 2 - :) & e ) { e (:link - 1 - - 0 - - -56 - - - 2 - |<<:) file_name("foo.txt"); throw; }@] Finally here is how the handler retrieves data from exceptions that derive from boost::(:link - 1 - - 0 - - -47 - - - 2 - :): [@catch( io_error & e ) { std::cerr << "I/O Error!\n"; if( std::string const * fn=(:link - 1 - - 0 - - -57 - - - 2 - :)<file_name>(e) ) std::cerr << "File name: " << *fn << "\n"; if( int const * c=(:link - 1 - - 0 - - -57 - - - 2 - :)<errno_code>(e) ) std::cerr << "OS says: " << strerror(*c) << "\n"; }@] In addition, boost::(:link - 1 - - 0 - - -30 - - - 2 - :) can be used to compose an automatic (if not user-friendly) message that contains all of the (:link - 1 - - 0 - - -52 - - - 2 - :) objects added to a boost::(:link - 1 - - 0 - - -47 - - - 2 - :). This is useful for inclusion in logs and other diagnostic objects. - - - - - 0 - - -16 - - - - 27 - 2 - (:auto !!:) Some exception hierarchies can not be modified to make boost::(:link - 1 - - 0 - - -47 - - - 2 - :) a base type. In this case, the (:link - 1 - - 0 - - -26 - - - 2 - :) function template can be used to make exception objects derive from boost::(:link - 1 - - 0 - - -47 - - - 2 - :) anyway. Here is an example: [@#include <(:link - 1 - - 0 - - -22 - - - 2 - :)> #include <stdexcept> typedef boost::(:link - 1 - - 0 - - -52 - - - 2 - :)<struct tag_std_range_min,size_t> std_range_min; typedef boost::(:link - 1 - - 0 - - -52 - - - 2 - :)<struct tag_std_range_max,size_t> std_range_max; typedef boost::(:link - 1 - - 0 - - -52 - - - 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 - - -26 - - - 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 - - -26 - - - 2 - :)<T> gets us an object of ''unspecified type'' which is guaranteed to derive from both boost::(:link - 1 - - 0 - - -47 - - - 2 - :) and T. This makes it possible to use (:link - 1 - - 0 - - -56 - - - 2 - mod="/":) to store additional information in the exception object. The exception can be intercepted as T &, so existing exception handling will not break. It can also be intercepted as boost::(:link - 1 - - 0 - - -47 - - - 2 - :) &, so that (:link - 1 - - 0 - - -46 - - - 2 - |more information can be added to the exception at a later time:). - - - - - 0 - - -17 - - - - 65 - 2 - (:auto !!:) !!!Why doesn't boost::exception derive from std::exception? Despite that (:link - 1 - - 0 - - -43 - - - 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 - - -47 - - - 2 - :) derives from std::exception, using the (:link - 1 - - 0 - - -26 - - - 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 - - -47 - - - 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 - - -52 - - - 2 - :) to an active exception object: [@catch( boost::(:link - 1 - - 0 - - -47 - - - 2 - :) & e ) { e (:link - 1 - - 0 - - -56 - - - 2 - |<<:) foo_info(foo); throw e; //Compile error: boost::(:link - 1 - - 0 - - -47 - - - 2 - :) is abstract }@] The correct code is: [@catch( boost::(:link - 1 - - 0 - - -47 - - - 2 - :) & e ) { e (:link - 1 - - 0 - - -56 - - - 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 - - -47 - - - 2 - :) does not by itself cause dynamic memory allocations. Deriving from boost::(:link - 1 - - 0 - - -47 - - - 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 - - -35 - - - 2 - :) instead of using throw directly is that it ensures that the emitted exception derives from boost::(:link - 1 - - 0 - - -47 - - - 2 - :) and that it is compatible with boost::(:link - 1 - - 0 - - -34 - - - 2 - :). The (:link - 1 - - 0 - - -32 - - - 2 - :) macro also results in a call to boost::(:link - 1 - - 0 - - -35 - - - 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 - - -30 - - - 2 - :) to compose a more useful, if not user-friendly message. Typical use of boost::(:link - 1 - - 0 - - -30 - - - 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 - - -32 - - - 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 - - -35 - - - 2 - :) function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::(:link - 1 - - 0 - - -47 - - - 2 - :) as a base of any exception passed to boost::(:link - 1 - - 0 - - -35 - - - 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 - - -47 - - - 2 - :), and without this they can't use any of the Boost Exception facilities. For example, if a user wants to use Boost Serialization in a separate thread, it is desirable to be able to transport exceptions emitted by that library into the main thread where they can be analyzed to generate a user-friendly message. This can be easily achieved using boost::(:link - 1 - - 0 - - -33 - - - 2 - :), but this requires that Boost Serialization throws exceptions using boost::(:link - 1 - - 0 - - -37 - - - 2 - :). If Boost Serialization calls boost::(:link - 1 - - 0 - - -35 - - - 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 - - -47 - - - 2 - :), it is often desirable to add one or more (:link - 1 - - 0 - - -52 - - - 2 - :) objects in it. The syntactic sugar provided by (:link - 1 - - 0 - - -56 - - - 2 - :) allows this to be done directly in a throw expression: [@throw error() (:link - 1 - - 0 - - -56 - - - 2 - |<<:) foo_info(foo) (:link - 1 - - 0 - - -56 - - - 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 - - -18 - - - - 9 - 2 - (:auto !!!:) (:include synopsis:) This - 1 - - 0 - - -52 - - - 2 - typedef is used by - 1 - - 0 - - -34 - - - 2 - if it defaults to returning an - 1 - - 0 - - -33 - - - 2 - that refers to an object of type - 1 - - 0 - - -28 - - - 2 - , to record in it the std::type_info of the original exception object. - - - - - 0 - - -19 - - - - 1 - 2 - (:auto !!:) (:pagelist fmt="index" tags="hpp" sort_prefix="6":) - - - - - 0 - - -20 - - - - 1 - 2 - (:auto !!:) (:pagelist fmt="index" tags="type":) - - - - - 0 - - -21 - - - - 11 - 2 - (:auto !!!:) Here is how cloning can be enabled in a throw-expression (15.1): [@#include <(:link - 1 - - 0 - - -11 - - - 2 - :)> #include <stdio.h> #include <errno.h> typedef boost::error_info<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link - 1 - - 0 - - -47 - - - 2 - :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::(:link - 1 - - 0 - - -37 - - - 2 - :)(file_read_error()) << errno_info(errno); }@] Of course, (:link - 1 - - 0 - - -37 - - - 2 - :) may be used with any exception type; there is no requirement that it should derive from boost::(:link - 1 - - 0 - - -47 - - - 2 - :). - - - - - 0 - - -22 - - 1 2 @@ -6271,7 +6054,189 @@ 0 - -23 + -16 + + + + 7 + 2 + (:auto !!!:) (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link + 1 + + 0 + + -50 + + + 2 + :) object. * Copy constructor: initializes a boost::(:link + 1 + + 0 + + -50 + + + 2 + :) object which shares ownership with x of all data added through (:link + 1 + + 0 + + -52 + + + 2 + mod="/":), including data that is added at a future time. !!!!Throws: Nothing. + + + + + 0 + + -17 + + + + 11 + 2 + (:auto !!:) Boost Exception supports transporting of exception objects between threads through cloning. This system is similar to (:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:), but because Boost Exception can not rely on language support, the use of (:link + 1 + + 0 + + -38 + + + 2 + :) at the time of the throw is required in order to use cloning. !!!!Note: All exceptions emitted by the familiar function boost::(:link + 1 + + 0 + + -36 + + + 2 + :) are guaranteed to derive from boost::(:link + 1 + + 0 + + -50 + + + 2 + :) and to support cloning. (:include + 1 + + 0 + + -18 + + + 2 + :) (:include + 1 + + 0 + + -41 + + + 2 + :) + + + + + 0 + + -18 + + + + 11 + 2 + (:auto !!!:) Here is how cloning can be enabled in a throw-expression (15.1): [@#include <(:link + 1 + + 0 + + -42 + + + 2 + :)> #include <stdio.h> #include <errno.h> typedef boost::error_info<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link + 1 + + 0 + + -50 + + + 2 + :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::(:link + 1 + + 0 + + -38 + + + 2 + :)(file_read_error()) << errno_info(errno); }@] Of course, (:link + 1 + + 0 + + -38 + + + 2 + :) may be used with any exception type; there is no requirement that it should derive from boost::(:link + 1 + + 0 + + -50 + + + 2 + :). + + + + + 0 + + -19 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -20 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -21 @@ -6282,7 +6247,7 @@ 0 - -52 + -14 2 @@ -6291,13 +6256,111 @@ 0 - -23 + -21 2 mod="m":) evaluates to T. + + + 0 + + -22 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) !!!!Description: Returns a const reference to the copy of the value passed to (:link + 1 + + 0 + + -14 + + + 2 + :)'s constructor stored in the (:link + 1 + + 0 + + -14 + + + 2 + :) object. !!!!Throws: Nothing. + + + + + 0 + + -23 + + + + 13 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link + 1 + + 0 + + -14 + + + 2 + :) template. * E must be polymorphic. !!!!Returns: * If dynamic_cast<boost::(:link + 1 + + 0 + + -50 + + + 2 + :) const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is null. * Otherwise, the returned pointer points to the stored value (use (:link + 1 + + 0 + + -52 + + + 2 + mod="/":) to store values in exception objects.) When x is destroyed, any pointers returned by (:link + 1 + + 0 + + -23 + + + 2 + :) become invalid. !!!!Throws: Nothing. !!!!Note: The interface of (:link + 1 + + 0 + + -23 + + + 2 + :) may be affected by the build (:link + 1 + + 0 + + -32 + + + 2 + :). + + 0 @@ -6326,7 +6389,7 @@ 0 - -30 + -31 2 @@ -6348,7 +6411,7 @@ 0 - -47 + -50 2 @@ -6357,7 +6420,7 @@ 0 - -47 + -50 2 @@ -6379,7 +6442,7 @@ 0 - -22 + -20 2 @@ -6388,7 +6451,7 @@ 0 - -52 + -14 2 @@ -6397,7 +6460,7 @@ 0 - -47 + -50 2 @@ -6406,7 +6469,7 @@ 0 - -52 + -14 2 @@ -6415,7 +6478,7 @@ 0 - -47 + -50 2 @@ -6424,7 +6487,7 @@ 0 - -56 + -52 2 @@ -6433,7 +6496,7 @@ 0 - -57 + -23 2 @@ -6442,7 +6505,7 @@ 0 - -57 + -23 2 @@ -6464,7 +6527,7 @@ 0 - -33 + -34 2 @@ -6473,7 +6536,7 @@ 0 - -34 + -35 2 @@ -6487,6 +6550,19 @@ -29 + + 1 + 2 + (:auto !!:) (:pagelist tags="macro":) + + + + + 0 + + -30 + + 19 2 @@ -6495,7 +6571,7 @@ 0 - -30 + -31 2 @@ -6504,7 +6580,7 @@ 0 - -47 + -50 2 @@ -6513,7 +6589,7 @@ 0 - -47 + -50 2 @@ -6522,7 +6598,7 @@ 0 - -56 + -52 2 @@ -6531,7 +6607,7 @@ 0 - -22 + -20 2 @@ -6540,7 +6616,7 @@ 0 - -47 + -50 2 @@ -6549,7 +6625,7 @@ 0 - -47 + -50 2 @@ -6558,7 +6634,7 @@ 0 - -30 + -31 2 @@ -6578,7 +6654,7 @@ 0 - -30 + -31 @@ -6589,7 +6665,7 @@ 0 - -47 + -50 2 @@ -6598,7 +6674,7 @@ 0 - -52 + -14 2 @@ -6607,7 +6683,7 @@ 0 - -47 + -50 2 @@ -6616,7 +6692,7 @@ 0 - -56 + -52 2 @@ -6625,7 +6701,7 @@ 0 - -47 + -50 2 @@ -6634,7 +6710,7 @@ 0 - -30 + -31 2 @@ -6643,7 +6719,7 @@ 0 - -52 + -14 2 @@ -6652,7 +6728,7 @@ 0 - -52 + -14 2 @@ -6661,7 +6737,7 @@ 0 - -52 + -14 2 @@ -6670,7 +6746,7 @@ 0 - -55 + -22 2 @@ -6679,7 +6755,7 @@ 0 - -55 + -22 2 @@ -6688,7 +6764,7 @@ 0 - -30 + -31 2 @@ -6697,7 +6773,7 @@ 0 - -52 + -14 2 @@ -6717,7 +6793,7 @@ 0 - -31 + -32 @@ -6728,7 +6804,7 @@ 0 - -57 + -23 2 @@ -6737,7 +6813,7 @@ 0 - -57 + -23 2 @@ -6746,7 +6822,7 @@ 0 - -47 + -50 2 @@ -6755,7 +6831,7 @@ 0 - -37 + -38 2 @@ -6773,7 +6849,7 @@ 0 - -35 + -36 2 @@ -6782,7 +6858,7 @@ 0 - -5 + -10 2 @@ -6791,7 +6867,7 @@ 0 - -35 + -36 2 @@ -6800,7 +6876,7 @@ 0 - -30 + -31 2 @@ -6811,7 +6887,7 @@ 0 - -32 + -33 @@ -6822,7 +6898,7 @@ 0 - -35 + -36 2 @@ -6831,7 +6907,7 @@ 0 - -57 + -23 2 @@ -6840,7 +6916,7 @@ 0 - -30 + -31 2 @@ -6851,7 +6927,7 @@ 0 - -33 + -34 @@ -6862,7 +6938,7 @@ 0 - -33 + -34 2 @@ -6871,7 +6947,7 @@ 0 - -33 + -34 2 @@ -6880,7 +6956,7 @@ 0 - -33 + -34 2 @@ -6889,7 +6965,7 @@ 0 - -33 + -34 2 @@ -6898,7 +6974,7 @@ 0 - -33 + -34 2 @@ -6907,7 +6983,7 @@ 0 - -33 + -34 2 @@ -6916,7 +6992,7 @@ 0 - -33 + -34 2 @@ -6925,7 +7001,7 @@ 0 - -34 + -35 2 @@ -6934,45 +7010,45 @@ 0 - -39 + -40 2 - :) concurrently to throw the same exception object into multiple threads. !!!!Nesting of exceptions An + :) concurrently to throw the same exception object into multiple threads. !!!!Nesting of exceptions: An (:link 1 0 - -33 + -34 2 - can be added as + :) can be added as (:link 1 0 - -52 + -14 2 - to any boost:: + :) to any boost::(:link 1 0 - -47 + -50 2 - . This is a convenient way to nest exceptions. There is no limit on the depth of the nesting, however cyclic references result in undefined behavior. + :). This is a convenient way to nest exceptions. There is no limit on the depth of the nesting, however cyclic references result in undefined behavior. 0 - -34 + -35 @@ -6983,7 +7059,7 @@ 0 - -34 + -35 2 @@ -6992,7 +7068,7 @@ 0 - -33 + -34 2 @@ -7001,7 +7077,7 @@ 0 - -33 + -34 2 @@ -7010,7 +7086,7 @@ 0 - -34 + -35 2 @@ -7019,7 +7095,7 @@ 0 - -34 + -35 2 @@ -7028,7 +7104,7 @@ 0 - -37 + -38 2 @@ -7037,7 +7113,7 @@ 0 - -34 + -35 2 @@ -7046,7 +7122,7 @@ 0 - -33 + -34 2 @@ -7064,7 +7140,7 @@ 0 - -47 + -50 2 @@ -7073,7 +7149,7 @@ 0 - -47 + -50 2 @@ -7082,7 +7158,7 @@ 0 - -47 + -50 2 @@ -7091,7 +7167,7 @@ 0 - -33 + -34 2 @@ -7100,7 +7176,7 @@ 0 - -47 + -50 2 @@ -7109,7 +7185,7 @@ 0 - -57 + -23 2 @@ -7118,7 +7194,7 @@ 0 - -18 + -11 2 @@ -7129,7 +7205,7 @@ 0 - -35 + -36 @@ -7140,7 +7216,7 @@ 0 - -35 + -36 2 @@ -7149,7 +7225,7 @@ 0 - -37 + -38 2 @@ -7167,7 +7243,7 @@ 0 - -35 + -36 2 @@ -7176,7 +7252,7 @@ 0 - -35 + -36 2 @@ -7185,7 +7261,7 @@ 0 - -35 + -36 2 @@ -7194,7 +7270,7 @@ 0 - -57 + -23 2 @@ -7203,7 +7279,7 @@ 0 - -30 + -31 2 @@ -7214,7 +7290,7 @@ 0 - -36 + -37 @@ -7225,7 +7301,7 @@ 0 - -47 + -50 2 @@ -7236,7 +7312,7 @@ 0 - -37 + -38 @@ -7247,7 +7323,7 @@ 0 - -33 + -34 2 @@ -7256,7 +7332,7 @@ 0 - -37 + -38 2 @@ -7265,7 +7341,7 @@ 0 - -37 + -38 2 @@ -7274,7 +7350,7 @@ 0 - -34 + -35 2 @@ -7283,7 +7359,7 @@ 0 - -33 + -34 2 @@ -7301,7 +7377,7 @@ 0 - -34 + -35 2 @@ -7310,7 +7386,7 @@ 0 - -35 + -36 2 @@ -7319,7 +7395,7 @@ 0 - -47 + -50 2 @@ -7328,7 +7404,7 @@ 0 - -33 + -34 2 @@ -7339,7 +7415,7 @@ 0 - -38 + -39 @@ -7359,7 +7435,7 @@ 0 - -52 + -14 2 @@ -7368,7 +7444,7 @@ 0 - -52 + -14 2 @@ -7377,7 +7453,7 @@ 0 - -52 + -14 2 @@ -7386,7 +7462,7 @@ 0 - -47 + -50 2 @@ -7395,7 +7471,7 @@ 0 - -57 + -23 2 @@ -7406,7 +7482,7 @@ 0 - -39 + -40 @@ -7419,7 +7495,7 @@ 0 - -40 + -41 @@ -7430,7 +7506,7 @@ 0 - -34 + -35 2 @@ -7439,7 +7515,7 @@ 0 - -33 + -34 2 @@ -7448,7 +7524,7 @@ 0 - -12 + -53 2 @@ -7457,7 +7533,7 @@ 0 - -47 + -50 2 @@ -7466,7 +7542,7 @@ 0 - -33 + -34 2 @@ -7475,7 +7551,7 @@ 0 - -33 + -34 2 @@ -7484,7 +7560,7 @@ 0 - -34 + -35 2 @@ -7493,7 +7569,7 @@ 0 - -34 + -35 2 @@ -7502,7 +7578,7 @@ 0 - -39 + -40 2 @@ -7511,7 +7587,7 @@ 0 - -33 + -34 2 @@ -7520,7 +7596,7 @@ 0 - -39 + -40 2 @@ -7529,7 +7605,7 @@ 0 - -34 + -35 2 @@ -7538,7 +7614,7 @@ 0 - -33 + -34 2 @@ -7547,7 +7623,7 @@ 0 - -37 + -38 2 @@ -7556,7 +7632,7 @@ 0 - -33 + -34 2 @@ -7574,7 +7650,7 @@ 0 - -34 + -35 2 @@ -7583,7 +7659,7 @@ 0 - -39 + -40 2 @@ -7594,7 +7670,20 @@ 0 - -41 + -42 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -43 @@ -7607,7 +7696,7 @@ 0 - -42 + -44 @@ -7618,255 +7707,13 @@ 0 - -52 + -14 2 object. (:include throws:) - - - 0 - - -43 - - - - 5 - 2 - (:auto !!!:) Exception types should use virtual inheritance when deriving from other exception types. This insight is due to Andrew Koenig. Using virtual inheritance prevents ambiguity problems in the exception handler: [@#include <iostream> struct my_exc1 : std::exception { char const* what() const throw(); }; struct my_exc2 : std::exception { char const* what() const throw(); }; struct your_exc3 : my_exc1, my_exc2 {}; int main() { try { throw your_exc3(); } catch(std::exception const& e) {} catch(...) { std::cout << "whoops!" << std::endl; } }@] The program above outputs "whoops!" because the conversion to std::exception is ambiguous. The overhead introduced by virtual inheritance is always negligible in the context of exception handling. Note that virtual bases are initialized directly by the constructor of the most-derived-type (the type passed to the throw statement, in case of exceptions.) However, typically this detail is of no concern when boost::(:link - 1 - - 0 - - -47 - - - 2 - :) is used, because it enables exception types to be trivial structs with no members (there's nothing to initialize.) See (:link - 1 - - 0 - - -8 - - - 2 - mod="w":). - - - - - 0 - - -44 - - - - 45 - 2 - !!Synopsis List of documented definitions, declarations and includes by header file: `#include <(:link - 1 - - 0 - - -49 - - - 2 - :)> [@(:include - 1 - - 0 - - -49 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -7 - - - 2 - :)> [@(:include - 1 - - 0 - - -7 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -11 - - - 2 - :)> [@(:include - 1 - - 0 - - -11 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -9 - - - 2 - :)> [@(:include - 1 - - 0 - - -9 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -24 - - - 2 - :)> [@(:include - 1 - - 0 - - -24 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -58 - - - 2 - :)> [@(:include - 1 - - 0 - - -58 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -13 - - - 2 - :)> [@(:include - 1 - - 0 - - -13 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -12 - - - 2 - :)> [@(:include - 1 - - 0 - - -12 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -6 - - - 2 - :)> [@(:include - 1 - - 0 - - -6 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -5 - - - 2 - :)> [@(:include - 1 - - 0 - - -5 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -22 - - - 2 - :)> (:include - 1 - - 0 - - -22 - - - 2 - synopsis:) - - 0 @@ -7877,25 +7724,25 @@ 5 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + (:auto !!!:) Exception types should use virtual inheritance when deriving from other exception types. This insight is due to Andrew Koenig. Using virtual inheritance prevents ambiguity problems in the exception handler: [@#include <iostream> struct my_exc1 : std::exception { char const* what() const throw(); }; struct my_exc2 : std::exception { char const* what() const throw(); }; struct your_exc3 : my_exc1, my_exc2 {}; int main() { try { throw your_exc3(); } catch(std::exception const& e) {} catch(...) { std::cout << "whoops!" << std::endl; } }@] The program above outputs "whoops!" because the conversion to std::exception is ambiguous. The overhead introduced by virtual inheritance is always negligible in the context of exception handling. Note that virtual bases are initialized directly by the constructor of the most-derived-type (the type passed to the throw statement, in case of exceptions.) However, typically this detail is of no concern when boost::(:link 1 0 - -47 + -50 2 - :), or a type that derives (indirectly) from boost::(:link + :) is used, because it enables exception types to be trivial structs with no members (there's nothing to initialize.) See (:link 1 0 - -47 + -7 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:) + mod="w":). @@ -7905,6 +7752,378 @@ -46 + + 45 + 2 + !!Synopsis List of documented definitions, declarations and includes by header file: `#include <(:link + 1 + + 0 + + -19 + + + 2 + :)> [@(:include + 1 + + 0 + + -19 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -5 + + + 2 + :)> [@(:include + 1 + + 0 + + -5 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -42 + + + 2 + :)> [@(:include + 1 + + 0 + + -42 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -9 + + + 2 + :)> [@(:include + 1 + + 0 + + -9 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -24 + + + 2 + :)> [@(:include + 1 + + 0 + + -24 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -15 + + + 2 + :)> [@(:include + 1 + + 0 + + -15 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -56 + + + 2 + :)> [@(:include + 1 + + 0 + + -56 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -53 + + + 2 + :)> [@(:include + 1 + + 0 + + -53 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -55 + + + 2 + :)> [@(:include + 1 + + 0 + + -55 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -10 + + + 2 + :)> [@(:include + 1 + + 0 + + -10 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -20 + + + 2 + :)> (:include + 1 + + 0 + + -20 + + + 2 + synopsis:) + + + + + 0 + + -47 + + + + 27 + 2 + (:auto !!:) Some exception hierarchies can not be modified to make boost::(:link + 1 + + 0 + + -50 + + + 2 + :) a base type. In this case, the (:link + 1 + + 0 + + -26 + + + 2 + :) function template can be used to make exception objects derive from boost::(:link + 1 + + 0 + + -50 + + + 2 + :) anyway. Here is an example: [@#include <(:link + 1 + + 0 + + -20 + + + 2 + :)> #include <stdexcept> typedef boost::(:link + 1 + + 0 + + -14 + + + 2 + :)<struct tag_std_range_min,size_t> std_range_min; typedef boost::(:link + 1 + + 0 + + -14 + + + 2 + :)<struct tag_std_range_max,size_t> std_range_max; typedef boost::(:link + 1 + + 0 + + -14 + + + 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 + + -26 + + + 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 + + -26 + + + 2 + :)<T> gets us an object of ''unspecified type'' which is guaranteed to derive from both boost::(:link + 1 + + 0 + + -50 + + + 2 + :) and T. This makes it possible to use (:link + 1 + + 0 + + -52 + + + 2 + mod="/":) to store additional information in the exception object. The exception can be intercepted as T &, so existing exception handling will not break. It can also be intercepted as boost::(:link + 1 + + 0 + + -50 + + + 2 + :) &, so that (:link + 1 + + 0 + + -49 + + + 2 + |more information can be added to the exception at a later time:). + + + + + 0 + + -48 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + 1 + + 0 + + -50 + + + 2 + :), or a type that derives (indirectly) from boost::(:link + 1 + + 0 + + -50 + + + 2 + :). !!!!Effects: Equivalent to x << v.(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements|get:)<0>() << ... << v.(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements|get:)<N>(). !!!!Returns: x. (:include throws:) + + + + + 0 + + -49 + + 11 2 @@ -7913,7 +8132,7 @@ 0 - -47 + -50 2 @@ -7922,7 +8141,7 @@ 0 - -47 + -50 2 @@ -7940,7 +8159,7 @@ 0 - -48 + -51 2 @@ -7949,7 +8168,7 @@ 0 - -38 + -39 2 @@ -7960,7 +8179,7 @@ 0 - -47 + -50 @@ -7971,7 +8190,7 @@ 0 - -47 + -50 2 @@ -7980,7 +8199,7 @@ 0 - -47 + -50 2 @@ -7989,7 +8208,7 @@ 0 - -52 + -14 2 @@ -7998,7 +8217,7 @@ 0 - -56 + -52 2 @@ -8007,7 +8226,7 @@ 0 - -47 + -50 2 @@ -8016,7 +8235,7 @@ 0 - -57 + -23 2 @@ -8027,7 +8246,7 @@ 0 - -48 + -51 @@ -8038,7 +8257,7 @@ 0 - -47 + -50 2 @@ -8047,7 +8266,7 @@ 0 - -22 + -20 2 @@ -8056,7 +8275,7 @@ 0 - -52 + -14 2 @@ -8065,7 +8284,7 @@ 0 - -47 + -50 2 @@ -8074,7 +8293,7 @@ 0 - -22 + -20 2 @@ -8083,7 +8302,7 @@ 0 - -52 + -14 2 @@ -8092,7 +8311,7 @@ 0 - -47 + -50 2 @@ -8101,7 +8320,7 @@ 0 - -47 + -50 2 @@ -8110,70 +8329,13 @@ 0 - -47 + -50 2 :) object is that the file name is relevant to any failure that occurs in parse_file, ''even if the failure is unrelated to file I/O''. - - - 0 - - -49 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -50 - - - - 1 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: This function must not be called outside of a catch block. !!!!Returns: A pointer of type E to the current exception object, or null if the current exception object can not be converted to E *. !!!!Throws: Nothing. - - - - - 0 - - -51 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) !!!!Effects: As if [@try { throw - 1 - - 0 - - -37 - - - 2 - (e); } catch(...) { return (:link - 1 - - 0 - - -34 - - - 2 - :)(); }@] - - 0 @@ -8182,171 +8344,36 @@ - 37 + 7 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: T must have accessible copy constructor and must not be a reference (there is no requirement that T's copy constructor does not throw.) !!!!Description: This class template is used to associate a Tag type with a value type T. Objects of type (:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link 1 0 - -52 + -50 2 - :)<Tag,T> can be passed to (:link + :), or a type that derives (indirectly) from boost::(:link 1 0 - -56 + -50 2 - mod="/":) to be stored in objects of type boost::(:link + :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link 1 0 - -47 + -14 2 - :). !!!!Usage: The header <(:link - 1 - - 0 - - -7 - - - 2 - :)> provides a declaration of the (:link - 1 - - 0 - - -52 - - - 2 - :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, for example: [@#include <(:link - 1 - - 0 - - -7 - - - 2 - :)> struct tag_errno; typedef boost::(:link - 1 - - 0 - - -52 - - - 2 - :)<tag_errno,int> errno_info;@] Or, the shorter equivalent: [@#include <(:link - 1 - - 0 - - -7 - - - 2 - :)> typedef boost::(:link - 1 - - 0 - - -52 - - - 2 - :)<struct tag_errno,int> errno_info;@] This errno_info typedef can be passed to (:link - 1 - - 0 - - -56 - - - 2 - mod="/":) (#include <(:link - 1 - - 0 - - -11 - - - 2 - :)> first) to store an int named tag_errno in exceptions of types that derive from boost::(:link - 1 - - 0 - - -47 - - - 2 - :): [@throw file_read_error() (:link - 1 - - 0 - - -56 - - - 2 - |<<:) errno_info(errno);@] It can also be passed to (:link - 1 - - 0 - - -57 - - - 2 - :) (#include <(:link - 1 - - 0 - - -53 - - - 2 - :)> first) to retrieve the tag_errno int from a boost::(:link - 1 - - 0 - - -47 - - - 2 - :): [@catch( boost::(:link - 1 - - 0 - - -47 - - - 2 - :) & x ) { if( int const * e=boost::(:link - 1 - - 0 - - -57 - - - 2 - :)<errno_info>(x) ) .... }@] + :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) @@ -8369,6 +8396,215 @@ -54 + + 1 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: This function must not be called outside of a catch block. !!!!Returns: A pointer of type E to the current exception object, or null if the current exception object can not be converted to E *. !!!!Throws: Nothing. + + + + + 0 + + -55 + + + + 1 + 2 + (:auto !!!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -56 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -57 + + + + 1 + 2 + (:auto !:) This is an alphabetical list of all Boost Exception documentation pages. (:pagelist fmt="index" except_tags="index noindex" mod="w":) + + + + + 0 + + -58 + + + + 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 + + -50 + + + 2 + :). *Confidently limit the throw site to provide only data that is available naturally. *Use exception-neutral contexts between the throw and the catch to augment exceptions with more relevant data as they bubble up. For example, in the throw statement below we only add the errno code, since this is the only failure-relevant information available in this context: [@struct exception_base: virtual std::exception, virtual boost::(:link + 1 + + 0 + + -50 + + + 2 + :) { }; struct io_error: virtual exception_base { }; struct file_read_error: virtual io_error { }; typedef boost::(:link + 1 + + 0 + + -14 + + + 2 + :)<struct tag_errno_code,int> errno_code; void read_file( FILE * f ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error() (:link + 1 + + 0 + + -52 + + + 2 + |<<:) errno_code(errno); .... }@] In a higher exception-neutral context, we add the file name to ''any'' exception that derives from boost::(:link + 1 + + 0 + + -50 + + + 2 + :): [@typedef boost::(:link + 1 + + 0 + + -14 + + + 2 + :)<struct tag_file_name,std::string> file_name; .... try { if( FILE * fp=fopen("foo.txt","rt") ) { shared_ptr<FILE> f(fp,fclose); .... read_file(fp); //throws types deriving from boost::(:link + 1 + + 0 + + -50 + + + 2 + :) do_something(); .... } else throw file_open_error() (:link + 1 + + 0 + + -52 + + + 2 + |<<:) errno_code(errno); } catch( boost::(:link + 1 + + 0 + + -50 + + + 2 + :) & e ) { e (:link + 1 + + 0 + + -52 + + + 2 + |<<:) file_name("foo.txt"); throw; }@] Finally here is how the handler retrieves data from exceptions that derive from boost::(:link + 1 + + 0 + + -50 + + + 2 + :): [@catch( io_error & e ) { std::cerr << "I/O Error!\n"; if( std::string const * fn=(:link + 1 + + 0 + + -23 + + + 2 + :)<file_name>(e) ) std::cerr << "File name: " << *fn << "\n"; if( int const * c=(:link + 1 + + 0 + + -23 + + + 2 + :)<errno_code>(e) ) std::cerr << "OS says: " << strerror(*c) << "\n"; }@] In addition, boost::(:link + 1 + + 0 + + -31 + + + 2 + :) can be used to compose an automatic (if not user-friendly) message that contains all of the (:link + 1 + + 0 + + -14 + + + 2 + :) objects added to a boost::(:link + 1 + + 0 + + -50 + + + 2 + :). This is useful for inclusion in logs and other diagnostic objects. + + + + + 0 + + -59 + + 69 2 @@ -8377,7 +8613,7 @@ 0 - -60 + -17 2 @@ -8386,7 +8622,7 @@ 0 - -35 + -36 2 @@ -8395,7 +8631,7 @@ 0 - -15 + -58 2 @@ -8404,57 +8640,12 @@ 0 - -46 + -49 2 mod="w":) ##(:link 1 - - 0 - - -16 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -60 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -8 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -43 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -29 - - - 2 - mod="w":) #Documentation ##Class (:link - 1 0 @@ -8462,12 +8653,57 @@ 2 + mod="w":) ##(:link + 1 + + 0 + + -17 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -7 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -45 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -30 + + + 2 + mod="w":) #Documentation ##Class (:link + 1 + + 0 + + -50 + + + 2 :) ##Throwing Exceptions ###(:link 1 0 - -32 + -33 2 @@ -8476,12 +8712,21 @@ 0 - -35 + -36 2 :) ##Transporting of Arbitrary Data to the Catch Site ###(:link 1 + + 0 + + -14 + + + 2 + :) ###(:link + 1 0 @@ -8494,7 +8739,7 @@ 0 - -56 + -48 2 @@ -8503,16 +8748,7 @@ 0 - -45 - - - 2 - :) ###(:link - 1 - - 0 - - -57 + -23 2 @@ -8527,24 +8763,6 @@ 2 :) ##(:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:) Transporting of Exceptions between Threads ###(:link 1 - - 0 - - -33 - - - 2 - :) ###(:link - 1 - - 0 - - -37 - - - 2 - :) ###(:link - 1 0 @@ -8557,7 +8775,7 @@ 0 - -51 + -38 2 @@ -8566,7 +8784,25 @@ 0 - -39 + -35 + + + 2 + :) ###(:link + 1 + + 0 + + -12 + + + 2 + :) ###(:link + 1 + + 0 + + -40 2 @@ -8584,12 +8820,48 @@ 0 - -30 + -31 2 :) ###(:link 1 + + 0 + + -60 + + + 2 + :) ##(:link + 1 + + 0 + + -54 + + + 2 + :) #API ##(:link + 1 + + 0 + + -46 + + + 2 + :) ##(:link + 1 + + 0 + + -8 + + + 2 + :) ##(:link + 1 0 @@ -8602,16 +8874,7 @@ 0 - -50 - - - 2 - :) #API ##(:link - 1 - - 0 - - -44 + -43 2 @@ -8620,7 +8883,7 @@ 0 - -19 + -29 2 @@ -8629,34 +8892,7 @@ 0 - -20 - - - 2 - :) ##(:link - 1 - - 0 - - -41 - - - 2 - :) ##(:link - 1 - - 0 - - -10 - - - 2 - :) ##(:link - 1 - - 0 - - -31 + -32 2 @@ -8665,7 +8901,7 @@ 0 - -17 + -6 2 @@ -8674,204 +8910,13 @@ 0 - -14 + -57 2 mod="w":) !!!Acknowledgements Thanks to Peter Dimov for his continuing help. Also thanks to Tobias Schwinger, Tom Brinkman, Pavel Vozenilek and everyone who participated in the review process. - - - 0 - - -55 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) !!!!Description: Returns a const reference to the copy of the value passed to (:link - 1 - - 0 - - -52 - - - 2 - :)'s constructor stored in the (:link - 1 - - 0 - - -52 - - - 2 - :) object. !!!!Throws: Nothing. - - - - - 0 - - -56 - - - - 7 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link - 1 - - 0 - - -47 - - - 2 - :), or a type that derives (indirectly) from boost::(:link - 1 - - 0 - - -47 - - - 2 - :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link - 1 - - 0 - - -52 - - - 2 - :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) - - - - - 0 - - -57 - - - - 13 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link - 1 - - 0 - - -52 - - - 2 - :) template. * E must be polymorphic. !!!!Returns: * If dynamic_cast<boost::(:link - 1 - - 0 - - -47 - - - 2 - :) const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is null. * Otherwise, the returned pointer points to the stored value (use (:link - 1 - - 0 - - -56 - - - 2 - mod="/":) to store values in exception objects.) When x is destroyed, any pointers returned by (:link - 1 - - 0 - - -57 - - - 2 - :) become invalid. !!!!Throws: Nothing. !!!!Note: The interface of (:link - 1 - - 0 - - -57 - - - 2 - :) may be affected by the build (:link - 1 - - 0 - - -31 - - - 2 - :). - - - - - 0 - - -58 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -59 - - - - 7 - 2 - (:auto !!!:) (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link - 1 - - 0 - - -47 - - - 2 - :) object. * Copy constructor: initializes a boost::(:link - 1 - - 0 - - -47 - - - 2 - :) object which shares ownership with x of all data added through (:link - 1 - - 0 - - -56 - - - 2 - mod="/":), including data that is added at a future time. !!!!Throws: Nothing. - - 0 @@ -8879,64 +8924,6 @@ -60 - - 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 - - -37 - - - 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 - - -35 - - - 2 - :) are guaranteed to derive from boost::(:link - 1 - - 0 - - -47 - - - 2 - :) and to support cloning. (:include - 1 - - 0 - - -21 - - - 2 - :) (:include - 1 - - 0 - - -40 - - - 2 - :) - - - - - 0 - - -61 - - 9 2 @@ -8945,7 +8932,7 @@ 0 - -47 + -50 2 @@ -8954,7 +8941,7 @@ 0 - -30 + -31 2 @@ -8963,7 +8950,7 @@ 0 - -61 + -60 2 @@ -8972,13 +8959,26 @@ 0 - -61 + -60 2 (); } }@] + + + 0 + + -61 + + + + 1 + 2 + (:auto !!:) (:pagelist fmt="index" tags="type":) + + @@ -9408,9 +9408,7 @@ - 1 - 2 - !!!!Throws: Any exception emitted by v's copy constructor. + 0 @@ -9432,7 +9430,9 @@ - 0 + 1 + 2 + !!!!Throws: Any exception emitted by v's copy constructor. @@ -9443,9 +9443,7 @@ - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. + 0 @@ -9478,7 +9476,9 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. @@ -9522,7 +9522,9 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. @@ -9566,9 +9568,7 @@ - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. + 0 @@ -9650,7 +9650,7 @@ 1 2 - (:include api:) + [@namespace boost { (:include api pre_indent="4":) }@] @@ -9661,18 +9661,7 @@ - 3 - 2 - [@#include < - 1 - - 0 - - -49 - - - 2 - > namespace boost { (:include api pre_indent="4":) }@] + 0 @@ -9683,9 +9672,7 @@ - 1 - 2 - [@namespace boost { (:include api pre_indent="4":) }@] + 0 @@ -9714,7 +9701,7 @@ 0 - -11 + -42 2 @@ -9729,7 +9716,9 @@ - 0 + 1 + 2 + (:include api:) @@ -9742,16 +9731,16 @@ 3 2 - [@#include <(:link + `#include < 1 0 - -49 + -53 2 - :)> namespace boost { (:include api pre_indent="4":) }@] + > [@namespace boost { (:include decl pre_indent="4":) }@] @@ -9764,16 +9753,16 @@ 3 2 - [@#include <(:link + `#include <(:link 1 0 - -49 + -53 2 - :)> namespace boost { (:include api pre_indent="4":) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -9786,7 +9775,7 @@ 1 2 - [@namespace boost { (:include api pre_indent="4":) }@] + [@#include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] @@ -9797,7 +9786,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -42 + + + 2 + :)> [@namespace boost { (:include def pre_indent="4":) }@] @@ -9808,7 +9808,18 @@ - 0 + 3 + 2 + [@#include <string> namespace boost { (:include + 1 + + 0 + + -50 + + + 2 + decl pre_indent="4":) (:include api pre_indent="4":) }@] @@ -9841,18 +9852,7 @@ - 3 - 2 - `#include < - 1 - - 0 - - -12 - - - 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -9863,7 +9863,9 @@ - 0 + 1 + 2 + [@namespace boost { (:include api pre_indent="4":) }@] @@ -9873,28 +9875,6 @@ -20 - - 0 - - - - - 0 - - -21 - - - - 0 - - - - - 0 - - -22 - - 1 2 @@ -9905,7 +9885,7 @@ 0 - -23 + -21 @@ -9916,13 +9896,48 @@ 0 - -11 + -42 2 :)> [@(:include decl:)@] + + + 0 + + -22 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -42 + + + 2 + :)> [@(:include decl:)@] + + + + + 0 + + -23 + + + + 1 + 2 + [@namespace boost { (:include decl pre_indent="4":) }@] + + 0 @@ -9938,7 +9953,7 @@ 0 - -49 + -19 2 @@ -10004,7 +10019,7 @@ 0 - -12 + -53 2 @@ -10030,18 +10045,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -58 - - - 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -10052,7 +10056,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -15 + + + 2 + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] @@ -10063,18 +10078,7 @@ - 3 - 2 - `#include < - 1 - - 0 - - -5 - - - 2 - > (:include decl:) + 0 @@ -10087,16 +10091,16 @@ 3 2 - `#include <(:link + `#include < 1 0 - -12 + -10 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + > (:include decl:) @@ -10114,7 +10118,7 @@ 0 - -12 + -53 2 @@ -10136,73 +10140,7 @@ 0 - -5 - - - 2 - :)> [@namespace boost { (:include decl:) }@] - - - - - 0 - - -36 - - - - 0 - - - - - 0 - - -37 - - - - 3 - 2 - `#include < - 1 - - 0 - - -6 - - - 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -38 - - - - 0 - - - - - 0 - - -39 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -12 + -53 2 @@ -10213,13 +10151,90 @@ 0 - -40 + -36 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -10 + + + 2 + :)> [@namespace boost { (:include decl:) }@] + + + + + 0 + + -37 0 + + + 0 + + -38 + + + + 3 + 2 + `#include < + 1 + + 0 + + -55 + + + 2 + > [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -39 + + + + 0 + + + + + 0 + + -40 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -53 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] + + 0 @@ -10241,16 +10256,16 @@ 3 2 - `#include <(:link + [@#include <(:link 1 0 - -11 + -19 2 - :)> [@(:include decl:)@] + :)> namespace boost { (:include api pre_indent="4":) }@] @@ -10272,7 +10287,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -42 + + + 2 + :)> [@(:include decl:)@] @@ -10283,27 +10309,7 @@ - 5 - 2 - `#include <(:link - 1 - - 0 - - -9 - - - 2 - :)> [@namespace boost { (:include - 1 - - 0 - - -45 - - - 2 - decl pre_indent="4":) }@] + 0 @@ -10325,18 +10331,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -49 - - - 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] + 0 @@ -10347,7 +10342,27 @@ - 0 + 5 + 2 + `#include <(:link + 1 + + 0 + + -9 + + + 2 + :)> [@namespace boost { (:include + 1 + + 0 + + -48 + + + 2 + decl pre_indent="4":) }@] @@ -10358,9 +10373,7 @@ - 1 - 2 - [@namespace boost { (:include api pre_indent="4":) }@] + 0 @@ -10373,16 +10386,16 @@ 3 2 - `#include < + `#include <(:link 1 0 - -13 + -19 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] + :)> [@namespace boost { (:include def pre_indent="4":) }@] @@ -10393,18 +10406,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -12 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -10422,11 +10424,11 @@ 0 - -11 + -42 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] @@ -10437,9 +10439,18 @@ - 1 + 3 2 - [@#include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] + [@#include <(:link + 1 + + 0 + + -19 + + + 2 + :)> namespace boost { (:include api pre_indent="4":) }@] @@ -10450,7 +10461,18 @@ - 0 + 3 + 2 + `#include < + 1 + + 0 + + -56 + + + 2 + > [@namespace boost { (:include decl pre_indent="4":) }@] @@ -10463,16 +10485,16 @@ 3 2 - `#include <(:link + [@#include < 1 0 - -11 + -19 2 - :)> [@(:include decl:)@] + > namespace boost { (:include api pre_indent="4":) }@] @@ -10483,18 +10505,9 @@ - 3 + 1 2 - `#include <(:link - 1 - - 0 - - -11 - - - 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + [@namespace boost { (:include api pre_indent="4":) }@] @@ -10505,9 +10518,7 @@ - 1 - 2 - [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -10518,18 +10529,7 @@ - 3 - 2 - [@#include <string> namespace boost { (:include - 1 - - 0 - - -47 - - - 2 - decl pre_indent="4":) (:include api pre_indent="4":) }@] + 0 @@ -10551,7 +10551,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -15 + + + 2 + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] @@ -10562,18 +10573,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -58 - - - 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -10784,7 +10784,7 @@ - -54 + -59 @@ -10801,7 +10801,7 @@ - -60 + -17 @@ -10818,7 +10818,7 @@ - -46 + -49 @@ -10835,7 +10835,7 @@ - -14 + -57 @@ -10869,7 +10869,7 @@ - -6 + -55 @@ -10886,7 +10886,58 @@ - -15 + -58 + + + + + + + 0 + + + + + + 1 + + + + -45 + + + + + + + 0 + + + + + + 1 + + + + -7 + + + + + + + 0 + + + + + + 1 + + + + -6 @@ -10937,7 +10988,7 @@ - -17 + -61 @@ -10954,7 +11005,7 @@ - -41 + -29 @@ -10971,58 +11022,7 @@ - -19 - - - - - - - 0 - - - - - - 1 - - - - -20 - - - - - - - 0 - - - - - - 1 - - - - -10 - - - - - - - 0 - - - - - - 1 - - - - -44 + -46 @@ -11046,7 +11046,7 @@ - -58 + -15 @@ -11070,7 +11070,7 @@ - -12 + -53 @@ -11126,7 +11126,7 @@ - -34 + -35 @@ -11154,7 +11154,7 @@ - -33 + -34 @@ -11182,7 +11182,7 @@ - -18 + -11 @@ -11210,7 +11210,7 @@ - -39 + -40 @@ -11238,7 +11238,7 @@ - -51 + -12 @@ -11262,7 +11262,7 @@ - -40 + -41 @@ -11314,7 +11314,7 @@ - -42 + -44 @@ -11342,7 +11342,7 @@ - -56 + -52 @@ -11366,7 +11366,7 @@ - -16 + -47 @@ -11394,7 +11394,7 @@ - -50 + -54 @@ -11422,7 +11422,7 @@ - -57 + -23 @@ -11450,7 +11450,7 @@ - -30 + -31 @@ -11478,7 +11478,7 @@ - -61 + -60 @@ -11502,7 +11502,7 @@ - -29 + -30 @@ -11526,7 +11526,7 @@ - -22 + -20 @@ -11578,7 +11578,7 @@ - -35 + -36 @@ -11610,7 +11610,7 @@ - -31 + -32 @@ -11634,7 +11634,7 @@ - -13 + -56 @@ -11662,7 +11662,7 @@ - -52 + -14 @@ -11694,7 +11694,7 @@ - -23 + -21 @@ -11726,7 +11726,7 @@ - -55 + -22 @@ -11750,7 +11750,7 @@ - -53 + -13 @@ -11774,7 +11774,7 @@ - -11 + -42 @@ -11798,7 +11798,7 @@ - -49 + -19 @@ -11826,7 +11826,7 @@ - -36 + -37 @@ -11854,7 +11854,7 @@ - -37 + -38 @@ -11910,7 +11910,7 @@ - -47 + -50 @@ -11942,7 +11942,7 @@ - -59 + -16 @@ -11990,7 +11990,7 @@ - -21 + -18 @@ -12014,7 +12014,7 @@ - -32 + -33 @@ -12038,7 +12038,7 @@ - -5 + -10 @@ -12062,7 +12062,7 @@ - -48 + -51 @@ -12090,7 +12090,7 @@ - -7 + -5 @@ -12118,7 +12118,7 @@ - -45 + -48 @@ -12142,7 +12142,7 @@ - -38 + -39 @@ -12179,16 +12179,7 @@ 0 - -6 - - - exception_ptr - - - - 0 - - -7 + -9 @@ -12197,7 +12188,7 @@ 0 - -9 + -10 @@ -12209,7 +12200,7 @@ -11 - + type @@ -12218,7 +12209,7 @@ -12 - + exception_ptr free function @@ -12227,7 +12218,7 @@ -13 - + error_info @@ -12236,6 +12227,15 @@ -14 + type + + + + 0 + + -15 + + @@ -12245,6 +12245,15 @@ -16 + function + + + + 0 + + -17 + + tutorial @@ -12254,22 +12263,13 @@ -18 - type - - - - 0 - - -21 - - noindex tutorial 0 - -22 + -19 @@ -12278,11 +12278,38 @@ 0 - -23 + -20 + + + + + + + 0 + + -21 type + + + 0 + + -22 + + + function member + + + + 0 + + -23 + + + error_info free function + 0 @@ -12323,7 +12350,7 @@ 0 - -29 + -30 diagnostic_information tutorial @@ -12332,7 +12359,7 @@ 0 - -30 + -31 diagnostic_information free function @@ -12341,7 +12368,7 @@ 0 - -32 + -33 macro @@ -12350,20 +12377,11 @@ 0 - -33 + -34 type - - - 0 - - -34 - - - exception_ptr free function - 0 @@ -12371,7 +12389,7 @@ -35 - free function + exception_ptr free function @@ -12380,7 +12398,7 @@ -36 - function + free function @@ -12389,7 +12407,7 @@ -37 - exception_ptr free function + function @@ -12398,7 +12416,7 @@ -38 - noalso noindex tutorial + exception_ptr free function @@ -12407,7 +12425,7 @@ -39 - exception_ptr free function + noalso noindex tutorial @@ -12416,6 +12434,15 @@ -40 + exception_ptr free function + + + + 0 + + -41 + + noindex tutorial @@ -12425,17 +12452,17 @@ -42 + + + + + 0 + + -44 + + function member - - - 0 - - -43 - - - tutorial - 0 @@ -12443,15 +12470,6 @@ -45 - error_info free function - - - - 0 - - -46 - - tutorial @@ -12461,7 +12479,7 @@ -47 - type + tutorial @@ -12470,7 +12488,7 @@ -48 - noalso noindex tutorial + error_info free function @@ -12479,7 +12497,7 @@ -49 - + tutorial @@ -12488,7 +12506,7 @@ -50 - function + type @@ -12497,7 +12515,7 @@ -51 - exception_ptr free function + noalso noindex tutorial @@ -12506,7 +12524,7 @@ -52 - type + error_info free function @@ -12515,7 +12533,7 @@ -53 - error_info + @@ -12524,7 +12542,7 @@ -54 - noindex + function @@ -12533,7 +12551,7 @@ -55 - function member + exception_ptr @@ -12542,7 +12560,7 @@ -56 - error_info free function + @@ -12551,15 +12569,6 @@ -57 - error_info free function - - - - 0 - - -58 - - @@ -12569,7 +12578,7 @@ -59 - function + noindex @@ -12578,15 +12587,6 @@ -60 - tutorial - - - - 0 - - -61 - - function