diff --git a/doc/diagnostic_information.html b/doc/diagnostic_information.html index 1ec4a97..9941f22 100644 --- a/doc/diagnostic_information.html +++ b/doc/diagnostic_information.html @@ -63,13 +63,13 @@ else return <unspecified-string-value>;

Example:

this is a possible output from the diagnostic_information function, as used in libs/exception/example/example_io.cpp:

-
example_io.cpp(83): Throw in function class boost::shared_ptr<struct _iobuf> __cdecl my_fopen(const char *,const char *)
+
example_io.cpp(70): Throw in function class boost::shared_ptr<struct _iobuf> __cdecl my_fopen(const char *,const char *)
 Dynamic exception type: class boost::exception_detail::clone_impl<class fopen_error>
 std::exception::what: example_io error
-[struct tag_errno *] = 2, OS says "No such file or directory"
-[struct tag_file_name *] = tmp1.txt
-[struct tag_function *] = fopen
-[struct tag_open_mode *] = rb
+[struct boost::errinfo_api_function_ *] = fopen +[struct boost::errinfo_errno_ *] = 2, "No such file or directory" +[struct boost::errinfo_file_name_ *] = tmp1.txt +[struct boost::errinfo_file_open_mode_ *] = rb

See Also:

BOOST_THROW_EXCEPTION
diff --git a/doc/source/boost-exception.reno b/doc/source/boost-exception.reno index a9e6820..e8974bf 100644 --- a/doc/source/boost-exception.reno +++ b/doc/source/boost-exception.reno @@ -53,29 +53,18 @@ - 2 - DA1CAA5F6BAB712AD89E8A0B7D83961FCE4AF9FD198791C9F6EA299800A64FAC - 3553871704 - 612 - 1496 - 154AC930BD1FDCADE24CDB07DBD3163CA26378AF4F1D428C34B67D1F68A60891 - 50905072 - 586 - 23 + 0 - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 + 1 - <string>throw_exception</string> + <string>boost/exception/enable_error_info.hpp</string> @@ -97,44 +86,6 @@ reno_context - - - - - - 0 - - - - - - 1 - - - - - <string>Synopsis</string> - - - synopsis - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 7 - - reno_context - @@ -176,6 +127,44 @@ (:include include:) (:auto also:) + + + 0 + + 7 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Synopsis</string> + + + synopsis + + + + + + 1 + 2 + (:include include:) (:auto also:) + + 0 @@ -184,394 +173,6 @@ reno_context - - - - - - 1 - CAD6C404CB725D336A44920D2341ECA131149AB02C368B59028F8147F16737BF - 2258638601 - 94 - 227 - - - - - - 0 - ../../../../boost/exception/info_tuple.hpp - 0 - 0 - - - - - <string>boost/exception/info_tuple.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 9 - - reno_context - - - - - - - 1 - F4C951B28F7DE500973AA3DFAA99F2BADA6EDAFA2B406C30BEF3B7FBE6FD57D7 - 2263754923 - 982 - 306 - - - - - - 0 - ../../example/error_info_2.cpp - 0 - 0 - - - - - <string>adding of arbitrary data to active exception objects</string> - - - adding_data_later - - - - - - 0 - - - - - 0 - - 10 - - reno_context - - - - - - - 2 - CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 - 1114955626 - 11770 - 723 - B20A3D4631F3B2415EED1888B65FA33D7AED20F86BE196159D9297AAED115787 - 3293519666 - 117 - 11169 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>rethrow_exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 11 - - 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 - - - - - - - 2 - AED5E79246B32BDF0E5C6CD8BDDC3370FD0BA1EFE3D4CE76C4A6D36A123F2E20 - 228982966 - 3918 - 518 - 6E325144EF4F41FA3A225EB30729101382C4E99B3D6160E307311E4B4E641010 - 1097215175 - 161 - 240 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - - <string>error_info::error_info</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 13 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>page index</string> - - - page_idx - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 14 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Types</string> - - - types - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 15 - - reno_context - - - - - - - 1 - 9E8DCE3BCF462A3A332DA70F61E46FA5C2AB791B95E33D3F2AF1307F53C84B1C - 1960675522 - 6483 - 591 - - - - - - 0 - ../../example/example_io.cpp - 0 - 0 - - - - - <string>diagnostic_information example</string> - - - - - - - - - 0 - - - - - 0 - - 16 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>using virtual inheritance in exception types</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 17 - - reno_context - @@ -617,147 +218,7 @@ 0 - 18 - - reno_context - - - - - - - 2 - D57BF77EE44CD2755E24A56DDC3E159716D04A7ABE009AE977D4926EFEC00F73 - 2498368808 - 973 - 3941 - 9432C669E21C649A86AC6DC5A34275B483A7D2D38118A462DF1C1CD7BBE5ED51 - 2535426829 - 441 - 110 - - - - - - 0 - ../../../../boost/exception/diagnostic_information.hpp - 0 - 0 - - - - - <string>current_exception_diagnostic_information</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 19 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>boost/exception/enable_error_info.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 20 - - 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 - - 21 + 9 reno_context @@ -802,101 +263,7 @@ 0 - 22 - - reno_context - - - - - - - 1 - 66E0BD9724AB83012F5B35D887E3313960DC0E69B94E0C03CA1F3C85A0D84A5C - 2883671483 - 311 - 302 - - - - - - 0 - ../../example/logging.cpp - 0 - 0 - - - - - <string>diagnostic information</string> - - - tutorial_diagnostic_information - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 23 - - 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 - - 24 + 10 reno_context @@ -945,7 +312,7 @@ 0 - 25 + 11 reno_context @@ -955,1025 +322,10 @@ 1 - A95165313334B684C85659D05D3D8EB17F4AF552EDCB3C180AC1F85D18C99CBF - 115507474 - 2037 - 91 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - - <string>boost/throw_exception.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 26 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Functions</string> - - - functions - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 27 - - reno_context - - - - - - - 2 - CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 - 1114955626 - 11770 - 723 - 1516D0B7E11CBEB60CE4222565ACCAFF2E9857A8A505C1C26E2AE90087250581 - 3624753243 - 279 - 26 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>original_exception_type</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 28 - - reno_context - - - - - - - 1 - C4350AAD8F0A0CCACF37D53E02311641BE439D771A79A6B15A10C919C8892A24 - 3170346377 - 596 - 323 - - - - - - 0 - ../../../../boost/exception/errinfo_errno.hpp - 0 - 0 - - - - - <string>boost/exception/errinfo_errno.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 29 - - 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 - - 30 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Motivation</string> - - - motivation - - - - - - 7 - 2 - (:include include:) (:auto also explicit=" - 1 - - 0 - - 31 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>exception types as simple semantic tags</string> - - - - - - - - 2 - - 1 - - 0 - - 32 - - reno_context - - - - - - - 1 - C95CEF2E9D0BAA1E950509471062916DB849A46A19F7692BA478030E79B338EB - 1917376632 - 706 - 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 - - 33 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>frequently asked questions</string> - - - - - - - - 2 - ":) - - - - - 0 - - 34 - - reno_context - - - - - - - 2 - 9A4ECF9A49A73AED83C1565CB8C67AE1519E8AFE6818F968B4C4733CB9E86CEF - 1615599655 - 68 + CAD6C404CB725D336A44920D2341ECA131149AB02C368B59028F8147F16737BF + 2258638601 + 94 227 - 34F0583BC8DE767CE2D79721E1F956895E43E5397473B1050F59BE7E26C773DB - 805836816 - 66 - 1 - - - - - - 0 - ../../../../boost/exception/error_info.hpp - 0 - 0 - - - - - <string>boost/exception/error_info.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -31 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 35 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Macros</string> - - - macros - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 36 - - 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 - - -33 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 37 - - reno_context - - - - - - - 1 - 04DDC793002AFCF4F4166D250C67D09B6FE8B86224318ED7847AD6EC423B70CA - 922651615 - 433 - 1061 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - - <string>BOOST_THROW_EXCEPTION</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 38 - - reno_context - - - - - - - 1 - F39D869016327CDFEA720920B2743F47989202BF5814B6556EC54A1B0FE562F8 - 3703518029 - 147 - 323 - - - - - - 0 - ../../../../boost/exception.hpp - 0 - 0 - - - - - <string>boost/exception.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 39 - - reno_context - - - - - - - 2 - AED5E79246B32BDF0E5C6CD8BDDC3370FD0BA1EFE3D4CE76C4A6D36A123F2E20 - 228982966 - 3918 - 518 - D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 - 4055211476 - 525 - 3387 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - - <string>exception/operator<<</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 40 - - reno_context - - - - - - - 3 - DA1CAA5F6BAB712AD89E8A0B7D83961FCE4AF9FD198791C9F6EA299800A64FAC - 3553871704 - 612 - 1496 - 154AC930BD1FDCADE24CDB07DBD3163CA26378AF4F1D428C34B67D1F68A60891 - 50905072 - 586 - 23 - CD1241D84950468704F3C3F04116B8DA5162A8BEA4364F10951232F49113C5DE - 1658463867 - 121 - 453 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - - <string>configuration macros</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 41 - - 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 - - 42 - - reno_context - - - - - - - 2 - E0BE7EFCD5550582AB95C9EEDA6E68CA0F89B19838DA61876D42161E1EA4AE71 - 2587249979 - 233 - 323 - 92AB508A6B1C2A62CB2ACED423BD04BB5A471674B5A51BFC1E6FB1F5C92AF9AA - 2372475309 - 70 - 157 - - - - - - 0 - ../../../../boost/exception/errinfo_at_line.hpp - 0 - 0 - - - - - <string>errinfo_at_line</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 43 - - reno_context - - - - - - - 2 - CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 - 1114955626 - 11770 - 723 - 6B3B617AC518A2177BDB89656E726B4E4D79577E289130493A61BAE24FB64838 - 3173127726 - 1101 - 2184 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>unknown_exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 44 - - reno_context - - - - - - - 2 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - F3FB15CD82336271C6E875BC620385322777D16F0B7C233300783CE35710CCBF - 3292878997 - 282 - 7305 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>enable_error_info</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 45 - - reno_context - - - - - - - 1 - FC684D0DD5A9732B4130F2AB3DB6E0491D0F523E14B7FB738B2019EA2C7F8717 - 2229778754 - 631 - 319 - - - - - - 0 - ../../example/cloning_2.cpp - 0 - 0 - - - - - <string>cloning and re-throwing an exception</string> - - - cloning_and_rethrowing - - - - - - 0 - - - - - 0 - - 46 - - 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 - - 47 - - reno_context - - - - - - - 2 - F7633FDCF6615C0199645701EE6E7ACE5CBCD7A7CF6838573791E91ABB3C09F2 - 1668435395 - 1332 - 396 - A1F443AF571973A12005D2F7D4AE09A32AAF686FEEAE272EC21512A65EB943E8 - 3879093659 - 1300 - 26 @@ -1987,7 +339,7 @@ - <string>tuple/operator<<</string> + <string>boost/exception/info_tuple.hpp</string> @@ -2005,7 +357,7 @@ 0 - 48 + 12 reno_context @@ -2014,32 +366,28 @@ - 2 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - DF9EA87B0140AACF4422F1B76F6A6A409C15F32858BBBA85A35981A824C56BA9 - 1137981799 - 192 - 8994 + 1 + 66E0BD9724AB83012F5B35D887E3313960DC0E69B94E0C03CA1F3C85A0D84A5C + 2883671483 + 311 + 306 0 - ../../../../boost/exception/exception.hpp + ../../example/logging.cpp 0 0 - <string>enable_current_exception</string> + <string>diagnostic information</string> - + tutorial_diagnostic_information @@ -2054,132 +402,7 @@ 0 - 49 - - reno_context - - - - - - - 2 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - 17E691632123EB67BA67D590B49EB8094F462F5A10A66A1C5438E1867EF1478E - 765399792 - 77 - 5917 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>exception::~exception</string> - - - exception_destructor - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 50 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>transporting of arbitrary data to the catch site</string> - - - tutorial_transporting_data - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 51 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>boost exception</string> - - - boost-exception - - - - - - 1 - 2 - (:include include:) - - - - - 0 - - 52 + 13 reno_context @@ -2224,7 +447,7 @@ 0 - 53 + 14 reno_context @@ -2244,10 +467,10 @@ - <string>transporting of exceptions between threads</string> + <string>using virtual inheritance in exception types</string> - tutorial_exception_ptr + @@ -2262,7 +485,45 @@ 0 - 54 + 15 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>page index</string> + + + page_idx + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 16 reno_context @@ -2272,9 +533,9 @@ 1 - 4EDD3DF2332B6D9D22AC9AD90B850ACC715A24DD466E675014CBED25C63C255F - 4175717823 - 328 + F39D869016327CDFEA720920B2743F47989202BF5814B6556EC54A1B0FE562F8 + 3703518029 + 147 323 @@ -2282,14 +543,14 @@ 0 - ../../../../boost/exception/errinfo_type_info_name.hpp + ../../../../boost/exception.hpp 0 0 - <string>boost/exception/errinfo_type_info_name.hpp</string> + <string>boost/exception.hpp</string> @@ -2307,236 +568,7 @@ 0 - 55 - - reno_context - - - - - - - 2 - 126A895281064E2195458B8A47CD73DB7E3BE3608F250925E07AF4230CBDDE1D - 4231421785 - 307 - 344 - 16179B125E2BC6D993FBE4BA5E9A96DBAE43CA1443C7D281B659D020B6725983 - 1126376090 - 92 - 209 - - - - - - 0 - ../../../../boost/exception/errinfo_type_info_name.hpp - 0 - 0 - - - - - <string>errinfo_type_info_name</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 56 - - 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 - - 57 - - reno_context - - - - - - - 1 - E444EE9697EEADFDE0767E1D0242FC0E70D98E61FB1F0FFA099648DE509B82F3 - 94503238 - 773 - 374 - - - - - - 0 - ../../example/info_tuple.cpp - 0 - 0 - - - - - <string>adding grouped data to exceptions</string> - - - grouping_data - - - - - - 0 - - - - - 0 - - 58 - - reno_context - - - - - - - 1 - D10E536B909EFFF78FB09E6242AEC7C74ACDD75AE7DF32B45870422B752E5D8E - 1903336130 - 557 - 382 - - - - - - 0 - ../../example/error_info_1.cpp - 0 - 0 - - - - - <string>adding of arbitrary data at the point of the throw</string> - - - adding_data_at_throw - - - - - - 0 - - - - - 0 - - 59 - - reno_context - - - - - - - 2 - CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 - 1114955626 - 11770 - 723 - AF894656AC8CED6190EEEE08B051DBF2106A393E313BB5BB1C17D4808EFED761 - 1496105832 - 1753 - 429 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>exception_ptr</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 60 + 17 reno_context @@ -2581,7 +613,7 @@ 0 - 61 + 18 reno_context @@ -2630,7 +662,7 @@ 0 - 62 + 19 reno_context @@ -2640,66 +672,73 @@ 2 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 + D57BF77EE44CD2755E24A56DDC3E159716D04A7ABE009AE977D4926EFEC00F73 + 2498368808 + 973 + 3941 + 9432C669E21C649A86AC6DC5A34275B483A7D2D38118A462DF1C1CD7BBE5ED51 + 2535426829 + 441 + 110 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + + <string>current_exception_diagnostic_information</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 20 + + reno_context + + + + + + + 1 + 4EDD3DF2332B6D9D22AC9AD90B850ACC715A24DD466E675014CBED25C63C255F + 4175717823 + 328 323 - 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 - 1693870740 - 2195 - 3720 0 - ../../../../boost/exception/exception.hpp + ../../../../boost/exception/errinfo_type_info_name.hpp 0 0 - <string>exception</string> - - - - - - - - - 1 - 2 - (:include include:) ---- !!!See Also: (:pagelist link="backlink" except_tags="exception,member" mod="w":) - - - - - 0 - - 63 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>boost/exception/enable_current_exception.hpp</string> + <string>boost/exception/errinfo_type_info_name.hpp</string> @@ -2717,7 +756,7 @@ 0 - 64 + 21 reno_context @@ -2726,80 +765,25 @@ - 0 - - - - - - 1 - - - - - <string>Headers</string> - - - headers - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -32 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 65 - - reno_context - - - - - - - 2 - 15CF5BD93D20D62D659C11A69330B06E408398EA488BEF1FD45437AADCDB424E - 1232553666 - 214 - 345 - 6262783847165581298EC9500031E6B7A97B2751A9CEF67C4794121A78142C58 - 3676119191 - 90 - 118 + 1 + 21E8093D2AF6946EAE135823066EF38B9DC8870432B44C81E585FF63A72F9903 + 3352783584 + 12170 + 323 0 - ../../../../boost/exception/errinfo_file_handle.hpp + ../../../../boost/exception_ptr.hpp 0 0 - <string>errinfo_file_handle</string> + <string>boost/exception_ptr.hpp</string> @@ -2817,7 +801,52 @@ 0 - 66 + 22 + + reno_context + + + + + + + 1 + A95165313334B684C85659D05D3D8EB17F4AF552EDCB3C180AC1F85D18C99CBF + 115507474 + 2037 + 91 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>boost/throw_exception.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 23 reno_context @@ -2870,7 +899,891 @@ 0 - 67 + 24 + + reno_context + + + + + + + 1 + C4350AAD8F0A0CCACF37D53E02311641BE439D771A79A6B15A10C919C8892A24 + 3170346377 + 596 + 323 + + + + + + 0 + ../../../../boost/exception/errinfo_errno.hpp + 0 + 0 + + + + + <string>boost/exception/errinfo_errno.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 25 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Types</string> + + + types + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 26 + + reno_context + + + + + + + 1 + 025A8CE0643CFC0EB812BD3EB89F8F410D91EC3467CC6F371E7215F25F590B27 + 2422739525 + 6071 + 412 + + + + + + 0 + ../../example/example_io.cpp + 0 + 0 + + + + + <string>diagnostic_information example</string> + + + + + + + + + 0 + + + + + 0 + + 27 + + reno_context + + + + + + + 1 + 08D021CA79AEBFFD7EB5E272BEBACE3BDED36B949DA26DD1EAFB7723C24065FE + 3589963844 + 393 + 307 + + + + + + 0 + ../../example/cloning_1.cpp + 0 + 0 + + + + + <string>using enable_current_exception at the time of the throw</string> + + + using_enable_cloning + + + + + + 0 + + + + + 0 + + 28 + + reno_context + + + + + + + 1 + E0BE7EFCD5550582AB95C9EEDA6E68CA0F89B19838DA61876D42161E1EA4AE71 + 2587249979 + 233 + 323 + + + + + + 0 + ../../../../boost/exception/errinfo_at_line.hpp + 0 + 0 + + + + + <string>boost/exception/errinfo_at_line.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 29 + + reno_context + + + + + + + 2 + 307034E20863A00923777A60D9495B4076B7F917D5B97203025299060F0833E0 + 3948311309 + 396 + 344 + F8ED2052577830AC0C515EC5932BB14445DD5DA714782281FCDB1776961FECB1 + 3880328768 + 82 + 308 + + + + + + 0 + ../../../../boost/exception/errinfo_file_name.hpp + 0 + 0 + + + + + <string>errinfo_file_name</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 30 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Macros</string> + + + macros + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 31 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Headers</string> + + + headers + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 32 + + reno_context + + + + + + + 2 + 15CF5BD93D20D62D659C11A69330B06E408398EA488BEF1FD45437AADCDB424E + 1232553666 + 214 + 345 + 6262783847165581298EC9500031E6B7A97B2751A9CEF67C4794121A78142C58 + 3676119191 + 90 + 118 + + + + + + 0 + ../../../../boost/exception/errinfo_file_handle.hpp + 0 + 0 + + + + + <string>errinfo_file_handle</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 33 + + reno_context + + + + + + + 2 + AED5E79246B32BDF0E5C6CD8BDDC3370FD0BA1EFE3D4CE76C4A6D36A123F2E20 + 228982966 + 3918 + 518 + D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 + 4055211476 + 525 + 3387 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>exception/operator<<</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 34 + + 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 + + 35 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>frequently asked questions</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 36 + + reno_context + + + + + + + 2 + 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF + 1282550303 + 9192 + 323 + 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 + 1693870740 + 2195 + 3720 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>exception</string> + + + + + + + + + 1 + 2 + (:include include:) ---- !!!See Also: (:pagelist link="backlink" except_tags="exception,member" mod="w":) + + + + + 0 + + 37 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>boost/exception/enable_current_exception.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 38 + + 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 + + 39 + + reno_context + + + + + + + 2 + AED5E79246B32BDF0E5C6CD8BDDC3370FD0BA1EFE3D4CE76C4A6D36A123F2E20 + 228982966 + 3918 + 518 + 6E325144EF4F41FA3A225EB30729101382C4E99B3D6160E307311E4B4E641010 + 1097215175 + 161 + 240 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>error_info::error_info</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 40 + + reno_context + + + + + + + 1 + FB3526A6A3A99CF87E766D0B34CEC3F8FB49228B2BFC54C3D56098778710397F + 3851746268 + 852 + 306 + + + + + + 0 + ../../example/error_info_2.cpp + 0 + 0 + + + + + <string>adding of arbitrary data to active exception objects</string> + + + adding_data_later + + + + + + 0 + + + + + 0 + + 41 + + reno_context + + + + + + + 2 + E0BE7EFCD5550582AB95C9EEDA6E68CA0F89B19838DA61876D42161E1EA4AE71 + 2587249979 + 233 + 323 + 92AB508A6B1C2A62CB2ACED423BD04BB5A471674B5A51BFC1E6FB1F5C92AF9AA + 2372475309 + 70 + 157 + + + + + + 0 + ../../../../boost/exception/errinfo_at_line.hpp + 0 + 0 + + + + + <string>errinfo_at_line</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 42 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>transporting of exceptions between threads</string> + + + tutorial_exception_ptr + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 43 + + 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 + + 44 reno_context @@ -2919,7 +1832,7 @@ 0 - 68 + 45 reno_context @@ -2964,7 +1877,207 @@ 0 - 69 + 46 + + reno_context + + + + + + + 2 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + 1516D0B7E11CBEB60CE4222565ACCAFF2E9857A8A505C1C26E2AE90087250581 + 3624753243 + 279 + 26 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>original_exception_type</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 47 + + 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 + + 48 + + reno_context + + + + + + + 2 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + B20A3D4631F3B2415EED1888B65FA33D7AED20F86BE196159D9297AAED115787 + 3293519666 + 117 + 11169 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>rethrow_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 49 + + reno_context + + + + + + + 2 + 126A895281064E2195458B8A47CD73DB7E3BE3608F250925E07AF4230CBDDE1D + 4231421785 + 307 + 344 + 16179B125E2BC6D993FBE4BA5E9A96DBAE43CA1443C7D281B659D020B6725983 + 1126376090 + 92 + 209 + + + + + + 0 + ../../../../boost/exception/errinfo_type_info_name.hpp + 0 + 0 + + + + + <string>errinfo_type_info_name</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 50 reno_context @@ -2974,27 +2087,148 @@ 1 - 4ED9709788BBAB4DE7CF336561606B8C0B41F70877A3395F4EE026F4AEB66CC6 - 743998427 - 409 - 307 + 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF + 1282550303 + 9192 + 323 0 - ../../example/cloning_1.cpp + ../../../../boost/exception/exception.hpp 0 0 - <string>using enable_current_exception at the time of the throw</string> + <string>boost/exception/exception.hpp</string> - using_enable_cloning + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 51 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>transporting of arbitrary data to the catch site</string> + + + tutorial_transporting_data + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 52 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>boost exception</string> + + + boost-exception + + + + + + 1 + 2 + (:include include:) + + + + + 0 + + 53 + + reno_context + + + + + + + 1 + 4BF26702AE28644631FE5D0F726C9AD0877433607F35DE5F522D94F39BE2A2AB + 1734013977 + 733 + 363 + + + + + + 0 + ../../example/info_tuple.cpp + 0 + 0 + + + + + <string>adding grouped data to exceptions</string> + + + grouping_data @@ -3003,6 +2237,774 @@ 0 + + + 0 + + 54 + + reno_context + + + + + + + 1 + 75EA7D29A2D365F947FE504A6AE38FA23FEA7031FDA3B6DA5DBBAA3D93794D30 + 1826787048 + 526 + 382 + + + + + + 0 + ../../example/error_info_1.cpp + 0 + 0 + + + + + <string>adding of arbitrary data at the point of the throw</string> + + + adding_data_at_throw + + + + + + 0 + + + + + 0 + + 55 + + reno_context + + + + + + + 1 + C95CEF2E9D0BAA1E950509471062916DB849A46A19F7692BA478030E79B338EB + 1917376632 + 706 + 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 + + 56 + + reno_context + + + + + + + 2 + F7633FDCF6615C0199645701EE6E7ACE5CBCD7A7CF6838573791E91ABB3C09F2 + 1668435395 + 1332 + 396 + A1F443AF571973A12005D2F7D4AE09A32AAF686FEEAE272EC21512A65EB943E8 + 3879093659 + 1300 + 26 + + + + + + 0 + ../../../../boost/exception/info_tuple.hpp + 0 + 0 + + + + + <string>tuple/operator<<</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 57 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Motivation</string> + + + motivation + + + + + + 7 + 2 + (:include include:) (:auto also explicit=" + 1 + + 0 + + 58 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>exception types as simple semantic tags</string> + + + + + + + + 2 + + 1 + + 0 + + -55 + + + 2 + + 1 + + 0 + + -35 + + + 2 + ":) + + + + + 0 + + -58 + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 59 + + reno_context + + + + + + + 2 + 9A4ECF9A49A73AED83C1565CB8C67AE1519E8AFE6818F968B4C4733CB9E86CEF + 1615599655 + 68 + 227 + 34F0583BC8DE767CE2D79721E1F956895E43E5397473B1050F59BE7E26C773DB + 805836816 + 66 + 1 + + + + + + 0 + ../../../../boost/exception/error_info.hpp + 0 + 0 + + + + + <string>boost/exception/error_info.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 60 + + reno_context + + + + + + + 3 + DA1CAA5F6BAB712AD89E8A0B7D83961FCE4AF9FD198791C9F6EA299800A64FAC + 3553871704 + 612 + 1496 + 154AC930BD1FDCADE24CDB07DBD3163CA26378AF4F1D428C34B67D1F68A60891 + 50905072 + 586 + 23 + CD1241D84950468704F3C3F04116B8DA5162A8BEA4364F10951232F49113C5DE + 1658463867 + 121 + 453 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>configuration macros</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 61 + + reno_context + + + + + + + 2 + 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF + 1282550303 + 9192 + 323 + DF9EA87B0140AACF4422F1B76F6A6A409C15F32858BBBA85A35981A824C56BA9 + 1137981799 + 192 + 8994 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>enable_current_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 62 + + reno_context + + + + + + + 2 + 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF + 1282550303 + 9192 + 323 + 17E691632123EB67BA67D590B49EB8094F462F5A10A66A1C5438E1867EF1478E + 765399792 + 77 + 5917 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>exception::~exception</string> + + + exception_destructor + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 63 + + reno_context + + + + + + + 2 + 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF + 1282550303 + 9192 + 323 + F3FB15CD82336271C6E875BC620385322777D16F0B7C233300783CE35710CCBF + 3292878997 + 282 + 7305 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>enable_error_info</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 64 + + reno_context + + + + + + + 1 + 04DDC793002AFCF4F4166D250C67D09B6FE8B86224318ED7847AD6EC423B70CA + 922651615 + 433 + 1061 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>BOOST_THROW_EXCEPTION</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 65 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Functions</string> + + + functions + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 66 + + 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 + + 67 + + reno_context + + + + + + + 2 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + 6B3B617AC518A2177BDB89656E726B4E4D79577E289130493A61BAE24FB64838 + 3173127726 + 1101 + 2184 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>unknown_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 68 + + 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 + + 69 + + reno_context + + + + + + + 2 + DA1CAA5F6BAB712AD89E8A0B7D83961FCE4AF9FD198791C9F6EA299800A64FAC + 3553871704 + 612 + 1496 + 154AC930BD1FDCADE24CDB07DBD3163CA26378AF4F1D428C34B67D1F68A60891 + 50905072 + 586 + 23 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>throw_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + 0 @@ -3016,25 +3018,29 @@ - 1 - E0BE7EFCD5550582AB95C9EEDA6E68CA0F89B19838DA61876D42161E1EA4AE71 - 2587249979 - 233 - 323 + 2 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + AF894656AC8CED6190EEEE08B051DBF2106A393E313BB5BB1C17D4808EFED761 + 1496105832 + 1753 + 429 0 - ../../../../boost/exception/errinfo_at_line.hpp + ../../../../boost/exception_ptr.hpp 0 0 - <string>boost/exception/errinfo_at_line.hpp</string> + <string>exception_ptr</string> @@ -3061,40 +3067,34 @@ - 2 - 307034E20863A00923777A60D9495B4076B7F917D5B97203025299060F0833E0 - 3948311309 - 396 - 344 - F8ED2052577830AC0C515EC5932BB14445DD5DA714782281FCDB1776961FECB1 - 3880328768 - 82 - 308 + 1 + FC684D0DD5A9732B4130F2AB3DB6E0491D0F523E14B7FB738B2019EA2C7F8717 + 2229778754 + 631 + 319 0 - ../../../../boost/exception/errinfo_file_name.hpp + ../../example/cloning_2.cpp 0 0 - <string>errinfo_file_name</string> + <string>cloning and re-throwing an exception</string> - + cloning_and_rethrowing - 1 - 2 - (:include include:) (:auto also:) + 0 @@ -3385,7 +3385,45 @@ - 0 + 9 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -8 + + + 2 + :) { public: (:include + 1 + + 0 + + -23 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -39 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -66 + + + 2 + decl pre_indent="4":) };@] @@ -3484,45 +3522,7 @@ - 9 - 2 - [@template <class Tag,class T> class (:link - 1 - - 0 - - -17 - - - 2 - :) { public: (:include - 1 - - 0 - - -66 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -12 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -29 - - - 2 - decl pre_indent="4":) };@] + 0 @@ -3654,7 +3654,27 @@ - 0 + 5 + 2 + [@typedef + 1 + + 0 + + -8 + + + 2 + <struct errinfo_file_name_,std::string> + 1 + + 0 + + -29 + + + 2 + ;@] @@ -3672,7 +3692,7 @@ 0 - -34 + -31 @@ -3683,7 +3703,49 @@ 0 - -31 + -32 + + + + 5 + 2 + [@typedef + 1 + + 0 + + -8 + + + 2 + <struct errinfo_file_handle_,weak_ptr<FILE> > + 1 + + 0 + + -32 + + + 2 + ;@] + + + + + 0 + + -33 + + + + 0 + + + + + 0 + + -34 @@ -3709,18 +3771,36 @@ - 0 - - - - - 0 - - -33 - - - - 0 + 7 + 2 + [@class (:link + 1 + + 0 + + -36 + + + 2 + :) { protected: (:include + 1 + + 0 + + -47 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -62 + + + 2 + decl pre_indent="4":) };@] @@ -3775,7 +3855,27 @@ - 0 + 5 + 2 + [@typedef + 1 + + 0 + + -8 + + + 2 + <struct errinfo_at_line_,int> + 1 + + 0 + + -41 + + + 2 + ;@] @@ -3786,27 +3886,7 @@ - 5 - 2 - [@typedef - 1 - - 0 - - -17 - - - 2 - <struct errinfo_at_line_,int> - 1 - - 0 - - -42 - - - 2 - ;@] + 0 @@ -3828,7 +3908,27 @@ - 0 + 5 + 2 + [@typedef + 1 + + 0 + + -8 + + + 2 + <struct errinfo_api_function_,int> + 1 + + 0 + + -44 + + + 2 + ;@] @@ -3883,7 +3983,27 @@ - 0 + 5 + 2 + [@typedef + 1 + + 0 + + -8 + + + 2 + <struct errinfo_type_info_name_,std::string> + 1 + + 0 + + -49 + + + 2 + ;@] @@ -3949,27 +4069,7 @@ - 5 - 2 - [@typedef - 1 - - 0 - - -17 - - - 2 - <struct errinfo_type_info_name_,std::string> - 1 - - 0 - - -55 - - - 2 - ;@] + 0 @@ -4046,36 +4146,7 @@ - 7 - 2 - [@class (:link - 1 - - 0 - - -62 - - - 2 - :) { protected: (:include - 1 - - 0 - - -20 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -49 - - - 2 - decl pre_indent="4":) };@] + 0 @@ -4100,17 +4171,6 @@ 0 - - - 0 - - -32 - - - - 0 - - 0 @@ -4119,27 +4179,7 @@ - 5 - 2 - [@typedef - 1 - - 0 - - -17 - - - 2 - <struct errinfo_file_handle_,weak_ptr<FILE> > - 1 - - 0 - - -65 - - - 2 - ;@] + 0 @@ -4161,27 +4201,7 @@ - 5 - 2 - [@typedef - 1 - - 0 - - -17 - - - 2 - <struct errinfo_api_function_,int> - 1 - - 0 - - -67 - - - 2 - ;@] + 0 @@ -4225,27 +4245,7 @@ - 5 - 2 - [@typedef - 1 - - 0 - - -17 - - - 2 - <struct errinfo_file_name_,std::string> - 1 - - 0 - - -71 - - - 2 - ;@] + 0 @@ -4263,7 +4263,7 @@ 0 - -17 + -8 2 @@ -4294,7 +4294,7 @@ 0 - -17 + -8 2 @@ -4365,7 +4365,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -63 + + + 2 + decl:)@] @@ -4398,18 +4409,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -47 - - - 2 - decl:)@] + 0 @@ -4420,7 +4420,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -44 + + + 2 + def:)@] @@ -4442,23 +4453,14 @@ - 5 + 3 2 [@(:include 1 0 - -17 - - - 2 - def:) (:include - 1 - - 0 - - -39 + -56 2 @@ -4484,7 +4486,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -43 + + + 2 + decl:)@] @@ -4528,7 +4541,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -29 + + + 2 + def:)@] @@ -4550,18 +4574,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -44 - - - 2 - decl:)@] + 0 @@ -4571,17 +4584,6 @@ -20 - - 0 - - - - - 0 - - -21 - - 3 2 @@ -4590,13 +4592,80 @@ 0 - -67 + -49 2 def:)@] + + + 0 + + -21 + + + + 13 + 2 + [@(:include + 1 + + 0 + + -67 + + + 2 + decl:) (:include + 1 + + 0 + + -46 + + + 2 + decl:) (:include + 1 + + 0 + + -70 + + + 2 + decl:) (:include + 1 + + 0 + + -18 + + + 2 + decl:) (:include + 1 + + 0 + + -6 + + + 2 + decl:) (:include + 1 + + 0 + + -48 + + + 2 + decl:)@] + + 0 @@ -4605,7 +4674,27 @@ - 0 + 5 + 2 + [@(:include + 1 + + 0 + + -64 + + + 2 + decl:) namespace boost { (:include + 1 + + 0 + + -69 + + + 2 + decl:) }@] @@ -4627,7 +4716,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -72 + + + 2 + def:)@] @@ -4638,27 +4738,7 @@ - 5 - 2 - [@(:include - 1 - - 0 - - -37 - - - 2 - decl:) namespace boost { (:include - 1 - - 0 - - -5 - - - 2 - decl:) }@] + 0 @@ -4698,7 +4778,7 @@ 0 - -72 + -41 2 @@ -4731,29 +4811,40 @@ 0 - -34 + -31 - 3 - 2 - [@(:include - 1 - - 0 - - -17 - - - 2 - decl:)@] + 0 0 - -31 + -32 + + + + 0 + + + + + 0 + + -33 + + + + 0 + + + + + 0 + + -34 @@ -4782,17 +4873,6 @@ 0 - - - 0 - - -33 - - - - 0 - - 0 @@ -4801,7 +4881,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -61 + + + 2 + decl:)@] @@ -4812,7 +4903,27 @@ - 0 + 5 + 2 + [@(:include + 1 + + 0 + + -8 + + + 2 + def:) (:include + 1 + + 0 + + -33 + + + 2 + decl:)@] @@ -4845,18 +4956,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -36 - - - 2 - decl:)@] + 0 @@ -4900,7 +5000,27 @@ - 0 + 5 + 2 + [@(:include + 1 + + 0 + + -10 + + + 2 + decl:) (:include + 1 + + 0 + + -19 + + + 2 + decl:)@] @@ -4911,63 +5031,7 @@ - 13 - 2 - [@(:include - 1 - - 0 - - -43 - - - 2 - decl:) (:include - 1 - - 0 - - -27 - - - 2 - decl:) (:include - 1 - - 0 - - -59 - - - 2 - decl:) (:include - 1 - - 0 - - -61 - - - 2 - decl:) (:include - 1 - - 0 - - -7 - - - 2 - decl:) (:include - 1 - - 0 - - -10 - - - 2 - decl:)@] + 0 @@ -5011,7 +5075,54 @@ - 0 + 11 + 2 + [@(:include + 1 + + 0 + + -36 + + + 2 + def:) (:include + 1 + + 0 + + -8 + + + 2 + decl:) typedef (:link + 1 + + 0 + + -8 + + + 2 + :)<struct tag_throw_function,char const *> throw_function; typedef (:link + 1 + + 0 + + -8 + + + 2 + :)<struct tag_throw_file,char const *> throw_file; typedef (:link + 1 + + 0 + + -8 + + + 2 + :)<struct tag_throw_line,int> throw_line;@] @@ -5033,18 +5144,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -23 - - - 2 - decl:)@] + 0 @@ -5066,18 +5166,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -55 - - - 2 - def:)@] + 0 @@ -5099,54 +5188,7 @@ - 11 - 2 - [@(:include - 1 - - 0 - - -62 - - - 2 - def:) (:include - 1 - - 0 - - -17 - - - 2 - decl:) typedef (:link - 1 - - 0 - - -17 - - - 2 - :)<struct tag_throw_function,char const *> throw_function; typedef (:link - 1 - - 0 - - -17 - - - 2 - :)<struct tag_throw_file,char const *> throw_file; typedef (:link - 1 - - 0 - - -17 - - - 2 - :)<struct tag_throw_line,int> throw_line;@] + 0 @@ -5179,7 +5221,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -8 + + + 2 + decl:)@] @@ -5190,18 +5243,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -71 - - - 2 - def:)@] + 0 @@ -5233,28 +5275,6 @@ -63 - - 3 - 2 - [@(:include - 1 - - 0 - - -48 - - - 2 - decl:)@] - - - - - 0 - - -64 - - 0 @@ -5263,7 +5283,7 @@ 0 - -32 + -64 @@ -5311,23 +5331,14 @@ - 5 + 3 2 [@(:include 1 0 - -24 - - - 2 - decl:) (:include - 1 - - 0 - - -18 + -34 2 @@ -5353,18 +5364,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -42 - - - 2 - def:)@] + 0 @@ -5434,6 +5434,33 @@ 2 [@#include <(:link 1 + + 0 + + -45 + + + 2 + :)> #include <(:link + 1 + + 0 + + -59 + + + 2 + :)> #include <(:link + 1 + + 0 + + -50 + + + 2 + :)> #include <(:link + 1 0 @@ -5446,25 +5473,7 @@ 0 - -34 - - - 2 - :)> #include <(:link - 1 - - 0 - - -56 - - - 2 - :)> #include <(:link - 1 - - 0 - - -41 + -38 2 @@ -5479,24 +5488,6 @@ 2 :)> #include <(:link 1 - - 0 - - -8 - - - 2 - :)> #include <(:link - 1 - - 0 - - -46 - - - 2 - :)> #include <(:link - 1 0 @@ -5509,7 +5500,7 @@ 0 - -70 + -9 2 @@ -5524,6 +5515,15 @@ 2 :)> #include <(:link 1 + + 0 + + -24 + + + 2 + :)> #include <(:link + 1 0 @@ -5536,7 +5536,7 @@ 0 - -60 + -17 2 @@ -5554,7 +5554,7 @@ 0 - -54 + -20 2 @@ -5576,7 +5576,7 @@ 0 - -65 + -32 2 @@ -5605,27 +5605,7 @@ - 5 - 2 - [@#ifdef BOOST_NO_EXCEPTIONS void (:link - 1 - - 0 - - -5 - - - 2 - :)( std::exception const & e ); // user defined #else template <class E> void (:link - 1 - - 0 - - -5 - - - 2 - :)( E const & e ); #endif@] + 0 @@ -5635,17 +5615,6 @@ -6 - - 0 - - - - - 0 - - -7 - - 5 2 @@ -5654,7 +5623,7 @@ 0 - -59 + -70 2 @@ -5663,7 +5632,7 @@ 0 - -7 + -6 2 @@ -5674,13 +5643,35 @@ 0 - -8 + -7 0 + + + 0 + + -8 + + + + 3 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -8 + + + 2 + :);@] + + 0 @@ -5700,9 +5691,9 @@ - 5 + 7 2 - [@void (:link + [@template <class E> std::string (:link 1 0 @@ -5711,16 +5702,25 @@ 2 - :)( (:link + :)( E const & e ); std::string (:link 1 0 - -59 + -10 2 - :) const & ep ); + :)( + 1 + + 0 + + -70 + + + 2 + const & p );@] @@ -5742,27 +5742,7 @@ - 5 - 2 - [@(:link - 1 - - 0 - - -12 - - - 2 - mod="m":)( (:link - 1 - - 0 - - -66 - - - 2 - mod="m":) const & v );@] + 0 @@ -5817,18 +5797,7 @@ - 3 - 2 - [@template <class Tag,class T> class (:link - 1 - - 0 - - -17 - - - 2 - :);@] + 0 @@ -5839,9 +5808,18 @@ - 3 + 5 2 - [@std::string (:link + [@template <class T> (:link + 1 + + 0 + + -70 + + + 2 + :) (:link 1 0 @@ -5850,7 +5828,7 @@ 2 - :)();@] + :)( T const & e );@] @@ -5861,7 +5839,18 @@ - 0 + 3 + 2 + [@std::string (:link + 1 + + 0 + + -19 + + + 2 + :)();@] @@ -5872,36 +5861,7 @@ - 7 - 2 - [@(:link - 1 - - 0 - - -20 - - - 2 - mod="m":)(); (:link - 1 - - 0 - - -20 - - - 2 - mod="m":)( (:link - 1 - - 0 - - -62 - - - 2 - :) const & x );@] + 0 @@ -5936,7 +5896,7 @@ 3 2 - [@template <class E> E * + [@typedef T (:link 1 0 @@ -5945,7 +5905,7 @@ 2 - ();@] + mod="m":);@] @@ -5956,36 +5916,7 @@ - 7 - 2 - [@template <class E> std::string (:link - 1 - - 0 - - -24 - - - 2 - :)( E const & e ); std::string (:link - 1 - - 0 - - -24 - - - 2 - :)( - 1 - - 0 - - -59 - - - 2 - const & p );@] + 0 @@ -6018,27 +5949,7 @@ - 5 - 2 - [@typedef (:link - 1 - - 0 - - -17 - - - 2 - :)<struct tag_original_exception_type,std::type_info const *> - 1 - - 0 - - -27 - - - 2 - ;@] + 0 @@ -6059,37 +5970,6 @@ -29 - - 5 - 2 - [@(:link - 1 - - 0 - - -66 - - - 2 - mod="m":) const & (:link - 1 - - 0 - - -29 - - - 2 - mod="m":)() const;@] - - - - - 0 - - -30 - - 0 @@ -6098,7 +5978,7 @@ 0 - -34 + -30 @@ -6116,6 +5996,79 @@ 0 + + + 0 + + -32 + + + + 0 + + + + + 0 + + -33 + + + + 5 + 2 + [@template <class E, class Tag, class T> E const & (:link + 1 + + 0 + + -33 + + + 2 + mod="/":)( E const & x, (:link + 1 + + 0 + + -8 + + + 2 + :)<Tag,T> const & v );@] + + + + + 0 + + -34 + + + + 5 + 2 + [@template <class ErrorInfo,class E> typename ErrorInfo::(:link + 1 + + 0 + + -23 + + + 2 + mod="m":) const * (:link + 1 + + 0 + + -34 + + + 2 + :)( E const & x );@] + + 0 @@ -6135,18 +6088,9 @@ - 5 + 3 2 - [@template <class ErrorInfo,class E> typename ErrorInfo::(:link - 1 - - 0 - - -66 - - - 2 - mod="m":) const * (:link + [@class (:link 1 0 @@ -6155,18 +6099,7 @@ 2 - :)( E const & x );@] - - - - - 0 - - -33 - - - - 0 + :);@] @@ -6177,90 +6110,7 @@ - 19 - 2 - [@#if !defined( BOOST_EXCEPTION_DISABLE ) #include <(:link - 1 - - 0 - - -56 - - - 2 - :)> #include <boost/current_function.hpp> #define (:link - 1 - - 0 - - -37 - - - 2 - :)(x)\ ::boost::(:link - 1 - - 0 - - -5 - - - 2 - :)( ::boost::(:link - 1 - - 0 - - -44 - - - 2 - :)(x) <<\ ::boost::(:link - 1 - - 0 - - -56 - - - 2 - |throw_function:)(BOOST_CURRENT_FUNCTION) <<\ ::boost::(:link - 1 - - 0 - - -56 - - - 2 - |throw_file:)(__FILE__) <<\ ::boost::(:link - 1 - - 0 - - -56 - - - 2 - |throw_line:)((int)__LINE__) ) #else #define (:link - 1 - - 0 - - -37 - - - 2 - :)(x) ::boost::(:link - 1 - - 0 - - -5 - - - 2 - :)(x) #endif@] + 0 @@ -6284,7 +6134,7 @@ 5 2 - [@template <class E, class Tag, class T> E const & (:link + [@(:link 1 0 @@ -6293,16 +6143,16 @@ 2 - mod="/":)( E const & x, (:link + mod="m":)( (:link 1 0 - -17 + -23 2 - :)<Tag,T> const & v );@] + mod="m":) const & v );@] @@ -6346,9 +6196,9 @@ - 5 + 3 2 - [@class (:link + [@template <class E> E * 1 0 @@ -6357,16 +6207,7 @@ 2 - :): public std::exception public boost:: - 1 - - 0 - - -62 - - - 2 - { ---unspecified--- };@] + ();@] @@ -6377,18 +6218,7 @@ - 3 - 2 - [@template <class T> ---unspecified--- (:link - 1 - - 0 - - -44 - - - 2 - :)( T const & x );@] + 0 @@ -6410,7 +6240,27 @@ - 0 + 5 + 2 + [@typedef (:link + 1 + + 0 + + -8 + + + 2 + :)<struct tag_original_exception_type,std::type_info const *> + 1 + + 0 + + -46 + + + 2 + ;@] @@ -6423,7 +6273,7 @@ 7 2 - [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link + [@(:link 1 0 @@ -6432,25 +6282,25 @@ 2 - mod="/":)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link + mod="m":)(); (:link 1 0 - -17 + -47 2 - :)<Tag1,T1>, ..., (:link + mod="m":)( (:link 1 0 - -17 + -36 2 - :)<TagN,TN> > const & v );@] + :) const & x );@] @@ -6461,9 +6311,9 @@ - 3 + 5 2 - [@template <class T> ---unspecified--- (:link + [@void (:link 1 0 @@ -6472,7 +6322,16 @@ 2 - :)( T const & e );@] + :)( (:link + 1 + + 0 + + -70 + + + 2 + :) const & ep ); @@ -6483,18 +6342,7 @@ - 3 - 2 - [@(:link - 1 - - 0 - - -49 - - - 2 - mod="m":)();@] + 0 @@ -6571,7 +6419,36 @@ - 0 + 7 + 2 + [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link + 1 + + 0 + + -56 + + + 2 + mod="/":)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link + 1 + + 0 + + -8 + + + 2 + :)<Tag1,T1>, ..., (:link + 1 + + 0 + + -8 + + + 2 + :)<TagN,TN> > const & v );@] @@ -6604,18 +6481,7 @@ - 3 - 2 - [@typedef ---unspecified--- (:link - 1 - - 0 - - -59 - - - 2 - :);@] + 0 @@ -6637,18 +6503,9 @@ - 5 + 3 2 - [@template <class T> (:link - 1 - - 0 - - -59 - - - 2 - :) (:link + [@template <class T> ---unspecified--- (:link 1 0 @@ -6670,7 +6527,7 @@ 3 2 - [@class (:link + [@(:link 1 0 @@ -6679,7 +6536,7 @@ 2 - :);@] + mod="m":)();@] @@ -6690,7 +6547,18 @@ - 0 + 3 + 2 + [@template <class T> ---unspecified--- (:link + 1 + + 0 + + -63 + + + 2 + :)( T const & x );@] @@ -6701,18 +6569,90 @@ - 0 - - - - - 0 - - -32 - - - - 0 + 19 + 2 + [@#if !defined( BOOST_EXCEPTION_DISABLE ) #include <(:link + 1 + + 0 + + -50 + + + 2 + :)> #include <boost/current_function.hpp> #define (:link + 1 + + 0 + + -64 + + + 2 + :)(x)\ ::boost::(:link + 1 + + 0 + + -69 + + + 2 + :)( ::boost::(:link + 1 + + 0 + + -63 + + + 2 + :)(x) <<\ ::boost::(:link + 1 + + 0 + + -50 + + + 2 + |throw_function:)(BOOST_CURRENT_FUNCTION) <<\ ::boost::(:link + 1 + + 0 + + -50 + + + 2 + |throw_file:)(__FILE__) <<\ ::boost::(:link + 1 + + 0 + + -50 + + + 2 + |throw_line:)((int)__LINE__) ) #else #define (:link + 1 + + 0 + + -64 + + + 2 + :)(x) ::boost::(:link + 1 + + 0 + + -69 + + + 2 + :)(x) #endif@] @@ -6734,9 +6674,18 @@ - 3 + 5 2 - [@typedef T (:link + [@(:link + 1 + + 0 + + -23 + + + 2 + mod="m":) const & (:link 1 0 @@ -6745,7 +6694,7 @@ 2 - mod="m":);@] + mod="m":)() const;@] @@ -6756,7 +6705,27 @@ - 0 + 5 + 2 + [@class (:link + 1 + + 0 + + -67 + + + 2 + :): public std::exception public boost:: + 1 + + 0 + + -36 + + + 2 + { ---unspecified--- };@] @@ -6778,7 +6747,27 @@ - 0 + 5 + 2 + [@#ifdef BOOST_NO_EXCEPTIONS void (:link + 1 + + 0 + + -69 + + + 2 + :)( std::exception const & e ); // user defined #else template <class E> void (:link + 1 + + 0 + + -69 + + + 2 + :)( E const & e ); #endif@] @@ -6789,7 +6778,18 @@ - 0 + 3 + 2 + [@typedef ---unspecified--- (:link + 1 + + 0 + + -70 + + + 2 + :);@] @@ -6880,81 +6880,9 @@ - 17 + 1 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must derive publicly from std::exception. !!!!Effects: * If BOOST_NO_EXCEPTIONS is not defined, boost::(:link - 1 - - 0 - - -5 - - - 2 - :)(e) is equivalent to throw boost::(:link - 1 - - 0 - - -48 - - - 2 - :)(boost::(:link - 1 - - 0 - - -44 - - - 2 - :)(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::(:link - 1 - - 0 - - -5 - - - 2 - :)(e) is equivalent to throw e; * If BOOST_NO_EXCEPTIONS is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of (:link - 1 - - 0 - - -5 - - - 2 - :) are allowed to assume that the function never returns; therefore, if the user-defined (:link - 1 - - 0 - - -5 - - - 2 - :) returns, the behavior is undefined. !!!!Note: Under BOOST_NO_EXCEPTIONS, unless BOOST_EXCEPTION_DISABLE is also defined, users can examine the passed exception object using boost:: - 1 - - 0 - - -36 - - - 2 - , or format an automatic diagnostic message using boost:: - 1 - - 0 - - -24 - - - 2 - . + (:auto !!!:) !!!Synopsis (:include synopsis:) @@ -6964,6 +6892,163 @@ -6 + + 33 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: The (:link + 1 + + 0 + + -6 + + + 2 + :) function must not be called outside of a catch block. !!!!Returns: * An (:link + 1 + + 0 + + -70 + + + 2 + :) that refers to the currently handled exception or a copy of the currently handled exception. * If the function needs to allocate memory and the attempt fails, it returns an (:link + 1 + + 0 + + -70 + + + 2 + :) that refers to an instance of std::bad_alloc. !!!!Throws: Nothing. !!!!Notes: * It is unspecified whether the return values of two successive calls to (:link + 1 + + 0 + + -6 + + + 2 + :) refer to the same exception object. * Correct implementation of (:link + 1 + + 0 + + -6 + + + 2 + :) may require compiler support, unless (:link + 1 + + 0 + + -61 + + + 2 + :) was used at the time the currently handled exception object was passed to throw. Whenever + 1 + + 0 + + -6 + + + 2 + fails to properly copy the current exception object, it returns an + 1 + + 0 + + -70 + + + 2 + to an object of type that is as close as possible to the original exception type, using + 1 + + 0 + + -67 + + + 2 + as a final fallback. All such types derive from boost:: + 1 + + 0 + + -36 + + + 2 + , and: ** if the original exception object derives from boost::(:link + 1 + + 0 + + -36 + + + 2 + :), then the boost::(:link + 1 + + 0 + + -36 + + + 2 + :) sub-object of the object referred to by the returned + 1 + + 0 + + -70 + + + 2 + is initialized by the boost::(:link + 1 + + 0 + + -36 + + + 2 + :) copy constructor; ** if available, the exception contains the std::type_info of the original exception object, accessible through + 1 + + 0 + + -34 + + + 2 + < + 1 + + 0 + + -46 + + + 2 + >. + + + + + 0 + + -7 + + 73 2 @@ -6972,7 +7057,7 @@ 0 - -56 + -50 2 @@ -6981,7 +7066,7 @@ 0 - -56 + -50 2 @@ -6990,7 +7075,7 @@ 0 - -34 + -59 2 @@ -6999,7 +7084,25 @@ 0 - -34 + -59 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -38 + + + 2 + :)> [@(:include + 1 + + 0 + + -38 2 @@ -7026,7 +7129,7 @@ 0 - -8 + -5 2 @@ -7035,7 +7138,7 @@ 0 - -8 + -5 2 @@ -7044,7 +7147,7 @@ 0 - -19 + -45 2 @@ -7053,7 +7156,7 @@ 0 - -19 + -45 2 @@ -7062,7 +7165,7 @@ 0 - -68 + -13 2 @@ -7071,7 +7174,7 @@ 0 - -68 + -13 2 @@ -7080,7 +7183,7 @@ 0 - -52 + -21 2 @@ -7089,7 +7192,7 @@ 0 - -52 + -21 2 @@ -7098,7 +7201,7 @@ 0 - -46 + -37 2 @@ -7107,7 +7210,7 @@ 0 - -46 + -37 2 @@ -7116,7 +7219,7 @@ 0 - -63 + -22 2 @@ -7125,25 +7228,7 @@ 0 - -63 - - - 2 - synopsis:)@] `#include <(:link - 1 - - 0 - - -25 - - - 2 - :)> [@(:include - 1 - - 0 - - -25 + -22 2 @@ -7152,7 +7237,7 @@ 0 - -21 + -9 2 @@ -7161,25 +7246,7 @@ 0 - -21 - - - 2 - synopsis:) `#include < - 1 - - 0 - - -70 - - - 2 - > (:include - 1 - - 0 - - -70 + -9 2 @@ -7203,6 +7270,24 @@ 2 synopsis:) `#include < 1 + + 0 + + -24 + + + 2 + > (:include + 1 + + 0 + + -24 + + + 2 + synopsis:) `#include < + 1 0 @@ -7224,7 +7309,7 @@ 0 - -60 + -17 2 @@ -7233,7 +7318,7 @@ 0 - -60 + -17 2 @@ -7260,7 +7345,7 @@ 0 - -54 + -20 2 @@ -7269,7 +7354,7 @@ 0 - -54 + -20 2 @@ -7298,139 +7383,31 @@ 0 - -7 + -8 - 33 + 37 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: The (:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: T must have accessible copy constructor and must not be a reference (there is no requirement that T's copy constructor does not throw.) !!!!Description: This class template is used to associate a Tag type with a value type T. Objects of type (:link 1 0 - -7 + -8 2 - :) function must not be called outside of a catch block. !!!!Returns: * An (:link + :)<Tag,T> can be passed to (:link 1 0 - -59 + -33 2 - :) that refers to the currently handled exception or a copy of the currently handled exception. * If the function needs to allocate memory and the attempt fails, it returns an (:link - 1 - - 0 - - -59 - - - 2 - :) that refers to an instance of std::bad_alloc. !!!!Throws: Nothing. !!!!Notes: * It is unspecified whether the return values of two successive calls to (:link - 1 - - 0 - - -7 - - - 2 - :) refer to the same exception object. * Correct implementation of (:link - 1 - - 0 - - -7 - - - 2 - :) may require compiler support, unless (:link - 1 - - 0 - - -48 - - - 2 - :) was used at the time the currently handled exception object was passed to throw. Whenever - 1 - - 0 - - -7 - - - 2 - fails to properly copy the current exception object, it returns an - 1 - - 0 - - -59 - - - 2 - to an object of type that is as close as possible to the original exception type, using - 1 - - 0 - - -43 - - - 2 - as a final fallback. All such types derive from boost:: - 1 - - 0 - - -62 - - - 2 - , and: ** if the original exception object derives from boost::(:link - 1 - - 0 - - -62 - - - 2 - :), then the boost::(:link - 1 - - 0 - - -62 - - - 2 - :) sub-object of the object referred to by the returned - 1 - - 0 - - -59 - - - 2 - is initialized by the boost::(:link - 1 - - 0 - - -62 - - - 2 - :) copy constructor; ** if available, the exception contains the std::type_info of the original exception object, accessible through + mod="/":) to be stored in objects of type boost::(:link 1 0 @@ -7439,23 +7416,149 @@ 2 - < + :). !!!!Usage: The header <(:link 1 0 - -27 + -59 2 - >. + :)> provides a declaration of the (:link + 1 + + 0 + + -8 + + + 2 + :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, for example: [@#include <(:link + 1 + + 0 + + -59 + + + 2 + :)> struct tag_errno; typedef boost::(:link + 1 + + 0 + + -8 + + + 2 + :)<tag_errno,int> errno_info;@] Or, the shorter equivalent: [@#include <(:link + 1 + + 0 + + -59 + + + 2 + :)> typedef boost::(:link + 1 + + 0 + + -8 + + + 2 + :)<struct tag_errno,int> errno_info;@] This errno_info typedef can be passed to (:link + 1 + + 0 + + -33 + + + 2 + mod="/":) (#include <(:link + 1 + + 0 + + -38 + + + 2 + :)> first) to store an int named tag_errno in exceptions of types that derive from boost::(:link + 1 + + 0 + + -36 + + + 2 + :): [@throw file_read_error() (:link + 1 + + 0 + + -33 + + + 2 + |<<:) errno_info(errno);@] It can also be passed to (:link + 1 + + 0 + + -34 + + + 2 + :) (#include <(:link + 1 + + 0 + + -68 + + + 2 + :)> first) to retrieve the tag_errno int from a boost::(:link + 1 + + 0 + + -36 + + + 2 + :): [@catch( boost::(:link + 1 + + 0 + + -36 + + + 2 + :) & x ) { if( int const * e=boost::(:link + 1 + + 0 + + -34 + + + 2 + :)<errno_info>(x) ) .... }@] 0 - -8 + -9 @@ -7464,100 +7567,6 @@ (:auto !!:) !!!Synopsis (:include synopsis:) - - - 0 - - -9 - - - - 19 - 2 - (:auto !!!:) Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Let's say we have an exception type file_read_error, which takes a file name in its constructor. Consider the following function: [@void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error(????); }@] How can the file_read function pass a file name to the exception type constructor? All it has is a FILE handle. Using boost::(:link - 1 - - 0 - - -62 - - - 2 - :) allows us to free the file_read function from the burden of storing the file name in exceptions it throws: [@#include <(:link - 1 - - 0 - - -38 - - - 2 - :)> #include <stdio.h> #include <errno.h> typedef boost::(:link - 1 - - 0 - - -17 - - - 2 - :)<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link - 1 - - 0 - - -62 - - - 2 - :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error() << errno_info(errno); }@] If file_read detects a failure, it throws an exception which contains the information that is available at the time, namely the errno. Other relevant information, such as the file name, can be added in a context higher up the call stack, where it is known naturally: [@#include <(:link - 1 - - 0 - - -38 - - - 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> typedef boost::(:link - 1 - - 0 - - -17 - - - 2 - :)<struct tag_file_name,std::string> file_name_info; boost::shared_ptr<FILE> file_open( char const * file_name, char const * mode ); void file_read( FILE * f, void * buffer, size_t size ); void parse_file( char const * file_name ) { boost::shared_ptr<FILE> f = file_open(file_name,"rb"); assert(f); try { char buf[1024]; file_read( f.get(), buf, sizeof(buf) ); } catch( boost::(:link - 1 - - 0 - - -62 - - - 2 - :) & e ) { e << file_name_info(file_name); throw; } }@] The above function is (almost) exception-neutral -- if an exception is emitted by any function call within the try block, parse_file does not need to do any real work, but it intercepts any boost::(:link - 1 - - 0 - - -62 - - - 2 - :) object, stores the file name, and re-throws using a throw-expression with no operand (15.1.6). The rationale for catching any boost::(:link - 1 - - 0 - - -62 - - - 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 @@ -7566,9 +7575,171 @@ - 1 + 37 2 - (:auto !!!:) (:include synopsis:) !!!!Precondition: ep shall not be null. !!!!Throws: The exception to which ep refers. + (:auto !!!:) (:include synopsis:) !!!!Returns: A string value that contains varying amount of implementation-specific diagnostic information about the passed object: *If E can be statically converted to boost::(:link + 1 + + 0 + + -36 + + + 2 + :), the returned value contains the string representations of all (:link + 1 + + 0 + + -8 + + + 2 + :) objects stored in the boost::(:link + 1 + + 0 + + -36 + + + 2 + :) through (:link + 1 + + 0 + + -33 + + + 2 + mod="/":), along with other diagnostic information relevant to the exception. If e can be dynamically converted to std::exception, the returned value also contains the what() string. *Otherwise, if E can be statically converted std::exception: **if e can be dynamically converted to boost::exception, the returned value is the same as if E could be statically converted to boost::(:link + 1 + + 0 + + -36 + + + 2 + :); **otherwise the returned value contains the what() string. *Otherwise, the boost::(:link + 1 + + 0 + + -10 + + + 2 + :) template is not available. The string representation of each (:link + 1 + + 0 + + -8 + + + 2 + :) object is deduced by a function call that is bound at the time the (:link + 1 + + 0 + + -8 + + + 2 + :)<Tag,T> template is instantiated. The following overload resolutions are attempted in order: #Unqualified call to to_string(x), where x is of type (:link + 1 + + 0 + + -8 + + + 2 + :)<Tag,T> (the return value is expected to be of type std::string.) #Unqualified call to to_string(x.(:link + 1 + + 0 + + -66 + + + 2 + mod="m":)()) (the return value is expected to be of type std::string.) #Unqualified call to s << x.(:link + 1 + + 0 + + -66 + + + 2 + mod="m":)(), where s is a std::ostringstream. The first successfully bound function is used at the time (:link + 1 + + 0 + + -10 + + + 2 + :) is called; if all 3 overload resolutions are unsuccessful, the system is unable to convert the (:link + 1 + + 0 + + -8 + + + 2 + :) object to string, and ''an unspecified stub string value is used without issuing a compile error.'' The + 1 + + 0 + + -70 + + + 2 + overload of + 1 + + 0 + + -10 + + + 2 + is equivalent to: [@if( p ) try { + 1 + + 0 + + -48 + + + 2 + (p); } catch(...) { return + 1 + + 0 + + -19 + + + 2 + (); } else return <unspecified-string-value>;@] !!!!Notes: *The format of the returned string is unspecified. *The returned string is ''not'' user-friendly. *The returned string may include additional platform-specific diagnostic information. (:include + 1 + + 0 + + -26 + + + 2 + :) @@ -7592,18 +7763,90 @@ - 3 + 19 2 - (:auto !!!:) (:include synopsis:) !!!!Effects: Stores a copy of v in the + (:auto !!:) Boost Exception provides a namespace-scope function (:link 1 0 - -17 + -10 2 - object. (:include throws:) + :) which takes a boost::(:link + 1 + + 0 + + -36 + + + 2 + :). The returned string contains: *the string representation of all data objects added to the boost::(:link + 1 + + 0 + + -36 + + + 2 + :) through (:link + 1 + + 0 + + -33 + + + 2 + mod="/":); *the output from std::exception::what; *additional platform-specific diagnostic information. The returned string is not presentable as a friendly user message, but because it is generated automatically, it is useful for debugging or logging purposes. Here is an example: [@#include <(:link + 1 + + 0 + + -75 + + + 2 + :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link + 1 + + 0 + + -36 + + + 2 + :). void g() { try { f(); } catch( boost::(:link + 1 + + 0 + + -36 + + + 2 + :) & e ) { std::cerr << (:link + 1 + + 0 + + -10 + + + 2 + :)(e); } }@] (:include + 1 + + 0 + + -26 + + + 2 + :) @@ -7616,7 +7859,7 @@ 1 2 - (:auto !:) This is an alphabetical list of all Boost Exception documentation pages. (:pagelist fmt="index" except_tags="index noindex" mod="w":) + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -7626,41 +7869,6 @@ -14 - - 1 - 2 - (:auto !!:) (:pagelist fmt="index" tags="type":) - - - - - 0 - - -15 - - - - 3 - 2 - !!!!Example: this is a possible output from the (:link - 1 - - 0 - - -24 - - - 2 - :) function, as used in ''libs/exception/example/example_io.cpp:'' [@example_io.cpp(83): Throw in function class boost::shared_ptr<struct _iobuf> __cdecl my_fopen(const char *,const char *) Dynamic exception type: class boost::exception_detail::clone_impl<class fopen_error> std::exception::what: example_io error [struct tag_errno *] = 2, OS says "No such file or directory" [struct tag_file_name *] = tmp1.txt [struct tag_function *] = fopen [struct tag_open_mode *] = rb@] - - - - - 0 - - -16 - - 5 2 @@ -7669,7 +7877,7 @@ 0 - -62 + -36 2 @@ -7678,13 +7886,48 @@ 0 - -31 + -58 2 mod="w":). + + + 0 + + -15 + + + + 1 + 2 + (:auto !:) This is an alphabetical list of all Boost Exception documentation pages. (:pagelist fmt="index" except_tags="index noindex" mod="w":) + + + + + 0 + + -16 + + + + 3 + 2 + (:auto !!:) This header has been deprecated. Please #include < + 1 + + 0 + + -75 + + + 2 + > instead. + + 0 @@ -7693,171 +7936,9 @@ - 37 + 1 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: T must have accessible copy constructor and must not be a reference (there is no requirement that T's copy constructor does not throw.) !!!!Description: This class template is used to associate a Tag type with a value type T. Objects of type (:link - 1 - - 0 - - -17 - - - 2 - :)<Tag,T> can be passed to (:link - 1 - - 0 - - -39 - - - 2 - mod="/":) to be stored in objects of type boost::(:link - 1 - - 0 - - -62 - - - 2 - :). !!!!Usage: The header <(:link - 1 - - 0 - - -34 - - - 2 - :)> provides a declaration of the (:link - 1 - - 0 - - -17 - - - 2 - :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, for example: [@#include <(:link - 1 - - 0 - - -34 - - - 2 - :)> struct tag_errno; typedef boost::(:link - 1 - - 0 - - -17 - - - 2 - :)<tag_errno,int> errno_info;@] Or, the shorter equivalent: [@#include <(:link - 1 - - 0 - - -34 - - - 2 - :)> typedef boost::(:link - 1 - - 0 - - -17 - - - 2 - :)<struct tag_errno,int> errno_info;@] This errno_info typedef can be passed to (:link - 1 - - 0 - - -39 - - - 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 - - -62 - - - 2 - :): [@throw file_read_error() (:link - 1 - - 0 - - -39 - - - 2 - |<<:) errno_info(errno);@] It can also be passed to (:link - 1 - - 0 - - -36 - - - 2 - :) (#include <(:link - 1 - - 0 - - -41 - - - 2 - :)> first) to retrieve the tag_errno int from a boost::(:link - 1 - - 0 - - -62 - - - 2 - :): [@catch( boost::(:link - 1 - - 0 - - -62 - - - 2 - :) & x ) { if( int const * e=boost::(:link - 1 - - 0 - - -36 - - - 2 - :)<errno_info>(x) ) .... }@] + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -7868,45 +7949,27 @@ - 9 + 5 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: This function must not be called outside of a catch block. !!!!Returns: If the current exception object can be converted to boost::(:link + (:auto !!!:) (:include synopsis:) !!!!Effects: As if [@try { throw 1 0 - -62 + -61 2 - :) or std::exception, this function returns the same string value returned by (:link + (e); } catch(...) { return (:link 1 0 - -24 + -6 2 - :) for the current exception object. Otherwise, an unspecified non-empty string is returned. Typical use is to call - 1 - - 0 - - -18 - - - 2 - from a top-level function to output diagnostic information about unhandled exceptions: [@int main() { try { run_program(); } catch( error & e ) { //handle error } catch( ...) { std::cerr << "Unhandled exception!" << std::endl << boost:: - 1 - - 0 - - -18 - - - 2 - (); } }@] + :)(); }@] @@ -7917,9 +7980,45 @@ - 1 + 9 2 - (:auto !!!:) !!!Synopsis (:include synopsis:) + (:auto !!!:) (:include synopsis:) !!!!Requirements: This function must not be called outside of a catch block. !!!!Returns: If the current exception object can be converted to boost::(:link + 1 + + 0 + + -36 + + + 2 + :) or std::exception, this function returns the same string value returned by (:link + 1 + + 0 + + -10 + + + 2 + :) for the current exception object. Otherwise, an unspecified non-empty string is returned. Typical use is to call + 1 + + 0 + + -19 + + + 2 + from a top-level function to output diagnostic information about unhandled exceptions: [@int main() { try { run_program(); } catch( error & e ) { //handle error } catch( ...) { std::cerr << "Unhandled exception!" << std::endl << boost:: + 1 + + 0 + + -19 + + + 2 + (); } }@] @@ -7930,36 +8029,9 @@ - 7 + 1 2 - (:auto !!!:) (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link - 1 - - 0 - - -62 - - - 2 - :) object. * Copy constructor: initializes a boost::(:link - 1 - - 0 - - -62 - - - 2 - :) object which shares ownership with x of all data added through (:link - 1 - - 0 - - -39 - - - 2 - mod="/":), including data that is added at a future time. !!!!Throws: Nothing. + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -7983,90 +8055,9 @@ - 19 + 1 2 - (:auto !!:) Boost Exception provides a namespace-scope function (:link - 1 - - 0 - - -24 - - - 2 - :) which takes a boost::(:link - 1 - - 0 - - -62 - - - 2 - :). The returned string contains: *the string representation of all data objects added to the boost::(:link - 1 - - 0 - - -62 - - - 2 - :) through (:link - 1 - - 0 - - -39 - - - 2 - mod="/":); *the output from std::exception::what; *additional platform-specific diagnostic information. The returned string is not presentable as a friendly user message, but because it is generated automatically, it is useful for debugging or logging purposes. Here is an example: [@#include <(:link - 1 - - 0 - - -75 - - - 2 - :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link - 1 - - 0 - - -62 - - - 2 - :). void g() { try { f(); } catch( boost::(:link - 1 - - 0 - - -62 - - - 2 - :) & e ) { std::cerr << (:link - 1 - - 0 - - -24 - - - 2 - :)(e); } }@] (:include - 1 - - 0 - - -15 - - - 2 - :) + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -8077,9 +8068,27 @@ - 1 + 5 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. + (:auto !!!:) (:include synopsis:) !!!!Definition: The expression + 1 + + 0 + + -8 + + + 2 + <Tag,T>::(:link + 1 + + 0 + + -23 + + + 2 + mod="m":) evaluates to T. @@ -8089,181 +8098,6 @@ -24 - - 37 - 2 - (:auto !!!:) (:include synopsis:) !!!!Returns: A string value that contains varying amount of implementation-specific diagnostic information about the passed object: *If E can be statically converted to boost::(:link - 1 - - 0 - - -62 - - - 2 - :), the returned value contains the string representations of all (:link - 1 - - 0 - - -17 - - - 2 - :) objects stored in the boost::(:link - 1 - - 0 - - -62 - - - 2 - :) through (:link - 1 - - 0 - - -39 - - - 2 - mod="/":), along with other diagnostic information relevant to the exception. If e can be dynamically converted to std::exception, the returned value also contains the what() string. *Otherwise, if E can be statically converted std::exception: **if e can be dynamically converted to boost::exception, the returned value is the same as if E could be statically converted to boost::(:link - 1 - - 0 - - -62 - - - 2 - :); **otherwise the returned value contains the what() string. *Otherwise, the boost::(:link - 1 - - 0 - - -24 - - - 2 - :) template is not available. The string representation of each (:link - 1 - - 0 - - -17 - - - 2 - :) object is deduced by a function call that is bound at the time the (:link - 1 - - 0 - - -17 - - - 2 - :)<Tag,T> template is instantiated. The following overload resolutions are attempted in order: #Unqualified call to to_string(x), where x is of type (:link - 1 - - 0 - - -17 - - - 2 - :)<Tag,T> (the return value is expected to be of type std::string.) #Unqualified call to to_string(x.(:link - 1 - - 0 - - -29 - - - 2 - mod="m":)()) (the return value is expected to be of type std::string.) #Unqualified call to s << x.(:link - 1 - - 0 - - -29 - - - 2 - mod="m":)(), where s is a std::ostringstream. The first successfully bound function is used at the time (:link - 1 - - 0 - - -24 - - - 2 - :) is called; if all 3 overload resolutions are unsuccessful, the system is unable to convert the (:link - 1 - - 0 - - -17 - - - 2 - :) object to string, and ''an unspecified stub string value is used without issuing a compile error.'' The - 1 - - 0 - - -59 - - - 2 - overload of - 1 - - 0 - - -24 - - - 2 - is equivalent to: [@if( p ) try { - 1 - - 0 - - -10 - - - 2 - (p); } catch(...) { return - 1 - - 0 - - -18 - - - 2 - (); } else return <unspecified-string-value>;@] !!!!Notes: *The format of the returned string is unspecified. *The returned string is ''not'' user-friendly. *The returned string may include additional platform-specific diagnostic information. (:include - 1 - - 0 - - -15 - - - 2 - :) - - - - - 0 - - -25 - - 1 2 @@ -8274,13 +8108,71 @@ 0 - -26 + -25 1 2 - (:auto !!:) (:pagelist fmt="index" tags="function":) + (:auto !!:) (:pagelist fmt="index" tags="type":) + + + + + 0 + + -26 + + + + 11 + 2 + !!!!Example: this is a possible output from the (:link + 1 + + 0 + + -10 + + + 2 + :) function, as used in ''libs/exception/example/example_io.cpp:'' [@example_io.cpp(70): Throw in function class boost::shared_ptr<struct _iobuf> __cdecl my_fopen(const char *,const char *) Dynamic exception type: class boost::exception_detail::clone_impl<class fopen_error> std::exception::what: example_io error [struct boost::(:link + 1 + + 0 + + -44 + + + 2 + :)_ *] = fopen [struct boost::(:link + 1 + + 0 + + -72 + + + 2 + :)_ *] = 2, "No such file or directory" [struct boost::(:link + 1 + + 0 + + -29 + + + 2 + :)_ *] = tmp1.txt [struct boost::(:link + 1 + + 0 + + -73 + + + 2 + :)_ *] = rb@] @@ -8291,45 +8183,72 @@ - 9 + 15 2 - (:auto !!!:) (:include synopsis:) This + (:auto !!!:) Here is how cloning can be enabled in a throw-expression (15.1): [@#include <(:link 1 0 - -17 + -38 2 - typedef is used by + :)> #include <(:link 1 0 - -7 + -24 2 - if it defaults to returning an + :)> #include <stdio.h> #include <errno.h> class file_read_error: public boost::(:link 1 0 - -59 + -36 2 - that refers to an object of type + :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::(:link 1 0 - -43 + -61 2 - , to record in it the std::type_info of the original exception object. + :)(file_read_error()) << boost::(:link + 1 + + 0 + + -72 + + + 2 + :)(errno); }@] Of course, (:link + 1 + + 0 + + -61 + + + 2 + :) may be used with any exception type; there is no requirement that it should derive from boost::(:link + 1 + + 0 + + -36 + + + 2 + :). @@ -8355,25 +8274,25 @@ 5 2 - (:auto !!!:) (:include synopsis:) !!!!Description: Returns a const reference to the copy of the value passed to (:link + (:auto !!!:) (:include synopsis:) This type is designed to be used as a standard 1 0 - -17 + -8 2 - :)'s constructor stored in the (:link + instance for transporting a relevant file name in exceptions deriving from boost:: 1 0 - -17 + -36 2 - :) object. !!!!Throws: Nothing. + . @@ -8383,216 +8302,6 @@ -30 - - 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 - - -62 - - - 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 - - -62 - - - 2 - :) { }; struct io_error: virtual exception_base { }; struct file_read_error: virtual io_error { }; typedef boost::(:link - 1 - - 0 - - -17 - - - 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 - - -39 - - - 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 - - -62 - - - 2 - :): [@typedef boost::(:link - 1 - - 0 - - -17 - - - 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 - - -62 - - - 2 - :) do_something(); .... } else throw file_open_error() (:link - 1 - - 0 - - -39 - - - 2 - |<<:) errno_code(errno); } catch( boost::(:link - 1 - - 0 - - -62 - - - 2 - :) & e ) { e (:link - 1 - - 0 - - -39 - - - 2 - |<<:) file_name("foo.txt"); throw; }@] Finally here is how the handler retrieves data from exceptions that derive from boost::(:link - 1 - - 0 - - -62 - - - 2 - :): [@catch( io_error & e ) { std::cerr << "I/O Error!\n"; if( std::string const * fn=(:link - 1 - - 0 - - -36 - - - 2 - :)<file_name>(e) ) std::cerr << "File name: " << *fn << "\n"; if( int const * c=(:link - 1 - - 0 - - -36 - - - 2 - :)<errno_code>(e) ) std::cerr << "OS says: " << strerror(*c) << "\n"; }@] In addition, boost::(:link - 1 - - 0 - - -24 - - - 2 - :) can be used to compose an automatic (if not user-friendly) message that contains all of the (:link - 1 - - 0 - - -17 - - - 2 - :) objects added to a boost::(:link - 1 - - 0 - - -62 - - - 2 - :). This is useful for inclusion in logs and other diagnostic objects. - - - - - 0 - - -34 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -31 - - - - 7 - 2 - (:auto !!!:) Deriving from boost::(:link - 1 - - 0 - - -62 - - - 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 - - -62 - - - 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 - - -62 - - - 2 - :) { }; struct io_error: virtual exception_base { }; struct file_error: virtual io_error { }; struct read_error: virtual io_error { }; struct file_read_error: virtual file_error, virtual read_error { };@] Using this approach, exception types become a simple tagging system for categorizing errors and selecting failures in exception handlers. - - - - - 0 - - -35 - - 1 2 @@ -8603,40 +8312,35 @@ 0 - -36 + -31 - 13 + 1 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link + (:auto !!:) (:pagelist tags="hpp" except_tags="noindex":) + + + + + 0 + + -32 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) This type is designed to be used as a standard 1 0 - -17 + -8 2 - :) template. * E must be polymorphic. !!!!Returns: * If dynamic_cast<boost::(:link - 1 - - 0 - - -62 - - - 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 - - -39 - - - 2 - mod="/":) to store values in exception objects.) When x is destroyed, any pointers returned by (:link + instance for transporting a relevant FILE pointer managed by a boost::shared_ptr<FILE> in exceptions deriving from boost:: 1 0 @@ -8645,25 +8349,7 @@ 2 - :) become invalid. !!!!Throws: Nothing. !!!!Note: The interface of (:link - 1 - - 0 - - -36 - - - 2 - :) may be affected by the build (:link - 1 - - 0 - - -40 - - - 2 - :). + . @@ -8673,6 +8359,113 @@ -33 + + 7 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + 1 + + 0 + + -36 + + + 2 + :), or a type that derives (indirectly) from boost::(:link + 1 + + 0 + + -36 + + + 2 + :). !!!!Postcondition: A copy of v is stored into x. If x already contains data of type (:link + 1 + + 0 + + -8 + + + 2 + :)<Tag,T>, that data is overwritten. Basic exception safety guarantee. !!!!Returns: x. (:include throws:) + + + + + 0 + + -34 + + + + 13 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link + 1 + + 0 + + -8 + + + 2 + :) template. * E must be polymorphic. !!!!Returns: * If dynamic_cast<boost::(:link + 1 + + 0 + + -36 + + + 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 + + -33 + + + 2 + mod="/":) to store values in exception objects.) When x is destroyed, any pointers returned by (:link + 1 + + 0 + + -34 + + + 2 + :) become invalid. !!!!Throws: Nothing. !!!!Note: The interface of (:link + 1 + + 0 + + -34 + + + 2 + :) may be affected by the build (:link + 1 + + 0 + + -60 + + + 2 + :). + + + + + 0 + + -35 + + 71 2 @@ -8681,7 +8474,7 @@ 0 - -16 + -14 2 @@ -8690,7 +8483,7 @@ 0 - -62 + -36 2 @@ -8699,7 +8492,7 @@ 0 - -44 + -63 2 @@ -8708,7 +8501,7 @@ 0 - -62 + -36 2 @@ -8717,7 +8510,7 @@ 0 - -17 + -8 2 @@ -8726,7 +8519,7 @@ 0 - -62 + -36 2 @@ -8735,7 +8528,7 @@ 0 - -39 + -33 2 @@ -8744,7 +8537,7 @@ 0 - -62 + -36 2 @@ -8753,7 +8546,7 @@ 0 - -62 + -36 2 @@ -8762,7 +8555,7 @@ 0 - -39 + -33 2 @@ -8771,7 +8564,7 @@ 0 - -62 + -36 2 @@ -8780,7 +8573,7 @@ 0 - -62 + -36 2 @@ -8789,7 +8582,7 @@ 0 - -5 + -69 2 @@ -8798,7 +8591,7 @@ 0 - -62 + -36 2 @@ -8807,7 +8600,7 @@ 0 - -7 + -6 2 @@ -8816,7 +8609,7 @@ 0 - -37 + -64 2 @@ -8825,7 +8618,7 @@ 0 - -5 + -69 2 @@ -8834,7 +8627,7 @@ 0 - -24 + -10 2 @@ -8843,7 +8636,7 @@ 0 - -24 + -10 2 @@ -8852,7 +8645,7 @@ 0 - -37 + -64 2 @@ -8861,7 +8654,7 @@ 0 - -5 + -69 2 @@ -8870,7 +8663,7 @@ 0 - -62 + -36 2 @@ -8879,7 +8672,7 @@ 0 - -5 + -69 2 @@ -8888,7 +8681,7 @@ 0 - -62 + -36 2 @@ -8897,7 +8690,7 @@ 0 - -59 + -70 2 @@ -8906,7 +8699,7 @@ 0 - -48 + -61 2 @@ -8915,7 +8708,7 @@ 0 - -5 + -69 2 @@ -8924,7 +8717,7 @@ 0 - -62 + -36 2 @@ -8933,7 +8726,7 @@ 0 - -17 + -8 2 @@ -8942,7 +8735,7 @@ 0 - -39 + -33 2 @@ -8951,7 +8744,7 @@ 0 - -39 + -33 2 @@ -8960,7 +8753,7 @@ 0 - -39 + -33 2 @@ -8969,7 +8762,7 @@ 0 - -39 + -33 2 @@ -8978,7 +8771,7 @@ 0 - -39 + -33 2 @@ -8987,7 +8780,7 @@ 0 - -17 + -8 2 @@ -8998,22 +8791,13 @@ 0 - -37 + -36 - 7 + 13 2 - (:auto !!!:) (:include synopsis:) This macro takes an exception object, records BOOST_CURRENT_FUNCTION, __FILE__ and __LINE__ in it, and forwards it to - 1 - - 0 - - -5 - - - 2 - . To recover this information at the catch site, use + (:auto !!!:) (:include synopsis:) Class boost::(:link 1 0 @@ -9022,16 +8806,65 @@ 2 - ; the information is also included in the message returned by + :) is designed to be used as a universal base for user-defined exception types. An object of any type deriving from boost::(:link 1 0 - -24 + -36 2 - . + :) can store data of arbitrary types, using the (:link + 1 + + 0 + + -8 + + + 2 + :) wrapper and (:link + 1 + + 0 + + -33 + + + 2 + mod="/":). To retrieve data from a boost::(:link + 1 + + 0 + + -36 + + + 2 + :) object, use the (:link + 1 + + 0 + + -34 + + + 2 + :) function template. + + + + + 0 + + -37 + + + + 1 + 2 + (:auto !!!:) !!!Synopsis (:include synopsis:) @@ -9042,18 +8875,9 @@ - 3 + 1 2 - (:auto !!:) This header has been deprecated. Please #include < - 1 - - 0 - - -75 - - - 2 - > instead. + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -9064,36 +8888,18 @@ - 7 + 3 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + (:auto !!!:) (:include synopsis:) !!!!Effects: Stores a copy of v in the 1 0 - -62 + -8 2 - :), or a type that derives (indirectly) from boost::(:link - 1 - - 0 - - -62 - - - 2 - :). !!!!Postcondition: A copy of v is stored into x. If x already contains data of type (:link - 1 - - 0 - - -17 - - - 2 - :)<Tag,T>, that data is overwritten. Basic exception safety guarantee. !!!!Returns: x. (:include throws:) + object. (:include throws:) @@ -9106,7 +8912,7 @@ 19 2 - (:auto !!:) Boost Exception responds to the following configuration macros: '''BOOST_NO_RTTI'''\\ '''BOOST_NO_TYPEID''' The first macro prevents Boost Exception from using dynamic_cast and dynamic typeid. If the second macro is also defined, Boost Exception does not use static typeid either. There are no observable degrading effects on the library functionality, except for the following: ->By default, the (:link + (:auto !!!:) Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Let's say we have an exception type file_read_error, which takes a file name in its constructor. Consider the following function: [@void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error(????); }@] How can the file_read function pass a file name to the exception type constructor? All it has is a FILE handle. Using boost::(:link 1 0 @@ -9115,7 +8921,16 @@ 2 - :) function template can be called with any exception type. If BOOST_NO_RTTI is defined, (:link + :) allows us to free the file_read function from the burden of storing the file name in exceptions it throws: [@(:link + 1 + + 0 + + -75 + + + 2 + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <errno.h> class file_read_error: public boost::(:link 1 0 @@ -9124,70 +8939,61 @@ 2 - :) can be used only with objects of type boost::(:link + :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error() << boost::(:link 1 0 - -62 + -72 2 - :). !!!!Note: The library needs RTTI functionality. Disabling the language RTTI support enables an internal RTTI system, which may have more or less overhead depending on the platform. '''BOOST_EXCEPTION_DISABLE''' By default, (:link + :)(errno); }@] If file_read detects a failure, it throws an exception which contains the information that is available at the time, namely the errno. Other relevant information, such as the file name, can be added in a context higher up the call stack, where it is known naturally: [@#include <(:link 1 0 - -48 + -75 2 - :) and (:link + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> boost::shared_ptr<FILE> file_open( char const * file_name, char const * mode ); void file_read( FILE * f, void * buffer, size_t size ); void parse_file( char const * file_name ) { boost::shared_ptr<FILE> f = file_open(file_name,"rb"); assert(f); try { char buf[1024]; file_read( f.get(), buf, sizeof(buf) ); } catch( boost::(:link 1 0 - -44 + -36 2 - :) are integrated directly in the (:link + :) & e ) { e << boost::(:link 1 0 - -5 + -29 2 - :) function. Defining BOOST_EXCEPTION_DISABLE disables this integration. Note that on some non-conformant compilers, for example MSVC 7.0 and older, as well as BCC, BOOST_EXCEPTION_DISABLE is implicitly defined in (:link + :)(file_name); throw; } }@] The above function is (almost) exception-neutral -- if an exception is emitted by any function call within the try block, parse_file does not need to do any real work, but it intercepts any boost::(:link 1 0 - -25 + -36 2 - :). '''BOOST_NO_EXCEPTIONS''' This macro disables exception handling in Boost, forwarding all exceptions to a user-defined non-template version of boost:: + :) object, stores the file name, and re-throws using a throw-expression with no operand (15.1.6). The rationale for catching any boost::(:link 1 0 - -5 + -36 2 - . However, unless BOOST_EXCEPTION_DISABLE is also defined, users can still examine the exception object for any data added at the point of the throw, or use boost:: - 1 - - 0 - - -24 - - - 2 - (of course under BOOST_NO_EXCEPTIONS, the user-defined boost::throw_exception is not allowed to return to the caller.) + :) 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''. @@ -9197,19 +9003,6 @@ -41 - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -42 - - 5 2 @@ -9218,7 +9011,7 @@ 0 - -17 + -8 2 @@ -9227,13 +9020,71 @@ 0 - -62 + -36 2 . + + + 0 + + -42 + + + + 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 + + -61 + + + 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 + + -69 + + + 2 + :) are guaranteed to derive from boost::(:link + 1 + + 0 + + -36 + + + 2 + :) and to support cloning. (:include + 1 + + 0 + + -27 + + + 2 + :) (:include + 1 + + 0 + + -71 + + + 2 + :) + + 0 @@ -9242,27 +9093,9 @@ - 5 + 1 2 - (:auto !!!:) (:include synopsis:) This type is used by the (:link - 1 - - 0 - - -59 - - - 2 - :) support in Boost Exception. Please see (:link - 1 - - 0 - - -7 - - - 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. @@ -9275,25 +9108,25 @@ 5 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: T must be a class with an accessible no-throw copy constructor as per (15.5.1). !!!!Returns: * If T derives from boost::(:link + (:auto !!!:) (:include synopsis:) This type is designed to be used as a standard 1 0 - -62 + -8 2 - :), the returned object is of type T and is a copy of x. * Otherwise, the returned object is of an unspecified type that derives publicly from both T and boost::(:link + instance for transporting the name of a relevant API function (which does not use exceptions to report errors) in exceptions deriving from boost:: 1 0 - -62 + -36 2 - :). The T sub-object is initialized from x by the T copy constructor. !!!!Throws: Nothing. + . @@ -9303,187 +9136,61 @@ -45 - - 37 - 2 - (:auto !!!:) When you catch an exception, you can call (:link - 1 - - 0 - - -7 - - - 2 - :) to get an (:link - 1 - - 0 - - -59 - - - 2 - :) object: [@#include <(:link - 1 - - 0 - - -46 - - - 2 - :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link - 1 - - 0 - - -62 - - - 2 - :)s void worker_thread( boost::(:link - 1 - - 0 - - -59 - - - 2 - :) & error ) { try { do_work(); error = boost::(:link - 1 - - 0 - - -59 - - - 2 - :)(); } catch( ... ) { error = boost::(:link - 1 - - 0 - - -7 - - - 2 - :)(); } }@] In the above example, note that (:link - 1 - - 0 - - -7 - - - 2 - :) captures the original type of the exception object. The exception can be thrown again using the (:link - 1 - - 0 - - -10 - - - 2 - :) function: [@// ...continued void work() { boost::(:link - 1 - - 0 - - -59 - - - 2 - :) error; boost::(:link http://www.boost.org/doc/html/boost/thread.html|thread:) t( boost::(:link http://www.boost.org/libs/bind/bind.html|bind:)(worker_thread,boost::(:link http://www.boost.org/doc/html/ref.html|ref:)(error)) ); t.(:link http://www.boost.org/doc/html/boost/thread.html|join:)(); if( error ) boost::(:link - 1 - - 0 - - -10 - - - 2 - :)(error); }@] Note that (:link - 1 - - 0 - - -7 - - - 2 - :) could fail to copy the original exception object in the following cases: * if there is not enough memory, in which case the returned (:link - 1 - - 0 - - -59 - - - 2 - :) points to an instance of std::bad_alloc, or * if (:link - 1 - - 0 - - -48 - - - 2 - :) was not used in the throw-expression passed to the original throw statement and the current implementation does not have the necessary compiler-specific support to copy the exception automatically, in which case the returned (:link - 1 - - 0 - - -59 - - - 2 - :) points to an instance of (:link - 1 - - 0 - - -43 - - - 2 - :). Regardless, the use of (:link - 1 - - 0 - - -7 - - - 2 - :) and (:link - 1 - - 0 - - -10 - - - 2 - :) in the above examples is well-formed. - - - - - 0 - - -46 - - 1 2 (:auto !!:) !!!Synopsis (:include synopsis:) + + + 0 + + -46 + + + + 9 + 2 + (:auto !!!:) (:include synopsis:) This + 1 + + 0 + + -8 + + + 2 + typedef is used by + 1 + + 0 + + -6 + + + 2 + if it defaults to returning an + 1 + + 0 + + -70 + + + 2 + that refers to an object of type + 1 + + 0 + + -67 + + + 2 + , to record in it the std::type_info of the original exception object. + + 0 @@ -9492,27 +9199,36 @@ - 5 + 7 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + (:auto !!!:) (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link 1 0 - -62 + -36 2 - :), or a type that derives (indirectly) from boost::(:link + :) object. * Copy constructor: initializes a boost::(:link 1 0 - -62 + -36 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:) + :) object which shares ownership with x of all data added through (:link + 1 + + 0 + + -33 + + + 2 + mod="/":), including data that is added at a future time. !!!!Throws: Nothing. @@ -9523,99 +9239,9 @@ - 21 + 1 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: * T must be a class with an accessible no-throw copy constructor. * If T has any virtual base types, those types must have an accessible default constructor. !!!!Returns: An object of ''unspecified'' type which derives publicly from T. That is, the returned object can be intercepted by a catch(T &). !!!!Description: This function is designed to be used directly in a throw-expression to enable the (:link - 1 - - 0 - - -59 - - - 2 - :) support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link - 1 - - 0 - - -48 - - - 2 - :)(my_exception());@] Unless (:link - 1 - - 0 - - -48 - - - 2 - :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link - 1 - - 0 - - -7 - - - 2 - :) may return an (:link - 1 - - 0 - - -59 - - - 2 - :) which refers to an instance of (:link - 1 - - 0 - - -43 - - - 2 - :). See (:link - 1 - - 0 - - -7 - - - 2 - :) for details. !!!!Note: Instead of using the throw keyword directly, it is preferable to call boost::(:link - 1 - - 0 - - -5 - - - 2 - :). This is guaranteed to throw an exception that derives from boost::(:link - 1 - - 0 - - -62 - - - 2 - :) and supports the (:link - 1 - - 0 - - -59 - - - 2 - :) functionality. + (:auto !!!:) (:include synopsis:) !!!!Precondition: ep shall not be null. !!!!Throws: The exception to which ep refers. @@ -9626,18 +9252,27 @@ - 3 + 5 2 - (:auto !!!:) (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link + (:auto !!!:) (:include synopsis:) This type is designed to be used as a standard 1 0 - -62 + -8 2 - :) object. !!!!Throws: Nothing. + instance for transporting strings returned by std::type_info::name in exceptions deriving from boost:: + 1 + + 0 + + -36 + + + 2 + objects. @@ -9648,54 +9283,9 @@ - 11 + 1 2 - (:auto !!:) All exception types that derive from boost::(:link - 1 - - 0 - - -62 - - - 2 - :) can be used as type-safe containers of arbitrary data objects, while complying with the no-throw requirements (15.5.1) of the ANSI C++ standard for exception types. When exceptions derive from boost::(:link - 1 - - 0 - - -62 - - - 2 - :), arbitrary data can be added to exception objects: *At the point of the throw; *At a later time as exceptions bubble up the call stack. (:include - 1 - - 0 - - -58 - - - 2 - :) (:include - 1 - - 0 - - -9 - - - 2 - :) (:include - 1 - - 0 - - -57 - - - 2 - :) + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -9706,144 +9296,9 @@ - 69 + 11 2 - !!Introduction The purpose of Boost Exception is to ease the design of exception class hierarchies and to help write exception handling and error reporting code. It supports transporting of arbitrary data to the catch site, which is otherwise tricky due to the no-throw requirements (15.5.1) for exception types. Data can be added to any exception object, either directly in the throw-expression (15.1), or at a later time as the exception object propagates up the call stack. The ability to add data to exception objects after they have been passed to throw is important, because often some of the information needed to handle an exception is unavailable in the context where the failure is detected. Boost Exception also supports (:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:)-style (:link - 1 - - 0 - - -53 - - - 2 - |copying:) of exception objects, implemented non-intrusively and automatically by the boost::(:link - 1 - - 0 - - -5 - - - 2 - :) function. !!Contents #(:link - 1 - - 0 - - -30 - - - 2 - :) #Tutorial ##(:link - 1 - - 0 - - -50 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -32 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -53 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -31 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -16 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -22 - - - 2 - mod="w":) #Documentation ##Class (:link - 1 - - 0 - - -62 - - - 2 - :) ##Throwing Exceptions ###(:link - 1 - - 0 - - -37 - - - 2 - :) ###(:link - 1 - - 0 - - -5 - - - 2 - :) ##Transporting of Arbitrary Data to the Catch Site ###(:link - 1 - - 0 - - -17 - - - 2 - :) ###(:link - 1 - - 0 - - -39 - - - 2 - :) ###(:link - 1 - - 0 - - -47 - - - 2 - :) ###(:link + (:auto !!:) All exception types that derive from boost::(:link 1 0 @@ -9852,12 +9307,205 @@ 2 + :) can be used as type-safe containers of arbitrary data objects, while complying with the no-throw requirements (15.5.1) of the ANSI C++ standard for exception types. When exceptions derive from boost::(:link + 1 + + 0 + + -36 + + + 2 + :), arbitrary data can be added to exception objects: *At the point of the throw; *At a later time as exceptions bubble up the call stack. (:include + 1 + + 0 + + -54 + + + 2 + :) (:include + 1 + + 0 + + -40 + + + 2 + :) (:include + 1 + + 0 + + -53 + + + 2 + :) + + + + + 0 + + -52 + + + + 69 + 2 + !!Introduction The purpose of Boost Exception is to ease the design of exception class hierarchies and to help write exception handling and error reporting code. It supports transporting of arbitrary data to the catch site, which is otherwise tricky due to the no-throw requirements (15.5.1) for exception types. Data can be added to any exception object, either directly in the throw-expression (15.1), or at a later time as the exception object propagates up the call stack. The ability to add data to exception objects after they have been passed to throw is important, because often some of the information needed to handle an exception is unavailable in the context where the failure is detected. Boost Exception also supports (:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:)-style (:link + 1 + + 0 + + -42 + + + 2 + |copying:) of exception objects, implemented non-intrusively and automatically by the boost::(:link + 1 + + 0 + + -69 + + + 2 + :) function. !!Contents #(:link + 1 + + 0 + + -57 + + + 2 + :) #Tutorial ##(:link + 1 + + 0 + + -51 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -55 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -42 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -58 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -14 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -12 + + + 2 + mod="w":) #Documentation ##Class (:link + 1 + + 0 + + -36 + + + 2 + :) ##Throwing Exceptions ###(:link + 1 + + 0 + + -64 + + + 2 :) ###(:link 1 0 - -44 + -69 + + + 2 + :) ##Transporting of Arbitrary Data to the Catch Site ###(:link + 1 + + 0 + + -8 + + + 2 + :) ###(:link + 1 + + 0 + + -33 + + + 2 + :) ###(:link + 1 + + 0 + + -56 + + + 2 + :) ###(:link + 1 + + 0 + + -34 + + + 2 + :) ###(:link + 1 + + 0 + + -63 2 @@ -9866,25 +9514,7 @@ 0 - -59 - - - 2 - :) ###(:link - 1 - - 0 - - -48 - - - 2 - :) ###(:link - 1 - - 0 - - -7 + -70 2 @@ -9902,25 +9532,7 @@ 0 - -10 - - - 2 - :) ###(:link - 1 - - 0 - - -43 - - - 2 - :) ##Diagnostic Information ###(:link - 1 - - 0 - - -24 + -6 2 @@ -9933,12 +9545,48 @@ 2 + :) ###(:link + 1 + + 0 + + -48 + + + 2 + :) ###(:link + 1 + + 0 + + -67 + + + 2 + :) ##Diagnostic Information ###(:link + 1 + + 0 + + -10 + + + 2 + :) ###(:link + 1 + + 0 + + -19 + + + 2 :) ##(:link 1 0 - -23 + -43 2 @@ -9947,7 +9595,7 @@ 0 - -6 + -7 2 @@ -9956,7 +9604,7 @@ 0 - -64 + -31 2 @@ -9965,7 +9613,7 @@ 0 - -14 + -25 2 @@ -9974,12 +9622,30 @@ 0 - -26 + -65 2 :) ##(:link 1 + + 0 + + -30 + + + 2 + :) ##(:link + 1 + + 0 + + -60 + + + 2 + mod="w":) #(:link + 1 0 @@ -9987,49 +9653,18 @@ 2 - :) ##(:link - 1 - - 0 - - -40 - - - 2 mod="w":) #(:link 1 0 - -33 - - - 2 - mod="w":) #(:link - 1 - - 0 - - -13 + -15 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 - - -52 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - 0 @@ -10038,133 +9673,18 @@ - 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 - - -48 - - - 2 - :) at the time of the throw is required in order to use cloning. !!!!Note: All exceptions emitted by the familiar function boost::(:link - 1 - - 0 - - -5 - - - 2 - :) are guaranteed to derive from boost::(:link - 1 - - 0 - - -62 - - - 2 - :) and to support cloning. (:include - 1 - - 0 - - -69 - - - 2 - :) (:include - 1 - - 0 - - -45 - - - 2 - :) - - - - - 0 - - -54 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -55 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) This type is designed to be used as a standard - 1 - - 0 - - -17 - - - 2 - instance for transporting strings returned by std::type_info::name in exceptions deriving from boost:: - 1 - - 0 - - -62 - - - 2 - objects. - - - - - 0 - - -56 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -57 - - - - 13 + 19 2 (:auto !!!:) The code snippet below demonstrates how boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) can be used to bundle the name of the function that failed, together with the reported errno so that they can be added to exception objects more conveniently together: [@#include <(:link 1 0 - -8 + -11 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link + :)> #include <(:link 1 0 @@ -10173,34 +9693,43 @@ 2 - :)<struct tag_file_name,std::string> file_name_info; typedef boost::(:link + :)> #include <(:link 1 0 - -17 + -9 2 - :)<struct tag_function,char const *> function_info; typedef boost::(:link + :)> #include <(:link 1 0 - -17 + -24 2 - :)<struct tag_errno,int> errno_info; typedef boost::tuple<function_info,errno_info> clib_failure; class file_open_error: public boost::(:link + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)<boost::(:link 1 0 - -62 + -44 2 - :) { }; boost::shared_ptr<FILE> file_open( char const * name, char const * mode ) { if( FILE * f=fopen(name,mode) ) return boost::shared_ptr<FILE>(f,fclose); else throw file_open_error() << file_name_info(name) << clib_failure("fopen",errno); }@] Note that the members of a boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) are stored separately in exception objects; they can only be retrieved individually, using (:link + :),boost::(:link + 1 + + 0 + + -72 + + + 2 + :)> clib_failure; class file_open_error: public boost::(:link 1 0 @@ -10209,6 +9738,24 @@ 2 + :) { }; boost::shared_ptr<FILE> file_open( char const * name, char const * mode ) { if( FILE * f=fopen(name,mode) ) return boost::shared_ptr<FILE>(f,fclose); else throw file_open_error() << boost::(:link + 1 + + 0 + + -29 + + + 2 + :)(name) << clib_failure("fopen",errno); }@] Note that the members of a boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) are stored separately in exception objects; they can only be retrieved individually, using (:link + 1 + + 0 + + -34 + + + 2 :). @@ -10216,54 +9763,54 @@ 0 - -58 + -54 17 2 - (:auto !!!:) The following example demonstrates how errno can be stored in exception objects using Boost Exception: [@#include <(:link + (:auto !!!:) The following example demonstrates how errno can be stored in exception objects using Boost Exception: [@#include < 1 0 - -38 + -75 2 - :)> #include <errno.h> #include <iostream> typedef boost::(:link + > #include <iostream> typedef boost:: 1 0 - -17 + -8 2 - :)<struct tag_errno,int> errno_info; //(1) class my_error: public boost::(:link + <struct tag_my_info,int> my_info; //(1) class my_error: public boost:: 1 0 - -62 + -36 2 - :), public std::exception { }; //(2) void f() { throw my_error() << errno_info(errno); //(3) } @] First, we instantiate the (:link + , public std::exception { }; //(2) void f() { throw my_error() << my_info(42); //(3) }@] First, we instantiate the (:link 1 0 - -17 + -8 2 - :) template using a unique identifier -- tag_errno, and the type of the info it identifies -- int. This provides compile-time type safety for the various values stored in exception objects. Second, we define class my_error, which derives from boost::(:link + :) template using a unique identifier -- tag_my_info, and the type of the info it identifies -- int. This provides compile-time type safety for the various values stored in exception objects. Second, we define class my_error, which derives from boost::(:link 1 0 - -62 + -36 2 @@ -10272,25 +9819,25 @@ 0 - -39 + -33 2 - |operator<<:) to store values in exception objects at the point of the throw. The stored errno value can be recovered at a later time like this: [@// ...continued void g() { try { f(); } catch( my_error & x ) { if( int const * err=boost::(:link + |operator<<:) to store values in exception objects at the point of the throw. The stored my_info value can be recovered at a later time like this: [@// ...continued void g() { try { f(); } catch( my_error & x ) { if( int const * mi=boost:: 1 0 - -36 + -34 2 - :)<errno_info>(x) ) std::cerr << "Error code: " << *err; } }@] The (:link + <my_info>(x) ) std::cerr << "My info: " << *mi; } }@] The (:link 1 0 - -36 + -34 2 @@ -10301,265 +9848,7 @@ 0 - -59 - - - - 25 - 2 - (:auto !!!:) (:include synopsis:) The (:link - 1 - - 0 - - -59 - - - 2 - :) type can be used to refer to a copy of an exception object. It is Default Constructible, Copy Constructible, Assignable and Equality Comparable; (:link - 1 - - 0 - - -59 - - - 2 - :)'s operations do not throw. The referenced object remains valid at least as long as there is an (:link - 1 - - 0 - - -59 - - - 2 - :) object that refers to it. Two instances of (:link - 1 - - 0 - - -59 - - - 2 - :) are equivalent and compare equal if and only if they refer to the same exception. The default constructor of (:link - 1 - - 0 - - -59 - - - 2 - :) produces the null value of the type. The null value is equivalent only to itself. !!!!Thread safety * It is legal for multiple threads to hold (:link - 1 - - 0 - - -59 - - - 2 - :) references to the same exception object. * It is illegal for multiple threads to modify the same (:link - 1 - - 0 - - -59 - - - 2 - :) object concurrently. * While calling (:link - 1 - - 0 - - -7 - - - 2 - :) makes a copy of the current exception object, it is still possible for the two copies to share internal state. Therefore, in general it is not safe to call (:link - 1 - - 0 - - -10 - - - 2 - :) concurrently to throw the same exception object into multiple threads. !!!!Nesting of exceptions: An (:link - 1 - - 0 - - -59 - - - 2 - :) can be added as (:link - 1 - - 0 - - -17 - - - 2 - :) to any boost::(:link - 1 - - 0 - - -62 - - - 2 - :). This is a convenient way to nest exceptions. There is no limit on the depth of the nesting, however cyclic references result in undefined behavior. - - - - - 0 - - -60 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -61 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) !!!!Effects: As if [@try { throw - 1 - - 0 - - -48 - - - 2 - (e); } catch(...) { return (:link - 1 - - 0 - - -7 - - - 2 - :)(); }@] - - - - - 0 - - -62 - - - - 13 - 2 - (:auto !!!:) (:include synopsis:) Class boost::(:link - 1 - - 0 - - -62 - - - 2 - :) is designed to be used as a universal base for user-defined exception types. An object of any type deriving from boost::(:link - 1 - - 0 - - -62 - - - 2 - :) can store data of arbitrary types, using the (:link - 1 - - 0 - - -17 - - - 2 - :) wrapper and (:link - 1 - - 0 - - -39 - - - 2 - mod="/":). To retrieve data from a boost::(:link - 1 - - 0 - - -62 - - - 2 - :) object, use the (:link - 1 - - 0 - - -36 - - - 2 - :) function template. - - - - - 0 - - -63 - - - - 1 - 2 - (:auto !!!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -64 - - - - 1 - 2 - (:auto !!:) (:pagelist tags="hpp" except_tags="noindex":) - - - - - 0 - - -32 + -55 @@ -10570,7 +9859,7 @@ 0 - -62 + -36 2 @@ -10579,7 +9868,7 @@ 0 - -44 + -63 2 @@ -10588,7 +9877,7 @@ 0 - -62 + -36 2 @@ -10606,7 +9895,7 @@ 0 - -17 + -8 2 @@ -10615,7 +9904,7 @@ 0 - -17 + -8 2 @@ -10624,7 +9913,7 @@ 0 - -17 + -8 2 @@ -10633,7 +9922,7 @@ 0 - -44 + -63 2 @@ -10642,7 +9931,7 @@ 0 - -44 + -63 2 @@ -10651,7 +9940,7 @@ 0 - -62 + -36 2 @@ -10660,7 +9949,7 @@ 0 - -39 + -33 2 @@ -10669,7 +9958,7 @@ 0 - -62 + -36 2 @@ -10678,7 +9967,7 @@ 0 - -50 + -51 2 @@ -10689,31 +9978,544 @@ 0 - -65 + -56 5 2 - (:auto !!!:) (:include synopsis:) This type is designed to be used as a standard + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link 1 0 - -17 + -36 2 - instance for transporting a relevant FILE pointer managed by a boost::shared_ptr<FILE> in exceptions deriving from boost:: + :), or a type that derives (indirectly) from boost::(:link 1 0 - -62 + -36 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 + + -57 + + + + 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 + + -36 + + + 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 + + -36 + + + 2 + :) { }; struct io_error: virtual exception_base { }; struct file_read_error: virtual io_error { }; typedef boost::(:link + 1 + + 0 + + -8 + + + 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 + + -33 + + + 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 + + -36 + + + 2 + :): [@typedef boost::(:link + 1 + + 0 + + -8 + + + 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 + + -36 + + + 2 + :) do_something(); .... } else throw file_open_error() (:link + 1 + + 0 + + -33 + + + 2 + |<<:) errno_code(errno); } catch( boost::(:link + 1 + + 0 + + -36 + + + 2 + :) & e ) { e (:link + 1 + + 0 + + -33 + + + 2 + |<<:) file_name("foo.txt"); throw; }@] Finally here is how the handler retrieves data from exceptions that derive from boost::(:link + 1 + + 0 + + -36 + + + 2 + :): [@catch( io_error & e ) { std::cerr << "I/O Error!\n"; if( std::string const * fn=(:link + 1 + + 0 + + -34 + + + 2 + :)<file_name>(e) ) std::cerr << "File name: " << *fn << "\n"; if( int const * c=(:link + 1 + + 0 + + -34 + + + 2 + :)<errno_code>(e) ) std::cerr << "OS says: " << strerror(*c) << "\n"; }@] In addition, boost::(:link + 1 + + 0 + + -10 + + + 2 + :) can be used to compose an automatic (if not user-friendly) message that contains all of the (:link + 1 + + 0 + + -8 + + + 2 + :) objects added to a boost::(:link + 1 + + 0 + + -36 + + + 2 + :). This is useful for inclusion in logs and other diagnostic objects. + + + + + 0 + + -58 + + + + 7 + 2 + (:auto !!!:) Deriving from boost::(:link + 1 + + 0 + + -36 + + + 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 + + -36 + + + 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 + + -36 + + + 2 + :) { }; struct io_error: virtual exception_base { }; struct file_error: virtual io_error { }; struct read_error: virtual io_error { }; struct file_read_error: virtual file_error, virtual read_error { };@] Using this approach, exception types become a simple tagging system for categorizing errors and selecting failures in exception handlers. + + + + + 0 + + -59 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -60 + + + + 19 + 2 + (:auto !!:) Boost Exception responds to the following configuration macros: '''BOOST_NO_RTTI'''\\ '''BOOST_NO_TYPEID''' The first macro prevents Boost Exception from using dynamic_cast and dynamic typeid. If the second macro is also defined, Boost Exception does not use static typeid either. There are no observable degrading effects on the library functionality, except for the following: ->By default, the (:link + 1 + + 0 + + -34 + + + 2 + :) function template can be called with any exception type. If BOOST_NO_RTTI is defined, (:link + 1 + + 0 + + -34 + + + 2 + :) can be used only with objects of type boost::(:link + 1 + + 0 + + -36 + + + 2 + :). !!!!Note: The library needs RTTI functionality. Disabling the language RTTI support enables an internal RTTI system, which may have more or less overhead depending on the platform. '''BOOST_EXCEPTION_DISABLE''' By default, (:link + 1 + + 0 + + -61 + + + 2 + :) and (:link + 1 + + 0 + + -63 + + + 2 + :) are integrated directly in the (:link + 1 + + 0 + + -69 + + + 2 + :) function. Defining BOOST_EXCEPTION_DISABLE disables this integration. Note that on some non-conformant compilers, for example MSVC 7.0 and older, as well as BCC, BOOST_EXCEPTION_DISABLE is implicitly defined in (:link + 1 + + 0 + + -22 + + + 2 + :). '''BOOST_NO_EXCEPTIONS''' This macro disables exception handling in Boost, forwarding all exceptions to a user-defined non-template version of boost:: + 1 + + 0 + + -69 + + + 2 + . However, unless BOOST_EXCEPTION_DISABLE is also defined, users can still examine the exception object for any data added at the point of the throw, or use boost:: + 1 + + 0 + + -10 + + + 2 + (of course under BOOST_NO_EXCEPTIONS, the user-defined boost::throw_exception is not allowed to return to the caller.) + + + + + 0 + + -61 + + + + 21 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: * T must be a class with an accessible no-throw copy constructor. * If T has any virtual base types, those types must have an accessible default constructor. !!!!Returns: An object of ''unspecified'' type which derives publicly from T. That is, the returned object can be intercepted by a catch(T &). !!!!Description: This function is designed to be used directly in a throw-expression to enable the (:link + 1 + + 0 + + -70 + + + 2 + :) support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link + 1 + + 0 + + -61 + + + 2 + :)(my_exception());@] Unless (:link + 1 + + 0 + + -61 + + + 2 + :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link + 1 + + 0 + + -6 + + + 2 + :) may return an (:link + 1 + + 0 + + -70 + + + 2 + :) which refers to an instance of (:link + 1 + + 0 + + -67 + + + 2 + :). See (:link + 1 + + 0 + + -6 + + + 2 + :) for details. !!!!Note: Instead of using the throw keyword directly, it is preferable to call boost::(:link + 1 + + 0 + + -69 + + + 2 + :). This is guaranteed to throw an exception that derives from boost::(:link + 1 + + 0 + + -36 + + + 2 + :) and supports the (:link + 1 + + 0 + + -70 + + + 2 + :) functionality. + + + + + 0 + + -62 + + + + 3 + 2 + (:auto !!!:) (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link + 1 + + 0 + + -36 + + + 2 + :) object. !!!!Throws: Nothing. + + + + + 0 + + -63 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: T must be a class with an accessible no-throw copy constructor as per (15.5.1). !!!!Returns: * If T derives from boost::(:link + 1 + + 0 + + -36 + + + 2 + :), the returned object is of type T and is a copy of x. * Otherwise, the returned object is of an unspecified type that derives publicly from both T and boost::(:link + 1 + + 0 + + -36 + + + 2 + :). The T sub-object is initialized from x by the T copy constructor. !!!!Throws: Nothing. + + + + + 0 + + -64 + + + + 7 + 2 + (:auto !!!:) (:include synopsis:) This macro takes an exception object, records BOOST_CURRENT_FUNCTION, __FILE__ and __LINE__ in it, and forwards it to + 1 + + 0 + + -69 + + + 2 + . To recover this information at the catch site, use + 1 + + 0 + + -34 + + + 2 + ; the information is also included in the message returned by + 1 + + 0 + + -10 + + + 2 + . + + + + + 0 + + -65 + + + + 1 + 2 + (:auto !!:) (:pagelist fmt="index" tags="function":) @@ -10726,25 +10528,25 @@ 5 2 - (:auto !!!:) (:include synopsis:) !!!!Definition: The expression + (:auto !!!:) (:include synopsis:) !!!!Description: Returns a const reference to the copy of the value passed to (:link 1 0 - -17 + -8 2 - <Tag,T>::(:link + :)'s constructor stored in the (:link 1 0 - -66 + -8 2 - mod="m":) evaluates to T. + :) object. !!!!Throws: Nothing. @@ -10757,25 +10559,25 @@ 5 2 - (:auto !!!:) (:include synopsis:) This type is designed to be used as a standard + (:auto !!!:) (:include synopsis:) This type is used by the (:link 1 0 - -17 + -70 2 - instance for transporting the name of a relevant API function (which does not use exceptions to report errors) in exceptions deriving from boost:: + :) support in Boost Exception. Please see (:link 1 0 - -62 + -6 2 - . + :). @@ -10799,54 +10601,81 @@ - 11 + 17 2 - (:auto !!!:) Here is how cloning can be enabled in a throw-expression (15.1): [@#include <(:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must derive publicly from std::exception. !!!!Effects: * If BOOST_NO_EXCEPTIONS is not defined, boost::(:link 1 0 - -11 + -69 2 - :)> #include <stdio.h> #include <errno.h> typedef boost::error_info<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link + :)(e) is equivalent to throw boost::(:link 1 0 - -62 + -61 2 - :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::(:link + :)(boost::(:link 1 0 - -48 + -63 2 - :)(file_read_error()) << errno_info(errno); }@] Of course, (:link + :)(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::(:link 1 0 - -48 + -69 2 - :) may be used with any exception type; there is no requirement that it should derive from boost::(:link + :)(e) is equivalent to throw e; * If BOOST_NO_EXCEPTIONS is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of (:link 1 0 - -62 + -69 2 - :). + :) are allowed to assume that the function never returns; therefore, if the user-defined (:link + 1 + + 0 + + -69 + + + 2 + :) returns, the behavior is undefined. !!!!Note: Under BOOST_NO_EXCEPTIONS, unless BOOST_EXCEPTION_DISABLE is also defined, users can examine the passed exception object using boost:: + 1 + + 0 + + -34 + + + 2 + , or format an automatic diagnostic message using boost:: + 1 + + 0 + + -10 + + + 2 + . @@ -10857,9 +10686,117 @@ - 1 + 25 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!!:) (:include synopsis:) The (:link + 1 + + 0 + + -70 + + + 2 + :) type can be used to refer to a copy of an exception object. It is Default Constructible, Copy Constructible, Assignable and Equality Comparable; (:link + 1 + + 0 + + -70 + + + 2 + :)'s operations do not throw. The referenced object remains valid at least as long as there is an (:link + 1 + + 0 + + -70 + + + 2 + :) object that refers to it. Two instances of (:link + 1 + + 0 + + -70 + + + 2 + :) are equivalent and compare equal if and only if they refer to the same exception. The default constructor of (:link + 1 + + 0 + + -70 + + + 2 + :) produces the null value of the type. The null value is equivalent only to itself. !!!!Thread safety * It is legal for multiple threads to hold (:link + 1 + + 0 + + -70 + + + 2 + :) references to the same exception object. * It is illegal for multiple threads to modify the same (:link + 1 + + 0 + + -70 + + + 2 + :) object concurrently. * While calling (:link + 1 + + 0 + + -6 + + + 2 + :) makes a copy of the current exception object, it is still possible for the two copies to share internal state. Therefore, in general it is not safe to call (:link + 1 + + 0 + + -48 + + + 2 + :) concurrently to throw the same exception object into multiple threads. !!!!Nesting of exceptions: An (:link + 1 + + 0 + + -70 + + + 2 + :) can be added as (:link + 1 + + 0 + + -8 + + + 2 + :) to any boost::(:link + 1 + + 0 + + -36 + + + 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. @@ -10870,27 +10807,171 @@ - 5 + 37 2 - (:auto !!!:) (:include synopsis:) This type is designed to be used as a standard + (:auto !!!:) When you catch an exception, you can call (:link 1 0 - -17 + -6 2 - instance for transporting a relevant file name in exceptions deriving from boost:: + :) to get an (:link 1 0 - -62 + -70 2 - . + :) object: [@#include <(:link + 1 + + 0 + + -21 + + + 2 + :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link + 1 + + 0 + + -36 + + + 2 + :)s void worker_thread( boost::(:link + 1 + + 0 + + -70 + + + 2 + :) & error ) { try { do_work(); error = boost::(:link + 1 + + 0 + + -70 + + + 2 + :)(); } catch( ... ) { error = boost::(:link + 1 + + 0 + + -6 + + + 2 + :)(); } }@] In the above example, note that (:link + 1 + + 0 + + -6 + + + 2 + :) captures the original type of the exception object. The exception can be thrown again using the (:link + 1 + + 0 + + -48 + + + 2 + :) function: [@// ...continued void work() { boost::(:link + 1 + + 0 + + -70 + + + 2 + :) error; boost::(:link http://www.boost.org/doc/html/boost/thread.html|thread:) t( boost::(:link http://www.boost.org/libs/bind/bind.html|bind:)(worker_thread,boost::(:link http://www.boost.org/doc/html/ref.html|ref:)(error)) ); t.(:link http://www.boost.org/doc/html/boost/thread.html|join:)(); if( error ) boost::(:link + 1 + + 0 + + -48 + + + 2 + :)(error); }@] Note that (:link + 1 + + 0 + + -6 + + + 2 + :) could fail to copy the original exception object in the following cases: * if there is not enough memory, in which case the returned (:link + 1 + + 0 + + -70 + + + 2 + :) points to an instance of std::bad_alloc, or * if (:link + 1 + + 0 + + -61 + + + 2 + :) was not used in the throw-expression passed to the original throw statement and the current implementation does not have the necessary compiler-specific support to copy the exception automatically, in which case the returned (:link + 1 + + 0 + + -70 + + + 2 + :) points to an instance of (:link + 1 + + 0 + + -67 + + + 2 + :). Regardless, the use of (:link + 1 + + 0 + + -6 + + + 2 + :) and (:link + 1 + + 0 + + -48 + + + 2 + :) in the above examples is well-formed. @@ -10908,7 +10989,7 @@ 0 - -17 + -8 2 @@ -10917,7 +10998,7 @@ 0 - -62 + -36 2 @@ -10939,7 +11020,7 @@ 0 - -17 + -8 2 @@ -10948,7 +11029,7 @@ 0 - -62 + -36 2 @@ -11093,9 +11174,7 @@ - 1 - 2 - !!!!Throws: Any exception emitted by v's copy constructor. + 0 @@ -11300,7 +11379,7 @@ 0 - -34 + -31 @@ -11311,7 +11390,31 @@ 0 - -31 + -32 + + + + 0 + + + + + 0 + + -33 + + + + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. + + + + + 0 + + -34 @@ -11340,17 +11443,6 @@ 0 - - - 0 - - -33 - - - - 0 - - 0 @@ -11383,7 +11475,7 @@ 1 2 - !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. + !!!!Throws: Any exception emitted by v's copy constructor. @@ -11471,9 +11563,7 @@ - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. + 0 @@ -11572,7 +11662,9 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. @@ -11663,17 +11755,6 @@ 0 - - - 0 - - -32 - - - - 0 - - 0 @@ -11830,16 +11911,16 @@ 3 2 - `#include <(:link + [@#include < 1 0 - -25 + -50 2 - :)> [@namespace boost { (:include decl:) }@] + > namespace boost { (:include api pre_indent="4":) }@] @@ -11850,7 +11931,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -21 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -11861,18 +11953,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -46 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -11885,16 +11966,16 @@ 3 2 - [@#include < + `#include <(:link 1 0 - -11 + -38 2 - > #include <boost/tuple/tuple.hpp> namespace boost { (:include api pre_indent="4":) }@] + :)> [@namespace boost { (:include def pre_indent="4":) }@] @@ -11905,7 +11986,18 @@ - 0 + 3 + 2 + [@#include < + 1 + + 0 + + -59 + + + 2 + > namespace boost { (:include api pre_indent="4":) }@] @@ -11923,11 +12015,11 @@ 0 - -46 + -45 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] @@ -11940,16 +12032,16 @@ 3 2 - [@#include <(:link + [@#include < 1 0 - -56 + -38 2 - :)> namespace boost { (:include api pre_indent="4":) }@] + > #include <boost/tuple/tuple.hpp> namespace boost { (:include api pre_indent="4":) }@] @@ -11960,18 +12052,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -11 - - - 2 - :)> [@(:include decl:)@] + 0 @@ -11982,7 +12063,9 @@ - 0 + 1 + 2 + [@namespace boost { (:include api pre_indent="4":) }@] @@ -12028,16 +12111,16 @@ 3 2 - `#include <(:link + [@#include < 1 0 - -11 + -59 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] + > #include <string> namespace boost { (:include api pre_indent="4":) }@] @@ -12055,11 +12138,11 @@ 0 - -68 + -21 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -12072,16 +12155,16 @@ 3 2 - [@#include < + `#include <(:link 1 0 - -56 + -45 2 - > namespace boost { (:include api pre_indent="4":) }@] + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] @@ -12092,7 +12175,18 @@ - 0 + 3 + 2 + [@#include < + 1 + + 0 + + -59 + + + 2 + > #include <string> namespace boost { (:include api pre_indent="4":) }@] @@ -12105,16 +12199,16 @@ 3 2 - [@#include < + [@#include <(:link 1 0 - -34 + -50 2 - > namespace boost { (:include api pre_indent="4":) }@] + :)> namespace boost { (:include api pre_indent="4":) }@] @@ -12125,7 +12219,9 @@ - 0 + 1 + 2 + (:include api:) @@ -12138,16 +12234,16 @@ 3 2 - `#include < + `#include <(:link 1 0 - -52 + -38 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] + :)> [@(:include decl:)@] @@ -12160,16 +12256,16 @@ 3 2 - `#include <(:link + [@#include < 1 0 - -68 + -59 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + > #include <errno.h> namespace boost { (:include api pre_indent="4":) }@] @@ -12180,9 +12276,7 @@ - 1 - 2 - (:include api:) + 0 @@ -12204,18 +12298,7 @@ - 3 - 2 - `#include < - 1 - - 0 - - -46 - - - 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -12233,11 +12316,11 @@ 0 - -34 + -59 2 - > #include <errno.h> namespace boost { (:include api pre_indent="4":) }@] + > namespace boost { (:include api pre_indent="4":) }@] @@ -12248,18 +12331,27 @@ - 3 + 5 2 - `#include <(:link + `#include < 1 0 - -11 + -17 2 - :)> [@(:include decl:)@] + > (:include + 1 + + 0 + + -17 + + + 2 + synopsis:) @@ -12277,24 +12369,77 @@ 0 - -34 + -31 - 1 - 2 - [@namespace boost { (:include api pre_indent="4":) }@] + 0 0 - -31 + -32 - 0 + 5 + 2 + `#include < + 1 + + 0 + + -76 + + + 2 + > (:include + 1 + + 0 + + -76 + + + 2 + synopsis:) + + + + + 0 + + -33 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -38 + + + 2 + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -34 + + + + 1 + 2 + [@namespace boost { (:include decl pre_indent="4":) }@] @@ -12316,20 +12461,18 @@ - 1 + 3 2 - [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -33 - - - - 0 + `#include <(:link + 1 + + 0 + + -50 + + + 2 + :)> [@namespace boost { (:include def pre_indent="4":) }@] @@ -12342,16 +12485,16 @@ 3 2 - `#include < + [@#include < 1 0 - -25 + -50 2 - > (:include decl:) + > namespace boost { (:include api pre_indent="4":) }@] @@ -12362,7 +12505,18 @@ - 0 + 3 + 2 + [@#include <(:link + 1 + + 0 + + -50 + + + 2 + :)> namespace boost { (:include api pre_indent="4":) }@] @@ -12380,11 +12534,11 @@ 0 - -11 + -38 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + :)> [@(:include decl:)@] @@ -12406,9 +12560,27 @@ - 1 + 5 2 - [@#include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] + `#include < + 1 + + 0 + + -28 + + + 2 + > (:include + 1 + + 0 + + -28 + + + 2 + synopsis:) @@ -12419,27 +12591,7 @@ - 5 - 2 - `#include < - 1 - - 0 - - -70 - - - 2 - > (:include - 1 - - 0 - - -70 - - - 2 - synopsis:) + 0 @@ -12449,28 +12601,6 @@ -43 - - 3 - 2 - `#include <(:link - 1 - - 0 - - -46 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -44 - - 3 2 @@ -12479,13 +12609,44 @@ 0 - -19 + -13 2 > [@namespace boost { (:include decl pre_indent="4":) }@] + + + 0 + + -44 + + + + 5 + 2 + `#include < + 1 + + 0 + + -9 + + + 2 + > (:include + 1 + + 0 + + -9 + + + 2 + synopsis:) + + 0 @@ -12494,7 +12655,18 @@ - 0 + 3 + 2 + [@#include <string> namespace boost { (:include + 1 + + 0 + + -36 + + + 2 + decl pre_indent="4":) (:include api pre_indent="4":) }@] @@ -12507,16 +12679,16 @@ 3 2 - [@#include <(:link + `#include < 1 0 - -56 + -21 2 - :)> namespace boost { (:include api pre_indent="4":) }@] + > [@namespace boost { (:include decl pre_indent="4":) }@] @@ -12527,27 +12699,7 @@ - 5 - 2 - `#include <(:link - 1 - - 0 - - -8 - - - 2 - :)> [@namespace boost { (:include - 1 - - 0 - - -47 - - - 2 - decl pre_indent="4":) }@] + 0 @@ -12560,16 +12712,16 @@ 3 2 - `#include < + `#include <(:link 1 0 - -63 + -21 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -12580,7 +12732,27 @@ - 0 + 5 + 2 + `#include < + 1 + + 0 + + -20 + + + 2 + > (:include + 1 + + 0 + + -20 + + + 2 + synopsis:) @@ -12591,7 +12763,9 @@ - 0 + 1 + 2 + [@namespace boost { (:include api pre_indent="4":) }@] @@ -12613,9 +12787,7 @@ - 1 - 2 - [@namespace boost { (:include api pre_indent="4":) }@] + 0 @@ -12637,18 +12809,7 @@ - 3 - 2 - [@#include < - 1 - - 0 - - -34 - - - 2 - > #include <string> namespace boost { (:include api pre_indent="4":) }@] + 0 @@ -12659,27 +12820,7 @@ - 5 - 2 - `#include < - 1 - - 0 - - -54 - - - 2 - > (:include - 1 - - 0 - - -54 - - - 2 - synopsis:) + 0 @@ -12690,9 +12831,27 @@ - 1 + 5 2 - [@namespace boost { (:include api pre_indent="4":) }@] + `#include <(:link + 1 + + 0 + + -11 + + + 2 + :)> [@namespace boost { (:include + 1 + + 0 + + -56 + + + 2 + decl pre_indent="4":) }@] @@ -12725,18 +12884,9 @@ - 3 + 1 2 - `#include <(:link - 1 - - 0 - - -46 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + [@namespace boost { (:include api pre_indent="4":) }@] @@ -12747,18 +12897,7 @@ - 3 - 2 - [@#include < - 1 - - 0 - - -34 - - - 2 - > #include <string> namespace boost { (:include api pre_indent="4":) }@] + 0 @@ -12771,16 +12910,16 @@ 3 2 - `#include <(:link + `#include < 1 0 - -46 + -37 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + > [@namespace boost { (:include decl pre_indent="4":) }@] @@ -12791,18 +12930,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -56 - - - 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] + 0 @@ -12815,16 +12943,16 @@ 3 2 - [@#include < + `#include < 1 0 - -56 + -5 2 - > namespace boost { (:include api pre_indent="4":) }@] + > [@namespace boost { (:include decl pre_indent="4":) }@] @@ -12835,18 +12963,18 @@ - 0 - - - - - 0 - - -32 - - - - 0 + 3 + 2 + `#include < + 1 + + 0 + + -22 + + + 2 + > (:include decl:) @@ -12857,27 +12985,7 @@ - 5 - 2 - `#include < - 1 - - 0 - - -76 - - - 2 - > (:include - 1 - - 0 - - -76 - - - 2 - synopsis:) + 0 @@ -12895,7 +13003,7 @@ 0 - -11 + -38 2 @@ -12910,9 +13018,9 @@ - 5 + 3 2 - `#include < + `#include <(:link 1 0 @@ -12921,16 +13029,7 @@ 2 - > (:include - 1 - - 0 - - -21 - - - 2 - synopsis:) + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -12941,18 +13040,9 @@ - 3 + 1 2 - [@#include <string> namespace boost { (:include - 1 - - 0 - - -62 - - - 2 - decl pre_indent="4":) (:include api pre_indent="4":) }@] + [@#include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] @@ -12963,7 +13053,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -22 + + + 2 + :)> [@namespace boost { (:include decl:) }@] @@ -12976,16 +13077,16 @@ 3 2 - [@#include < + `#include <(:link 1 0 - -34 + -21 2 - > namespace boost { (:include api pre_indent="4":) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -12996,27 +13097,7 @@ - 5 - 2 - `#include < - 1 - - 0 - - -60 - - - 2 - > (:include - 1 - - 0 - - -60 - - - 2 - synopsis:) + 0 @@ -13034,7 +13115,7 @@ 0 - -28 + -24 2 @@ -13043,7 +13124,7 @@ 0 - -28 + -24 2 @@ -13096,7 +13177,7 @@ 0 - -34 + -59 2 @@ -13131,7 +13212,7 @@ 0 - -34 + -59 2 @@ -13235,10 +13316,16 @@ -30 - -34 + -31 - -31 + -32 + + + -33 + + + -34 -35 @@ -13246,9 +13333,6 @@ -36 - - -33 - -37 @@ -13333,9 +13417,6 @@ -64 - - -32 - -65 @@ -13377,6 +13458,40 @@ 72 + + + + + 0 + + + + + + 1 + + + + -52 + + + + + + + 0 + + + + + + 1 + + + + -42 + + @@ -13408,7 +13523,7 @@ - -53 + -15 @@ -13425,7 +13540,7 @@ - -50 + -5 @@ -13442,7 +13557,7 @@ - -13 + -37 @@ -13459,126 +13574,7 @@ - -19 - - - - - - - 0 - - - - - - 1 - - - - -63 - - - - - - - 0 - - - - - - 1 - - - - -30 - - - - - - - 0 - - - - - - 1 - - - - -16 - - - - - - - 0 - - - - - - 1 - - - - -31 - - - - - - - 0 - - - - - - 1 - - - - -33 - - - - - - - 0 - - - - - - 1 - - - - -26 - - - - - - - 0 - - - - - - 1 - - - - -64 + -57 @@ -13598,6 +13594,23 @@ -14 + + + + + 0 + + + + + + 1 + + + + -58 + + @@ -13629,7 +13642,75 @@ - -6 + -65 + + + + + + + 0 + + + + + + 1 + + + + -31 + + + + + + + 0 + + + + + + 1 + + + + -25 + + + + + + + 0 + + + + + + 1 + + + + -30 + + + + + + + 0 + + + + + + 1 + + + + -7 @@ -13653,7 +13734,7 @@ - -68 + -45 @@ -13677,7 +13758,7 @@ - -46 + -21 @@ -13701,7 +13782,7 @@ - -60 + -17 @@ -13753,7 +13834,7 @@ - -21 + -9 @@ -13781,7 +13862,7 @@ - -43 + -67 @@ -13809,7 +13890,7 @@ - -7 + -6 @@ -13837,7 +13918,7 @@ - -59 + -70 @@ -13865,7 +13946,7 @@ - -27 + -46 @@ -13893,7 +13974,7 @@ - -10 + -48 @@ -13921,7 +14002,7 @@ - -61 + -18 @@ -13945,31 +14026,7 @@ - -45 - - - - - - - 1 - 9E8DCE3BCF462A3A332DA70F61E46FA5C2AB791B95E33D3F2AF1307F53C84B1C - 1960675522 - 6483 - 591 - - - - - - 0 - ../../example/example_io.cpp - 0 - 0 - - - - -15 + -71 @@ -13997,7 +14054,7 @@ - -55 + -49 @@ -14025,7 +14082,7 @@ - -12 + -39 @@ -14053,7 +14110,7 @@ - -39 + -33 @@ -14077,7 +14134,55 @@ - -28 + -24 + + + + + + + 1 + 025A8CE0643CFC0EB812BD3EB89F8F410D91EC3467CC6F371E7215F25F590B27 + 2422739525 + 6071 + 412 + + + + + + 0 + ../../example/example_io.cpp + 0 + 0 + + + + -26 + + + + + + + 1 + 75EA7D29A2D365F947FE504A6AE38FA23FEA7031FDA3B6DA5DBBAA3D93794D30 + 1826787048 + 526 + 382 + + + + + + 0 + ../../example/error_info_1.cpp + 0 + 0 + + + + -54 @@ -14105,7 +14210,7 @@ - -23 + -43 @@ -14133,7 +14238,7 @@ - -36 + -34 @@ -14161,7 +14266,7 @@ - -65 + -32 @@ -14172,7 +14277,7 @@ 66E0BD9724AB83012F5B35D887E3313960DC0E69B94E0C03CA1F3C85A0D84A5C 2883671483 311 - 302 + 306 @@ -14185,7 +14290,7 @@ - -22 + -12 @@ -14213,7 +14318,7 @@ - -24 + -10 @@ -14237,7 +14342,7 @@ - -54 + -20 @@ -14317,7 +14422,7 @@ - -67 + -44 @@ -14341,7 +14446,7 @@ - -70 + -28 @@ -14369,7 +14474,7 @@ - -42 + -41 @@ -14397,7 +14502,7 @@ - -18 + -19 @@ -14429,23 +14534,23 @@ 1 - D10E536B909EFFF78FB09E6242AEC7C74ACDD75AE7DF32B45870422B752E5D8E - 1903336130 - 557 - 382 + FB3526A6A3A99CF87E766D0B34CEC3F8FB49228B2BFC54C3D56098778710397F + 3851746268 + 852 + 306 0 - ../../example/error_info_1.cpp + ../../example/error_info_2.cpp 0 0 - -58 + -40 @@ -14469,7 +14574,7 @@ - -52 + -13 @@ -14521,7 +14626,7 @@ - -17 + -8 @@ -14553,7 +14658,7 @@ - -66 + -23 @@ -14585,7 +14690,31 @@ - -29 + -66 + + + + + + + 1 + 4BF26702AE28644631FE5D0F726C9AD0877433607F35DE5F522D94F39BE2A2AB + 1734013977 + 733 + 363 + + + + + + 0 + ../../example/info_tuple.cpp + 0 + 0 + + + + -53 @@ -14613,7 +14742,7 @@ - -5 + -69 @@ -14645,7 +14774,7 @@ - -40 + -60 @@ -14669,7 +14798,7 @@ - -41 + -68 @@ -14693,7 +14822,7 @@ - -11 + -38 @@ -14717,7 +14846,7 @@ - -56 + -50 @@ -14745,7 +14874,7 @@ - -49 + -62 @@ -14773,7 +14902,7 @@ - -48 + -61 @@ -14801,7 +14930,7 @@ - -44 + -63 @@ -14829,7 +14958,7 @@ - -62 + -36 @@ -14861,7 +14990,7 @@ - -20 + -47 @@ -14885,7 +15014,7 @@ - -8 + -11 @@ -14909,31 +15038,7 @@ - -25 - - - - - - - 1 - 4ED9709788BBAB4DE7CF336561606B8C0B41F70877A3395F4EE026F4AEB66CC6 - 743998427 - 409 - 307 - - - - - - 0 - ../../example/cloning_1.cpp - 0 - 0 - - - - -69 + -22 @@ -14957,31 +15062,7 @@ - -37 - - - - - - - 1 - F4C951B28F7DE500973AA3DFAA99F2BADA6EDAFA2B406C30BEF3B7FBE6FD57D7 - 2263754923 - 982 - 306 - - - - - - 0 - ../../example/error_info_2.cpp - 0 - 0 - - - - -9 + -64 @@ -15009,7 +15090,7 @@ - -71 + -29 @@ -15033,7 +15114,7 @@ - -32 + -55 @@ -15061,7 +15142,7 @@ - -34 + -59 @@ -15089,31 +15170,7 @@ - -47 - - - - - - - 1 - E444EE9697EEADFDE0767E1D0242FC0E70D98E61FB1F0FFA099648DE509B82F3 - 94503238 - 773 - 374 - - - - - - 0 - ../../example/info_tuple.cpp - 0 - 0 - - - - -57 + -56 @@ -15137,7 +15194,31 @@ - -38 + -16 + + + + + + + 1 + 08D021CA79AEBFFD7EB5E272BEBACE3BDED36B949DA26DD1EAFB7723C24065FE + 3589963844 + 393 + 307 + + + + + + 0 + ../../example/cloning_1.cpp + 0 + 0 + + + + -27 @@ -15168,13 +15249,13 @@ -5 - free function + error_info 0 - -7 + -6 exception_ptr free function @@ -15186,16 +15267,7 @@ -8 - - - - - 0 - - -9 - - - noalso noindex tutorial + type @@ -15204,7 +15276,7 @@ -10 - exception_ptr free function + diagnostic_information free function @@ -15222,7 +15294,7 @@ -12 - function member + diagnostic_information tutorial @@ -15237,7 +15309,7 @@ 0 - -16 + -14 tutorial @@ -15246,70 +15318,7 @@ 0 - -17 - - - type - - - - 0 - - -18 - - - function - - - - 0 - - -19 - - - error_info - - - - 0 - - -20 - - - function - - - - 0 - - -22 - - - diagnostic_information tutorial - - - - 0 - - -23 - - - function - - - - 0 - - -24 - - - diagnostic_information free function - - - - 0 - - -25 + -15 @@ -15318,52 +15327,7 @@ 0 - -27 - - - type - - - - 0 - - -29 - - - function member - - - - 0 - - -34 - - - - - - - 0 - - -36 - - - error_info free function - - - - 0 - - -37 - - - macro - - - - 0 - - -38 + -16 noindex @@ -15372,61 +15336,25 @@ 0 - -39 + -18 - error_info free function + exception_ptr free function 0 - -41 + -19 - error_info + function 0 - -42 - - - type - - - - 0 - - -43 - - - exception_ptr type - - - - 0 - - -44 - - - error_info free function - - - - 0 - - -45 - - - noindex tutorial - - - - 0 - - -46 + -21 @@ -15435,11 +15363,173 @@ 0 - -47 + -22 + + + + + + + 0 + + -23 + + + type + + + + 0 + + -27 + + + noindex tutorial + + + + 0 + + -29 + + + type + + + + 0 + + -32 + + + type + + + + 0 + + -33 error_info free function + + + 0 + + -34 + + + error_info free function + + + + 0 + + -36 + + + type + + + + 0 + + -37 + + + exception_ptr + + + + 0 + + -38 + + + + + + + 0 + + -39 + + + function member + + + + 0 + + -40 + + + noalso noindex tutorial + + + + 0 + + -41 + + + type + + + + 0 + + -42 + + + tutorial + + + + 0 + + -43 + + + function + + + + 0 + + -44 + + + type + + + + 0 + + -45 + + + + + + + 0 + + -46 + + + type + + + + 0 + + -47 + + + function + 0 @@ -15456,7 +15546,7 @@ -49 - function + type @@ -15465,7 +15555,7 @@ -50 - tutorial + @@ -15474,7 +15564,7 @@ -51 - noindex + tutorial @@ -15483,7 +15573,7 @@ -52 - + noindex @@ -15492,7 +15582,16 @@ -53 - tutorial + noalso noindex tutorial + + + + 0 + + -54 + + + noalso noindex tutorial @@ -15501,7 +15600,7 @@ -55 - type + tutorial @@ -15510,25 +15609,7 @@ -56 - - - - - 0 - - -57 - - - noalso noindex tutorial - - - - 0 - - -58 - - - noalso noindex tutorial + error_info free function @@ -15537,7 +15618,7 @@ -59 - type + @@ -15555,7 +15636,7 @@ -62 - type + function @@ -15564,25 +15645,16 @@ -63 - exception_ptr + error_info free function 0 - -32 + -64 - tutorial - - - - 0 - - -65 - - - type + macro @@ -15591,7 +15663,7 @@ -66 - type + function member @@ -15600,7 +15672,7 @@ -67 - type + exception_ptr type @@ -15609,7 +15681,7 @@ -68 - + error_info @@ -15618,7 +15690,16 @@ -69 - noindex tutorial + free function + + + + 0 + + -70 + + + type @@ -15627,7 +15708,7 @@ -71 - type + noindex tutorial diff --git a/doc/tutorial_diagnostic_information.html b/doc/tutorial_diagnostic_information.html index 3f07df7..03fd4da 100644 --- a/doc/tutorial_diagnostic_information.html +++ b/doc/tutorial_diagnostic_information.html @@ -47,13 +47,13 @@ g() }

Example:

this is a possible output from the diagnostic_information function, as used in libs/exception/example/example_io.cpp:

-
example_io.cpp(83): Throw in function class boost::shared_ptr<struct _iobuf> __cdecl my_fopen(const char *,const char *)
+
example_io.cpp(70): Throw in function class boost::shared_ptr<struct _iobuf> __cdecl my_fopen(const char *,const char *)
 Dynamic exception type: class boost::exception_detail::clone_impl<class fopen_error>
 std::exception::what: example_io error
-[struct tag_errno *] = 2, OS says "No such file or directory"
-[struct tag_file_name *] = tmp1.txt
-[struct tag_function *] = fopen
-[struct tag_open_mode *] = rb
+[struct boost::errinfo_api_function_ *] = fopen +[struct boost::errinfo_errno_ *] = 2, "No such file or directory" +[struct boost::errinfo_file_name_ *] = tmp1.txt +[struct boost::errinfo_file_open_mode_ *] = rb

See Also:

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

#include <boost/exception/info.hpp>
+#include <boost/exception/errinfo_errno.hpp>
 #include <stdio.h>
 #include <errno.h>
 
-typedef boost::error_info<struct tag_errno,int> errno_info;
-
 class file_read_error: public boost::exception { };
 
 void
@@ -40,7 +39,7 @@ file_read( FILE * f, void * buffer, size_t size )
     {
     if( size!=fread(buffer,1,size,f) )
         throw boost::enable_current_exception(file_read_error()) <<
-            errno_info(errno);
+            boost::errinfo_errno(errno);
     }

Of course, enable_current_exception may be used with any exception type; there is no requirement that it should derive from boost::exception.

Cloning and Re-Throwing an Exception

diff --git a/doc/tutorial_transporting_data.html b/doc/tutorial_transporting_data.html index 0ab9f62..0d20ac3 100644 --- a/doc/tutorial_transporting_data.html +++ b/doc/tutorial_transporting_data.html @@ -29,24 +29,22 @@

Adding of Arbitrary Data at the Point of the Throw

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

-
#include <boost/exception.hpp>
-#include <errno.h>
+
#include <boost/exception/all.hpp>
 #include <iostream>
 
-typedef boost::error_info<struct tag_errno,int> errno_info; //(1)
+typedef boost::error_info<struct tag_my_info,int> my_info; //(1)
 
 class my_error: public boost::exception, public std::exception { }; //(2)
 
 void
 f()
     {
-    throw my_error() << errno_info(errno); //(3)
-    }
-
-

First, we instantiate the error_info template using a unique identifier -- tag_errno, and the type of the info it identifies -- int. This provides compile-time type safety for the various values stored in exception objects.

+ throw my_error() << my_info(42); //(3) + }
+

First, we instantiate the error_info template using a unique identifier -- tag_my_info, and the type of the info it identifies -- int. This provides compile-time type safety for the various values stored in exception objects.

Second, we define class my_error, which derives from boost::exception.

Finally, (3) illustrates how the typedef from (1) can be used with operator<< to store values in exception objects at the point of the throw.

-

The stored errno value can be recovered at a later time like this:

+

The stored my_info value can be recovered at a later time like this:

// ...continued
 
 void
@@ -59,8 +57,8 @@ g()
     catch(
     my_error & x )
         {
-        if( int const * err=boost::get_error_info<errno_info>(x) )
-            std::cerr << "Error code: " << *err;
+        if( int const * mi=boost::get_error_info<my_info>(x) )
+            std::cerr << "My info: " << *mi;
         }
     }

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

