From 474ed15d35244acac758efd0b10d431be59c4793 Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Tue, 2 Sep 2008 23:20:49 +0000 Subject: [PATCH] documentation update [SVN r48554] --- doc/BOOST_THROW_EXCEPTION.html | 57 + doc/source/boost-exception.reno | 7956 +++++++++++++++---------------- 2 files changed, 4035 insertions(+), 3978 deletions(-) create mode 100644 doc/BOOST_THROW_EXCEPTION.html diff --git a/doc/BOOST_THROW_EXCEPTION.html b/doc/BOOST_THROW_EXCEPTION.html new file mode 100644 index 0000000..d96f297 --- /dev/null +++ b/doc/BOOST_THROW_EXCEPTION.html @@ -0,0 +1,57 @@ + + + + + BOOST_THROW_EXCEPTION + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

BOOST_THROW_EXCEPTION

+
+

#include <boost/throw_exception.hpp>

+
#if !defined( BOOST_NO_EXCEPTIONS ) && !defined( BOOST_EXCEPTION_DISABLE )
+    #include <boost/exception/exception.hpp>
+    #include <boost/current_function.hpp>
+    #define BOOST_THROW_EXCEPTION(x)\
+        ::boost::throw_exception( ::boost::enable_error_info(x) <<\
+        ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\
+        ::boost::throw_file(__FILE__) <<\
+        ::boost::throw_line((int)__LINE__) )
+#else
+    #define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x)
+#endif
+

This macro takes an exception object, records BOOST_CURRENT_FUNCTION, __FILE__ and __LINE__ in it, and forwards it to throw_exception. To recover this information at the catch site, use get_error_info; the information is also included in the message returned by diagnostic_information.

