From f80f55143edd95132a9828f7eaceedbb013b4c57 Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Thu, 9 Apr 2009 05:48:51 +0000 Subject: [PATCH] documentation update [SVN r52280] --- doc/current_exception.html | 1 + doc/frequently_asked_questions.html | 49 +- doc/source/boost-exception.reno | 5304 ++++++++++++++------------- 3 files changed, 2696 insertions(+), 2658 deletions(-) diff --git a/doc/current_exception.html b/doc/current_exception.html index 9ad515a..f8daa0f 100644 --- a/doc/current_exception.html +++ b/doc/current_exception.html @@ -46,6 +46,7 @@ boost copy_exception
enable_current_exception
exception_ptr
+
Frequently Asked Questions
unknown_exception
diff --git a/doc/frequently_asked_questions.html b/doc/frequently_asked_questions.html index 69e3192..af81879 100644 --- a/doc/frequently_asked_questions.html +++ b/doc/frequently_asked_questions.html @@ -21,16 +21,9 @@

Frequently Asked Questions

-

Why use operator<< overload for adding info to exceptions?

-

Before throwing an object of type that derives from boost::exception, it is often desirable to add one or more error_info objects in it. The syntactic sugar provided by exception/operator<< allows this to be done directly in a throw expression:

-
throw error() << foo_info(foo) << bar_info(bar);
-

which saves typing compared to this possible alternative:

-
error e;
-e.add(foo_info(foo));
-e.add(bar_info(bar));
-throw e;
-

and looks better than something like:

-
throw error().add(foo_info(foo)).add(bar_info(bar));
+

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

+

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

+

Of course, boost::exception should not be used to replace std::exception as a base type in exception type hierarchies. Instead, it should be included as a virtual base, in addition to std::exception (which should also be derived virtually.)

Why is boost::exception abstract?

To prevent exception-neutral contexts from erroneously erasing the type of the original exception when adding error_info to an active exception object:

catch( boost::exception & e )
@@ -44,23 +37,12 @@ throw e;
e << foo_info(foo); throw; //Okay, re-throwing the original exception object. } -

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

-

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

-

Of course, boost::exception should not be used to replace std::exception as a base type in exception type hierarchies. Instead, it should be included as a virtual base, in addition to std::exception (which should also be derived virtually.)

What is the space overhead of the boost::exception base class?

The space overhead for the boost::exception data members is negligible in the context of exception handling. Throwing objects that derive from boost::exception does not by itself cause dynamic memory allocations.

Deriving from boost::exception enables any data to be added to exceptions, which usually does allocate memory. However, this memory is reclaimed when the exception has been handled, and since typically user code does not allocate memory during the unrolling of the stack, adding error info to exceptions should not cause memory fragmentation.

-

Why is boost::exception integrated in boost::throw_exception?

-

The boost::throw_exception function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::exception as a base of any exception passed to boost::throw_exception. Such concerns are dictated by the typical strict interpretation of a common principle in C and C++, that users only pay for features they actually use.

-

The problem is that users of Boost Exception can't by themselves cause a library to throw types that derive from boost::exception, and without this they can't use any of the Boost Exception facilities.

-

For example, if a user wants to use Boost Serialization in a separate thread, it is desirable to be able to transport exceptions emitted by that library into the main thread where they can be analyzed to generate a user-friendly message. This can be easily achieved using boost::exception_ptr, but this requires that Boost Serialization throws exceptions using boost::enable_current_exception. If Boost Serialization calls boost::throw_exception to throw, this behavior happens automatically and transparently.

-

The cost of this integration is:

-
  • In terms of space: a pointer and 3 ints are added to the static size of exception objects.
  • -
  • In terms of speed: the pointer is initialized to null at the point of the throw.
  • -
  • In terms of coupling: about 400 self-contained lines of C++ with no external includes.
  • -
-

Should I call boost::throw_exception or BOOST_THROW_EXCEPTION?

-

It is preferable to throw exceptions using the BOOST_THROW_EXCEPTION macro. This has the benefit of recording in the exception object the __FILE__ and __LINE__ of the throw, as well as the pretty name of the function that throws. This has virtually no overhead, yet enables boost::diagnostic_information to compose a more useful, if not user-friendly message.

+

Should I use boost::throw_exception or BOOST_THROW_EXCEPTION or just throw?

+

The benefit of calling boost::throw_exception instead of using throw directly is that it ensures that the emitted exception derives from boost::exception and that it is compatible with boost::current_exception.

+

The BOOST_THROW_EXCEPTION macro also results in a call to boost::throw_exception, but in addition it records in the exception object the __FILE__ and __LINE__ of the throw, as well as the pretty name of the function that throws. This has virtually no overhead, yet enables boost::diagnostic_information to compose a more useful, if not user-friendly message.

Typical use of boost::diagnostic_information is:

catch( boost::exception & e )
     {
@@ -78,6 +60,25 @@ std::exception::what: example_io error
 [struct tag_file_name *] = tmp1.xml
 [struct tag_function *] = fopen
 [struct tag_open_mode *] = rb
+

Why is boost::exception integrated in boost::throw_exception?

+

The boost::throw_exception function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::exception as a base of any exception passed to boost::throw_exception. Such concerns are dictated by the typical strict interpretation of a common principle in C and C++, that users only pay for features they actually use.

+

The problem is that users of Boost Exception can't by themselves cause a library to throw types that derive from boost::exception, and without this they can't use any of the Boost Exception facilities.

+

For example, if a user wants to use Boost Serialization in a separate thread, it is desirable to be able to transport exceptions emitted by that library into the main thread where they can be analyzed to generate a user-friendly message. This can be easily achieved using boost::exception_ptr, but this requires that Boost Serialization throws exceptions using boost::enable_current_exception. If Boost Serialization calls boost::throw_exception to throw, this behavior happens automatically and transparently.

+

The cost of this integration is:

+
  • In terms of space: a pointer and 3 ints are added to the static size of exception objects.
  • +
  • In terms of speed: the pointer is initialized to null at the point of the throw.
  • +
  • In terms of coupling: about 400 self-contained lines of C++ with no external includes.
  • +
+

Why use operator<< overload for adding info to exceptions?

+

Before throwing an object of type that derives from boost::exception, it is often desirable to add one or more error_info objects in it. The syntactic sugar provided by exception/operator<< allows this to be done directly in a throw expression:

+
throw error() << foo_info(foo) << bar_info(bar);
+

which saves typing compared to this possible alternative:

+
error e;
+e.add(foo_info(foo));
+e.add(bar_info(bar));
+throw e;
+

and looks better than something like:

+
throw error().add(foo_info(foo)).add(bar_info(bar));

See Also:

Boost Exception
diff --git a/doc/source/boost-exception.reno b/doc/source/boost-exception.reno index 594879b..a6a998a 100644 --- a/doc/source/boost-exception.reno +++ b/doc/source/boost-exception.reno @@ -58,10 +58,10 @@ 2533933282 8724 615 - 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 - 2078296250 - 305 - 8156 + E23085202D084CBB50F289988A6A592F06D923B77D0AB25D7A98A7188DF5BE3B + 1414247481 + 766 + 7388 @@ -75,7 +75,7 @@ - <string>copy_exception</string> + <string>current_exception</string> @@ -140,32 +140,28 @@ - 2 - 1D3204D3ADDAB7AA716BEA1489EA852A9D6B5C110243364F6931FEF1CC2E5F88 - 422052608 - 3923 - 518 - 6E325144EF4F41FA3A225EB30729101382C4E99B3D6160E307311E4B4E641010 - 1097215175 - 161 - 240 + 1 + 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF + 1282550303 + 9192 + 323 0 - ../../../../boost/exception/info.hpp + ../../../../boost/exception/exception.hpp 0 0 - <string>error_info::error_info</string> + <string>boost/exception/exception.hpp</string> - + exception_exception_hpp @@ -189,18 +185,29 @@ - 0 + 2 + 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 + 2533933282 + 8724 + 615 + 0066D4E6E6B189906E6DE04F08509F3737511701A1B1355B37511EC18E8371F4 + 2078296250 + 305 + 8156 - 1 + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 - <string>frequently asked questions</string> + <string>copy_exception</string> @@ -222,55 +229,6 @@ reno_context - - - - - - 2 - 1D3204D3ADDAB7AA716BEA1489EA852A9D6B5C110243364F6931FEF1CC2E5F88 - 422052608 - 3923 - 518 - D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 - 4055211476 - 525 - 3392 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - - <string>exception/operator<<</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 10 - - reno_context - @@ -312,6 +270,55 @@ (:include include:) (:auto also:) + + + 0 + + 10 + + reno_context + + + + + + + 2 + 1D3204D3ADDAB7AA716BEA1489EA852A9D6B5C110243364F6931FEF1CC2E5F88 + 422052608 + 3923 + 518 + 6E325144EF4F41FA3A225EB30729101382C4E99B3D6160E307311E4B4E641010 + 1097215175 + 161 + 240 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>error_info::error_info</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + 0 @@ -320,6 +327,138 @@ 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 + + 12 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>frequently asked questions</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 13 + + reno_context + + + + + + + 2 + 1D3204D3ADDAB7AA716BEA1489EA852A9D6B5C110243364F6931FEF1CC2E5F88 + 422052608 + 3923 + 518 + D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 + 4055211476 + 525 + 3392 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>exception/operator<<</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 14 + + reno_context + @@ -352,7 +491,7 @@ 0 - 12 + 15 reno_context @@ -386,7 +525,7 @@ 0 - 13 + 16 reno_context @@ -427,7 +566,7 @@ 0 - -8 + -12 2 @@ -438,7 +577,33 @@ 0 - 14 + -15 + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + -16 + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 17 reno_context @@ -487,7 +652,7 @@ 0 - 15 + 18 reno_context @@ -536,78 +701,7 @@ 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 - - -12 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -13 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 17 + 19 reno_context @@ -650,7 +744,7 @@ 0 - 18 + 20 reno_context @@ -660,28 +754,28 @@ 2 - 9748FFBBC9F02FEB97E0BA1E6280C51FFF5D7F217F0F12EE8ED29F6BE5CCCE44 - 2533933282 - 8724 - 615 - E23085202D084CBB50F289988A6A592F06D923B77D0AB25D7A98A7188DF5BE3B - 1414247481 - 766 - 7388 + F7537DC10435D0F7CC368E0FC747B2B1169E1CE60FCBAE8AC86F2256667C95B2 + 3301865866 + 4151 + 557 + D747B0A0953B72747224DE7856DB793A4BFF7B73793873CF22810FCB304A7310 + 505472020 + 3665 + 26 0 - ../../../../boost/exception_ptr.hpp + ../../../../boost/exception/diagnostic_information.hpp 0 0 - <string>current_exception</string> + <string>diagnostic_information</string> @@ -699,7 +793,7 @@ 0 - 19 + 21 reno_context @@ -752,7 +846,7 @@ 0 - 20 + 22 reno_context @@ -801,7 +895,7 @@ 0 - 21 + 23 reno_context @@ -846,56 +940,7 @@ 0 - 22 - - reno_context - - - - - - - 2 - F7537DC10435D0F7CC368E0FC747B2B1169E1CE60FCBAE8AC86F2256667C95B2 - 3301865866 - 4151 - 557 - D747B0A0953B72747224DE7856DB793A4BFF7B73793873CF22810FCB304A7310 - 505472020 - 3665 - 26 - - - - - - 0 - ../../../../boost/exception/diagnostic_information.hpp - 0 - 0 - - - - - <string>diagnostic_information</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 23 + 24 reno_context @@ -934,51 +979,6 @@ 0 - - - 0 - - 24 - - reno_context - - - - - - - 1 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>boost/exception/exception.hpp</string> - - - exception_exception_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - 0 @@ -1217,6 +1217,51 @@ reno_context + + + + + + 1 + 9E3988368193B192FA2426DE2B97FA8D0DA8A9FFECAD6A010FE1B5CD9662FAE9 + 109897168 + 4491 + 227 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + + <string>boost/exception/diagnostic_information.hpp</string> + + + exception_diagnostic_information_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 31 + + reno_context + @@ -1256,7 +1301,7 @@ 0 - 31 + 32 reno_context @@ -1305,7 +1350,7 @@ 0 - 32 + 33 reno_context @@ -1354,7 +1399,7 @@ 0 - 33 + 34 reno_context @@ -1392,7 +1437,7 @@ 0 - 34 + 35 reno_context @@ -1430,7 +1475,7 @@ 0 - 35 + 36 reno_context @@ -1479,7 +1524,7 @@ 0 - 36 + 37 reno_context @@ -1528,7 +1573,7 @@ 0 - 37 + 38 reno_context @@ -1566,7 +1611,7 @@ 0 - 38 + 39 reno_context @@ -1615,7 +1660,7 @@ 0 - 39 + 40 reno_context @@ -1660,49 +1705,6 @@ (:include include:) (:auto also:) - - - 0 - - 40 - - reno_context - - - - - - - 1 - D10E536B909EFFF78FB09E6242AEC7C74ACDD75AE7DF32B45870422B752E5D8E - 1903336130 - 557 - 382 - - - - - - 0 - ../../example/error_info_1.cpp - 0 - 0 - - - - - <string>adding of arbitrary data at the point of the throw</string> - - - adding_data_at_throw - - - - - - 0 - - 0 @@ -1711,175 +1713,6 @@ reno_context - - - - - - 0 - - - - - - 1 - - - - - <string>Types</string> - - - types - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 42 - - 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 - - 43 - - reno_context - - - - - - - 1 - 9E3988368193B192FA2426DE2B97FA8D0DA8A9FFECAD6A010FE1B5CD9662FAE9 - 109897168 - 4491 - 227 - - - - - - 0 - ../../../../boost/exception/diagnostic_information.hpp - 0 - 0 - - - - - <string>boost/exception/diagnostic_information.hpp</string> - - - exception_diagnostic_information_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 44 - - reno_context - - - - - - - 1 - 9E8DCE3BCF462A3A332DA70F61E46FA5C2AB791B95E33D3F2AF1307F53C84B1C - 1960675522 - 6483 - 591 - - - - - - 0 - ../../example/example_io.cpp - 0 - 0 - - - - - <string>diagnostic_information example</string> - - - - - - - - - 0 - - - - - 0 - - 45 - - reno_context - @@ -1925,6 +1758,173 @@ (:include include:) (:auto also:) + + + 0 + + 42 + + reno_context + + + + + + + 1 + D10E536B909EFFF78FB09E6242AEC7C74ACDD75AE7DF32B45870422B752E5D8E + 1903336130 + 557 + 382 + + + + + + 0 + ../../example/error_info_1.cpp + 0 + 0 + + + + + <string>adding of arbitrary data at the point of the throw</string> + + + adding_data_at_throw + + + + + + 0 + + + + + 0 + + 43 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Types</string> + + + types + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 44 + + 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 + + 45 + + reno_context + + + + + + + 1 + 9E8DCE3BCF462A3A332DA70F61E46FA5C2AB791B95E33D3F2AF1307F53C84B1C + 1960675522 + 6483 + 591 + + + + + + 0 + ../../example/example_io.cpp + 0 + 0 + + + + + <string>diagnostic_information example</string> + + + + + + + + + 0 + + 0 @@ -2669,6 +2669,28 @@ 0 + + + 0 + + -12 + + + + 0 + + + + + 0 + + -13 + + + + 0 + + 0 @@ -2702,28 +2724,6 @@ 0 - - - 0 - - -12 - - - - 0 - - - - - 0 - - -13 - - - - 0 - - 0 @@ -2962,6 +2962,17 @@ -38 + + 0 + + + + + 0 + + -39 + + 7 2 @@ -2970,7 +2981,7 @@ 0 - -38 + -39 2 @@ -2979,7 +2990,7 @@ 0 - -45 + -41 2 @@ -2999,7 +3010,7 @@ 0 - -39 + -40 @@ -3010,7 +3021,7 @@ 0 - -39 + -40 2 @@ -3028,7 +3039,7 @@ 0 - -7 + -10 2 @@ -3044,17 +3055,6 @@ decl pre_indent="4":) };@] - - - 0 - - -40 - - - - 0 - - 0 @@ -3319,7 +3319,54 @@ - 0 + 11 + 2 + [@(:include + 1 + + 0 + + -39 + + + 2 + def:) (:include + 1 + + 0 + + -40 + + + 2 + decl:) typedef (:link + 1 + + 0 + + -40 + + + 2 + :)<struct tag_throw_function,char const *> throw_function; typedef (:link + 1 + + 0 + + -40 + + + 2 + :)<struct tag_throw_file,char const *> throw_file; typedef (:link + 1 + + 0 + + -40 + + + 2 + :)<struct tag_throw_line,int> throw_line;@] @@ -3366,6 +3413,28 @@ 0 + + + 0 + + -12 + + + + 0 + + + + + 0 + + -13 + + + + 0 + + 0 @@ -3399,28 +3468,6 @@ 0 - - - 0 - - -12 - - - - 0 - - - - - 0 - - -13 - - - - 0 - - 0 @@ -3506,54 +3553,7 @@ - 11 - 2 - [@(:include - 1 - - 0 - - -38 - - - 2 - def:) (:include - 1 - - 0 - - -39 - - - 2 - decl:) typedef (:link - 1 - - 0 - - -39 - - - 2 - :)<struct tag_throw_function,char const *> throw_function; typedef (:link - 1 - - 0 - - -39 - - - 2 - :)<struct tag_throw_file,char const *> throw_file; typedef (:link - 1 - - 0 - - -39 - - - 2 - :)<struct tag_throw_line,int> throw_line;@] + 0 @@ -3571,7 +3571,7 @@ 0 - -32 + -33 2 @@ -3604,7 +3604,7 @@ 0 - -20 + -22 2 @@ -3641,7 +3641,27 @@ - 0 + 5 + 2 + [@(:include + 1 + + 0 + + -20 + + + 2 + decl:) (:include + 1 + + 0 + + -28 + + + 2 + decl:)@] @@ -3784,27 +3804,7 @@ - 5 - 2 - [@(:include - 1 - - 0 - - -22 - - - 2 - decl:) (:include - 1 - - 0 - - -28 - - - 2 - decl:)@] + 0 @@ -3877,7 +3877,7 @@ 0 - -10 + -9 2 @@ -3899,7 +3899,7 @@ 0 - -43 + -30 2 @@ -3917,7 +3917,7 @@ 0 - -24 + -7 2 @@ -3986,7 +3986,7 @@ 0 - -14 + -17 2 @@ -4019,7 +4019,7 @@ 0 - -39 + -40 2 @@ -4052,7 +4052,7 @@ 0 - -39 + -40 2 @@ -4061,7 +4061,7 @@ 0 - -9 + -13 2 @@ -4083,25 +4083,7 @@ 0 - -31 - - - 2 - decl:) (:include - 1 - - 0 - - -15 - - - 2 - decl:) (:include - 1 - - 0 - - -5 + -32 2 @@ -4119,7 +4101,25 @@ 0 - -36 + -8 + + + 2 + decl:) (:include + 1 + + 0 + + -5 + + + 2 + decl:) (:include + 1 + + 0 + + -37 2 @@ -4141,7 +4141,7 @@ 0 - -21 + -23 2 @@ -4150,7 +4150,7 @@ 0 - -35 + -36 2 @@ -4214,12 +4214,12 @@ 5 2 - [@template <class T> (:link + [@(:link 1 0 - -15 + -18 2 @@ -4232,7 +4232,7 @@ 2 - :)( T const & e );@] + :)();@] @@ -4253,6 +4253,88 @@ -7 + + 0 + + + + + 0 + + -8 + + + + 5 + 2 + [@template <class T> (:link + 1 + + 0 + + -18 + + + 2 + :) (:link + 1 + + 0 + + -8 + + + 2 + :)( T const & e );@] + + + + + 0 + + -9 + + + + 7 + 2 + [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link + 1 + + 0 + + -9 + + + 2 + mod="/":)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link + 1 + + 0 + + -40 + + + 2 + :)<Tag1,T1>, ..., (:link + 1 + + 0 + + -40 + + + 2 + :)<TagN,TN> > const & v );@] + + + + + 0 + + -10 + + 5 2 @@ -4261,7 +4343,7 @@ 0 - -7 + -10 2 @@ -4277,88 +4359,6 @@ mod="m":) const & v );@] - - - 0 - - -8 - - - - 0 - - - - - 0 - - -9 - - - - 5 - 2 - [@template <class E, class Tag, class T> E const & (:link - 1 - - 0 - - -9 - - - 2 - mod="/":)( E const & x, (:link - 1 - - 0 - - -39 - - - 2 - :)<Tag,T> const & v );@] - - - - - 0 - - -10 - - - - 7 - 2 - [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link - 1 - - 0 - - -10 - - - 2 - mod="/":)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link - 1 - - 0 - - -39 - - - 2 - :)<Tag1,T1>, ..., (:link - 1 - - 0 - - -39 - - - 2 - :)<TagN,TN> > const & v );@] - - 0 @@ -4370,61 +4370,6 @@ 0 - - - 0 - - -14 - - - - 3 - 2 - [@template <class T> ---unspecified--- (:link - 1 - - 0 - - -14 - - - 2 - :)( T const & x );@] - - - - - 0 - - -15 - - - - 3 - 2 - [@typedef ---unspecified--- (:link - 1 - - 0 - - -15 - - - 2 - :);@] - - - - - 0 - - -16 - - - - 0 - - 0 @@ -4443,6 +4388,59 @@ -13 + + 5 + 2 + [@template <class E, class Tag, class T> E const & (:link + 1 + + 0 + + -13 + + + 2 + mod="/":)( E const & x, (:link + 1 + + 0 + + -40 + + + 2 + :)<Tag,T> const & v );@] + + + + + 0 + + -14 + + + + 0 + + + + + 0 + + -15 + + + + 0 + + + + + 0 + + -16 + + 0 @@ -4455,7 +4453,18 @@ - 0 + 3 + 2 + [@template <class T> ---unspecified--- (:link + 1 + + 0 + + -17 + + + 2 + :)( T const & x );@] @@ -4466,18 +4475,9 @@ - 5 + 3 2 - [@(:link - 1 - - 0 - - -15 - - - 2 - :) (:link + [@typedef ---unspecified--- (:link 1 0 @@ -4486,7 +4486,7 @@ 2 - :)();@] + :);@] @@ -4510,7 +4510,7 @@ 3 2 - [@template <class T> ---unspecified--- (:link + [@template <class E> std::string (:link 1 0 @@ -4519,7 +4519,7 @@ 2 - :)( T const & e );@] + :)( E const & e );@] @@ -4530,90 +4530,7 @@ - 19 - 2 - [@#if !defined( BOOST_EXCEPTION_DISABLE ) #include <(:link - 1 - - 0 - - -24 - - - 2 - :)> #include <boost/current_function.hpp> #define (:link - 1 - - 0 - - -21 - - - 2 - :)(x)\ ::boost::(:link - 1 - - 0 - - -35 - - - 2 - :)( ::boost::(:link - 1 - - 0 - - -14 - - - 2 - :)(x) <<\ ::boost::(:link - 1 - - 0 - - -24 - - - 2 - |throw_function:)(BOOST_CURRENT_FUNCTION) <<\ ::boost::(:link - 1 - - 0 - - -24 - - - 2 - |throw_file:)(__FILE__) <<\ ::boost::(:link - 1 - - 0 - - -24 - - - 2 - |throw_line:)((int)__LINE__) ) #else #define (:link - 1 - - 0 - - -21 - - - 2 - :)(x) ::boost::(:link - 1 - - 0 - - -35 - - - 2 - :)(x) #endif@] + 0 @@ -4626,7 +4543,7 @@ 3 2 - [@template <class E> std::string (:link + [@template <class T> ---unspecified--- (:link 1 0 @@ -4635,7 +4552,7 @@ 2 - :)( E const & e );@] + :)( T const & e );@] @@ -4646,7 +4563,90 @@ - 0 + 19 + 2 + [@#if !defined( BOOST_EXCEPTION_DISABLE ) #include <(:link + 1 + + 0 + + -7 + + + 2 + :)> #include <boost/current_function.hpp> #define (:link + 1 + + 0 + + -23 + + + 2 + :)(x)\ ::boost::(:link + 1 + + 0 + + -36 + + + 2 + :)( ::boost::(:link + 1 + + 0 + + -17 + + + 2 + :)(x) <<\ ::boost::(:link + 1 + + 0 + + -7 + + + 2 + |throw_function:)(BOOST_CURRENT_FUNCTION) <<\ ::boost::(:link + 1 + + 0 + + -7 + + + 2 + |throw_file:)(__FILE__) <<\ ::boost::(:link + 1 + + 0 + + -7 + + + 2 + |throw_line:)((int)__LINE__) ) #else #define (:link + 1 + + 0 + + -23 + + + 2 + :)(x) ::boost::(:link + 1 + + 0 + + -36 + + + 2 + :)(x) #endif@] @@ -4766,6 +4766,17 @@ -31 + + 0 + + + + + 0 + + -32 + + 5 2 @@ -4774,7 +4785,7 @@ 0 - -31 + -32 2 @@ -4783,7 +4794,7 @@ 0 - -38 + -39 2 @@ -4794,7 +4805,7 @@ 0 - -32 + -33 @@ -4814,24 +4825,13 @@ 0 - -32 + -33 2 :)( E const & x );@] - - - 0 - - -33 - - - - 0 - - 0 @@ -4851,27 +4851,7 @@ - 5 - 2 - [@#ifdef BOOST_NO_EXCEPTIONS void (:link - 1 - - 0 - - -35 - - - 2 - :)( std::exception const & e ); // user defined #else template <class E> void (:link - 1 - - 0 - - -35 - - - 2 - :)( E const & e ); #endif@] + 0 @@ -4884,7 +4864,7 @@ 5 2 - [@void (:link + [@#ifdef BOOST_NO_EXCEPTIONS void (:link 1 0 @@ -4893,16 +4873,16 @@ 2 - :)( (:link + :)( std::exception const & e ); // user defined #else template <class E> void (:link 1 0 - -15 + -36 2 - :) const & ep ); + :)( E const & e ); #endif@] @@ -4913,7 +4893,27 @@ - 0 + 5 + 2 + [@void (:link + 1 + + 0 + + -37 + + + 2 + :)( (:link + 1 + + 0 + + -18 + + + 2 + :) const & ep ); @@ -4924,18 +4924,7 @@ - 3 - 2 - [@class (:link - 1 - - 0 - - -38 - - - 2 - :);@] + 0 @@ -4948,7 +4937,7 @@ 3 2 - [@template <class Tag,class T> class (:link + [@class (:link 1 0 @@ -4968,7 +4957,18 @@ - 0 + 3 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -40 + + + 2 + :);@] @@ -4979,7 +4979,36 @@ - 0 + 7 + 2 + [@(:link + 1 + + 0 + + -41 + + + 2 + mod="m":)(); (:link + 1 + + 0 + + -41 + + + 2 + mod="m":)( (:link + 1 + + 0 + + -39 + + + 2 + :) const & x );@] @@ -5023,36 +5052,7 @@ - 7 - 2 - [@(:link - 1 - - 0 - - -45 - - - 2 - mod="m":)(); (:link - 1 - - 0 - - -45 - - - 2 - mod="m":)( (:link - 1 - - 0 - - -38 - - - 2 - :) const & x );@] + 0 @@ -5273,18 +5273,18 @@ - 5 + 29 2 - (:auto !!!:) (:include synopsis:) !!!!Effects: As if [@try { throw + (:auto !!!:) (:include synopsis:) !!!!Requirements: The (:link 1 0 - -20 + -5 2 - (e); } catch(...) { return (:link + :) function must not be called outside of a catch block. !!!!Returns: * An (:link 1 0 @@ -5293,7 +5293,115 @@ 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 + + -18 + + + 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 + + -5 + + + 2 + :) refer to the same exception object. * Correct implementation of (:link + 1 + + 0 + + -5 + + + 2 + :) may require compiler support, unless (:link + 1 + + 0 + + -22 + + + 2 + :) was used at the time the currently handled exception object was passed to throw. If (:link + 1 + + 0 + + -22 + + + 2 + :) was not used, and if the compiler does not provide the necessary support, then (:link + 1 + + 0 + + -5 + + + 2 + :) may return an (:link + 1 + + 0 + + -18 + + + 2 + :) that refers to an instance of (:link + 1 + + 0 + + -32 + + + 2 + :). In this case, if the original exception object derives from boost::(:link + 1 + + 0 + + -39 + + + 2 + :), then the boost::(:link + 1 + + 0 + + -39 + + + 2 + :) sub-object of the (:link + 1 + + 0 + + -32 + + + 2 + :) object is initialized by the boost::(:link + 1 + + 0 + + -39 + + + 2 + :) copy constructor. @@ -5311,7 +5419,7 @@ 0 - -38 + -39 2 @@ -5320,7 +5428,7 @@ 0 - -38 + -39 2 @@ -5329,7 +5437,7 @@ 0 - -40 + -42 2 @@ -5338,7 +5446,7 @@ 0 - -30 + -31 2 @@ -5347,7 +5455,7 @@ 0 - -23 + -24 2 @@ -5362,18 +5470,9 @@ - 3 + 1 2 - (:auto !!!:) (:include synopsis:) !!!!Effects: Stores a copy of v in the - 1 - - 0 - - -39 - - - 2 - object. (:include throws:) + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -5384,234 +5483,9 @@ - 57 + 5 2 - (:auto !!!:) !!!Why use operator<< overload for adding info to exceptions? Before throwing an object of type that derives from boost::(:link - 1 - - 0 - - -38 - - - 2 - :), it is often desirable to add one or more (:link - 1 - - 0 - - -39 - - - 2 - :) objects in it. The syntactic sugar provided by (:link - 1 - - 0 - - -9 - - - 2 - :) allows this to be done directly in a throw expression: [@throw error() (:link - 1 - - 0 - - -9 - - - 2 - |<<:) foo_info(foo) (:link - 1 - - 0 - - -9 - - - 2 - |<<:) bar_info(bar);@] which saves typing compared to this possible alternative: [@error e; e.add(foo_info(foo)); e.add(bar_info(bar)); throw e;@] and looks better than something like: [@throw error().add(foo_info(foo)).add(bar_info(bar));@] !!!Why is boost::exception abstract? To prevent exception-neutral contexts from erroneously erasing the type of the original exception when adding (:link - 1 - - 0 - - -39 - - - 2 - :) to an active exception object: [@catch( boost::(:link - 1 - - 0 - - -38 - - - 2 - :) & e ) { e (:link - 1 - - 0 - - -9 - - - 2 - |<<:) foo_info(foo); throw e; //Compile error: boost::(:link - 1 - - 0 - - -38 - - - 2 - :) is abstract }@] The correct code is: [@catch( boost::(:link - 1 - - 0 - - -38 - - - 2 - :) & e ) { e (:link - 1 - - 0 - - -9 - - - 2 - |<<:) foo_info(foo); throw; //Okay, re-throwing the original exception object. }@] !!!Why doesn't boost::exception derive from std::exception? Despite that (:link - 1 - - 0 - - -37 - - - 2 - |virtual inheritance should be used in deriving from base exception types:), many programmers fail to follow this principle when deriving from std::exception. If boost::(:link - 1 - - 0 - - -38 - - - 2 - :) derives from std::exception, using the - 1 - - 0 - - -14 - - - 2 - function with such user-defined types would introduce dangerous ambiguity which would break all catch(std::exception &) statements. Of course, boost::(:link - 1 - - 0 - - -38 - - - 2 - :) should not be used to replace std::exception as a base type in exception type hierarchies. Instead, it should be included as a virtual base, in addition to std::exception (which should also be derived virtually.) !!!What is the space overhead of the boost::exception base class? The space overhead for the boost::exception data members is negligible in the context of exception handling. Throwing objects that derive from boost::(:link - 1 - - 0 - - -38 - - - 2 - :) does not by itself cause dynamic memory allocations. Deriving from boost::(:link - 1 - - 0 - - -38 - - - 2 - :) enables any data to be added to exceptions, which usually does allocate memory. However, this memory is reclaimed when the exception has been handled, and since typically user code does not allocate memory during the unrolling of the stack, adding error info to exceptions should not cause memory fragmentation. !!!Why is boost::exception integrated in boost::throw_exception? The boost::(:link - 1 - - 0 - - -35 - - - 2 - :) function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::(:link - 1 - - 0 - - -38 - - - 2 - :) as a base of any exception passed to boost::(:link - 1 - - 0 - - -35 - - - 2 - :). Such concerns are dictated by the typical strict interpretation of a common principle in C and C++, that users only pay for features they actually use. The problem is that users of Boost Exception can't by themselves cause a library to throw types that derive from boost::(:link - 1 - - 0 - - -38 - - - 2 - :), and without this they can't use any of the Boost Exception facilities. For example, if a user wants to use Boost Serialization in a separate thread, it is desirable to be able to transport exceptions emitted by that library into the main thread where they can be analyzed to generate a user-friendly message. This can be easily achieved using boost::(:link - 1 - - 0 - - -15 - - - 2 - :), but this requires that Boost Serialization throws exceptions using boost::(:link - 1 - - 0 - - -20 - - - 2 - :). If Boost Serialization calls boost::(:link - 1 - - 0 - - -35 - - - 2 - :) to throw, this behavior happens automatically and transparently. The cost of this integration is: * In terms of space: a pointer and 3 ints are added to the static size of exception objects. * In terms of speed: the pointer is initialized to null at the point of the throw. * In terms of coupling: about 400 self-contained lines of C++ with no external includes. !!!Should I call boost::throw_exception or BOOST_THROW_EXCEPTION? It is preferable to throw exceptions using the (:link - 1 - - 0 - - -21 - - - 2 - :) macro. This has the benefit of recording in the exception object the __FILE__ and __LINE__ of the throw, as well as the pretty name of the function that throws. This has virtually no overhead, yet enables boost::(:link + (:auto !!!:) (:include synopsis:) !!!!Effects: As if [@try { throw 1 0 @@ -5620,25 +5494,16 @@ 2 - :) to compose a more useful, if not user-friendly message. Typical use of boost::(:link + (e); } catch(...) { return (:link 1 0 - -22 + -5 2 - :) is: [@catch( boost::exception & e ) { std::cerr << "OMG!" << boost::diagnostic_information(e); } catch( ... ) { std::cerr << "OMG!!!"; }@] This is a possible message it may display, the first line is only possible if (:link - 1 - - 0 - - -21 - - - 2 - :) is used: [@example_io.cpp(83): Throw in function void parse_file(const char *) Dynamic exception type: class file_open_error std::exception::what: example_io error [struct tag_errno_code *] = 2, OS says "No such file or directory" [struct tag_file_name *] = tmp1.xml [struct tag_function *] = fopen [struct tag_open_mode *] = rb@] + :)(); }@] @@ -5649,28 +5514,10 @@ - 7 + 5 2 (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link 1 - - 0 - - -38 - - - 2 - :), or a type that derives (indirectly) from boost::(:link - 1 - - 0 - - -38 - - - 2 - :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link - 1 0 @@ -5678,40 +5525,40 @@ 2 - :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) - - - - - 0 - - -10 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link - 1 - - 0 - - -38 - - - 2 :), or a type that derives (indirectly) from boost::(:link 1 0 - -38 + -39 2 :). !!!!Effects: Equivalent to x << v.(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements|get:)<0>() << ... << v.(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements|get:)<N>(). !!!!Returns: x. (:include throws:) + + + 0 + + -10 + + + + 3 + 2 + (:auto !!!:) (:include synopsis:) !!!!Effects: Stores a copy of v in the + 1 + + 0 + + -40 + + + 2 + object. (:include throws:) + + 0 @@ -5719,279 +5566,6 @@ -11 - - 33 - 2 - (:auto !!!:) Traditionally, when using exceptions to report failures, the throw site: *creates an exception object of the appropriate type, and *stuffs it with data relevant to the detected error. A higher context in the program contains a catch statement which: *selects failures based on exception types, and *inspects exception objects for data required to deal with the problem. The main issue with this "traditional" approach is that often, the data available at the point of the throw is insufficient for the catch site to handle the failure. Here is an example of a catch statement: [@catch( file_read_error & e ) { std::cerr << e.file_name(); }@] And here is a possible matching throw: [@void read_file( FILE * f ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error(???); .... }@] Clearly, the problem is that the handler requires a file name but the read_file function does not have a file name to put in the exception object; all it has is a FILE pointer! In an attempt to deal with this problem, we could modify read_file to accept a file name: [@void read_file( FILE * f, char const * name ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error(name); .... }@] This is not a real solution: it simply shifts the burden of supplying a file name to the immediate caller of the read_file function. ->''In general, the data required to handle a given library-emitted exception depends on the program that links to it. Many contexts between the throw and the catch may have relevant information which must be transported to the exception handler.'' !!!Exception wrapping The idea of exception wrapping is to catch an exception from a lower level function (such as the read_file function above), and throw a new exception object that contains the original exception (and also carries a file name.) This method seems to be particularly popular with C++ programmers with Java background. Exception wrapping leads to the following problems: *To wrap an exception object it must be copied, which may result in slicing. *Wrapping is practically impossible to use in generic contexts. The second point is actually special case of violating the exception neutrality principle. Most contexts in a program can not handle exceptions; such contexts should not interfere with the process of exception handling. !!!The boost::exception solution *Simply derive your exception types from boost::(:link - 1 - - 0 - - -38 - - - 2 - :). *Confidently limit the throw site to provide only data that is available naturally. *Use exception-neutral contexts between the throw and the catch to augment exceptions with more relevant data as they bubble up. For example, in the throw statement below we only add the errno code, since this is the only failure-relevant information available in this context: [@struct exception_base: virtual std::exception, virtual boost::(:link - 1 - - 0 - - -38 - - - 2 - :) { }; struct io_error: virtual exception_base { }; struct file_read_error: virtual io_error { }; typedef boost::(:link - 1 - - 0 - - -39 - - - 2 - :)<struct tag_errno_code,int> errno_code; void read_file( FILE * f ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error() (:link - 1 - - 0 - - -9 - - - 2 - |<<:) errno_code(errno); .... }@] In a higher exception-neutral context, we add the file name to ''any'' exception that derives from boost::(:link - 1 - - 0 - - -38 - - - 2 - :): [@typedef boost::(:link - 1 - - 0 - - -39 - - - 2 - :)<struct tag_file_name,std::string> file_name; .... try { if( FILE * fp=fopen("foo.txt","rt") ) { shared_ptr<FILE> f(fp,fclose); .... read_file(fp); //throws types deriving from boost::(:link - 1 - - 0 - - -38 - - - 2 - :) do_something(); .... } else throw file_open_error() (:link - 1 - - 0 - - -9 - - - 2 - |<<:) errno_code(errno); } catch( boost::(:link - 1 - - 0 - - -38 - - - 2 - :) & e ) { e (:link - 1 - - 0 - - -9 - - - 2 - |<<:) file_name("foo.txt"); throw; }@] Finally here is how the handler retrieves data from exceptions that derive from boost::(:link - 1 - - 0 - - -38 - - - 2 - :): [@catch( io_error & e ) { std::cerr << "I/O Error!\n"; if( std::string const * fn=(:link - 1 - - 0 - - -32 - - - 2 - :)<file_name>(e) ) std::cerr << "File name: " << *fn << "\n"; if( int const * c=(:link - 1 - - 0 - - -32 - - - 2 - :)<errno_code>(e) ) std::cerr << "OS says: " << strerror(*c) << "\n"; }@] In addition, boost::(:link - 1 - - 0 - - -22 - - - 2 - :) can be used to compose an automatic (if not user-friendly) message that contains all of the (:link - 1 - - 0 - - -39 - - - 2 - :) objects added to a boost::(:link - 1 - - 0 - - -38 - - - 2 - :). This is useful for inclusion in logs and other diagnostic objects. - - - - - 0 - - -14 - - - - 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 - - -38 - - - 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 - - -38 - - - 2 - :). The T sub-object is initialized from x by the T copy constructor. !!!!Throws: Nothing. - - - - - 0 - - -15 - - - - 17 - 2 - (:auto !!!:) (:include synopsis:) The (:link - 1 - - 0 - - -15 - - - 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 - - -15 - - - 2 - :)'s operations do not throw. Two instances of (:link - 1 - - 0 - - -15 - - - 2 - :) are equivalent and compare equal if and only if they refer to the same exception. The default constructor of (:link - 1 - - 0 - - -15 - - - 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 - - -15 - - - 2 - :) references to the same exception object. * It is illegal for multiple threads to modify the same (:link - 1 - - 0 - - -15 - - - 2 - :) object concurrently. * While calling (:link - 1 - - 0 - - -18 - - - 2 - :) makes a copy of the current exception object, it is still possible for the two copies to share internal state. Therefore, in general it is not safe to call (:link - 1 - - 0 - - -36 - - - 2 - :) concurrently to throw the same exception object into multiple threads. - - - - - 0 - - -16 - - 19 2 @@ -6000,7 +5574,7 @@ 0 - -22 + -20 2 @@ -6009,7 +5583,7 @@ 0 - -38 + -39 2 @@ -6018,7 +5592,7 @@ 0 - -38 + -39 2 @@ -6027,7 +5601,7 @@ 0 - -9 + -13 2 @@ -6045,7 +5619,7 @@ 0 - -38 + -39 2 @@ -6054,7 +5628,7 @@ 0 - -38 + -39 2 @@ -6063,7 +5637,7 @@ 0 - -22 + -20 2 @@ -6072,7 +5646,7 @@ 0 - -44 + -45 2 @@ -6087,9 +5661,9 @@ - 7 + 65 2 - (:auto !!!:) Deriving from boost::(:link + (:auto !!!:) !!!Why doesn't boost::exception derive from std::exception? Despite that (:link 1 0 @@ -6098,25 +5672,286 @@ 2 - :) effectively decouples the semantics of a failure from the information that is relevant to each individual instance of reporting a failure with a given semantic. In other words: with boost::(:link + |virtual inheritance should be used in deriving from base exception types:), many programmers fail to follow this principle when deriving from std::exception. If boost::(:link 1 0 - -38 + -39 2 - :), what data a given exception object transports depends primarily on the context in which failures are reported (not on its type.) Since exception types need no members, it becomes very natural to throw exceptions that derive from more than one type to indicate multiple appropriate semantics: [@struct exception_base: virtual std::exception, virtual boost::(:link + :) derives from std::exception, using the (:link 1 0 - -38 + -17 2 - :) { }; struct io_error: virtual exception_base { }; struct file_error: virtual io_error { }; struct read_error: virtual io_error { }; struct file_read_error: virtual file_error, virtual read_error { };@] Using this approach, exception types become a simple tagging system for categorizing errors and selecting failures in exception handlers. + :) function with such user-defined types would introduce dangerous ambiguity which would break all catch(std::exception &) statements. Of course, boost::(:link + 1 + + 0 + + -39 + + + 2 + :) should not be used to replace std::exception as a base type in exception type hierarchies. Instead, it should be included as a virtual base, in addition to std::exception (which should also be derived virtually.) !!!Why is boost::exception abstract? To prevent exception-neutral contexts from erroneously erasing the type of the original exception when adding (:link + 1 + + 0 + + -40 + + + 2 + :) to an active exception object: [@catch( boost::(:link + 1 + + 0 + + -39 + + + 2 + :) & e ) { e (:link + 1 + + 0 + + -13 + + + 2 + |<<:) foo_info(foo); throw e; //Compile error: boost::(:link + 1 + + 0 + + -39 + + + 2 + :) is abstract }@] The correct code is: [@catch( boost::(:link + 1 + + 0 + + -39 + + + 2 + :) & e ) { e (:link + 1 + + 0 + + -13 + + + 2 + |<<:) foo_info(foo); throw; //Okay, re-throwing the original exception object. }@] !!!What is the space overhead of the boost::exception base class? The space overhead for the boost::exception data members is negligible in the context of exception handling. Throwing objects that derive from boost::(:link + 1 + + 0 + + -39 + + + 2 + :) does not by itself cause dynamic memory allocations. Deriving from boost::(:link + 1 + + 0 + + -39 + + + 2 + :) enables any data to be added to exceptions, which usually does allocate memory. However, this memory is reclaimed when the exception has been handled, and since typically user code does not allocate memory during the unrolling of the stack, adding error info to exceptions should not cause memory fragmentation. !!!Should I use boost::throw_exception or BOOST_THROW_EXCEPTION or just throw? The benefit of calling boost::(:link + 1 + + 0 + + -36 + + + 2 + :) instead of using throw directly is that it ensures that the emitted exception derives from boost::(:link + 1 + + 0 + + -39 + + + 2 + :) and that it is compatible with boost::(:link + 1 + + 0 + + -5 + + + 2 + :). The (:link + 1 + + 0 + + -23 + + + 2 + :) macro also results in a call to boost::(:link + 1 + + 0 + + -36 + + + 2 + :), but in addition it records in the exception object the __FILE__ and __LINE__ of the throw, as well as the pretty name of the function that throws. This has virtually no overhead, yet enables boost::(:link + 1 + + 0 + + -20 + + + 2 + :) to compose a more useful, if not user-friendly message. Typical use of boost::(:link + 1 + + 0 + + -20 + + + 2 + :) is: [@catch( boost::exception & e ) { std::cerr << "OMG!" << boost::diagnostic_information(e); } catch( ... ) { std::cerr << "OMG!!!"; }@] This is a possible message it may display, the first line is only possible if (:link + 1 + + 0 + + -23 + + + 2 + :) is used: [@example_io.cpp(83): Throw in function void parse_file(const char *) Dynamic exception type: class file_open_error std::exception::what: example_io error [struct tag_errno_code *] = 2, OS says "No such file or directory" [struct tag_file_name *] = tmp1.xml [struct tag_function *] = fopen [struct tag_open_mode *] = rb@] !!!Why is boost::exception integrated in boost::throw_exception? The boost::(:link + 1 + + 0 + + -36 + + + 2 + :) function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::(:link + 1 + + 0 + + -39 + + + 2 + :) as a base of any exception passed to boost::(:link + 1 + + 0 + + -36 + + + 2 + :). Such concerns are dictated by the typical strict interpretation of a common principle in C and C++, that users only pay for features they actually use. The problem is that users of Boost Exception can't by themselves cause a library to throw types that derive from boost::(:link + 1 + + 0 + + -39 + + + 2 + :), and without this they can't use any of the Boost Exception facilities. For example, if a user wants to use Boost Serialization in a separate thread, it is desirable to be able to transport exceptions emitted by that library into the main thread where they can be analyzed to generate a user-friendly message. This can be easily achieved using boost::(:link + 1 + + 0 + + -18 + + + 2 + :), but this requires that Boost Serialization throws exceptions using boost::(:link + 1 + + 0 + + -22 + + + 2 + :). If Boost Serialization calls boost::(:link + 1 + + 0 + + -36 + + + 2 + :) to throw, this behavior happens automatically and transparently. The cost of this integration is: * In terms of space: a pointer and 3 ints are added to the static size of exception objects. * In terms of speed: the pointer is initialized to null at the point of the throw. * In terms of coupling: about 400 self-contained lines of C++ with no external includes. !!!Why use operator<< overload for adding info to exceptions? Before throwing an object of type that derives from boost::(:link + 1 + + 0 + + -39 + + + 2 + :), it is often desirable to add one or more (:link + 1 + + 0 + + -40 + + + 2 + :) objects in it. The syntactic sugar provided by (:link + 1 + + 0 + + -13 + + + 2 + :) allows this to be done directly in a throw expression: [@throw error() (:link + 1 + + 0 + + -13 + + + 2 + |<<:) foo_info(foo) (:link + 1 + + 0 + + -13 + + + 2 + |<<:) bar_info(bar);@] which saves typing compared to this possible alternative: [@error e; e.add(foo_info(foo)); e.add(bar_info(bar)); throw e;@] and looks better than something like: [@throw error().add(foo_info(foo)).add(bar_info(bar));@] @@ -6126,6 +5961,243 @@ -13 + + 7 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + 1 + + 0 + + -39 + + + 2 + :), or a type that derives (indirectly) from boost::(:link + 1 + + 0 + + -39 + + + 2 + :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link + 1 + + 0 + + -40 + + + 2 + :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) + + + + + 0 + + -14 + + + + 33 + 2 + (:auto !!!:) Traditionally, when using exceptions to report failures, the throw site: *creates an exception object of the appropriate type, and *stuffs it with data relevant to the detected error. A higher context in the program contains a catch statement which: *selects failures based on exception types, and *inspects exception objects for data required to deal with the problem. The main issue with this "traditional" approach is that often, the data available at the point of the throw is insufficient for the catch site to handle the failure. Here is an example of a catch statement: [@catch( file_read_error & e ) { std::cerr << e.file_name(); }@] And here is a possible matching throw: [@void read_file( FILE * f ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error(???); .... }@] Clearly, the problem is that the handler requires a file name but the read_file function does not have a file name to put in the exception object; all it has is a FILE pointer! In an attempt to deal with this problem, we could modify read_file to accept a file name: [@void read_file( FILE * f, char const * name ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error(name); .... }@] This is not a real solution: it simply shifts the burden of supplying a file name to the immediate caller of the read_file function. ->''In general, the data required to handle a given library-emitted exception depends on the program that links to it. Many contexts between the throw and the catch may have relevant information which must be transported to the exception handler.'' !!!Exception wrapping The idea of exception wrapping is to catch an exception from a lower level function (such as the read_file function above), and throw a new exception object that contains the original exception (and also carries a file name.) This method seems to be particularly popular with C++ programmers with Java background. Exception wrapping leads to the following problems: *To wrap an exception object it must be copied, which may result in slicing. *Wrapping is practically impossible to use in generic contexts. The second point is actually special case of violating the exception neutrality principle. Most contexts in a program can not handle exceptions; such contexts should not interfere with the process of exception handling. !!!The boost::exception solution *Simply derive your exception types from boost::(:link + 1 + + 0 + + -39 + + + 2 + :). *Confidently limit the throw site to provide only data that is available naturally. *Use exception-neutral contexts between the throw and the catch to augment exceptions with more relevant data as they bubble up. For example, in the throw statement below we only add the errno code, since this is the only failure-relevant information available in this context: [@struct exception_base: virtual std::exception, virtual boost::(:link + 1 + + 0 + + -39 + + + 2 + :) { }; struct io_error: virtual exception_base { }; struct file_read_error: virtual io_error { }; typedef boost::(:link + 1 + + 0 + + -40 + + + 2 + :)<struct tag_errno_code,int> errno_code; void read_file( FILE * f ) { .... size_t nr=fread(buf,1,count,f); if( ferror(f) ) throw file_read_error() (:link + 1 + + 0 + + -13 + + + 2 + |<<:) errno_code(errno); .... }@] In a higher exception-neutral context, we add the file name to ''any'' exception that derives from boost::(:link + 1 + + 0 + + -39 + + + 2 + :): [@typedef boost::(:link + 1 + + 0 + + -40 + + + 2 + :)<struct tag_file_name,std::string> file_name; .... try { if( FILE * fp=fopen("foo.txt","rt") ) { shared_ptr<FILE> f(fp,fclose); .... read_file(fp); //throws types deriving from boost::(:link + 1 + + 0 + + -39 + + + 2 + :) do_something(); .... } else throw file_open_error() (:link + 1 + + 0 + + -13 + + + 2 + |<<:) errno_code(errno); } catch( boost::(:link + 1 + + 0 + + -39 + + + 2 + :) & e ) { e (:link + 1 + + 0 + + -13 + + + 2 + |<<:) file_name("foo.txt"); throw; }@] Finally here is how the handler retrieves data from exceptions that derive from boost::(:link + 1 + + 0 + + -39 + + + 2 + :): [@catch( io_error & e ) { std::cerr << "I/O Error!\n"; if( std::string const * fn=(:link + 1 + + 0 + + -33 + + + 2 + :)<file_name>(e) ) std::cerr << "File name: " << *fn << "\n"; if( int const * c=(:link + 1 + + 0 + + -33 + + + 2 + :)<errno_code>(e) ) std::cerr << "OS says: " << strerror(*c) << "\n"; }@] In addition, boost::(:link + 1 + + 0 + + -20 + + + 2 + :) can be used to compose an automatic (if not user-friendly) message that contains all of the (:link + 1 + + 0 + + -40 + + + 2 + :) objects added to a boost::(:link + 1 + + 0 + + -39 + + + 2 + :). This is useful for inclusion in logs and other diagnostic objects. + + + + + 0 + + -15 + + + + 7 + 2 + (:auto !!!:) Deriving from boost::(:link + 1 + + 0 + + -39 + + + 2 + :) effectively decouples the semantics of a failure from the information that is relevant to each individual instance of reporting a failure with a given semantic. In other words: with boost::(:link + 1 + + 0 + + -39 + + + 2 + :), what data a given exception object transports depends primarily on the context in which failures are reported (not on its type.) Since exception types need no members, it becomes very natural to throw exceptions that derive from more than one type to indicate multiple appropriate semantics: [@struct exception_base: virtual std::exception, virtual boost::(:link + 1 + + 0 + + -39 + + + 2 + :) { }; struct io_error: virtual exception_base { }; struct file_error: virtual io_error { }; struct read_error: virtual io_error { }; struct file_read_error: virtual file_error, virtual read_error { };@] Using this approach, exception types become a simple tagging system for categorizing errors and selecting failures in exception handlers. + + + + + 0 + + -16 + + 27 2 @@ -6134,7 +6206,7 @@ 0 - -38 + -39 2 @@ -6143,7 +6215,7 @@ 0 - -14 + -17 2 @@ -6152,7 +6224,7 @@ 0 - -38 + -39 2 @@ -6170,7 +6242,7 @@ 0 - -39 + -40 2 @@ -6179,7 +6251,7 @@ 0 - -39 + -40 2 @@ -6188,7 +6260,7 @@ 0 - -39 + -40 2 @@ -6197,7 +6269,7 @@ 0 - -14 + -17 2 @@ -6206,7 +6278,7 @@ 0 - -14 + -17 2 @@ -6215,7 +6287,7 @@ 0 - -38 + -39 2 @@ -6224,7 +6296,7 @@ 0 - -9 + -13 2 @@ -6233,7 +6305,7 @@ 0 - -38 + -39 2 @@ -6257,9 +6329,40 @@ - 37 + 5 2 - (:auto !!!:) When you catch an exception, you can call (:link + (: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 + + -39 + + + 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 + + -39 + + + 2 + :). The T sub-object is initialized from x by the T copy constructor. !!!!Throws: Nothing. + + + + + 0 + + -18 + + + + 17 + 2 + (:auto !!!:) (:include synopsis:) The (:link 1 0 @@ -6268,12 +6371,97 @@ 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 + + -18 + + + 2 + :)'s operations do not throw. Two instances of (:link + 1 + + 0 + + -18 + + + 2 + :) are equivalent and compare equal if and only if they refer to the same exception. The default constructor of (:link + 1 + + 0 + + -18 + + + 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 + + -18 + + + 2 + :) references to the same exception object. * It is illegal for multiple threads to modify the same (:link + 1 + + 0 + + -18 + + + 2 + :) object concurrently. * While calling (:link + 1 + + 0 + + -5 + + + 2 + :) makes a copy of the current exception object, it is still possible for the two copies to share internal state. Therefore, in general it is not safe to call (:link + 1 + + 0 + + -37 + + + 2 + :) concurrently to throw the same exception object into multiple threads. + + + + + 0 + + -19 + + + + 37 + 2 + (:auto !!!:) When you catch an exception, you can call (:link + 1 + + 0 + + -5 + + + 2 :) to get an (:link 1 0 - -15 + -18 2 @@ -6291,7 +6479,7 @@ 0 - -38 + -39 2 @@ -6300,7 +6488,7 @@ 0 - -15 + -18 2 @@ -6309,7 +6497,7 @@ 0 - -15 + -18 2 @@ -6318,7 +6506,7 @@ 0 - -18 + -5 2 @@ -6327,7 +6515,7 @@ 0 - -18 + -5 2 @@ -6336,7 +6524,7 @@ 0 - -36 + -37 2 @@ -6345,7 +6533,7 @@ 0 - -15 + -18 2 @@ -6354,7 +6542,7 @@ 0 - -36 + -37 2 @@ -6363,7 +6551,7 @@ 0 - -18 + -5 2 @@ -6372,7 +6560,7 @@ 0 - -15 + -18 2 @@ -6381,7 +6569,7 @@ 0 - -20 + -22 2 @@ -6390,7 +6578,7 @@ 0 - -15 + -18 2 @@ -6399,7 +6587,7 @@ 0 - -31 + -32 2 @@ -6408,7 +6596,7 @@ 0 - -18 + -5 2 @@ -6417,246 +6605,13 @@ 0 - -36 + -37 2 :) in the above examples is well-formed. - - - 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 - - -15 - - - 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 - - -15 - - - 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 - - -20 - - - 2 - :) was used at the time the currently handled exception object was passed to throw. If (:link - 1 - - 0 - - -20 - - - 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 - - -15 - - - 2 - :) that refers to an instance of (:link - 1 - - 0 - - -31 - - - 2 - :). In this case, if the original exception object derives from boost::(:link - 1 - - 0 - - -38 - - - 2 - :), then the boost::(:link - 1 - - 0 - - -38 - - - 2 - :) sub-object of the (:link - 1 - - 0 - - -31 - - - 2 - :) object is initialized by the boost::(:link - 1 - - 0 - - -38 - - - 2 - :) copy constructor. - - - - - 0 - - -19 - - - - 19 - 2 - (:auto !!:) Boost Exception responds to the following configuration macros: '''BOOST_NO_RTTI'''\\ '''BOOST_NO_TYPEID''' The first macro prevents Boost Exception from using dynamic_cast and dynamic typeid. If the second macro is also defined, Boost Exception does not use static typeid either. There are no observable degrading effects on the library functionality, except for the following: ->By default, the (:link - 1 - - 0 - - -32 - - - 2 - :) function template can be called with any exception type. If BOOST_NO_RTTI is defined, (:link - 1 - - 0 - - -32 - - - 2 - :) can be used only with objects of type boost::(:link - 1 - - 0 - - -38 - - - 2 - :). !!!!Note: The library needs RTTI functionality. Disabling the language RTTI support enables an internal RTTI system, which may have more or less overhead depending on the platform. '''BOOST_EXCEPTION_DISABLE''' By default, (:link - 1 - - 0 - - -20 - - - 2 - :) and (:link - 1 - - 0 - - -14 - - - 2 - :) are integrated directly in the (:link - 1 - - 0 - - -35 - - - 2 - :) function. Defining BOOST_EXCEPTION_DISABLE disables this integration. Note that on some non-conformant compilers, for example MSVC 7.0 and older, as well as BCC, BOOST_EXCEPTION_DISABLE is implicitly defined in (:link - 1 - - 0 - - -58 - - - 2 - :). '''BOOST_NO_EXCEPTIONS''' This macro disables exception handling in Boost, forwarding all exceptions to a user-defined non-template version of boost:: - 1 - - 0 - - -35 - - - 2 - . However, unless BOOST_EXCEPTION_DISABLE is also defined, users can still examine the exception object for any data added at the point of the throw, or use boost:: - 1 - - 0 - - -22 - - - 2 - (of course under BOOST_NO_EXCEPTIONS, the user-defined boost::throw_exception is not allowed to return to the caller.) - - 0 @@ -6664,149 +6619,6 @@ -20 - - 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 - - -15 - - - 2 - :) support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link - 1 - - 0 - - -20 - - - 2 - :)(my_exception());@] Unless (:link - 1 - - 0 - - -20 - - - 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 - - -15 - - - 2 - :) which refers to an instance of (:link - 1 - - 0 - - -31 - - - 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 - - -35 - - - 2 - :). This is guaranteed to throw an exception that derives from boost::(:link - 1 - - 0 - - -38 - - - 2 - :) and supports the (:link - 1 - - 0 - - -15 - - - 2 - :) functionality. - - - - - 0 - - -21 - - - - 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 - - -35 - - - 2 - . To recover this information at the catch site, use - 1 - - 0 - - -32 - - - 2 - ; the information is also included in the message returned by - 1 - - 0 - - -22 - - - 2 - . - - - - - 0 - - -22 - - 29 2 @@ -6815,7 +6627,7 @@ 0 - -38 + -39 2 @@ -6824,7 +6636,7 @@ 0 - -39 + -40 2 @@ -6833,7 +6645,7 @@ 0 - -38 + -39 2 @@ -6842,7 +6654,7 @@ 0 - -9 + -13 2 @@ -6851,7 +6663,7 @@ 0 - -38 + -39 2 @@ -6860,7 +6672,7 @@ 0 - -22 + -20 2 @@ -6869,7 +6681,7 @@ 0 - -39 + -40 2 @@ -6878,7 +6690,7 @@ 0 - -39 + -40 2 @@ -6887,7 +6699,7 @@ 0 - -39 + -40 2 @@ -6914,7 +6726,7 @@ 0 - -22 + -20 2 @@ -6923,7 +6735,7 @@ 0 - -39 + -40 2 @@ -6932,13 +6744,210 @@ 0 - -44 + -45 2 :) + + + 0 + + -21 + + + + 19 + 2 + (:auto !!:) Boost Exception responds to the following configuration macros: '''BOOST_NO_RTTI'''\\ '''BOOST_NO_TYPEID''' The first macro prevents Boost Exception from using dynamic_cast and dynamic typeid. If the second macro is also defined, Boost Exception does not use static typeid either. There are no observable degrading effects on the library functionality, except for the following: ->By default, the (:link + 1 + + 0 + + -33 + + + 2 + :) function template can be called with any exception type. If BOOST_NO_RTTI is defined, (:link + 1 + + 0 + + -33 + + + 2 + :) can be used only with objects of type boost::(:link + 1 + + 0 + + -39 + + + 2 + :). !!!!Note: The library needs RTTI functionality. Disabling the language RTTI support enables an internal RTTI system, which may have more or less overhead depending on the platform. '''BOOST_EXCEPTION_DISABLE''' By default, (:link + 1 + + 0 + + -22 + + + 2 + :) and (:link + 1 + + 0 + + -17 + + + 2 + :) are integrated directly in the (:link + 1 + + 0 + + -36 + + + 2 + :) function. Defining BOOST_EXCEPTION_DISABLE disables this integration. Note that on some non-conformant compilers, for example MSVC 7.0 and older, as well as BCC, BOOST_EXCEPTION_DISABLE is implicitly defined in (:link + 1 + + 0 + + -58 + + + 2 + :). '''BOOST_NO_EXCEPTIONS''' This macro disables exception handling in Boost, forwarding all exceptions to a user-defined non-template version of boost:: + 1 + + 0 + + -36 + + + 2 + . However, unless BOOST_EXCEPTION_DISABLE is also defined, users can still examine the exception object for any data added at the point of the throw, or use boost:: + 1 + + 0 + + -20 + + + 2 + (of course under BOOST_NO_EXCEPTIONS, the user-defined boost::throw_exception is not allowed to return to the caller.) + + + + + 0 + + -22 + + + + 21 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: T must be a class with an accessible no-throw copy constructor. !!!!Returns: An object of ''unspecified'' type which derives publicly from T. That is, the returned object can be intercepted by a catch(T &). !!!!Description: This function is designed to be used directly in a throw-expression to enable the (:link + 1 + + 0 + + -18 + + + 2 + :) support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link + 1 + + 0 + + -22 + + + 2 + :)(my_exception());@] Unless (:link + 1 + + 0 + + -22 + + + 2 + :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link + 1 + + 0 + + -5 + + + 2 + :) may return an (:link + 1 + + 0 + + -18 + + + 2 + :) which refers to an instance of (:link + 1 + + 0 + + -32 + + + 2 + :). See (:link + 1 + + 0 + + -5 + + + 2 + :) for details. !!!!Note: Instead of using the throw keyword directly, it is preferable to call boost::(:link + 1 + + 0 + + -36 + + + 2 + :). This is guaranteed to throw an exception that derives from boost::(:link + 1 + + 0 + + -39 + + + 2 + :) and supports the (:link + 1 + + 0 + + -18 + + + 2 + :) functionality. + + 0 @@ -6946,6 +6955,46 @@ -23 + + 7 + 2 + (:auto !!!:) (:include synopsis:) This macro takes an exception object, records BOOST_CURRENT_FUNCTION, __FILE__ and __LINE__ in it, and forwards it to + 1 + + 0 + + -36 + + + 2 + . To recover this information at the catch site, use + 1 + + 0 + + -33 + + + 2 + ; the information is also included in the message returned by + 1 + + 0 + + -20 + + + 2 + . + + + + + 0 + + -24 + + 13 2 @@ -6963,7 +7012,7 @@ 0 - -39 + -40 2 @@ -6972,7 +7021,7 @@ 0 - -39 + -40 2 @@ -6981,7 +7030,7 @@ 0 - -39 + -40 2 @@ -6990,7 +7039,7 @@ 0 - -38 + -39 2 @@ -6999,26 +7048,13 @@ 0 - -32 + -33 2 :). - - - 0 - - -24 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - 0 @@ -7047,7 +7083,7 @@ 0 - -38 + -39 2 @@ -7082,7 +7118,7 @@ 0 - -38 + -39 2 @@ -7091,7 +7127,7 @@ 0 - -22 + -20 2 @@ -7136,6 +7172,19 @@ -30 + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -31 + + 19 2 @@ -7144,7 +7193,7 @@ 0 - -38 + -39 2 @@ -7162,7 +7211,7 @@ 0 - -39 + -40 2 @@ -7171,7 +7220,7 @@ 0 - -38 + -39 2 @@ -7189,7 +7238,7 @@ 0 - -39 + -40 2 @@ -7198,7 +7247,7 @@ 0 - -38 + -39 2 @@ -7207,7 +7256,7 @@ 0 - -38 + -39 2 @@ -7216,7 +7265,7 @@ 0 - -38 + -39 2 @@ -7227,7 +7276,7 @@ 0 - -31 + -32 @@ -7238,7 +7287,7 @@ 0 - -15 + -18 2 @@ -7247,74 +7296,7 @@ 0 - -18 - - - 2 - :). - - - - - 0 - - -32 - - - - 13 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link - 1 - - 0 - - -39 - - - 2 - :) template. * E must be polymorphic. !!!!Returns: * If dynamic_cast<boost::(:link - 1 - - 0 - - -38 - - - 2 - :) const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is null. * Otherwise, the returned pointer points to the stored value (use (:link - 1 - - 0 - - -9 - - - 2 - mod="/":) to store values in exception objects.) When x is destroyed, any pointers returned by (:link - 1 - - 0 - - -32 - - - 2 - :) become invalid. !!!!Throws: Nothing. !!!!Note: The interface of (:link - 1 - - 0 - - -32 - - - 2 - :) may be affected by the build (:link - 1 - - 0 - - -19 + -5 2 @@ -7329,18 +7311,76 @@ - 69 + 13 2 - !!Introduction The purpose of Boost Exception is to ease the design of exception class hierarchies and to help write exception handling and error reporting code. It supports transporting of arbitrary data to the catch site, which is otherwise tricky due to the no-throw requirements (15.5.1) for exception types. Data can be added to any exception object, either directly in the throw-expression (15.1), or at a later time as the exception object propagates up the call stack. The ability to add data to exception objects after they have been passed to throw is important, because often some of the information needed to handle an exception is unavailable in the context where the failure is detected. Boost Exception also supports (:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:)-style (:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link 1 0 - -34 + -40 2 - |copying:) of exception objects, implemented non-intrusively and automatically by the boost::(:link + :) template. * E must be polymorphic. !!!!Returns: * If dynamic_cast<boost::(:link + 1 + + 0 + + -39 + + + 2 + :) const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is null. * Otherwise, the returned pointer points to the stored value (use (:link + 1 + + 0 + + -13 + + + 2 + mod="/":) to store values in exception objects.) When x is destroyed, any pointers returned by (:link + 1 + + 0 + + -33 + + + 2 + :) become invalid. !!!!Throws: Nothing. !!!!Note: The interface of (:link + 1 + + 0 + + -33 + + + 2 + :) may be affected by the build (:link + 1 + + 0 + + -21 + + + 2 + :). + + + + + 0 + + -34 + + + + 69 + 2 + !!Introduction The purpose of Boost Exception is to ease the design of exception class hierarchies and to help write exception handling and error reporting code. It supports transporting of arbitrary data to the catch site, which is otherwise tricky due to the no-throw requirements (15.5.1) for exception types. Data can be added to any exception object, either directly in the throw-expression (15.1), or at a later time as the exception object propagates up the call stack. The ability to add data to exception objects after they have been passed to throw is important, because often some of the information needed to handle an exception is unavailable in the context where the failure is detected. Boost Exception also supports (:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:)-style (:link 1 0 @@ -7349,12 +7389,21 @@ 2 + |copying:) of exception objects, implemented non-intrusively and automatically by the boost::(:link + 1 + + 0 + + -36 + + + 2 :) function. !!Contents #(:link 1 0 - -11 + -14 2 @@ -7369,42 +7418,6 @@ 2 mod="w":) ##(:link 1 - - 0 - - -13 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -34 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -12 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -37 - - - 2 - mod="w":) ##(:link - 1 0 @@ -7412,25 +7425,7 @@ 2 - mod="w":) #Documentation ##Class (:link - 1 - - 0 - - -38 - - - 2 - :) ##Throwing Exceptions ###(:link - 1 - - 0 - - -21 - - - 2 - :) ###(:link + mod="w":) ##(:link 1 0 @@ -7439,7 +7434,34 @@ 2 - :) ##Transporting of Arbitrary Data to the Catch Site ###(:link + mod="w":) ##(:link + 1 + + 0 + + -15 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -38 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -11 + + + 2 + mod="w":) #Documentation ##Class (:link 1 0 @@ -7448,6 +7470,42 @@ 2 + :) ##Throwing Exceptions ###(:link + 1 + + 0 + + -23 + + + 2 + :) ###(:link + 1 + + 0 + + -36 + + + 2 + :) ##Transporting of Arbitrary Data to the Catch Site ###(:link + 1 + + 0 + + -40 + + + 2 + :) ###(:link + 1 + + 0 + + -13 + + + 2 :) ###(:link 1 @@ -7462,7 +7520,7 @@ 0 - -10 + -33 2 @@ -7471,39 +7529,12 @@ 0 - -32 - - - 2 - :) ###(:link - 1 - - 0 - - -14 + -17 2 :) ##(:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:) Transporting of Exceptions between Threads ###(:link 1 - - 0 - - -15 - - - 2 - :) ###(:link - 1 - - 0 - - -20 - - - 2 - :) ###(:link - 1 0 @@ -7513,6 +7544,15 @@ 2 :) ###(:link 1 + + 0 + + -22 + + + 2 + :) ###(:link + 1 0 @@ -7525,7 +7565,7 @@ 0 - -36 + -8 2 @@ -7534,7 +7574,16 @@ 0 - -31 + -37 + + + 2 + :) ###(:link + 1 + + 0 + + -32 2 @@ -7543,7 +7592,7 @@ 0 - -22 + -20 2 @@ -7588,7 +7637,7 @@ 0 - -41 + -43 2 @@ -7615,7 +7664,7 @@ 0 - -19 + -21 2 @@ -7624,7 +7673,7 @@ 0 - -8 + -12 2 @@ -7644,7 +7693,7 @@ 0 - -34 + -35 @@ -7655,7 +7704,7 @@ 0 - -20 + -22 2 @@ -7664,7 +7713,7 @@ 0 - -35 + -36 2 @@ -7673,7 +7722,7 @@ 0 - -38 + -39 2 @@ -7682,7 +7731,7 @@ 0 - -42 + -44 2 @@ -7691,7 +7740,7 @@ 0 - -17 + -19 2 @@ -7702,7 +7751,7 @@ 0 - -35 + -36 @@ -7713,7 +7762,7 @@ 0 - -35 + -36 2 @@ -7722,7 +7771,7 @@ 0 - -20 + -22 2 @@ -7731,7 +7780,7 @@ 0 - -14 + -17 2 @@ -7740,7 +7789,7 @@ 0 - -35 + -36 2 @@ -7749,7 +7798,7 @@ 0 - -35 + -36 2 @@ -7758,7 +7807,7 @@ 0 - -35 + -36 2 @@ -7767,7 +7816,7 @@ 0 - -32 + -33 2 @@ -7776,7 +7825,7 @@ 0 - -22 + -20 2 @@ -7787,7 +7836,7 @@ 0 - -36 + -37 @@ -7800,7 +7849,7 @@ 0 - -37 + -38 @@ -7811,7 +7860,7 @@ 0 - -38 + -39 2 @@ -7820,7 +7869,7 @@ 0 - -12 + -15 2 @@ -7831,7 +7880,7 @@ 0 - -38 + -39 @@ -7842,7 +7891,7 @@ 0 - -38 + -39 2 @@ -7851,7 +7900,7 @@ 0 - -38 + -39 2 @@ -7860,7 +7909,7 @@ 0 - -39 + -40 2 @@ -7869,7 +7918,7 @@ 0 - -9 + -13 2 @@ -7878,7 +7927,7 @@ 0 - -38 + -39 2 @@ -7887,7 +7936,7 @@ 0 - -32 + -33 2 @@ -7898,7 +7947,7 @@ 0 - -39 + -40 @@ -7909,7 +7958,7 @@ 0 - -39 + -40 2 @@ -7918,7 +7967,7 @@ 0 - -9 + -13 2 @@ -7927,7 +7976,7 @@ 0 - -38 + -39 2 @@ -7945,7 +7994,7 @@ 0 - -39 + -40 2 @@ -7963,7 +8012,7 @@ 0 - -39 + -40 2 @@ -7981,7 +8030,7 @@ 0 - -39 + -40 2 @@ -7990,7 +8039,7 @@ 0 - -9 + -13 2 @@ -8008,7 +8057,7 @@ 0 - -38 + -39 2 @@ -8017,7 +8066,7 @@ 0 - -9 + -13 2 @@ -8026,7 +8075,7 @@ 0 - -32 + -33 2 @@ -8044,7 +8093,7 @@ 0 - -38 + -39 2 @@ -8053,7 +8102,7 @@ 0 - -38 + -39 2 @@ -8062,7 +8111,7 @@ 0 - -32 + -33 2 @@ -8073,7 +8122,47 @@ 0 - -40 + -41 + + + + 7 + 2 + (:auto !!!:) (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link + 1 + + 0 + + -39 + + + 2 + :) object. * Copy constructor: initializes a boost::(:link + 1 + + 0 + + -39 + + + 2 + :) object which shares ownership with x of all data added through (:link + 1 + + 0 + + -13 + + + 2 + mod="/":), including data that is added at a future time. !!!!Throws: Nothing. + + + + + 0 + + -42 @@ -8093,7 +8182,7 @@ 0 - -39 + -40 2 @@ -8102,7 +8191,7 @@ 0 - -38 + -39 2 @@ -8111,7 +8200,7 @@ 0 - -39 + -40 2 @@ -8120,7 +8209,7 @@ 0 - -38 + -39 2 @@ -8129,7 +8218,7 @@ 0 - -9 + -13 2 @@ -8138,7 +8227,7 @@ 0 - -32 + -33 2 @@ -8147,7 +8236,7 @@ 0 - -32 + -33 2 @@ -8158,7 +8247,7 @@ 0 - -41 + -43 @@ -8171,7 +8260,7 @@ 0 - -42 + -44 @@ -8191,7 +8280,7 @@ 0 - -38 + -39 2 @@ -8200,7 +8289,7 @@ 0 - -20 + -22 2 @@ -8209,7 +8298,7 @@ 0 - -20 + -22 2 @@ -8218,7 +8307,7 @@ 0 - -38 + -39 2 @@ -8229,20 +8318,7 @@ 0 - -43 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -44 + -45 @@ -8253,53 +8329,13 @@ 0 - -22 + -20 2 :) function, as used in ''libs/exception/example/example_io.cpp:'' [@example_io.cpp(83): Throw in function class boost::shared_ptr<struct _iobuf> __cdecl my_fopen(const char *,const char *) Dynamic exception type: class boost::exception_detail::clone_impl<class fopen_error> std::exception::what: example_io error [struct tag_errno *] = 2, OS says "No such file or directory" [struct tag_file_name *] = tmp1.txt [struct tag_function *] = fopen [struct tag_open_mode *] = rb@] - - - 0 - - -45 - - - - 7 - 2 - (:auto !!!:) (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link - 1 - - 0 - - -38 - - - 2 - :) object. * Copy constructor: initializes a boost::(:link - 1 - - 0 - - -38 - - - 2 - :) object which shares ownership with x of all data added through (:link - 1 - - 0 - - -9 - - - 2 - mod="/":), including data that is added at a future time. !!!!Throws: Nothing. - - 0 @@ -8315,7 +8351,7 @@ 0 - -39 + -40 2 @@ -8324,7 +8360,7 @@ 0 - -39 + -40 2 @@ -8346,7 +8382,7 @@ 0 - -24 + -7 2 @@ -8355,7 +8391,7 @@ 0 - -24 + -7 2 @@ -8436,7 +8472,7 @@ 0 - -43 + -30 2 @@ -8445,7 +8481,7 @@ 0 - -43 + -30 2 @@ -8596,7 +8632,7 @@ 0 - -39 + -40 2 @@ -8773,9 +8809,7 @@ - 1 - 2 - !!!!Throws: Any exception emitted by v's copy constructor. + 0 @@ -8799,7 +8833,7 @@ 1 2 - !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. + !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. @@ -8812,7 +8846,7 @@ 1 2 - !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. + !!!!Throws: Any exception emitted by v's copy constructor. @@ -8826,6 +8860,30 @@ 0 + + + 0 + + -12 + + + + 0 + + + + + 0 + + -13 + + + + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. + + 0 @@ -8859,28 +8917,6 @@ 0 - - - 0 - - -12 - - - - 0 - - - - - 0 - - -13 - - - - 0 - - 0 @@ -9420,18 +9456,9 @@ - 3 + 1 2 - `#include <(:link - 1 - - 0 - - -56 - - - 2 - :)> [@(:include decl:)@] + [@namespace boost { (:include api pre_indent="4":) }@] @@ -9441,103 +9468,6 @@ -8 - - 0 - - - - - 0 - - -9 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -56 - - - 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -10 - - - - 5 - 2 - `#include <(:link - 1 - - 0 - - -49 - - - 2 - :)> [@namespace boost { (:include - 1 - - 0 - - -10 - - - 2 - decl pre_indent="4":) }@] - - - - - 0 - - -11 - - - - 0 - - - - - 0 - - -14 - - - - 3 - 2 - `#include < - 1 - - 0 - - -52 - - - 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -15 - - 3 2 @@ -9557,7 +9487,60 @@ 0 - -16 + -9 + + + + 5 + 2 + `#include <(:link + 1 + + 0 + + -49 + + + 2 + :)> [@namespace boost { (:include + 1 + + 0 + + -9 + + + 2 + decl pre_indent="4":) }@] + + + + + 0 + + -10 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -56 + + + 2 + :)> [@(:include decl:)@] + + + + + 0 + + -11 @@ -9582,6 +9565,50 @@ -13 + + 3 + 2 + `#include <(:link + 1 + + 0 + + -56 + + + 2 + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -14 + + + + 0 + + + + + 0 + + -15 + + + + 0 + + + + + 0 + + -16 + + 0 @@ -9594,7 +9621,18 @@ - 0 + 3 + 2 + `#include < + 1 + + 0 + + -52 + + + 2 + > [@namespace boost { (:include decl pre_indent="4":) }@] @@ -9637,6 +9675,39 @@ -20 + + 3 + 2 + `#include <(:link + 1 + + 0 + + -30 + + + 2 + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -21 + + + + 0 + + + + + 0 + + -22 + + 3 2 @@ -9656,7 +9727,7 @@ 0 - -21 + -23 @@ -9674,39 +9745,6 @@ > (:include decl:) - - - 0 - - -22 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -43 - - - 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -23 - - - - 0 - - 0 @@ -9715,9 +9753,7 @@ - 1 - 2 - [@namespace boost { (:include api pre_indent="4":) }@] + 0 @@ -9759,7 +9795,7 @@ 0 - -24 + -7 2 @@ -9781,7 +9817,7 @@ 0 - -43 + -30 2 @@ -9809,7 +9845,18 @@ - 0 + 3 + 2 + [@#include <string> namespace boost { (:include + 1 + + 0 + + -39 + + + 2 + decl pre_indent="4":) (:include api pre_indent="4":) }@] @@ -9819,6 +9866,17 @@ -31 + + 0 + + + + + 0 + + -32 + + 3 2 @@ -9838,7 +9896,7 @@ 0 - -32 + -33 @@ -9847,17 +9905,6 @@ [@namespace boost { (:include decl pre_indent="4":) }@] - - - 0 - - -33 - - - - 0 - - 0 @@ -9876,6 +9923,17 @@ -35 + + 0 + + + + + 0 + + -36 + + 3 2 @@ -9895,7 +9953,7 @@ 0 - -36 + -37 @@ -9913,17 +9971,6 @@ :)> [@namespace boost { (:include decl pre_indent="4":) }@] - - - 0 - - -37 - - - - 0 - - 0 @@ -9932,18 +9979,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -24 - - - 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] + 0 @@ -9961,7 +9997,7 @@ 0 - -56 + -7 2 @@ -9976,7 +10012,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -56 + + + 2 + :)> [@namespace boost { (:include def pre_indent="4":) }@] @@ -10009,18 +10056,7 @@ - 3 - 2 - [@#include <string> namespace boost { (:include - 1 - - 0 - - -38 - - - 2 - decl pre_indent="4":) (:include api pre_indent="4":) }@] + 0 @@ -10161,7 +10197,7 @@ 0 - -24 + -7 2 @@ -10218,7 +10254,7 @@ 0 - -24 + -7 2 @@ -10240,7 +10276,7 @@ 0 - -24 + -7 2 @@ -10323,6 +10359,12 @@ -11 + + -12 + + + -13 + -14 @@ -10332,12 +10374,6 @@ -16 - - -12 - - - -13 - -17 @@ -10489,7 +10525,7 @@ - -33 + -34 @@ -10506,7 +10542,7 @@ - -34 + -35 @@ -10591,7 +10627,7 @@ - -11 + -14 @@ -10608,7 +10644,24 @@ - -37 + -38 + + + + + + + 0 + + + + + + 1 + + + + -15 @@ -10628,23 +10681,6 @@ -12 - - - - - 0 - - - - - - 1 - - - - -8 - - @@ -10693,7 +10729,7 @@ - -41 + -43 @@ -10751,7 +10787,7 @@ - -17 + -19 @@ -10775,7 +10811,7 @@ - -44 + -45 @@ -10799,7 +10835,7 @@ - -13 + -16 @@ -10855,7 +10891,7 @@ - -31 + -32 @@ -10883,7 +10919,7 @@ - -18 + -5 @@ -10911,7 +10947,7 @@ - -15 + -18 @@ -10939,7 +10975,7 @@ - -36 + -37 @@ -10967,7 +11003,7 @@ - -5 + -8 @@ -10995,7 +11031,7 @@ - -32 + -33 @@ -11019,7 +11055,7 @@ - -16 + -11 @@ -11071,7 +11107,7 @@ - -7 + -10 @@ -11099,7 +11135,7 @@ - -9 + -13 @@ -11123,7 +11159,7 @@ - -40 + -42 @@ -11199,7 +11235,7 @@ - -35 + -36 @@ -11231,7 +11267,7 @@ - -19 + -21 @@ -11283,7 +11319,7 @@ - -39 + -40 @@ -11399,7 +11435,7 @@ - -22 + -20 @@ -11475,7 +11511,7 @@ - -24 + -7 @@ -11531,7 +11567,7 @@ - -20 + -22 @@ -11559,7 +11595,7 @@ - -14 + -17 @@ -11587,7 +11623,7 @@ - -38 + -39 @@ -11619,7 +11655,7 @@ - -45 + -41 @@ -11667,7 +11703,7 @@ - -42 + -44 @@ -11691,7 +11727,7 @@ - -21 + -23 @@ -11715,7 +11751,7 @@ - -30 + -31 @@ -11739,7 +11775,7 @@ - -43 + -30 @@ -11795,7 +11831,7 @@ - -10 + -9 @@ -11819,7 +11855,7 @@ - -23 + -24 @@ -11868,7 +11904,16 @@ -7 - function member + + + + + 0 + + -8 + + + exception_ptr free function @@ -11886,31 +11931,13 @@ -10 - error_info free function + function member 0 - -14 - - - error_info free function - - - - 0 - - -15 - - - type - - - - 0 - - -16 + -11 diagnostic_information tutorial @@ -11922,6 +11949,15 @@ -13 + error_info free function + + + + 0 + + -16 + + tutorial @@ -11931,7 +11967,7 @@ -17 - noindex tutorial + error_info free function @@ -11940,7 +11976,16 @@ -18 - exception_ptr free function + type + + + + 0 + + -19 + + + noindex tutorial @@ -11949,16 +11994,7 @@ -20 - exception_ptr free function - - - - 0 - - -21 - - - macro + diagnostic_information free function @@ -11967,7 +12003,7 @@ -22 - diagnostic_information free function + exception_ptr free function @@ -11976,7 +12012,7 @@ -23 - noalso noindex tutorial + macro @@ -11985,7 +12021,7 @@ -24 - + noalso noindex tutorial @@ -12039,7 +12075,7 @@ -30 - noalso noindex tutorial + @@ -12048,7 +12084,7 @@ -31 - exception_ptr type + noalso noindex tutorial @@ -12057,7 +12093,7 @@ -32 - error_info free function + exception_ptr type @@ -12066,7 +12102,7 @@ -33 - noindex + error_info free function @@ -12075,7 +12111,7 @@ -34 - tutorial + noindex @@ -12084,7 +12120,7 @@ -35 - free function + tutorial @@ -12093,7 +12129,7 @@ -36 - exception_ptr free function + free function @@ -12102,7 +12138,7 @@ -37 - tutorial + exception_ptr free function @@ -12111,7 +12147,7 @@ -38 - type + tutorial @@ -12129,7 +12165,16 @@ -40 - noalso noindex tutorial + type + + + + 0 + + -41 + + + function @@ -12138,26 +12183,17 @@ -42 + noalso noindex tutorial + + + + 0 + + -44 + + noindex tutorial - - - 0 - - -43 - - - - - - - 0 - - -45 - - - function - 0