@@ -75,28 +73,25 @@ file_read( FILE * f, void * buffer, size_t size ) }

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

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

-
#include <boost/exception.hpp>
+
boost/exception/all.hpp>
+#include <boost/shared_ptr.hpp>
 #include <stdio.h>
 #include <errno.h>
 
-typedef boost::error_info<struct tag_errno,int> errno_info;
-
 class file_read_error: public boost::exception { };
 
 void
 file_read( FILE * f, void * buffer, size_t size )
     {
     if( size!=fread(buffer,1,size,f) )
-        throw file_read_error() << errno_info(errno);
+        throw file_read_error() << boost::errinfo_errno(errno);
     }

If file_read detects a failure, it throws an exception which contains the information that is available at the time, namely the errno. Other relevant information, such as the file name, can be added in a context higher up the call stack, where it is known naturally:

-
#include <boost/exception.hpp>
+
#include <boost/exception/all.hpp>
 #include <boost/shared_ptr.hpp>
 #include <stdio.h>
 #include <string>
 
-typedef boost::error_info<struct tag_file_name,std::string> file_name_info;
-
 boost::shared_ptr<FILE> file_open( char const * file_name, char const * mode );
 void file_read( FILE * f, void * buffer, size_t size );
 
@@ -113,7 +108,7 @@ parse_file( char const * file_name )
     catch(
     boost::exception & e )
         {
-        e << file_name_info(file_name);
+        e << boost::errinfo_file_name(file_name);
         throw;
         }
     }