+
+ + + + +
+
+
+ + diff --git a/doc/source/boost-exception.reno b/doc/source/boost-exception.reno index 3927f07..1a46fa8 100644 --- a/doc/source/boost-exception.reno +++ b/doc/source/boost-exception.reno @@ -48,478 +48,6 @@ 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> - - - exception_error_info_value_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 6 - - 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 - - 7 - - reno_context - - - - - - - 2 - 86E1196533E771AEFD141DA43FCD980AE3D7689A45EDD54A2DF28B1943E0E7DB - 941210061 - 8706 - 487 - 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 - 2078296250 - 305 - 8138 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>copy_exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 8 - - reno_context - - - - - - - 2 - E86977BC88F0D950B8FD02FC853FFC0D7230B26376B908037F3F4AF429FD9A4D - 557160971 - 1522 - 433 - 25FBAAA29F300B32DF38832E0A102B8A4FAB726B5FAEE428B00DBD5D58D9BB16 - 3475582031 - 1039 - 477 - - - - - - 0 - ../../../../boost/exception/diagnostic_information.hpp - 0 - 0 - - - - - <string>diagnostic_information</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 9 - - reno_context - - - - - - - 2 - 50E48ABD58B427E16B2EFA345D5FE67159057CB90F19AA1AD52C11991FD8500E - 4076172629 - 8577 - 323 - DF9EA87B0140AACF4422F1B76F6A6A409C15F32858BBBA85A35981A824C56BA9 - 1137981799 - 192 - 8379 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>enable_current_exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 10 - - reno_context - - - - - - - 2 - 50E48ABD58B427E16B2EFA345D5FE67159057CB90F19AA1AD52C11991FD8500E - 4076172629 - 8577 - 323 - 2D32D2DE11DB8BDD6F34C94CC165ABEF4F4CCB2D119354FA05811534E2AF356F - 1002290201 - 1604 - 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 - - 11 - - reno_context - - - - - - - 1 - 17FF6C63843EE64ED66CB038DD95B4C4D6BA1B0FD36B27BEFD84A909161D2853 - 1237535165 - 231 - 1255 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - - <string>BOOST_THROW_EXCEPTION</string> - - - - - - - - - 1 - 2 - (:include include:) (:pagelist link="backlink":) - - - - - 0 - - 12 - - reno_context - - - - - - - 2 - 86E1196533E771AEFD141DA43FCD980AE3D7689A45EDD54A2DF28B1943E0E7DB - 941210061 - 8706 - 487 - 0E9DF8366080712A816BE91ABCEF1E2044145B63D75B0B995B537900F378189E - 1069696031 - 255 - 8445 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>rethrow_exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 13 - - reno_context - - - - - - - 1 - 50E48ABD58B427E16B2EFA345D5FE67159057CB90F19AA1AD52C11991FD8500E - 4076172629 - 8577 - 323 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>boost/exception/exception.hpp</string> - - - exception_exception_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 14 - - reno_context - - - - - - - 1 - 67D64FAD0AB7CA6B2173A14F363D19B27F59EEBDB5C1076F8BCCA1B54D4CCD7D - 2241687287 - 303 - 323 - - - - - - 0 - ../../../../boost/exception.hpp - 0 - 0 - - - - - <string>boost/exception.hpp</string> - - - exception_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 15 - - reno_context - @@ -565,7 +93,7 @@ 0 - 16 + 6 reno_context @@ -574,281 +102,41 @@ - 2 - 86E1196533E771AEFD141DA43FCD980AE3D7689A45EDD54A2DF28B1943E0E7DB - 941210061 - 8706 - 487 - 448B6444D4B3E46F822F56C14FDA3F6F96B869543EBA1E291C5E3D36F73AF24B - 2443226110 - 700 - 1496 + 1 + 187BFD2B78A0DD006717B5B06FFD465E2468F521C32A86FB793F7A68AB5417F3 + 4276724153 + 574 + 382 0 - ../../../../boost/exception_ptr.hpp + ../../example/error_info_1.cpp 0 0 - <string>unknown_exception</string> + <string>adding of arbitrary data at the point of the throw</string> - + adding_data_at_throw - 1 - 2 - (:include include:) (:auto also:) + 0 0 - 17 - - reno_context - - - - - - - 2 - 86E1196533E771AEFD141DA43FCD980AE3D7689A45EDD54A2DF28B1943E0E7DB - 941210061 - 8706 - 487 - F86EB07D04CD0D0645080D1121DA899746D0C45137E17E1D9BE605E75396F047 - 1983537541 - 1346 - 148 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>exception_ptr</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 18 - - reno_context - - - - - - - 2 - 86E1196533E771AEFD141DA43FCD980AE3D7689A45EDD54A2DF28B1943E0E7DB - 941210061 - 8706 - 487 - E23085202D084CBB50F289988A6A592F06D923B77D0AB25D7A98A7188DF5BE3B - 1414247481 - 766 - 7370 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>current_exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 19 - - reno_context - - - - - - - 2 - 50E48ABD58B427E16B2EFA345D5FE67159057CB90F19AA1AD52C11991FD8500E - 4076172629 - 8577 - 323 - B4D37C317A3B45825DDA1A8C8B1CE71CC2E530D15090D05995FCBEC4247F49C4 - 2742768198 - 258 - 6714 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>enable_error_info</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 20 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>transporting of arbitrary data to the catch site</string> - - - tutorial_transporting_data - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 21 - - reno_context - - - - - - - 2 - 80895C67727835F0DAB5F5EF65FB2FD9E64008528BD4B800119E88BFB914588F - 2505563498 - 3946 - 518 - 7108B78DA28F7485BBB4D649BEE943AF19A3D63C80DD03F927FDA7A6D8EE2F3B - 3042951402 - 778 - 26 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - - <string>error_info</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 22 + 7 reno_context @@ -897,6 +185,698 @@ (:include include:) (:auto also:) + + + 0 + + 8 + + reno_context + + + + + + + 1 + CAD6C404CB725D336A44920D2341ECA131149AB02C368B59028F8147F16737BF + 2258638601 + 94 + 227 + + + + + + 0 + ../../../../boost/exception/info_tuple.hpp + 0 + 0 + + + + + <string>boost/exception/info_tuple.hpp</string> + + + exception_error_info_group_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 9 + + reno_context + + + + + + + 2 + 50E48ABD58B427E16B2EFA345D5FE67159057CB90F19AA1AD52C11991FD8500E + 4076172629 + 8577 + 323 + 17E691632123EB67BA67D590B49EB8094F462F5A10A66A1C5438E1867EF1478E + 765399792 + 77 + 5326 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>exception::~exception</string> + + + exception_destructor + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 10 + + reno_context + + + + + + + 2 + 86E1196533E771AEFD141DA43FCD980AE3D7689A45EDD54A2DF28B1943E0E7DB + 941210061 + 8706 + 487 + 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 + 2078296250 + 305 + 8138 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>copy_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 11 + + reno_context + + + + + + + 2 + 50E48ABD58B427E16B2EFA345D5FE67159057CB90F19AA1AD52C11991FD8500E + 4076172629 + 8577 + 323 + 2D32D2DE11DB8BDD6F34C94CC165ABEF4F4CCB2D119354FA05811534E2AF356F + 1002290201 + 1604 + 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 + + 12 + + reno_context + + + + + + + 1 + 17FF6C63843EE64ED66CB038DD95B4C4D6BA1B0FD36B27BEFD84A909161D2853 + 1237535165 + 231 + 1255 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>BOOST_THROW_EXCEPTION</string> + + + + + + + + + 1 + 2 + (:include include:) (:pagelist link="backlink":) + + + + + 0 + + 13 + + reno_context + + + + + + + 2 + 50E48ABD58B427E16B2EFA345D5FE67159057CB90F19AA1AD52C11991FD8500E + 4076172629 + 8577 + 323 + DF9EA87B0140AACF4422F1B76F6A6A409C15F32858BBBA85A35981A824C56BA9 + 1137981799 + 192 + 8379 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>enable_current_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 14 + + reno_context + + + + + + + 2 + E86977BC88F0D950B8FD02FC853FFC0D7230B26376B908037F3F4AF429FD9A4D + 557160971 + 1522 + 433 + 25FBAAA29F300B32DF38832E0A102B8A4FAB726B5FAEE428B00DBD5D58D9BB16 + 3475582031 + 1039 + 477 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + + <string>diagnostic_information</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 15 + + reno_context + + + + + + + 1 + A08B750D3232ABEE88525742EFF8F342E5B2E4DE52BA6F55A8CFED666A50756E + 4268561218 + 4003 + 323 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>boost/exception/info.hpp</string> + + + exception_error_info_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 16 + + reno_context + + + + + + + 1 + 7116AEECEA666794E31DC99390ADEC1BA6AF74B2398067A0739767B4B76FA97A + 4128134227 + 307 + 302 + + + + + + 0 + ../../example/logging.cpp + 0 + 0 + + + + + <string>diagnostic information</string> + + + tutorial_diagnostic_information + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 17 + + reno_context + + + + + + + 1 + 50E48ABD58B427E16B2EFA345D5FE67159057CB90F19AA1AD52C11991FD8500E + 4076172629 + 8577 + 323 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>boost/exception/exception.hpp</string> + + + exception_exception_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 18 + + reno_context + + + + + + + 2 + 50E48ABD58B427E16B2EFA345D5FE67159057CB90F19AA1AD52C11991FD8500E + 4076172629 + 8577 + 323 + B4D37C317A3B45825DDA1A8C8B1CE71CC2E530D15090D05995FCBEC4247F49C4 + 2742768198 + 258 + 6714 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>enable_error_info</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 19 + + 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 + + 20 + + reno_context + + + + + + + 2 + 86E1196533E771AEFD141DA43FCD980AE3D7689A45EDD54A2DF28B1943E0E7DB + 941210061 + 8706 + 487 + E23085202D084CBB50F289988A6A592F06D923B77D0AB25D7A98A7188DF5BE3B + 1414247481 + 766 + 7370 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>current_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 21 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>transporting of exceptions between threads</string> + + + tutorial_exception_ptr + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 22 + + 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 @@ -911,27 +891,27 @@ 1 - D9B8E6AA12A4F33953B1A961FA590C5A3840234B6531CA8C04AC985AD5800835 - 2432554768 - 702 - 408 + F6A7A960DE8CB8740E206D2585D4C83854DE073ABDAFFB8BD1C9A6B73428197D + 129904804 + 4115 + 323 0 - ../../example/enable_error_info.cpp + ../../../../boost/exception/get_error_info.hpp 0 0 - <string>integrating boost exception in existing exception class hierarchies</string> + <string>boost/exception/get_error_info.hpp</string> - tutorial_enable_error_info + @@ -955,28 +935,77 @@ - 1 - F4C951B28F7DE500973AA3DFAA99F2BADA6EDAFA2B406C30BEF3B7FBE6FD57D7 - 2263754923 - 982 - 306 + 2 + 86E1196533E771AEFD141DA43FCD980AE3D7689A45EDD54A2DF28B1943E0E7DB + 941210061 + 8706 + 487 + F86EB07D04CD0D0645080D1121DA899746D0C45137E17E1D9BE605E75396F047 + 1983537541 + 1346 + 148 0 - ../../example/error_info_2.cpp + ../../../../boost/exception_ptr.hpp 0 0 - <string>adding of arbitrary data to active exception objects</string> + <string>exception_ptr</string> - adding_data_later + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 25 + + reno_context + + + + + + + 1 + 4ED9709788BBAB4DE7CF336561606B8C0B41F70877A3395F4EE026F4AEB66CC6 + 743998427 + 409 + 307 + + + + + + 0 + ../../example/cloning_1.cpp + 0 + 0 + + + + + <string>using enable_current_exception at the time of the throw</string> + + + using_enable_cloning @@ -989,7 +1018,142 @@ 0 - 25 + 26 + + reno_context + + + + + + + 1 + 67D64FAD0AB7CA6B2173A14F363D19B27F59EEBDB5C1076F8BCCA1B54D4CCD7D + 2241687287 + 303 + 323 + + + + + + 0 + ../../../../boost/exception.hpp + 0 + 0 + + + + + <string>boost/exception.hpp</string> + + + exception_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 27 + + reno_context + + + + + + + 1 + 05BBA12328429E0E88C8D44170E103FDF8DCD84E0C9AFB19D0478F9F4606FBE7 + 3486222742 + 2082 + 91 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>boost/throw_exception.hpp</string> + + + throw_exception_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 28 + + reno_context + + + + + + + 1 + 25DF01CCA9425952104C6606C336BB091879E4A22680790BBB352670DFB0E0CD + 4271502180 + 8870 + 323 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>boost/exception_ptr.hpp</string> + + + exception_cloning_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 29 reno_context @@ -1038,52 +1202,7 @@ 0 - 26 - - reno_context - - - - - - - 1 - 25DF01CCA9425952104C6606C336BB091879E4A22680790BBB352670DFB0E0CD - 4271502180 - 8870 - 323 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>boost/exception_ptr.hpp</string> - - - exception_cloning_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 27 + 30 reno_context @@ -1093,14 +1212,14 @@ 2 - 80895C67727835F0DAB5F5EF65FB2FD9E64008528BD4B800119E88BFB914588F - 2505563498 - 3946 + 17F10DBB69A481226D23CBBD7A897BF484EB8C5B1DC2E346E725EF0B8CE76D14 + 469421394 + 3808 518 D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 4055211476 525 - 3415 + 3277 @@ -1128,137 +1247,6 @@ (:include include:) (:auto also:) - - - 0 - - 28 - - reno_context - - - - - - - 1 - 187BFD2B78A0DD006717B5B06FFD465E2468F521C32A86FB793F7A68AB5417F3 - 4276724153 - 574 - 382 - - - - - - 0 - ../../example/error_info_1.cpp - 0 - 0 - - - - - <string>adding of arbitrary data at the point of the throw</string> - - - adding_data_at_throw - - - - - - 0 - - - - - 0 - - 29 - - reno_context - - - - - - - 1 - CAD6C404CB725D336A44920D2341ECA131149AB02C368B59028F8147F16737BF - 2258638601 - 94 - 227 - - - - - - 0 - ../../../../boost/exception/info_tuple.hpp - 0 - 0 - - - - - <string>boost/exception/info_tuple.hpp</string> - - - exception_error_info_group_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 30 - - reno_context - - - - - - - 1 - 4ED9709788BBAB4DE7CF336561606B8C0B41F70877A3395F4EE026F4AEB66CC6 - 743998427 - 409 - 307 - - - - - - 0 - ../../example/cloning_1.cpp - 0 - 0 - - - - - <string>using enable_current_exception at the time of the throw</string> - - - using_enable_cloning - - - - - - 0 - - 0 @@ -1272,25 +1260,29 @@ - 1 - 86015F1EAE1BF32CF58BD22D021B7697EAF6A5B07B79CE46116046B74AAE0327 - 2401878021 - 1632 - 323 + 2 + 126BB1D8971585CBE7D78EF3C12259D72FD5E973A84626AA9FC3234220A11CAB + 3471702891 + 969 + 344 + A7FD310E1340E103081DA2A7899DA0E213C696C84D52C17ADA09F6942EE97D47 + 2978648279 + 530 + 433 0 - ../../../../boost/exception/diagnostic_information.hpp + ../../../../boost/exception/detail/error_info_impl.hpp 0 0 - <string>boost/exception/diagnostic_information.hpp</string> + <string>error_info</string> @@ -1344,32 +1336,7 @@ 0 - 33 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>transporting of exceptions between threads</string> - - - tutorial_exception_ptr - - + -21 2 @@ -1378,7 +1345,7 @@ 0 - 34 + 33 reno_context @@ -1423,25 +1390,32 @@ 0 - -20 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -23 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -33 + 34 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>transporting of arbitrary data to the catch site</string> + + + tutorial_transporting_data + + 2 @@ -1460,42 +1434,33 @@ 1 - 7116AEECEA666794E31DC99390ADEC1BA6AF74B2398067A0739767B4B76FA97A - 4128134227 - 307 - 302 + D9B8E6AA12A4F33953B1A961FA590C5A3840234B6531CA8C04AC985AD5800835 + 2432554768 + 702 + 408 0 - ../../example/logging.cpp + ../../example/enable_error_info.cpp 0 0 - <string>diagnostic information</string> + <string>integrating boost exception in existing exception class hierarchies</string> - tutorial_diagnostic_information + tutorial_enable_error_info 2 - mod="w":) #Documentation ##Class (:link - 1 - - 0 - - -10 - - - 2 - :) ##Transporting of Arbitrary Data to the Catch Site ###(:link + mod="w":) ##(:link 1 0 @@ -1504,88 +1469,7 @@ 2 - :) ###(:link - 1 - - 0 - - -27 - - - 2 - :) ###(:link - 1 - - 0 - - -15 - - - 2 - :) ###(:link - 1 - - 0 - - -25 - - - 2 - :) ###(:link - 1 - - 0 - - -19 - - - 2 - :) ##(:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:) Transporting of Exceptions between Threads ###(:link - 1 - - 0 - - -17 - - - 2 - :) ###(:link - 1 - - 0 - - -9 - - - 2 - :) ###(:link - 1 - - 0 - - -18 - - - 2 - :) ###(:link - 1 - - 0 - - -7 - - - 2 - :) ###(:link - 1 - - 0 - - -12 - - - 2 - :) ###(:link + mod="w":) ##(:link 1 0 @@ -1594,25 +1478,7 @@ 2 - :) ##(:link - 1 - - 0 - - -8 - - - 2 - :) ##(:link - 1 - - 0 - - -34 - - - 2 - :), (:link + mod="w":) #Documentation ##Class (:link 1 0 @@ -1621,12 +1487,12 @@ 2 - :) ##Headers ###(:link + :) ##Transporting of Arbitrary Data to the Catch Site ###(:link 1 0 - -14 + -31 2 @@ -1635,7 +1501,7 @@ 0 - -31 + -30 2 @@ -1650,6 +1516,33 @@ 2 :) ###(:link 1 + + 0 + + -29 + + + 2 + :) ###(:link + 1 + + 0 + + -18 + + + 2 + :) ##(:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:) Transporting of Exceptions between Threads ###(:link + 1 + + 0 + + -24 + + + 2 + :) ###(:link + 1 0 @@ -1659,6 +1552,24 @@ 2 :) ###(:link 1 + + 0 + + -20 + + + 2 + :) ###(:link + 1 + + 0 + + -10 + + + 2 + :) ###(:link + 1 0 @@ -1671,25 +1582,29 @@ - 1 - 004B7821B451CA1B70A9BE6231A5359BE7A5E991793A4B4DB1DB0008905DF6B6 - 2648584333 - 4115 - 323 + 2 + 86E1196533E771AEFD141DA43FCD980AE3D7689A45EDD54A2DF28B1943E0E7DB + 941210061 + 8706 + 487 + 0E9DF8366080712A816BE91ABCEF1E2044145B63D75B0B995B537900F378189E + 1069696031 + 255 + 8445 0 - ../../../../boost/exception/get_error_info.hpp + ../../../../boost/exception_ptr.hpp 0 0 - <string>boost/exception/get_error_info.hpp</string> + <string>rethrow_exception</string> @@ -1712,43 +1627,65 @@ - 1 - B3FB1F53BE0C995FC6388C2C4510AA859AC443E2E68F1F4E31541A8F7510861F - 3274515267 - 4141 - 323 + 2 + 86E1196533E771AEFD141DA43FCD980AE3D7689A45EDD54A2DF28B1943E0E7DB + 941210061 + 8706 + 487 + 448B6444D4B3E46F822F56C14FDA3F6F96B869543EBA1E291C5E3D36F73AF24B + 2443226110 + 700 + 1496 0 - ../../../../boost/exception/info.hpp + ../../../../boost/exception_ptr.hpp 0 0 - <string>boost/exception/info.hpp</string> + <string>unknown_exception</string> - exception_error_info_hpp + 2 - :) ###(:link + :) ##(:link 1 0 - -29 + -14 2 - :) ###(:link + :) ##(:link + 1 + + 0 + + -33 + + + 2 + :), (:link + 1 + + 0 + + -12 + + + 2 + :) ##Headers ###(:link 1 0 @@ -1772,38 +1709,137 @@ 1 - 05BBA12328429E0E88C8D44170E103FDF8DCD84E0C9AFB19D0478F9F4606FBE7 - 3486222742 - 2082 - 91 + 86015F1EAE1BF32CF58BD22D021B7697EAF6A5B07B79CE46116046B74AAE0327 + 2401878021 + 1632 + 323 0 - ../../../../boost/throw_exception.hpp + ../../../../boost/exception/diagnostic_information.hpp 0 0 - <string>boost/throw_exception.hpp</string> + <string>boost/exception/diagnostic_information.hpp</string> - throw_exception_hpp + 2 + :) ###(:link + 1 + + 0 + + 39 + + 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> + + + exception_error_info_value_hpp + + + + + 2 + :) ###(:link + 1 + + 0 + + -17 + + + 2 + :) ###(:link + 1 + + 0 + + -23 + + + 2 + :) ###(:link + 1 + + 0 + + -15 + + + 2 + :) ###(:link + 1 + + 0 + + -8 + + + 2 + :) ###(:link + 1 + + 0 + + -28 + + + 2 + :) ###(:link + 1 + + 0 + + -27 + + + 2 :) #(:link 1 0 - 39 + 40 reno_context @@ -1837,7 +1873,7 @@ 0 - -14 + -26 2 @@ -1846,93 +1882,12 @@ 0 - -13 + -17 2 api pre_indent="4":) (:include 1 - - 0 - - -37 - - - 2 - api pre_indent="4":) (:include - 1 - - 0 - - -29 - - - 2 - api pre_indent="4":) (:include - 1 - - 0 - - -31 - - - 2 - api pre_indent="4":) (:include - 1 - - 0 - - -26 - - - 2 - api pre_indent="4":) }@] `#include <(:link - 1 - - 0 - - -38 - - - 2 - :)> [@(:include - 1 - - 0 - - -38 - - - 2 - api:)@] !!Class exception (:include - 1 - - 0 - - -10 - - - 2 - :) !!Transporting of Arbitrary Data to the Catch Site (:include - 1 - - 0 - - -21 - - - 2 - :) (:include - 1 - - 0 - - -27 - - - 2 - :) (:include - 1 0 @@ -1940,12 +1895,66 @@ 2 - :) (:include + api pre_indent="4":) (:include 1 0 - -25 + -8 + + + 2 + api pre_indent="4":) (:include + 1 + + 0 + + -38 + + + 2 + api pre_indent="4":) (:include + 1 + + 0 + + -28 + + + 2 + api pre_indent="4":) }@] `#include <(:link + 1 + + 0 + + -27 + + + 2 + :)> [@(:include + 1 + + 0 + + -27 + + + 2 + api:)@] !!Class exception (:include + 1 + + 0 + + -11 + + + 2 + :) !!Transporting of Arbitrary Data to the Catch Site (:include + 1 + + 0 + + -31 2 @@ -1954,16 +1963,7 @@ 0 - -19 - - - 2 - :) !!Transporting of Exceptions between Threads (:include - 1 - - 0 - - -17 + -30 2 @@ -1972,7 +1972,16 @@ 0 - -9 + -5 + + + 2 + :) (:include + 1 + + 0 + + -29 2 @@ -1985,12 +1994,12 @@ 2 - :) (:include + :) !!Transporting of Exceptions between Threads (:include 1 0 - -7 + -24 2 @@ -1999,7 +2008,7 @@ 0 - -12 + -13 2 @@ -2008,7 +2017,34 @@ 0 - -16 + -20 + + + 2 + :) (:include + 1 + + 0 + + -10 + + + 2 + :) (:include + 1 + + 0 + + -36 + + + 2 + :) (:include + 1 + + 0 + + -37 2 @@ -2017,7 +2053,7 @@ 0 - -8 + -14 2 @@ -2026,7 +2062,7 @@ 0 - -34 + -33 2 @@ -2037,7 +2073,7 @@ 0 - -33 + -36 @@ -2050,7 +2086,7 @@ 0 - -34 + -38 @@ -2076,7 +2112,50 @@ 0 - -36 + 41 + + 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 + + -34 @@ -2089,20 +2168,20 @@ 0 - -37 + -40 1 2 - (:include include:) (:auto also:) + (:auto !:) (:pagelist fmt="index" except_tags="index,noindex" mod="w":) 0 - -38 + -37 @@ -2118,55 +2197,6 @@ -39 - - 1 - 2 - (:auto !:) (:pagelist fmt="index" except_tags="index,noindex" mod="w":) - - - - - 0 - - 40 - - reno_context - - - - - - - 2 - 50E48ABD58B427E16B2EFA345D5FE67159057CB90F19AA1AD52C11991FD8500E - 4076172629 - 8577 - 323 - 17E691632123EB67BA67D590B49EB8094F462F5A10A66A1C5438E1867EF1478E - 765399792 - 77 - 5326 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>exception::~exception</string> - - - exception_destructor - - - - 1 2 @@ -2177,43 +2207,13 @@ 0 - 41 - - reno_context - - - - - - - 1 - E444EE9697EEADFDE0767E1D0242FC0E70D98E61FB1F0FFA099648DE509B82F3 - 94503238 - 773 - 374 - - - - - - 0 - ../../example/info_tuple.cpp - 0 - 0 - - - - - <string>adding grouped data to exceptions</string> - - - grouping_data - - + -33 - 0 + 1 + 2 + (:include include:) (:auto also:) @@ -2293,36 +2293,7 @@ - 7 - 2 - [@class (:link - 1 - - 0 - - -10 - - - 2 - :) { protected: (:include - 1 - - 0 - - -22 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -40 - - - 2 - decl pre_indent="4":) };@] + 0 @@ -2333,7 +2304,36 @@ - 0 + 7 + 2 + [@class (:link + 1 + + 0 + + -11 + + + 2 + :) { protected: (:include + 1 + + 0 + + -7 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -9 + + + 2 + decl pre_indent="4":) };@] @@ -2443,18 +2443,7 @@ - 3 - 2 - [@template <class Tag,class T> class (:link - 1 - - 0 - - -21 - - - 2 - :) { public: typedef T value_type; error_info( value_type const & ); };@] + 0 @@ -2564,7 +2553,18 @@ - 0 + 3 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -31 + + + 2 + :) { public: typedef T value_type; error_info( value_type const & ); };@] @@ -2578,39 +2578,6 @@ 0 - - - 0 - - -33 - - - - 0 - - - - - 0 - - -34 - - - - 0 - - - - - 0 - - -35 - - - - 0 - - 0 @@ -2622,17 +2589,6 @@ 0 - - - 0 - - -37 - - - - 0 - - 0 @@ -2648,7 +2604,29 @@ 0 - -39 + -35 + + + + 0 + + + + + 0 + + -41 + + + + 0 + + + + + 0 + + -34 @@ -2670,7 +2648,29 @@ 0 - -41 + -37 + + + + 0 + + + + + 0 + + -39 + + + + 0 + + + + + 0 + + -33 @@ -2699,18 +2699,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -21 - - - 2 - decl:)@] + 0 @@ -2743,7 +2732,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -5 + + + 2 + decl:)@] @@ -2798,72 +2798,7 @@ - 15 - 2 - [@(:include - 1 - - 0 - - -10 - - - 2 - def:) (:include - 1 - - 0 - - -21 - - - 2 - decl:) typedef (:link - 1 - - 0 - - -21 - - - 2 - :)<struct tag_throw_function,char const *> throw_function; typedef (:link - 1 - - 0 - - -21 - - - 2 - :)<struct tag_throw_file,char const *> throw_file; typedef (:link - 1 - - 0 - - -21 - - - 2 - :)<struct tag_throw_line,int> throw_line; (:include - 1 - - 0 - - -19 - - - 2 - decl:) (:include - 1 - - 0 - - -9 - - - 2 - decl:)@] + 0 @@ -2874,72 +2809,7 @@ - 15 - 2 - [@#include <(:link - 1 - - 0 - - -31 - - - 2 - :)> #include <(:link - 1 - - 0 - - -5 - - - 2 - :)> #include <(:link - 1 - - 0 - - -13 - - - 2 - :)> #include <(:link - 1 - - 0 - - -36 - - - 2 - :)> #include <(:link - 1 - - 0 - - -37 - - - 2 - :)> #include <(:link - 1 - - 0 - - -29 - - - 2 - :)> #include <(:link - 1 - - 0 - - -26 - - - 2 - :)>@] + 0 @@ -2950,7 +2820,27 @@ - 0 + 5 + 2 + [@(:include + 1 + + 0 + + -31 + + + 2 + def:) (:include + 1 + + 0 + + -30 + + + 2 + decl:)@] @@ -2972,7 +2862,72 @@ - 0 + 15 + 2 + [@(:include + 1 + + 0 + + -11 + + + 2 + def:) (:include + 1 + + 0 + + -31 + + + 2 + decl:) typedef (:link + 1 + + 0 + + -31 + + + 2 + :)<struct tag_throw_function,char const *> throw_function; typedef (:link + 1 + + 0 + + -31 + + + 2 + :)<struct tag_throw_file,char const *> throw_file; typedef (:link + 1 + + 0 + + -31 + + + 2 + :)<struct tag_throw_line,int> throw_line; (:include + 1 + + 0 + + -18 + + + 2 + decl:) (:include + 1 + + 0 + + -13 + + + 2 + decl:)@] @@ -3038,7 +2993,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -29 + + + 2 + decl:)@] @@ -3071,18 +3037,27 @@ - 11 + 15 2 - [@(:include + [@#include <(:link 1 0 - -16 + -38 2 - decl:) (:include + :)> #include <(:link + 1 + + 0 + + -39 + + + 2 + :)> #include <(:link 1 0 @@ -3091,34 +3066,43 @@ 2 - decl:) (:include + :)> #include <(:link 1 0 - -7 + -23 2 - decl:) (:include + :)> #include <(:link 1 0 - -18 + -15 2 - decl:) (:include + :)> #include <(:link 1 0 - -12 + -8 2 - decl:)@] + :)> #include <(:link + 1 + + 0 + + -28 + + + 2 + :)>@] @@ -3129,7 +3113,27 @@ - 0 + 5 + 2 + [@(:include + 1 + + 0 + + -12 + + + 2 + decl:) namespace boost { (:include + 1 + + 0 + + -33 + + + 2 + decl:) }@] @@ -3140,7 +3144,54 @@ - 0 + 11 + 2 + [@(:include + 1 + + 0 + + -37 + + + 2 + decl:) (:include + 1 + + 0 + + -24 + + + 2 + decl:) (:include + 1 + + 0 + + -10 + + + 2 + decl:) (:include + 1 + + 0 + + -20 + + + 2 + decl:) (:include + 1 + + 0 + + -36 + + + 2 + decl:)@] @@ -3151,18 +3202,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -15 - - - 2 - decl:)@] + 0 @@ -3184,27 +3224,7 @@ - 5 - 2 - [@(:include - 1 - - 0 - - -10 - - - 2 - decl:) (:include - 1 - - 0 - - -8 - - - 2 - decl:)@] + 0 @@ -3218,39 +3238,6 @@ 0 - - - 0 - - -33 - - - - 0 - - - - - 0 - - -34 - - - - 0 - - - - - 0 - - -35 - - - - 0 - - 0 @@ -3259,49 +3246,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -25 - - - 2 - decl:)@] - - - - - 0 - - -37 - - - - 5 - 2 - [@(:include - 1 - - 0 - - -21 - - - 2 - def:) (:include - 1 - - 0 - - -27 - - - 2 - decl:)@] + 0 @@ -3323,23 +3268,45 @@ 2 - decl:) namespace boost { (:include + decl:) (:include 1 0 - -34 + -14 2 - decl:) }@] + decl:)@] 0 - -39 + -35 + + + + 0 + + + + + 0 + + -41 + + + + 0 + + + + + 0 + + -34 @@ -3361,7 +3328,40 @@ 0 - -41 + -37 + + + + 0 + + + + + 0 + + -39 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -31 + + + 2 + decl:)@] + + + + + 0 + + -33 @@ -3390,7 +3390,36 @@ - 0 + 7 + 2 + [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link + 1 + + 0 + + -5 + + + 2 + |operator<<:)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link + 1 + + 0 + + -31 + + + 2 + :)<Tag1,T1>, ..., (:link + 1 + + 0 + + -31 + + + 2 + :)<TagN,TN> > const & v );@] @@ -3412,18 +3441,9 @@ - 5 + 7 2 - [@template <class T> (:link - 1 - - 0 - - -17 - - - 2 - :) (:link + [@(:link 1 0 @@ -3432,7 +3452,25 @@ 2 - :)( T const & e );@] + mod="m":)(); (:link + 1 + + 0 + + -7 + + + 2 + mod="m":)( (:link + 1 + + 0 + + -11 + + + 2 + :) const & x );@] @@ -3443,27 +3481,7 @@ - 5 - 2 - [@std::string (:link - 1 - - 0 - - -8 - - - 2 - :)( boost:: - 1 - - 0 - - -10 - - - 2 - const & x );@] + 0 @@ -3476,7 +3494,7 @@ 3 2 - [@template <class T> ---unspecified--- (:link + [@(:link 1 0 @@ -3485,7 +3503,7 @@ 2 - :)( T const & e );@] + mod="m":)();@] @@ -3496,9 +3514,18 @@ - 3 + 5 2 - [@class (:link + [@template <class T> (:link + 1 + + 0 + + -24 + + + 2 + :) (:link 1 0 @@ -3507,7 +3534,7 @@ 2 - :);@] + :)( T const & e );@] @@ -3518,18 +3545,9 @@ - 19 + 3 2 - [@#if !defined( BOOST_NO_EXCEPTIONS ) && !defined( BOOST_EXCEPTION_DISABLE ) #include < - 1 - - 0 - - -13 - - - 2 - > #include <boost/current_function.hpp> #define + [@class (:link 1 0 @@ -3538,70 +3556,7 @@ 2 - (x)\ ::boost:: - 1 - - 0 - - -34 - - - 2 - ( ::boost:: - 1 - - 0 - - -19 - - - 2 - (x) <<\ ::boost::(:link - 1 - - 0 - - -13 - - - 2 - |throw_function:)(BOOST_CURRENT_FUNCTION) <<\ ::boost::(:link - 1 - - 0 - - -13 - - - 2 - |throw_file:)(__FILE__) <<\ ::boost::(:link - 1 - - 0 - - -13 - - - 2 - |throw_line:)((int)__LINE__) ) #else #define - 1 - - 0 - - -11 - - - 2 - (x) ::boost:: - 1 - - 0 - - -34 - - - 2 - (x) #endif@] + :);@] @@ -3612,18 +3567,9 @@ - 5 + 19 2 - [@void (:link - 1 - - 0 - - -12 - - - 2 - :)( (:link + [@#if !defined( BOOST_NO_EXCEPTIONS ) && !defined( BOOST_EXCEPTION_DISABLE ) #include < 1 0 @@ -3632,7 +3578,79 @@ 2 - :) const & ep ); + > #include <boost/current_function.hpp> #define + 1 + + 0 + + -12 + + + 2 + (x)\ ::boost:: + 1 + + 0 + + -33 + + + 2 + ( ::boost:: + 1 + + 0 + + -18 + + + 2 + (x) <<\ ::boost::(:link + 1 + + 0 + + -17 + + + 2 + |throw_function:)(BOOST_CURRENT_FUNCTION) <<\ ::boost::(:link + 1 + + 0 + + -17 + + + 2 + |throw_file:)(__FILE__) <<\ ::boost::(:link + 1 + + 0 + + -17 + + + 2 + |throw_line:)((int)__LINE__) ) #else #define + 1 + + 0 + + -12 + + + 2 + (x) ::boost:: + 1 + + 0 + + -33 + + + 2 + (x) #endif@] @@ -3643,7 +3661,18 @@ - 0 + 3 + 2 + [@template <class T> ---unspecified--- (:link + 1 + + 0 + + -13 + + + 2 + :)( T const & e );@] @@ -3654,7 +3683,27 @@ - 0 + 5 + 2 + [@std::string (:link + 1 + + 0 + + -14 + + + 2 + :)( boost:: + 1 + + 0 + + -11 + + + 2 + const & x );@] @@ -3665,36 +3714,7 @@ - 7 - 2 - [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link - 1 - - 0 - - -15 - - - 2 - |operator<<:)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link - 1 - - 0 - - -21 - - - 2 - :)<Tag1,T1>, ..., (:link - 1 - - 0 - - -21 - - - 2 - :)<TagN,TN> > const & v );@] + 0 @@ -3705,27 +3725,7 @@ - 5 - 2 - [@class (:link - 1 - - 0 - - -16 - - - 2 - :): public std::exception public boost:: - 1 - - 0 - - -10 - - - 2 - { ---unspecified--- };@] + 0 @@ -3736,18 +3736,7 @@ - 3 - 2 - [@typedef ---unspecified--- (:link - 1 - - 0 - - -17 - - - 2 - :);@] + 0 @@ -3757,37 +3746,6 @@ -18 - - 5 - 2 - [@(:link - 1 - - 0 - - -17 - - - 2 - :) (:link - 1 - - 0 - - -18 - - - 2 - :)();@] - - - - - 0 - - -19 - - 3 2 @@ -3796,7 +3754,7 @@ 0 - -19 + -18 2 @@ -3807,7 +3765,7 @@ 0 - -20 + -19 @@ -3818,22 +3776,42 @@ 0 - -21 + -20 - 3 + 5 2 - [@template <class Tag,class T> class (:link + [@(:link 1 0 - -21 + -24 2 - :);@] + :) (:link + 1 + + 0 + + -20 + + + 2 + :)();@] + + + + + 0 + + -21 + + + + 0 @@ -3844,36 +3822,7 @@ - 7 - 2 - [@(:link - 1 - - 0 - - -22 - - - 2 - mod="m":)(); (:link - 1 - - 0 - - -22 - - - 2 - mod="m":)( (:link - 1 - - 0 - - -10 - - - 2 - :) const & x );@] + 0 @@ -3895,7 +3844,18 @@ - 0 + 3 + 2 + [@typedef ---unspecified--- (:link + 1 + + 0 + + -24 + + + 2 + :);@] @@ -3906,18 +3866,7 @@ - 3 - 2 - [@template <class ErrorInfo,class E> (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:)<typename ErrorInfo::value_type const> (:link - 1 - - 0 - - -25 - - - 2 - :)( E const & x );@] + 0 @@ -3939,27 +3888,7 @@ - 5 - 2 - [@template <class E, class Tag, class T> E const & (:link - 1 - - 0 - - -27 - - - 2 - |operator<<:)( E const & x, (:link - 1 - - 0 - - -21 - - - 2 - :)<Tag,T> const & v );@] + 0 @@ -3981,7 +3910,18 @@ - 0 + 3 + 2 + [@template <class ErrorInfo,class E> (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:)<typename ErrorInfo::value_type const> (:link + 1 + + 0 + + -29 + + + 2 + :)( E const & x );@] @@ -3992,7 +3932,27 @@ - 0 + 5 + 2 + [@template <class E, class Tag, class T> E const & (:link + 1 + + 0 + + -30 + + + 2 + |operator<<:)( E const & x, (:link + 1 + + 0 + + -31 + + + 2 + :)<Tag,T> const & v );@] @@ -4003,7 +3963,18 @@ - 0 + 3 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -31 + + + 2 + :);@] @@ -4021,75 +3992,31 @@ 0 - -33 - - - - 0 - - - - - 0 - - -34 + -36 5 2 - [@#ifdef BOOST_NO_EXCEPTIONS void (:link + [@void (:link 1 0 - -34 + -36 2 - :)( std::exception const & e ); // user defined #else template <class E> void (:link + :)( (:link 1 0 - -34 + -24 2 - :)( E const & e ); #endif@] - - - - - 0 - - -35 - - - - 0 - - - - - 0 - - -36 - - - - 0 - - - - - 0 - - -37 - - - - 0 + :) const & ep ); @@ -4107,7 +4034,29 @@ 0 - -39 + -35 + + + + 0 + + + + + 0 + + -41 + + + + 0 + + + + + 0 + + -34 @@ -4122,31 +4071,82 @@ - 3 - 2 - [@(:link - 1 - - 0 - - -40 - - - 2 - mod="m":)();@] + 0 0 - -41 + -37 + + + + 5 + 2 + [@class (:link + 1 + + 0 + + -37 + + + 2 + :): public std::exception public boost:: + 1 + + 0 + + -11 + + + 2 + { ---unspecified--- };@] + + + + + 0 + + -39 0 + + + 0 + + -33 + + + + 5 + 2 + [@#ifdef BOOST_NO_EXCEPTIONS void (:link + 1 + + 0 + + -33 + + + 2 + :)( std::exception const & e ); // user defined #else template <class E> void (:link + 1 + + 0 + + -33 + + + 2 + :)( E const & e ); #endif@] + + @@ -4168,514 +4168,6 @@ -5 - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -6 - - - - 37 - 2 - (:auto !!!:) When you catch an exception, you can call (:link - 1 - - 0 - - -18 - - - 2 - :) to get an (:link - 1 - - 0 - - -17 - - - 2 - :) object: [@#include <(:link - 1 - - 0 - - -26 - - - 2 - :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link - 1 - - 0 - - -10 - - - 2 - :)s void worker_thread( boost::(:link - 1 - - 0 - - -17 - - - 2 - :) & error ) { try { do_work(); error = boost::(:link - 1 - - 0 - - -17 - - - 2 - :)(); } catch( ... ) { error = boost::(:link - 1 - - 0 - - -18 - - - 2 - :)(); } }@] In the above example, note that (:link - 1 - - 0 - - -18 - - - 2 - :) captures the original type of the exception object. The exception can be thrown again using the (:link - 1 - - 0 - - -12 - - - 2 - :) function: [@// ...continued void work() { boost::(:link - 1 - - 0 - - -17 - - - 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 - - -12 - - - 2 - :)(error); }@] Note that (:link - 1 - - 0 - - -18 - - - 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 - - -17 - - - 2 - :) points to an instance of std::bad_alloc, or * if (:link - 1 - - 0 - - -9 - - - 2 - :) was not used in the throw-expression passed to the original throw statement and the current implementation does not have the necessary compiler-specific support to copy the exception automatically, in which case the returned (:link - 1 - - 0 - - -17 - - - 2 - :) points to an instance of (:link - 1 - - 0 - - -16 - - - 2 - :). Regardless, the use of (:link - 1 - - 0 - - -18 - - - 2 - :) and (:link - 1 - - 0 - - -12 - - - 2 - :) in the above examples is well-formed. - - - - - 0 - - -7 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) !!!!Effects: As if [@try { throw - 1 - - 0 - - -9 - - - 2 - (e); } catch(...) { return (:link - 1 - - 0 - - -18 - - - 2 - :)(); }@] - - - - - 0 - - -8 - - - - 7 - 2 - (:auto !!!:) (:include synopsis:) !!!!Returns: This function iterates over all data objects stored in the boost::(:link - 1 - - 0 - - -10 - - - 2 - :) through (:link - 1 - - 0 - - -27 - - - 2 - |operator<<:). The returned string is constructed by converting each data object to string and then concatenating these strings together. When the (:link - 1 - - 0 - - -21 - - - 2 - :)<Tag,T> template is instantiated, the system attempts overload resolution for an unqualified call to to_string(x), where x is of type T. If this is successful, the to_string overload is expected to return std::string and is used to convert objects of type T to string. Otherwise, the system attempts overload resolution for s << x, where s is a std::ostringstream and x is of type T. If this is successful, the operator<< overload is used to convert objects of type T to string. Otherwise the system is unable to convert objects of type T to string, and an unspecified stub string value is used without issuing a compile error. !!!!Notes: *The format of the returned string is unspecified. *The returned string is ''not'' user-friendly. *If dynamic_cast<std::exception const *>(&x) is not null, the returned string includes the output from std::exception::what. *The returned string may include additional platform-specific diagnostic information. - - - - - 0 - - -9 - - - - 21 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: T must be a class with an accessible no-throw copy constructor. !!!!Returns: An object of ''unspecified'' type which derives publicly from T. That is, the returned object can be intercepted by a catch(T &). !!!!Description: This function is designed to be used directly in a throw-expression to enable the (:link - 1 - - 0 - - -17 - - - 2 - :) support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link - 1 - - 0 - - -9 - - - 2 - :)(my_exception());@] Unless (:link - 1 - - 0 - - -9 - - - 2 - :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link - 1 - - 0 - - -18 - - - 2 - :) may return an (:link - 1 - - 0 - - -17 - - - 2 - :) which refers to an instance of (:link - 1 - - 0 - - -16 - - - 2 - :). See (:link - 1 - - 0 - - -18 - - - 2 - :) for details. !!!!Note: Instead of using the throw keyword directly, it is preferable to call boost::(:link - 1 - - 0 - - -34 - - - 2 - :). This is guaranteed to throw an exception that derives from boost::(:link - 1 - - 0 - - -10 - - - 2 - :) and supports the (:link - 1 - - 0 - - -17 - - - 2 - :) functionality. - - - - - 0 - - -10 - - - - 13 - 2 - (:auto !!!:) (:include synopsis:) Class boost::(:link - 1 - - 0 - - -10 - - - 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 - - -10 - - - 2 - :) can store data of arbitrary types, using the (:link - 1 - - 0 - - -21 - - - 2 - :) wrapper and (:link - 1 - - 0 - - -27 - - - 2 - |operator<<:). To retrieve data from a boost::(:link - 1 - - 0 - - -10 - - - 2 - :) object, use the (:link - 1 - - 0 - - -25 - - - 2 - :) function template. - - - - - 0 - - -11 - - - - 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 - - -34 - - - 2 - . To recover this information at the catch site, use - 1 - - 0 - - -25 - - - 2 - ; the information is also included in the message returned by - 1 - - 0 - - -8 - - - 2 - . - - - - - 0 - - -12 - - - - 1 - 2 - (:auto !!!:) (:include synopsis:) !!!!Precondition: ep shall not be null. !!!!Throws: The exception to which ep refers. - - - - - 0 - - -13 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -14 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -15 - - 5 2 @@ -4684,7 +4176,7 @@ 0 - -10 + -11 2 @@ -4693,7 +4185,7 @@ 0 - -10 + -11 2 @@ -4704,472 +4196,92 @@ 0 - -16 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) This type is used by the (:link - 1 - - 0 - - -17 - - - 2 - :) support in Boost Exception. Please see (:link - 1 - - 0 - - -18 - - - 2 - :). - - - - - 0 - - -17 + -6 17 2 - (:auto !!!:) (:include synopsis:) The (:link + (:auto !!!:) The following example demonstrates how errno can be stored in exception objects using Boost Exception: [@#include <(:link 1 0 - -17 + -26 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 + :)> #include <errno.h> #include <iostream> typedef boost::(:link 1 0 - -17 + -31 2 - :)'s operations do not throw. Two instances of (:link + :)<struct tag_errno,int> errno_info; //(1) class my_error: public boost::(:link 1 0 - -17 + -11 2 - :) are equivalent and compare equal if and only if they refer to the same exception. The default constructor of (:link + :), public std::exception { }; //(2) void f() { throw my_error() << errno_info(errno); //(3) } @] First, we instantiate the (:link 1 0 - -17 + -31 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 + :) template using a unique identifier -- tag_errno, and the type of the info it identifies -- int. This provides compile-time type safety for the various values stored in exception objects. Second, we define class my_error, which derives from boost::(:link 1 0 - -17 + -11 2 - :) references to the same exception object. * It is illegal for multiple threads to modify the same (:link + :). Finally, (3) illustrates how the typedef from (1) can be used with (:link 1 0 - -17 + -30 2 - :) object concurrently. * While calling + |operator<<:) to store values in exception objects at the point of the throw. The stored errno value can be recovered at a later time like this: [@// ...continued void g() { try { f(); } catch( my_error & x ) { if( boost::shared_ptr<int const> err=boost::(:link 1 0 - -18 + -29 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 + :)<errno_info>(x) ) std::cerr << "Error code: " << *err; } }@] The (:link 1 0 - -12 + -29 2 - to throw the same exception object concurrently into multiple threads. + :) function template is instantiated with the typedef from (1), and is passed an exception object of a polymorphic type. If the exception object contains the requested value, the returned (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:) will point to it; otherwise an empty (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:) is returned. 0 - -18 - - - - 29 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: The (:link - 1 - - 0 - - -18 - - - 2 - :) function must not be called outside of a catch block. !!!!Returns: * An (:link - 1 - - 0 - - -17 - - - 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 - - -17 - - - 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 - - -18 - - - 2 - :) refer to the same exception object. * Correct implementation of (:link - 1 - - 0 - - -18 - - - 2 - :) may require compiler support, unless (:link - 1 - - 0 - - -9 - - - 2 - :) was used at the time the currently handled exception object was passed to throw. If (:link - 1 - - 0 - - -9 - - - 2 - :) was not used, and if the compiler does not provide the necessary support, then (:link - 1 - - 0 - - -18 - - - 2 - :) may return an (:link - 1 - - 0 - - -17 - - - 2 - :) that refers to an instance of (:link - 1 - - 0 - - -16 - - - 2 - :). In this case, if the original exception object derives from boost::(:link - 1 - - 0 - - -10 - - - 2 - :), then the boost::(:link - 1 - - 0 - - -10 - - - 2 - :) sub-object of the (:link - 1 - - 0 - - -16 - - - 2 - :) object is initialized by the boost::(:link - 1 - - 0 - - -10 - - - 2 - :) copy constructor. - - - - - 0 - - -19 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: T must be a class with an accessible no-throw copy constructor as per (15.5.1). !!!!Returns: * If T derives from boost::(:link - 1 - - 0 - - -10 - - - 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 - - -10 - - - 2 - :). The T sub-object is initialized from x by the T copy constructor. !!!!Throws: Nothing. - - - - - 0 - - -20 - - - - 11 - 2 - (:auto !!:) All exception types that derive from boost::(:link - 1 - - 0 - - -10 - - - 2 - :) can be used as type-safe containers of arbitrary data objects, while complying with the no-throw requirements (15.5.1) of the ANSI C++ standard for exception types. Data can be added to a boost::(:link - 1 - - 0 - - -10 - - - 2 - :) at the time of the throw, or at a later time. (:include - 1 - - 0 - - -28 - - - 2 - :) (:include - 1 - - 0 - - -24 - - - 2 - :) (:include - 1 - - 0 - - -41 - - - 2 - :) - - - - - 0 - - -21 - - - - 25 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: T must have accessible copy constructor and must not be a reference (there is no requirement that T's copy constructor does not throw.) !!!!Description: This class template is used to associate a Tag type with a value type T. Objects of type (:link - 1 - - 0 - - -21 - - - 2 - :)<Tag,T> can be passed to (:link - 1 - - 0 - - -27 - - - 2 - |operator<<:) to be stored in objects of type boost::(:link - 1 - - 0 - - -10 - - - 2 - :). !!!!Note: The header <(:link - 1 - - 0 - - -5 - - - 2 - :)> provides a declaration of the (:link - 1 - - 0 - - -21 - - - 2 - :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, like this: [@#include <(:link - 1 - - 0 - - -5 - - - 2 - :)> typedef boost::(:link - 1 - - 0 - - -21 - - - 2 - :)<struct tag_errno,int> errno_info;@] Of course, to actually add an (:link - 1 - - 0 - - -21 - - - 2 - :) object to (:link - 1 - - 0 - - -10 - - - 2 - mod="p":) using (:link - 1 - - 0 - - -27 - - - 2 - |operator<<:), or to retrieve it using (:link - 1 - - 0 - - -25 - - - 2 - :), you must first #include <(:link - 1 - - 0 - - -37 - - - 2 - :)>. - - - - - 0 - - -22 + -7 @@ -5180,7 +4292,7 @@ 0 - -10 + -11 2 @@ -5189,7 +4301,7 @@ 0 - -10 + -11 2 @@ -5198,7 +4310,7 @@ 0 - -27 + -30 2 @@ -5209,121 +4321,57 @@ 0 - -23 + -8 - 27 + 1 2 - (:auto !!:) Some exception hierarchies can not be modified to make boost::(:link + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -9 + + + + 3 + 2 + (:auto !!!:) (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link 1 0 - -10 + -11 2 - :) a base type. In this case, the (:link + :) object. !!!!Throws: Nothing. + + + + + 0 + + -10 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) !!!!Effects: As if [@try { throw 1 0 - -19 + -13 2 - :) function template can be used to make exception objects derive from boost::(:link - 1 - - 0 - - -10 - - - 2 - :) anyway. Here is an example: [@#include <(:link - 1 - - 0 - - -14 - - - 2 - :)> #include <stdexcept> typedef boost::(:link - 1 - - 0 - - -21 - - - 2 - :)<struct tag_std_range_min,size_t> std_range_min; typedef boost::(:link - 1 - - 0 - - -21 - - - 2 - :)<struct tag_std_range_max,size_t> std_range_max; typedef boost::(:link - 1 - - 0 - - -21 - - - 2 - :)<struct tag_std_range_index,size_t> std_range_index; template <class T> class my_container { public: size_t size() const; T const & operator[]( size_t i ) const { if( i > size() ) throw boost::(:link - 1 - - 0 - - -19 - - - 2 - :)(std::range_error("Index out of range")) << std_range_min(0) << std_range_max(size()) << std_range_index(i); //.... } }; @] The call to (:link - 1 - - 0 - - -19 - - - 2 - :)<T> gets us an object of ''unspecified type'' which is guaranteed to derive from both boost::(:link - 1 - - 0 - - -10 - - - 2 - :) and T. This makes it possible to use (:link - 1 - - 0 - - -27 - - - 2 - |operator<<:) to store additional information in the exception object. The exception can be intercepted as T &, so existing exception handling will not break. It can also be intercepted as boost::(:link - 1 - - 0 - - -10 - - - 2 - :) &, so that (:link + (e); } catch(...) { return (:link 1 0 @@ -5332,29 +4380,283 @@ 2 - |more information can be added to the exception at a later time:). + :)(); }@] 0 - -24 + -11 + + + + 13 + 2 + (:auto !!!:) (:include synopsis:) Class boost::(:link + 1 + + 0 + + -11 + + + 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 + + -11 + + + 2 + :) can store data of arbitrary types, using the (:link + 1 + + 0 + + -31 + + + 2 + :) wrapper and (:link + 1 + + 0 + + -30 + + + 2 + |operator<<:). To retrieve data from a boost::(:link + 1 + + 0 + + -11 + + + 2 + :) object, use the (:link + 1 + + 0 + + -29 + + + 2 + :) function template. + + + + + 0 + + -12 + + + + 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 + + -33 + + + 2 + . To recover this information at the catch site, use + 1 + + 0 + + -29 + + + 2 + ; the information is also included in the message returned by + 1 + + 0 + + -14 + + + 2 + . + + + + + 0 + + -13 21 2 - (:auto !!!:) Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Here is an example: [@#include <stdio.h> #include <string> class file_read_error { public: explicit file_read_error( std::string const & fn ): fn_(fn) { }; std::string const & file_name() const { return fn_; } private: std::string fn_; }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error("????"); }@] We have defined an exception class file_read_error which can store a file name, so that when we catch a file_read_error object, we know which file the failure is related to. However, the file_read function does not have the file name at the time of the throw; all it has is a FILE handle. One possible solution is to not use FILE handles directly. We could have our own class file which stores both a FILE handle and a file name, and pass that to file_read. However, this could be problematic if we communicate with 3rd party code that does not use our class file (probably because they have their own similar class.) A better solution is to make class file_read_error derive (possibly indirectly) from boost::(:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: T must be a class with an accessible no-throw copy constructor. !!!!Returns: An object of ''unspecified'' type which derives publicly from T. That is, the returned object can be intercepted by a catch(T &). !!!!Description: This function is designed to be used directly in a throw-expression to enable the (:link 1 0 - -10 + -24 2 - :), and free the file_read function from the burden of storing the file name in exceptions it throws: [@#include <(:link + :) support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link + 1 + + 0 + + -13 + + + 2 + :)(my_exception());@] Unless (:link + 1 + + 0 + + -13 + + + 2 + :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link + 1 + + 0 + + -20 + + + 2 + :) may return an (:link + 1 + + 0 + + -24 + + + 2 + :) which refers to an instance of (:link + 1 + + 0 + + -37 + + + 2 + :). See (:link + 1 + + 0 + + -20 + + + 2 + :) for details. !!!!Note: Instead of using the throw keyword directly, it is preferable to call boost::(:link + 1 + + 0 + + -33 + + + 2 + :). This is guaranteed to throw an exception that derives from boost::(:link + 1 + + 0 + + -11 + + + 2 + :) and supports the (:link + 1 + + 0 + + -24 + + + 2 + :) functionality. + + + + + 0 + + -14 + + + + 7 + 2 + (:auto !!!:) (:include synopsis:) !!!!Returns: This function iterates over all data objects stored in the boost::(:link + 1 + + 0 + + -11 + + + 2 + :) through (:link + 1 + + 0 + + -30 + + + 2 + |operator<<:). The returned string is constructed by converting each data object to string and then concatenating these strings together. When the (:link + 1 + + 0 + + -31 + + + 2 + :)<Tag,T> template is instantiated, the system attempts overload resolution for an unqualified call to to_string(x), where x is of type T. If this is successful, the to_string overload is expected to return std::string and is used to convert objects of type T to string. Otherwise, the system attempts overload resolution for s << x, where s is a std::ostringstream and x is of type T. If this is successful, the operator<< overload is used to convert objects of type T to string. Otherwise the system is unable to convert objects of type T to string, and an unspecified stub string value is used without issuing a compile error. !!!!Notes: *The format of the returned string is unspecified. *The returned string is ''not'' user-friendly. *If dynamic_cast<std::exception const *>(&x) is not null, the returned string includes the output from std::exception::what. *The returned string may include additional platform-specific diagnostic information. + + + + + 0 + + -15 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -16 + + + + 17 + 2 + (:auto !!:) Boost Exception provides a namespace-scope function (:link 1 0 @@ -5363,25 +4665,61 @@ 2 - :)> #include <stdio.h> #include <errno.h> typedef boost::(:link + :) which takes a boost::(:link 1 0 - -21 + -11 2 - :)<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link + :). The returned string contains: *the string representation of all data objects added to the boost::(:link 1 0 - -10 + -11 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 + :) through (:link + 1 + + 0 + + -30 + + + 2 + |operator<<:); *the output from std::exception::what; *additional platform-specific diagnostic information. The returned string is not presentable as a friendly user message, but because it is generated automatically, it is useful for debugging or logging purposes. Here is an example: [@#include <(:link + 1 + + 0 + + -26 + + + 2 + :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link + 1 + + 0 + + -11 + + + 2 + :). void g() { try { f(); } catch( boost::(:link + 1 + + 0 + + -11 + + + 2 + :) & e ) { std::cerr << (:link 1 0 @@ -5390,48 +4728,114 @@ 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> typedef boost::(:link + :)(e); } }@] + + + + + 0 + + -17 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -18 + + + + 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 - -21 + -11 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 + :), 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 - -10 + -11 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 + :). The T sub-object is initialized from x by the T copy constructor. !!!!Throws: Nothing. + + + + + 0 + + -19 + + + + 13 + 2 + (:auto !!!:) The code snippet below demonstrates how boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) can be used to bundle the name of the function that failed, together with the reported errno so that they can be added to exception objects more conveniently together: [@#include <(:link 1 0 - -10 + -8 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 + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link 1 0 - -10 + -31 2 - :) object is that the file name is relevant to any failure that occurs in parse_file, ''even if the failure is unrelated to file I/O''. As usual, the stored data can be retrieved using (:link + :)<struct tag_file_name,std::string> file_name_info; typedef boost::(:link 1 0 - -25 + -31 + + + 2 + :)<struct tag_function,char const *> function_info; typedef boost::(:link + 1 + + 0 + + -31 + + + 2 + :)<struct tag_errno,int> errno_info; typedef boost::tuple<function_info,errno_info> clib_failure; class file_open_error: public boost::(:link + 1 + + 0 + + -11 + + + 2 + :) { }; boost::shared_ptr<FILE> file_open( char const * name, char const * mode ) { if( FILE * f=fopen(name,mode) ) return boost::shared_ptr<FILE>(f,fclose); else throw file_open_error() << file_name_info(name) << clib_failure("fopen",errno); }@] Note that the members of a boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) are stored separately in exception objects; they can only be retrieved individually, using (:link + 1 + + 0 + + -29 2 @@ -5442,22 +4846,179 @@ 0 - -25 + -20 - 9 + 29 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: The (:link 1 0 - -21 + -20 2 - :) template. * E must be polymorphic. * The + :) function must not be called outside of a catch block. !!!!Returns: * An (:link + 1 + + 0 + + -24 + + + 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 + + -24 + + + 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 + + -20 + + + 2 + :) refer to the same exception object. * Correct implementation of (:link + 1 + + 0 + + -20 + + + 2 + :) may require compiler support, unless (:link + 1 + + 0 + + -13 + + + 2 + :) was used at the time the currently handled exception object was passed to throw. If (:link + 1 + + 0 + + -13 + + + 2 + :) was not used, and if the compiler does not provide the necessary support, then (:link + 1 + + 0 + + -20 + + + 2 + :) may return an (:link + 1 + + 0 + + -24 + + + 2 + :) that refers to an instance of (:link + 1 + + 0 + + -37 + + + 2 + :). In this case, if the original exception object derives from boost::(:link + 1 + + 0 + + -11 + + + 2 + :), then the boost::(:link + 1 + + 0 + + -11 + + + 2 + :) sub-object of the (:link + 1 + + 0 + + -37 + + + 2 + :) object is initialized by the boost::(:link + 1 + + 0 + + -11 + + + 2 + :) copy constructor. + + + + + 0 + + -21 + + + + 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 + + -13 + + + 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 + + -33 + + + 2 + :) are guaranteed to derive from boost::(:link + 1 + + 0 + + -11 + + + 2 + :) and to support cloning. (:include 1 0 @@ -5466,25 +5027,347 @@ 2 - function must not be called outside of a catch block. !!!!Returns: * If dynamic_cast<boost::(:link + :) (:include 1 0 - -10 + -22 2 - :) const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is an empty shared_ptr. * Otherwise, the returned shared_ptr points to the stored value (use (:link + :) + + + + + 0 + + -22 + + + + 37 + 2 + (:auto !!!:) When you catch an exception, you can call (:link 1 0 - -27 + -20 2 - |operator<<:) to store values in exception objects.) The shared_ptr is valid even after x has been destroyed. !!!!Throws: Nothing. + :) to get an (:link + 1 + + 0 + + -24 + + + 2 + :) object: [@#include <(:link + 1 + + 0 + + -28 + + + 2 + :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link + 1 + + 0 + + -11 + + + 2 + :)s void worker_thread( boost::(:link + 1 + + 0 + + -24 + + + 2 + :) & error ) { try { do_work(); error = boost::(:link + 1 + + 0 + + -24 + + + 2 + :)(); } catch( ... ) { error = boost::(:link + 1 + + 0 + + -20 + + + 2 + :)(); } }@] In the above example, note that (:link + 1 + + 0 + + -20 + + + 2 + :) captures the original type of the exception object. The exception can be thrown again using the (:link + 1 + + 0 + + -36 + + + 2 + :) function: [@// ...continued void work() { boost::(:link + 1 + + 0 + + -24 + + + 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 + + -36 + + + 2 + :)(error); }@] Note that (:link + 1 + + 0 + + -20 + + + 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 + + -24 + + + 2 + :) points to an instance of std::bad_alloc, or * if (:link + 1 + + 0 + + -13 + + + 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 + + -24 + + + 2 + :) points to an instance of (:link + 1 + + 0 + + -37 + + + 2 + :). Regardless, the use of (:link + 1 + + 0 + + -20 + + + 2 + :) and (:link + 1 + + 0 + + -36 + + + 2 + :) in the above examples is well-formed. + + + + + 0 + + -23 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -24 + + + + 17 + 2 + (:auto !!!:) (:include synopsis:) The (:link + 1 + + 0 + + -24 + + + 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 + + -24 + + + 2 + :)'s operations do not throw. Two instances of (:link + 1 + + 0 + + -24 + + + 2 + :) are equivalent and compare equal if and only if they refer to the same exception. The default constructor of (:link + 1 + + 0 + + -24 + + + 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 + + -24 + + + 2 + :) references to the same exception object. * It is illegal for multiple threads to modify the same (:link + 1 + + 0 + + -24 + + + 2 + :) object concurrently. * While calling + 1 + + 0 + + -20 + + + 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 + 1 + + 0 + + -36 + + + 2 + to throw the same exception object concurrently into multiple threads. + + + + + 0 + + -25 + + + + 11 + 2 + (:auto !!!:) Here is how cloning can be enabled in a throw-expression (15.1): [@#include <(:link + 1 + + 0 + + -15 + + + 2 + :)> #include <stdio.h> #include <errno.h> typedef boost::error_info<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link + 1 + + 0 + + -11 + + + 2 + :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::(:link + 1 + + 0 + + -13 + + + 2 + :)(file_read_error()) << errno_info(errno); }@] Of course, (:link + 1 + + 0 + + -13 + + + 2 + :) may be used with any exception type; there is no requirement that it should derive from boost::(:link + 1 + + 0 + + -11 + + + 2 + :). @@ -5508,36 +5391,9 @@ - 7 + 1 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link - 1 - - 0 - - -10 - - - 2 - :), or a type that derives (indirectly) from boost::(:link - 1 - - 0 - - -10 - - - 2 - :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link - 1 - - 0 - - -21 - - - 2 - :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -5548,81 +5404,9 @@ - 17 + 1 2 - (:auto !!!:) The following example demonstrates how errno can be stored in exception objects using Boost Exception: [@#include <(:link - 1 - - 0 - - -14 - - - 2 - :)> #include <errno.h> #include <iostream> typedef boost::(:link - 1 - - 0 - - -21 - - - 2 - :)<struct tag_errno,int> errno_info; //(1) class my_error: public boost::(:link - 1 - - 0 - - -10 - - - 2 - :), public std::exception { }; //(2) void f() { throw my_error() << errno_info(errno); //(3) } @] First, we instantiate the (:link - 1 - - 0 - - -21 - - - 2 - :) template using a unique identifier -- tag_errno, and the type of the info it identifies -- int. This provides compile-time type safety for the various values stored in exception objects. Second, we define class my_error, which derives from boost::(:link - 1 - - 0 - - -10 - - - 2 - :). Finally, (3) illustrates how the typedef from (1) can be used with (:link - 1 - - 0 - - -27 - - - 2 - |operator<<:) to store values in exception objects at the point of the throw. The stored errno value can be recovered at a later time like this: [@// ...continued void g() { try { f(); } catch( my_error & x ) { if( boost::shared_ptr<int const> err=boost::(:link - 1 - - 0 - - -25 - - - 2 - :)<errno_info>(x) ) std::cerr << "Error code: " << *err; } }@] The (:link - 1 - - 0 - - -25 - - - 2 - :) function template is instantiated with the typedef from (1), and is passed an exception object of a polymorphic type. If the exception object contains the requested value, the returned (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:) will point to it; otherwise an empty (:link http://www.boost.org/libs/smart_ptr/shared_ptr.htm|shared_ptr:) is returned. + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -5633,9 +5417,45 @@ - 1 + 9 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link + 1 + + 0 + + -31 + + + 2 + :) template. * E must be polymorphic. * The + 1 + + 0 + + -29 + + + 2 + function must not be called outside of a catch block. !!!!Returns: * If dynamic_cast<boost::(:link + 1 + + 0 + + -11 + + + 2 + :) const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is an empty shared_ptr. * Otherwise, the returned shared_ptr points to the stored value (use (:link + 1 + + 0 + + -30 + + + 2 + |operator<<:) to store values in exception objects.) The shared_ptr is valid even after x has been destroyed. !!!!Throws: Nothing. @@ -5646,54 +5466,36 @@ - 11 + 7 2 - (:auto !!!:) Here is how cloning can be enabled in a throw-expression (15.1): [@#include <(:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link 1 0 - -37 + -11 2 - :)> #include <stdio.h> #include <errno.h> typedef boost::error_info<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link + :), or a type that derives (indirectly) from boost::(:link 1 0 - -10 + -11 2 - :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::(:link + :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link 1 0 - -9 + -31 2 - :)(file_read_error()) << errno_info(errno); }@] Of course, (:link - 1 - - 0 - - -9 - - - 2 - :) may be used with any exception type; there is no requirement that it should derive from boost::(:link - 1 - - 0 - - -10 - - - 2 - :). + :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) @@ -5704,9 +5506,117 @@ - 1 + 25 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (: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 + + -31 + + + 2 + :)<Tag,T> can be passed to (:link + 1 + + 0 + + -30 + + + 2 + |operator<<:) to be stored in objects of type boost::(:link + 1 + + 0 + + -11 + + + 2 + :). !!!!Note: The header <(:link + 1 + + 0 + + -39 + + + 2 + :)> provides a declaration of the (:link + 1 + + 0 + + -31 + + + 2 + :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, like this: [@#include <(:link + 1 + + 0 + + -39 + + + 2 + :)> typedef boost::(:link + 1 + + 0 + + -31 + + + 2 + :)<struct tag_errno,int> errno_info;@] Of course, to actually add an (:link + 1 + + 0 + + -31 + + + 2 + :) object to (:link + 1 + + 0 + + -11 + + + 2 + mod="p":) using (:link + 1 + + 0 + + -30 + + + 2 + |operator<<:), or to retrieve it using (:link + 1 + + 0 + + -29 + + + 2 + :), you must first #include <(:link + 1 + + 0 + + -15 + + + 2 + :)>. @@ -5720,216 +5630,6 @@ 0 - - - 0 - - -33 - - - - 11 - 2 - (:auto !!:) Boost Exception supports transporting of exception objects between threads through cloning. This system is similar to (:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:), but because Boost Exception can not rely on language support, the use of (:link - 1 - - 0 - - -9 - - - 2 - :) at the time of the throw is required in order to use cloning. !!!!Note: All exceptions emitted by the familiar function boost::(:link - 1 - - 0 - - -34 - - - 2 - :) are guaranteed to derive from boost::(:link - 1 - - 0 - - -10 - - - 2 - :) and to support cloning. (:include - 1 - - 0 - - -30 - - - 2 - :) (:include - 1 - - 0 - - -6 - - - 2 - :) - - - - - 0 - - -34 - - - - 13 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must derive publicly from std::exception. !!!!Effects: * If BOOST_NO_EXCEPTIONS is not defined, boost::(:link - 1 - - 0 - - -34 - - - 2 - :)(e) is equivalent to throw boost::(:link - 1 - - 0 - - -9 - - - 2 - :)(boost::(:link - 1 - - 0 - - -19 - - - 2 - :)(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::(:link - 1 - - 0 - - -34 - - - 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 - - -34 - - - 2 - :) are allowed to assume that the function never returns; therefore, if the user-defined (:link - 1 - - 0 - - -34 - - - 2 - :) returns, the behavior is undefined. - - - - - 0 - - -35 - - - - 17 - 2 - (:auto !!:) Boost Exception provides a namespace-scope function (:link - 1 - - 0 - - -8 - - - 2 - :) which takes a boost::(:link - 1 - - 0 - - -10 - - - 2 - :). The returned string contains: *the string representation of all data objects added to the boost::(:link - 1 - - 0 - - -10 - - - 2 - :) through (:link - 1 - - 0 - - -27 - - - 2 - |operator<<:); *the output from std::exception::what; *additional platform-specific diagnostic information. The returned string is not presentable as a friendly user message, but because it is generated automatically, it is useful for debugging or logging purposes. Here is an example: [@#include <(:link - 1 - - 0 - - -14 - - - 2 - :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link - 1 - - 0 - - -10 - - - 2 - :). void g() { try { f(); } catch( boost::(:link - 1 - - 0 - - -10 - - - 2 - :) & e ) { std::cerr << (:link - 1 - - 0 - - -8 - - - 2 - :)(e); } }@] - - 0 @@ -5940,20 +5640,7 @@ 1 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -37 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) + (:auto !!!:) (:include synopsis:) !!!!Precondition: ep shall not be null. !!!!Throws: The exception to which ep refers. @@ -5973,33 +5660,130 @@ 0 - -39 + -35 - 0 - - - - - 0 - - -40 - - - - 3 + 27 2 - (:auto !!!:) (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link + (:auto !!:) Some exception hierarchies can not be modified to make boost::(:link 1 0 - -10 + -11 2 - :) object. !!!!Throws: Nothing. + :) a base type. In this case, the (:link + 1 + + 0 + + -18 + + + 2 + :) function template can be used to make exception objects derive from boost::(:link + 1 + + 0 + + -11 + + + 2 + :) anyway. Here is an example: [@#include <(:link + 1 + + 0 + + -26 + + + 2 + :)> #include <stdexcept> typedef boost::(:link + 1 + + 0 + + -31 + + + 2 + :)<struct tag_std_range_min,size_t> std_range_min; typedef boost::(:link + 1 + + 0 + + -31 + + + 2 + :)<struct tag_std_range_max,size_t> std_range_max; typedef boost::(:link + 1 + + 0 + + -31 + + + 2 + :)<struct tag_std_range_index,size_t> std_range_index; template <class T> class my_container { public: size_t size() const; T const & operator[]( size_t i ) const { if( i > size() ) throw boost::(:link + 1 + + 0 + + -18 + + + 2 + :)(std::range_error("Index out of range")) << std_range_min(0) << std_range_max(size()) << std_range_index(i); //.... } }; @] The call to (:link + 1 + + 0 + + -18 + + + 2 + :)<T> gets us an object of ''unspecified type'' which is guaranteed to derive from both boost::(:link + 1 + + 0 + + -11 + + + 2 + :) and T. This makes it possible to use (:link + 1 + + 0 + + -30 + + + 2 + |operator<<:) to store additional information in the exception object. The exception can be intercepted as T &, so existing exception handling will not break. It can also be intercepted as boost::(:link + 1 + + 0 + + -11 + + + 2 + :) &, so that (:link + 1 + + 0 + + -34 + + + 2 + |more information can be added to the exception at a later time:). @@ -6010,9 +5794,90 @@ - 13 + 21 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 + (:auto !!!:) Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Here is an example: [@#include <stdio.h> #include <string> class file_read_error { public: explicit file_read_error( std::string const & fn ): fn_(fn) { }; std::string const & file_name() const { return fn_; } private: std::string fn_; }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error("????"); }@] We have defined an exception class file_read_error which can store a file name, so that when we catch a file_read_error object, we know which file the failure is related to. However, the file_read function does not have the file name at the time of the throw; all it has is a FILE handle. One possible solution is to not use FILE handles directly. We could have our own class file which stores both a FILE handle and a file name, and pass that to file_read. However, this could be problematic if we communicate with 3rd party code that does not use our class file (probably because they have their own similar class.) A better solution is to make class file_read_error derive (possibly indirectly) from boost::(:link + 1 + + 0 + + -11 + + + 2 + :), and free the file_read function from the burden of storing the file name in exceptions it throws: [@#include <(:link + 1 + + 0 + + -26 + + + 2 + :)> #include <stdio.h> #include <errno.h> typedef boost::(:link + 1 + + 0 + + -31 + + + 2 + :)<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link + 1 + + 0 + + -11 + + + 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 + + -26 + + + 2 + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> typedef boost::(:link + 1 + + 0 + + -31 + + + 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 + + -11 + + + 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 + + -11 + + + 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 + + -11 + + + 2 + :) object is that the file name is relevant to any failure that occurs in parse_file, ''even if the failure is unrelated to file I/O''. As usual, the stored data can be retrieved using (:link 1 0 @@ -6021,54 +5886,189 @@ 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link + :). + + + + + 0 + + -34 + + + + 11 + 2 + (:auto !!:) All exception types that derive from boost::(:link 1 0 - -21 + -11 2 - :)<struct tag_file_name,std::string> file_name_info; typedef boost::(:link + :) can be used as type-safe containers of arbitrary data objects, while complying with the no-throw requirements (15.5.1) of the ANSI C++ standard for exception types. Data can be added to a boost::(:link 1 0 - -21 + -11 2 - :)<struct tag_function,char const *> function_info; typedef boost::(:link + :) at the time of the throw, or at a later time. (:include 1 0 - -21 + -6 2 - :)<struct tag_errno,int> errno_info; typedef boost::tuple<function_info,errno_info> clib_failure; class file_open_error: public boost::(:link + :) (:include 1 0 - -10 + -41 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 + :) (:include 1 0 - -25 + -19 + + + 2 + :) + + + + + 0 + + -40 + + + + 0 + + + + + 0 + + -37 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) This type is used by the (:link + 1 + + 0 + + -24 + + + 2 + :) support in Boost Exception. Please see (:link + 1 + + 0 + + -20 2 :). + + + 0 + + -39 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -33 + + + + 13 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must derive publicly from std::exception. !!!!Effects: * If BOOST_NO_EXCEPTIONS is not defined, boost::(:link + 1 + + 0 + + -33 + + + 2 + :)(e) is equivalent to throw boost::(:link + 1 + + 0 + + -13 + + + 2 + :)(boost::(:link + 1 + + 0 + + -18 + + + 2 + :)(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::(:link + 1 + + 0 + + -33 + + + 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 + + -33 + + + 2 + :) are allowed to assume that the function never returns; therefore, if the user-defined (:link + 1 + + 0 + + -33 + + + 2 + :) returns, the behavior is undefined. + + @@ -6091,7 +6091,9 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. @@ -6201,9 +6203,7 @@ - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. + 0 @@ -6335,9 +6335,7 @@ - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. + 0 @@ -6370,7 +6368,9 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. @@ -6395,39 +6395,6 @@ 0 - - - 0 - - -33 - - - - 0 - - - - - 0 - - -34 - - - - 0 - - - - - 0 - - -35 - - - - 0 - - 0 @@ -6439,17 +6406,6 @@ 0 - - - 0 - - -37 - - - - 0 - - 0 @@ -6465,7 +6421,29 @@ 0 - -39 + -35 + + + + 0 + + + + + 0 + + -41 + + + + 0 + + + + + 0 + + -34 @@ -6487,7 +6465,29 @@ 0 - -41 + -37 + + + + 0 + + + + + 0 + + -39 + + + + 0 + + + + + 0 + + -33 @@ -6516,9 +6516,27 @@ - 1 + 5 2 - [@namespace boost { (:include api pre_indent="4":) }@] + `#include <(:link + 1 + + 0 + + -8 + + + 2 + :)> [@namespace boost { (:include + 1 + + 0 + + -5 + + + 2 + decl pre_indent="4":) }@] @@ -6540,18 +6558,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -26 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -6562,18 +6569,9 @@ - 3 + 1 2 - `#include <(:link - 1 - - 0 - - -31 - - - 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + [@#include <boost/tuple/tuple.hpp> namespace boost { (:include api pre_indent="4":) }@] @@ -6584,18 +6582,7 @@ - 3 - 2 - `#include < - 1 - - 0 - - -13 - - - 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -6613,11 +6600,11 @@ 0 - -13 + -28 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -6630,16 +6617,16 @@ 3 2 - `#include < + `#include <(:link 1 0 - -38 + -17 2 - > (:include decl:) + :)> [@namespace boost { (:include def pre_indent="4":) }@] @@ -6652,16 +6639,16 @@ 3 2 - `#include <(:link + `#include < 1 0 - -26 + -27 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + > (:include decl:) @@ -6671,100 +6658,89 @@ -13 + + 3 + 2 + `#include < + 1 + + 0 + + -17 + + + 2 + > [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -14 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -38 + + + 2 + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -15 + + + + 3 + 2 + [@#include <(:link + 1 + + 0 + + -17 + + + 2 + :)> #include <boost/current_function.hpp> #include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -16 + + + + 0 + + + + + 0 + + -17 + + 1 2 [@namespace boost { (:include api pre_indent="4":) }@] - - - 0 - - -14 - - - - 1 - 2 - [@(:include api:)@] - - - - - 0 - - -15 - - - - 5 - 2 - `#include <(:link - 1 - - 0 - - -29 - - - 2 - :)> [@namespace boost { (:include - 1 - - 0 - - -15 - - - 2 - decl pre_indent="4":) }@] - - - - - 0 - - -16 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -26 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -17 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -26 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] - - 0 @@ -6772,28 +6748,6 @@ -18 - - 3 - 2 - `#include <(:link - 1 - - 0 - - -26 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -19 - - 3 2 @@ -6802,7 +6756,7 @@ 0 - -13 + -17 2 @@ -6813,7 +6767,7 @@ 0 - -20 + -19 @@ -6824,7 +6778,7 @@ 0 - -21 + -20 @@ -6835,11 +6789,22 @@ 0 - -37 + -28 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -21 + + + + 0 @@ -6861,7 +6826,9 @@ - 0 + 1 + 2 + [@#include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] @@ -6872,7 +6839,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -28 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -6883,18 +6861,7 @@ - 3 - 2 - `#include < - 1 - - 0 - - -36 - - - 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -6905,18 +6872,9 @@ - 3 + 1 2 - [@#include <(:link - 1 - - 0 - - -13 - - - 2 - :)> namespace boost { (:include api pre_indent="4":) }@] + [@(:include api:)@] @@ -6927,18 +6885,9 @@ - 3 + 1 2 - `#include <(:link - 1 - - 0 - - -37 - - - 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + (:include api:) @@ -6949,7 +6898,18 @@ - 0 + 3 + 2 + [@#include <(:link + 1 + + 0 + + -17 + + + 2 + :)> namespace boost { (:include api pre_indent="4":) }@] @@ -6960,9 +6920,18 @@ - 1 + 3 2 - [@#include <boost/tuple/tuple.hpp> namespace boost { (:include api pre_indent="4":) }@] + `#include < + 1 + + 0 + + -23 + + + 2 + > [@namespace boost { (:include decl pre_indent="4":) }@] @@ -6973,7 +6942,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -15 + + + 2 + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] @@ -6984,9 +6964,18 @@ - 1 + 3 2 - [@#include <exception> #include <string> namespace boost { (:include api pre_indent="4":) }@] + `#include <(:link + 1 + + 0 + + -15 + + + 2 + :)> [@namespace boost { (:include def pre_indent="4":) }@] @@ -7004,18 +6993,7 @@ 0 - -33 - - - - 0 - - - - - 0 - - -34 + -36 @@ -7026,11 +7004,24 @@ 0 - -38 + -28 2 - :)> [@namespace boost { (:include decl:) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -38 + + + + 1 + 2 + [@#include <exception> #include <string> namespace boost { (:include api pre_indent="4":) }@] @@ -7048,55 +7039,18 @@ 0 - -36 + -41 - 1 - 2 - [@#include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] + 0 0 - -37 - - - - 3 - 2 - [@#include <(:link - 1 - - 0 - - -13 - - - 2 - :)> #include <boost/current_function.hpp> #include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] - - - - - 0 - - -38 - - - - 1 - 2 - (:include api:) - - - - - 0 - - -39 + -34 @@ -7118,11 +7072,57 @@ 0 - -41 + -37 - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -28 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -39 + + + + 1 + 2 + [@namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -33 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -27 + + + 2 + :)> [@namespace boost { (:include decl:) }@] @@ -7227,32 +7227,32 @@ -32 - - -33 - - - -34 - - - -35 - -36 - - -37 - -38 - -39 + -35 + + + -41 + + + -34 -40 - -41 + -37 + + + -39 + + + -33 @@ -7290,7 +7290,7 @@ - -33 + -21 @@ -7307,7 +7307,7 @@ - -20 + -34 @@ -7324,7 +7324,7 @@ - -39 + -40 @@ -7348,7 +7348,7 @@ - -13 + -17 @@ -7376,7 +7376,7 @@ - -10 + -11 @@ -7408,7 +7408,7 @@ - -22 + -7 @@ -7436,7 +7436,7 @@ - -40 + -9 @@ -7464,7 +7464,7 @@ - -9 + -13 @@ -7492,7 +7492,35 @@ - -19 + -18 + + + + + + + 2 + 17F10DBB69A481226D23CBBD7A897BF484EB8C5B1DC2E346E725EF0B8CE76D14 + 469421394 + 3808 + 518 + D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 + 4055211476 + 525 + 3277 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + -30 @@ -7516,31 +7544,7 @@ - -6 - - - - - - - 1 - B3FB1F53BE0C995FC6388C2C4510AA859AC443E2E68F1F4E31541A8F7510861F - 3274515267 - 4141 - 323 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - -37 + -22 @@ -7564,7 +7568,7 @@ - -31 + -38 @@ -7588,7 +7592,7 @@ - -23 + -35 @@ -7616,7 +7620,7 @@ - -8 + -14 @@ -7640,7 +7644,31 @@ - -11 + -12 + + + + + + + 1 + A08B750D3232ABEE88525742EFF8F342E5B2E4DE52BA6F55A8CFED666A50756E + 4268561218 + 4003 + 323 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + -15 @@ -7664,7 +7692,31 @@ - -35 + -16 + + + + + + + 1 + F6A7A960DE8CB8740E206D2585D4C83854DE073ABDAFFB8BD1C9A6B73428197D + 129904804 + 4115 + 323 + + + + + + 0 + ../../../../boost/exception/get_error_info.hpp + 0 + 0 + + + + -23 @@ -7688,63 +7740,7 @@ - -14 - - - - - - - 2 - 80895C67727835F0DAB5F5EF65FB2FD9E64008528BD4B800119E88BFB914588F - 2505563498 - 3946 - 518 - 7108B78DA28F7485BBB4D649BEE943AF19A3D63C80DD03F927FDA7A6D8EE2F3B - 3042951402 - 778 - 26 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - -21 - - - - - - - 2 - 80895C67727835F0DAB5F5EF65FB2FD9E64008528BD4B800119E88BFB914588F - 2505563498 - 3946 - 518 - D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 - 4055211476 - 525 - 3415 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - -27 + -26 @@ -7772,7 +7768,7 @@ - -34 + -33 @@ -7800,31 +7796,35 @@ - -25 + -29 - 1 - 004B7821B451CA1B70A9BE6231A5359BE7A5E991793A4B4DB1DB0008905DF6B6 - 2648584333 - 4115 - 323 + 2 + 126BB1D8971585CBE7D78EF3C12259D72FD5E973A84626AA9FC3234220A11CAB + 3471702891 + 969 + 344 + A7FD310E1340E103081DA2A7899DA0E213C696C84D52C17ADA09F6942EE97D47 + 2978648279 + 530 + 433 0 - ../../../../boost/exception/get_error_info.hpp + ../../../../boost/exception/detail/error_info_impl.hpp 0 0 - -36 + -31 @@ -7848,7 +7848,7 @@ - -29 + -8 @@ -7872,7 +7872,7 @@ - -30 + -25 @@ -7896,7 +7896,7 @@ - -26 + -28 @@ -7920,7 +7920,7 @@ - -24 + -41 @@ -7948,7 +7948,7 @@ - -18 + -20 @@ -7976,7 +7976,7 @@ - -17 + -24 @@ -8004,7 +8004,7 @@ - -16 + -37 @@ -8032,7 +8032,7 @@ - -12 + -36 @@ -8060,7 +8060,7 @@ - -7 + -10 @@ -8084,7 +8084,7 @@ - -38 + -27 @@ -8112,7 +8112,7 @@ - -5 + -39 @@ -8140,7 +8140,7 @@ - -15 + -5 @@ -8164,7 +8164,7 @@ - -28 + -6 @@ -8188,7 +8188,7 @@ - -41 + -19 @@ -8219,7 +8219,7 @@ -5 - + error_info free function @@ -8237,7 +8237,7 @@ -7 - exception_ptr free function + function @@ -8246,7 +8246,7 @@ -8 - diagnostic_information free function + @@ -8255,7 +8255,7 @@ -9 - exception_ptr free function + function @@ -8264,7 +8264,7 @@ -10 - type + exception_ptr free function @@ -8273,7 +8273,7 @@ -11 - + type @@ -8282,7 +8282,7 @@ -12 - exception_ptr free function + @@ -8291,7 +8291,7 @@ -13 - + exception_ptr free function @@ -8300,7 +8300,7 @@ -14 - + diagnostic_information free function @@ -8309,7 +8309,7 @@ -15 - error_info free function + @@ -8318,7 +8318,7 @@ -16 - exception_ptr type + diagnostic_information tutorial @@ -8327,7 +8327,7 @@ -17 - type + @@ -8336,7 +8336,7 @@ -18 - exception_ptr free function + error_info free function @@ -8345,7 +8345,7 @@ -19 - error_info free function + noalso noindex tutorial @@ -8354,7 +8354,7 @@ -20 - tutorial + exception_ptr free function @@ -8363,7 +8363,7 @@ -21 - type + tutorial @@ -8372,7 +8372,7 @@ -22 - function + noalso noindex tutorial @@ -8381,7 +8381,7 @@ -23 - tutorial + error_info @@ -8390,7 +8390,7 @@ -24 - noalso noindex tutorial + type @@ -8399,7 +8399,7 @@ -25 - error_info free function + noalso noindex tutorial @@ -8417,7 +8417,7 @@ -27 - error_info free function + @@ -8426,7 +8426,7 @@ -28 - noalso noindex tutorial + @@ -8435,7 +8435,7 @@ -29 - + error_info free function @@ -8444,7 +8444,7 @@ -30 - noalso noindex tutorial + error_info free function @@ -8453,7 +8453,7 @@ -31 - + type @@ -8464,33 +8464,6 @@ noindex - - - 0 - - -33 - - - tutorial - - - - 0 - - -34 - - - free function - - - - 0 - - -35 - - - diagnostic_information tutorial - 0 @@ -8498,16 +8471,7 @@ -36 - error_info - - - - 0 - - -37 - - - + exception_ptr free function @@ -8522,19 +8486,10 @@ 0 - -39 + -35 - index noindex - - - - 0 - - -40 - - - function + tutorial @@ -8545,6 +8500,51 @@ noalso noindex tutorial + + + 0 + + -34 + + + tutorial + + + + 0 + + -40 + + + index noindex + + + + 0 + + -37 + + + exception_ptr type + + + + 0 + + -39 + + + + + + + 0 + + -33 + + + free function +