@@ -122,15 +117,15 @@ parse_file( char const * file_name )

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

#include <boost/exception/info_tuple.hpp>
+#include <boost/exception/errinfo_file_name.hpp>
+#include <boost/exception/errinfo_api_function.hpp>
+#include <boost/exception/errinfo_errno.hpp>
 #include <boost/shared_ptr.hpp>
 #include <stdio.h>
 #include <string>
 #include <errno.h>
 
-typedef boost::error_info<struct tag_file_name,std::string> file_name_info;
-typedef boost::error_info<struct tag_function,char const *> function_info;
-typedef boost::error_info<struct tag_errno,int> errno_info;
-typedef boost::tuple<function_info,errno_info> clib_failure;
+typedef boost::tuple<boost::errinfo_api_function,boost::errinfo_errno> clib_failure;
 
 class file_open_error: public boost::exception { };
 
@@ -141,7 +136,7 @@ file_open( char const * name, char const * mode )
         return boost::shared_ptr<FILE>(f,fclose);
     else
         throw file_open_error() <<
-            file_name_info(name) <<
+            boost::errinfo_file_name(name) <<
             clib_failure("fopen",errno);
     }

Note that the members of a boost::tuple are stored separately in exception objects; they can only be retrieved individually, using get_error_info.

diff --git a/example/cloning_1.cpp b/example/cloning_1.cpp index 4e23a62..356d741 100644 --- a/example/cloning_1.cpp +++ b/example/cloning_1.cpp @@ -6,11 +6,10 @@ //This example shows how to enable cloning when throwing a boost::exception. #include +#include #include #include -typedef boost::error_info errno_info; - class file_read_error: public boost::exception { }; void @@ -18,5 +17,5 @@ file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::enable_current_exception(file_read_error()) << - errno_info(errno); + boost::errinfo_errno(errno); } diff --git a/example/error_info_1.cpp b/example/error_info_1.cpp index 1b433cf..5ba0b58 100644 --- a/example/error_info_1.cpp +++ b/example/error_info_1.cpp @@ -6,18 +6,17 @@ //This example shows how to add data to boost::exception objects at the //point of the throw, and how to retrieve that data at the point of the catch. -#include -#include +#include #include -typedef boost::error_info errno_info; //(1) +typedef boost::error_info my_info; //(1) class my_error: public boost::exception, public std::exception { }; //(2) void f() { - throw my_error() << errno_info(errno); //(3) + throw my_error() << my_info(42); //(3) } void @@ -30,7 +29,7 @@ g() catch( my_error & x ) { - if( int const * err=boost::get_error_info(x) ) - std::cerr << "Error code: " << *err; + if( int const * mi=boost::get_error_info(x) ) + std::cerr << "My info: " << *mi; } } diff --git a/example/error_info_2.cpp b/example/error_info_2.cpp index 3234256..a086c25 100644 --- a/example/error_info_2.cpp +++ b/example/error_info_2.cpp @@ -5,28 +5,24 @@ //This example shows how to add arbitrary data to active exception objects. -#include +#include #include #include #include // -typedef boost::error_info errno_info; - class file_read_error: public boost::exception { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) - throw file_read_error() << errno_info(errno); + throw file_read_error() << boost::errinfo_errno(errno); } // -typedef boost::error_info file_name_info; - boost::shared_ptr file_open( char const * file_name, char const * mode ); void file_read( FILE * f, void * buffer, size_t size ); @@ -43,7 +39,7 @@ parse_file( char const * file_name ) catch( boost::exception & e ) { - e << file_name_info(file_name); + e << boost::errinfo_file_name(file_name); throw; } } diff --git a/example/example_io.cpp b/example/example_io.cpp index 3befc46..53d8b1d 100644 --- a/example/example_io.cpp +++ b/example/example_io.cpp @@ -3,16 +3,17 @@ //Distributed under the Boost Software License, Version 1.0. (See accompanying //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -//This program simulates errors on copying simple data files. -//It demonstrates how the proposed Boost exception library can be used. -// -//The documentation for boost::exception can be found at: -// -// http://www.revergestudios.com/boost-exception/boost-exception.htm. -// -//The output from this program can vary depending on the compiler/OS combination. +//This program simulates errors on copying simple data files. It demonstrates +//typical Boost Exception usage. + +//The output from this program can vary depending on the platform. #include +#include +#include +#include +#include +#include #include #include #include @@ -21,22 +22,8 @@ #include #include -typedef boost::error_info errno_info; -typedef boost::error_info > file_stream_info; -typedef boost::error_info open_mode_info; //The open mode of a failed fopen request. -typedef boost::error_info file_name_info; //The file name of a failed file operation. -typedef boost::error_info file_name_src_info; //The source file name of a failed copy operation. -typedef boost::error_info file_name_dst_info; //The destination file name of a failed copy operation. -typedef boost::error_info function_info; //The name of the C function which reported the failure. - -std::string -to_string( errno_info const & e ) - { - int en=e.value(); - std::ostringstream s; - s << en << ", OS says \"" << strerror(en) << "\""; - return s.str(); - } +typedef boost::error_info errinfo_src_file_name; +typedef boost::error_info errinfo_dst_file_name; char const data[] = "example"; size_t const data_size = sizeof(data); @@ -77,10 +64,10 @@ my_fopen( char const * name, char const * mode ) return boost::shared_ptr(f,fclose); else BOOST_THROW_EXCEPTION(fopen_error() << - errno_info(errno) << - file_name_info(name) << - open_mode_info(mode) << - function_info("fopen")); + boost::errinfo_errno (errno) << + boost::errinfo_file_name(name) << + boost::errinfo_file_open_mode(mode) << + boost::errinfo_api_function("fopen")); } void @@ -89,9 +76,9 @@ my_fread( void * buffer, size_t size, size_t count, boost::shared_ptr cons assert(stream); if( count!=fread(buffer,size,count,stream.get()) || ferror(stream.get()) ) BOOST_THROW_EXCEPTION(fread_error() << - function_info("fread") << - errno_info(errno) << - file_stream_info(boost::weak_ptr(stream))); + boost::errinfo_api_function("fread") << + boost::errinfo_errno(errno) << + boost::errinfo_file_handle(boost::weak_ptr(stream))); } void @@ -100,9 +87,9 @@ my_fwrite( void const * buffer, size_t size, size_t count, boost::shared_ptr(stream))); + boost::errinfo_api_function("fwrite") << + boost::errinfo_errno(errno) << + boost::errinfo_file_handle(boost::weak_ptr(stream))); } void @@ -132,17 +119,17 @@ copy_data( char const * src_file_name, char const * dst_file_name ) catch( boost::exception & x ) { - if( boost::weak_ptr const * f=boost::get_error_info(x) ) + if( boost::weak_ptr const * f=boost::get_error_info(x) ) if( boost::shared_ptr fs = f->lock() ) { if( fs==src ) - x << file_name_info(src_file_name); + x << boost::errinfo_file_name(src_file_name); else if( fs==dst ) - x << file_name_info(dst_file_name); + x << boost::errinfo_file_name(dst_file_name); } x << - file_name_src_info(src_file_name) << - file_name_dst_info(dst_file_name); + errinfo_src_file_name(src_file_name) << + errinfo_dst_file_name(dst_file_name); throw; } } @@ -150,25 +137,25 @@ copy_data( char const * src_file_name, char const * dst_file_name ) void dump_copy_info( boost::exception const & x ) { - if( std::string const * src = boost::get_error_info(x) ) + if( std::string const * src = boost::get_error_info(x) ) std::cerr << "Source file name: " << *src << "\n"; - if( std::string const * dst = boost::get_error_info(x) ) + if( std::string const * dst = boost::get_error_info(x) ) std::cerr << "Destination file name: " << *dst << "\n"; } void dump_file_info( boost::exception const & x ) { - if( std::string const * fn = boost::get_error_info(x) ) + if( std::string const * fn = boost::get_error_info(x) ) std::cerr << "File name: " << *fn << "\n"; } void dump_clib_info( boost::exception const & x ) { - if( int const * err=boost::get_error_info(x) ) + if( int const * err=boost::get_error_info(x) ) std::cerr << "OS error: " << *err << "\n"; - if( std::string const * fn=boost::get_error_info(x) ) + if( char const * const * fn=boost::get_error_info(x) ) std::cerr << "Failed function: " << *fn << "\n"; } diff --git a/example/info_tuple.cpp b/example/info_tuple.cpp index de19c44..0664e73 100644 --- a/example/info_tuple.cpp +++ b/example/info_tuple.cpp @@ -3,19 +3,19 @@ //Distributed under the Boost Software License, Version 1.0. (See accompanying //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -//This example shows how boost::error_info_group can be used to bundle -//the name of the function that fails together with the reported errno. +//This example shows how boost::tuple can be used to bundle the +//name of the function that fails together with the reported errno. #include +#include +#include +#include #include #include #include #include -typedef boost::error_info file_name_info; -typedef boost::error_info function_info; -typedef boost::error_info errno_info; -typedef boost::tuple clib_failure; +typedef boost::tuple clib_failure; class file_open_error: public boost::exception { }; @@ -26,6 +26,6 @@ file_open( char const * name, char const * mode ) return boost::shared_ptr(f,fclose); else throw file_open_error() << - file_name_info(name) << + boost::errinfo_file_name(name) << clib_failure("fopen",errno); } diff --git a/example/logging.cpp b/example/logging.cpp index e01d946..c1b51e7 100644 --- a/example/logging.cpp +++ b/example/logging.cpp @@ -3,7 +3,7 @@ //Distributed under the Boost Software License, Version 1.0. (See accompanying //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -//This example shows to print all data contained in a boost::exception. +//This example shows how to print all data contained in a boost::exception. #include #include