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.
diff --git a/doc/source/boost-exception.reno b/doc/source/boost-exception.reno
index 3f69501..ed8b813 100644
--- a/doc/source/boost-exception.reno
+++ b/doc/source/boost-exception.reno
@@ -48,55 +48,6 @@
reno_context
-
-
-
-
- 1
- 2
- (:include include:)
(:auto also:)
-
-
-
-
- 0
-
- 6
-
- reno_context
-
+
+
+ 0
+
+ 6
+
+ reno_context
+
+
+
+
+
+ 1
+ 2
+ (:include include:)
(:auto also:)
+
+ 0
@@ -142,273 +142,6 @@
reno_context
-
-
-
-
- 1
- 2
- (:include include:)
(:auto also:)
-
-
-
-
- 0
-
- 8
-
- reno_context
-
-
-
-
-
- 1
- 2
- (:include include:)
(:auto also:)
-
-
-
-
- 0
-
- 9
-
- reno_context
-
-
-
-
-
- 0
-
-
-
-
- 0
-
- 10
-
- reno_context
-
-
-
-
-
- 1
- 2
- (:include include:)
(:auto also:)
-
-
-
-
- 0
-
- 11
-
- reno_context
-
-
-
-
-
- 1
- 2
- (:include include:)
(:auto also:)
-
-
-
-
- 0
-
- 12
-
- reno_context
-
-
-
-
-
- 0
-
-
-
-
- 0
-
- 13
-
- reno_context
-
+
+
+ 0
+
+ 8
+
+ reno_context
+
+
+
+
+
+ 1
+ 2
+ (:include include:)
(:auto also:)
+
+
+
+
+ 0
+
+ 9
+
+ reno_context
+
+
+
+
+
+ 1
+ 2
+ (:include include:)
(:auto also:)
+
+
+
+
+ 0
+
+ 10
+
+ reno_context
+
+
+
+
+
+ 1
+ 2
+ (:include include:)
(:auto also:)
+
+
+
+
+ 0
+
+ 11
+
+ reno_context
+
+
+
+
+
+ 0
+
+
+
+
+ 0
+
+ 12
+
+ reno_context
+
+
+
+
+
+ 1
+ 2
+ (:include include:)
(:auto also:)
+
+
+
+
+ 0
+
+ 13
+
+ reno_context
+
+
+
+
+
+ 1
+ 2
+ (:include include:)
(:auto also:)
+
+ 0
@@ -458,6 +464,87 @@
reno_context
+
+
+
+
+ 0
+
+
+
+
+ 0
+
+ 15
+
+ reno_context
+
+
+
+
+
+ 1
+ 2
+ (:include include:)
(:auto also:)
+
+
+
+
+ 0
+
+ 16
+
+ reno_context
+
+
+
+ 0
+
+ -18
+
+
+
+ 1
+ 2
+ (:include include:)
(:auto also:)
+
+
+
+
+ 0
+
+ 19reno_context
@@ -618,7 +731,56 @@
0
- 18
+ 20
+
+ reno_context
+
+
+
+
+
+ 1
+ 2
+ (:include include:)
(:auto also:)
+
+
+
+
+ 0
+
+ 21reno_context
@@ -667,7 +829,7 @@
0
- 19
+ 22reno_context
@@ -712,7 +874,7 @@
0
- 20
+ 23reno_context
@@ -757,20 +919,7 @@
0
- -15
-
-
-
- 1
- 2
- (:include include:)
(:auto also:)
-
-
-
-
- 0
-
- 21
+ 24reno_context
@@ -819,7 +968,7 @@
0
- 22
+ 25reno_context
@@ -855,7 +1004,7 @@
0
- 23
+ 26reno_context
@@ -889,7 +1038,7 @@
0
- 24
+ 27reno_context
@@ -934,7 +1083,7 @@
0
- -14
+ -162
@@ -943,32 +1092,7 @@
0
- 25
-
- reno_context
-
-
+ -152
@@ -977,7 +1101,7 @@
0
- 26
+ 28reno_context
@@ -1018,7 +1142,7 @@
0
- -7
+ -92
@@ -1027,7 +1151,7 @@
0
- -23
+ -262
@@ -1036,7 +1160,7 @@
0
- -15
+ -172
@@ -1045,7 +1169,7 @@
0
- 27
+ 29reno_context
@@ -1079,7 +1203,7 @@
0
- 28
+ 30reno_context
@@ -1124,7 +1248,7 @@
0
- 29
+ 31reno_context
@@ -1169,7 +1293,7 @@
0
- -17
+ -192
@@ -1178,7 +1302,7 @@
0
- -18
+ -212
@@ -1187,7 +1311,7 @@
0
- -10
+ -122
@@ -1196,43 +1320,7 @@
0
- 30
-
- reno_context
-
-
+ -62
@@ -1241,7 +1329,7 @@
0
- 31
+ 32reno_context
@@ -1286,43 +1374,7 @@
0
- 32
-
- reno_context
-
-
+ -202
@@ -1331,7 +1383,7 @@
0
- -5
+ -82
@@ -1340,7 +1392,7 @@
0
- -13
+ -72
@@ -1484,7 +1536,7 @@
0
- -24
+ -272
@@ -1493,7 +1545,7 @@
0
- -6
+ -52
@@ -1633,7 +1685,7 @@
0
- -8
+ -102
@@ -1721,7 +1773,7 @@
0
- -19
+ -222
@@ -1730,7 +1782,7 @@
0
- -20
+ -232
@@ -1903,7 +1955,7 @@
0
- -16
+ -182
@@ -1955,7 +2007,7 @@
0
- -19
+ -222
@@ -2009,7 +2061,7 @@
0
- -8
+ -102
@@ -2033,51 +2085,6 @@
2 api:)@]
!!Class exception
(:include 1
-
- 0
-
- -28
-
-
- 2
- :)
!!Transporting of Arbitrary Data to the Catch Site
(:include
- 1
-
- 0
-
- -29
-
-
- 2
- :)
(:include
- 1
-
- 0
-
- -17
-
-
- 2
- :)
(:include
- 1
-
- 0
-
- -18
-
-
- 2
- :)
(:include
- 1
-
- 0
-
- -10
-
-
- 2
- :)
(:include
- 10
@@ -2085,7 +2092,7 @@
2
- :)
!!Transporting of Exceptions between Threads
(:include
+ :)
!!Transporting of Arbitrary Data to the Catch Site
(:include 10
@@ -2096,6 +2103,42 @@
2:)
(:include 1
+
+ 0
+
+ -19
+
+
+ 2
+ :)
(:include
+ 1
+
+ 0
+
+ -21
+
+
+ 2
+ :)
(:include
+ 1
+
+ 0
+
+ -12
+
+
+ 2
+ :)
(:include
+ 1
+
+ 0
+
+ -6
+
+
+ 2
+ :)
!!Transporting of Exceptions between Threads
(:include
+ 10
@@ -2108,7 +2151,7 @@
0
- -5
+ -202
@@ -2117,7 +2160,16 @@
0
- -13
+ -8
+
+
+ 2
+ :)
(:include
+ 1
+
+ 0
+
+ -72
@@ -2153,7 +2205,7 @@
0
- -24
+ -272
@@ -2162,65 +2214,13 @@
0
- -6
+ -52:)
!!Acknowledgements
Peter Dimov has been continuously influencing the design and evolution of Boost Exception. Also thanks to Tobias Schwinger, Tom Brinkman, Pavel Vozenilek and everyone who participated in the review process.
-
-
- 0
-
- -23
-
-
-
- 1
- 2
- (:include include:)
(:auto also:)
-
-
-
-
- 0
-
- -24
-
-
-
- 1
- 2
- (:include include:)
(:auto also:)
-
-
-
-
- 0
-
- -32
-
-
-
- 1
- 2
- (:include include:)
(:auto also:)
-
-
-
-
- 0
-
- -25
-
-
-
- 1
- 2
- (:include include:)
(:auto also:)
-
- 0
@@ -2234,19 +2234,6 @@
(:include include:)
(:auto also:)
-
-
- 0
-
- -39
-
-
-
- 1
- 2
- (:include include:)
(:auto also:)
-
- 0
@@ -2260,6 +2247,19 @@
(:include include:)
(:auto also:)
+
+
+ 0
+
+ -34
+
+
+
+ 1
+ 2
+ (:include include:)
(:auto also:)
+
+ 0
@@ -2270,7 +2270,20 @@
12
- (:include include:)
----
!!!See Also:
(:pagelist link="backlink" except_tags="exception,member" mod="w":)
+ (:include include:)
(:auto also:)
+
+
+
+
+ 0
+
+ -36
+
+
+
+ 1
+ 2
+ (:include include:)
(:auto also:)
@@ -2286,19 +2299,6 @@
(:include include:)
(:auto also:)
-
-
- 0
-
- -34
-
-
-
- 1
- 2
- (:include include:)
(:auto also:)
-
- 0
@@ -2309,7 +2309,7 @@
12
- (:include include:)
(:auto also:)
+ (:include include:)
----
!!!See Also:
(:pagelist link="backlink" except_tags="exception,member" mod="w":)
@@ -2325,6 +2325,32 @@
(:include include:)
(:auto also:)
+
+
+ 0
+
+ -39
+
+
+
+ 1
+ 2
+ (:include include:)
(:auto also:)
+
+
+
+
+ 0
+
+ -32
+
+
+
+ 1
+ 2
+ (:include include:)
(:auto also:)
+
+ 0
@@ -2351,19 +2377,6 @@
(:include include:)
(:auto also:)
-
-
- 0
-
- -36
-
-
-
- 1
- 2
- (:include include:)
(:auto also:)
-
- 0
@@ -2377,6 +2390,49 @@
(:include include:)
(:auto also:)
+
+
+ 0
+
+ 46
+
+ reno_context
+
+
+
+
+
+ 0
+
+ 0
@@ -2390,6 +2446,59 @@
(:include include:)
(:auto also:)
+
+
+ 0
+
+ 47
+
+ reno_context
+
+
+
+
+
+ 1
+ 2
+ (:include include:)
(:auto also:)
+
+ 0
@@ -2455,19 +2564,6 @@
(:include include:)
(:auto also:)
-
-
- 0
-
- -16
-
-
-
- 1
- 2
- (:include include:)
(:auto also:)
-
- 0
@@ -2485,7 +2581,7 @@
0
- 46
+ 48reno_context
@@ -2534,92 +2630,6 @@
(:include include:)
(:auto also:)
-
-
- 0
-
- 47
-
- reno_context
-
-
-
-
-
- 0
-
-
-
-
- 0
-
- 48
-
- reno_context
-
-
-
-
-
- 0
-
- 0
@@ -2628,145 +2638,6 @@
reno_context
-
-
-
-
- 0
-
-
-
-
- 0
-
- 50
-
- reno_context
-
-
-
-
-
- 1
- 2
- (:include include:)
(:auto also:)
-
-
-
-
- 0
-
- 51
-
- reno_context
-
-
-
-
-
- 0
-
-
-
-
- 0
-
- 52
-
- reno_context
-
+
+
+ 0
+
+ 50
+
+ reno_context
+
+
+
+
+
+ 0
+
+
+
+
+ 0
+
+ 51
+
+ reno_context
+
+
+
+
+
+ 0
+
+
+
+
+ 0
+
+ 52
+
+ reno_context
+
+
+
+
+
+ 0
+
+
@@ -2936,6 +2936,28 @@
0
+
+
+ 0
+
+ -15
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -16
+
+
+
+ 0
+
+ 0
@@ -2980,17 +3002,6 @@
0
-
-
- 0
-
- -15
-
-
-
- 0
-
- 0
@@ -3035,17 +3046,6 @@
0
-
-
- 0
-
- -32
-
-
-
- 0
-
- 0
@@ -3068,17 +3068,6 @@
0
-
-
- 0
-
- -39
-
-
-
- 0
-
- 0
@@ -3090,95 +3079,6 @@
0
-
-
- 0
-
- -28
-
-
-
- 7
- 2
- [@class
(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :)
{
protected:
(:include
- 1
-
- 0
-
- -52
-
-
- 2
- decl pre_indent="4":)
(:include
- 1
-
- 0
-
- -21
-
-
- 2
- decl pre_indent="4":)
};@]
-
-
-
-
- 0
-
- -29
-
-
-
- 9
- 2
- [@template <class Tag,class T>
class
(:link
- 1
-
- 0
-
- -29
-
-
- 2
- :)
{
public:
(:include
- 1
-
- 0
-
- -50
-
-
- 2
- decl pre_indent="4":)
(:include
- 1
-
- 0
-
- -11
-
-
- 2
- decl pre_indent="4":)
(:include
- 1
-
- 0
-
- -46
-
-
- 2
- decl pre_indent="4":)
};@]
-
- 0
@@ -3194,13 +3094,75 @@
0
- -30
+ -280
+
+
+ 0
+
+ -36
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -29
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -30
+
+
+
+ 7
+ 2
+ [@class
(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :)
{
protected:
(:include
+ 1
+
+ 0
+
+ -49
+
+
+ 2
+ decl pre_indent="4":)
(:include
+ 1
+
+ 0
+
+ -24
+
+
+ 2
+ decl pre_indent="4":)
};@]
+
+ 0
@@ -3208,6 +3170,66 @@
-31
+
+ 9
+ 2
+ [@template <class Tag,class T>
class
(:link
+ 1
+
+ 0
+
+ -31
+
+
+ 2
+ :)
{
public:
(:include
+ 1
+
+ 0
+
+ -47
+
+
+ 2
+ decl pre_indent="4":)
(:include
+ 1
+
+ 0
+
+ -13
+
+
+ 2
+ decl pre_indent="4":)
(:include
+ 1
+
+ 0
+
+ -48
+
+
+ 2
+ decl pre_indent="4":)
};@]
+
+
+
+
+ 0
+
+ -39
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -32
+
+ 0
@@ -3234,17 +3256,6 @@
0
-
-
- 0
-
- -36
-
-
-
- 0
-
- 0
@@ -3256,6 +3267,17 @@
0
+
+
+ 0
+
+ -46
+
+
+
+ 0
+
+ 0
@@ -3267,6 +3289,17 @@
0
+
+
+ 0
+
+ -47
+
+
+
+ 0
+
+ 0
@@ -3322,17 +3355,6 @@
0
-
-
- 0
-
- -16
-
-
-
- 0
-
- 0
@@ -3344,28 +3366,6 @@
0
-
-
- 0
-
- -46
-
-
-
- 0
-
-
-
-
- 0
-
- -47
-
-
-
- 0
-
- 0
@@ -3476,18 +3476,7 @@
- 3
- 2
- [@(:include
- 1
-
- 0
-
- -32
-
-
- 2
- decl:)@]
+ 0
@@ -3509,7 +3498,18 @@
- 0
+ 3
+ 2
+ [@(:include
+ 1
+
+ 0
+
+ -20
+
+
+ 2
+ decl:)@]
@@ -3556,6 +3556,28 @@
0
+
+
+ 0
+
+ -15
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -16
+
+
+
+ 0
+
+ 0
@@ -3586,54 +3608,7 @@
- 11
- 2
- [@(:include
- 1
-
- 0
-
- -28
-
-
- 2
- def:)
(:include
- 1
-
- 0
-
- -29
-
-
- 2
- decl:)
typedef (:link
- 1
-
- 0
-
- -29
-
-
- 2
- :)<struct tag_throw_function,char const *> throw_function;
typedef (:link
- 1
-
- 0
-
- -29
-
-
- 2
- :)<struct tag_throw_file,char const *> throw_file;
typedef (:link
- 1
-
- 0
-
- -29
-
-
- 2
- :)<struct tag_throw_line,int> throw_line;@]
+ 0
@@ -3643,28 +3618,6 @@
-20
-
- 3
- 2
- [@(:include
- 1
-
- 0
-
- -10
-
-
- 2
- decl:)@]
-
-
-
-
- 0
-
- -15
-
- 0
@@ -3688,7 +3641,54 @@
- 0
+ 11
+ 2
+ [@(:include
+ 1
+
+ 0
+
+ -30
+
+
+ 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;@]
@@ -3699,7 +3699,18 @@
- 0
+ 3
+ 2
+ [@(:include
+ 1
+
+ 0
+
+ -12
+
+
+ 2
+ decl:)@]
@@ -3713,17 +3724,6 @@
0
-
-
- 0
-
- -32
-
-
-
- 0
-
- 0
@@ -3750,29 +3750,18 @@
0
- -39
+ -27
- 3
- 2
- [@(:include
- 1
-
- 0
-
- -30
-
-
- 2
- decl:)@]
+ 00
- -27
+ -34
@@ -3794,7 +3783,7 @@
0
- -29
+ -36
@@ -3805,7 +3794,7 @@
0
- -34
+ -29
@@ -3834,6 +3823,39 @@
0
+
+
+ 0
+
+ -39
+
+
+
+ 3
+ 2
+ [@(:include
+ 1
+
+ 0
+
+ -6
+
+
+ 2
+ decl:)@]
+
+
+
+
+ 0
+
+ -32
+
+
+
+ 0
+
+ 0
@@ -3856,17 +3878,6 @@
0
-
-
- 0
-
- -36
-
-
-
- 0
-
- 0
@@ -3889,6 +3900,17 @@
decl:)@]
+
+
+ 0
+
+ -46
+
+
+
+ 0
+
+ 0
@@ -3922,7 +3944,7 @@
0
- -19
+ -222
@@ -3931,7 +3953,7 @@
0
- -20
+ -232
@@ -3965,6 +3987,17 @@
:)>@]
+
+
+ 0
+
+ -47
+
+
+
+ 0
+
+ 0
@@ -3980,7 +4013,7 @@
0
- -29
+ -312
@@ -4002,7 +4035,7 @@
0
- -29
+ -312
@@ -4011,7 +4044,7 @@
0
- -17
+ -192
@@ -4033,7 +4066,7 @@
0
- -18
+ -212
@@ -4064,7 +4097,7 @@
0
- -31
+ -322
@@ -4073,7 +4106,7 @@
0
- -13
+ -72
@@ -4082,7 +4115,7 @@
0
- -5
+ -82
@@ -4113,7 +4146,7 @@
0
- -6
+ -52
@@ -4122,24 +4155,13 @@
0
- -24
+ -272 decl:)
}@]
-
-
- 0
-
- -16
-
-
-
- 0
-
- 0
@@ -4151,28 +4173,6 @@
0
-
-
- 0
-
- -46
-
-
-
- 0
-
-
-
-
- 0
-
- -47
-
-
-
- 0
-
- 0
@@ -4249,37 +4249,6 @@
-5
-
- 5
- 2
- [@(:link
- 1
-
- 0
-
- -31
-
-
- 2
- :) (:link
- 1
-
- 0
-
- -5
-
-
- 2
- :)();@]
-
-
-
-
- 0
-
- -6
-
- 192
@@ -4288,7 +4257,7 @@
0
- -19
+ -222
@@ -4297,7 +4266,7 @@
0
- -6
+ -52
@@ -4306,7 +4275,7 @@
0
- -24
+ -272
@@ -4315,7 +4284,7 @@
0
- -30
+ -62
@@ -4324,7 +4293,7 @@
0
- -19
+ -222
@@ -4333,7 +4302,7 @@
0
- -19
+ -222
@@ -4342,7 +4311,7 @@
0
- -19
+ -222
@@ -4351,7 +4320,7 @@
0
- -6
+ -52
@@ -4360,13 +4329,35 @@
0
- -24
+ -272(x)
#endif@]
+
+
+ 0
+
+ -6
+
+
+
+ 3
+ 2
+ [@template <class T>
---unspecified--- (:link
+ 1
+
+ 0
+
+ -6
+
+
+ 2
+ :)( T const & x );@]
+
+ 0
@@ -4375,7 +4366,27 @@
- 0
+ 5
+ 2
+ [@template <class T>
(:link
+ 1
+
+ 0
+
+ -32
+
+
+ 2
+ :) (:link
+ 1
+
+ 0
+
+ -7
+
+
+ 2
+ :)( T const & e );@]
@@ -4386,7 +4397,27 @@
- 0
+ 5
+ 2
+ [@(:link
+ 1
+
+ 0
+
+ -32
+
+
+ 2
+ :) (:link
+ 1
+
+ 0
+
+ -8
+
+
+ 2
+ :)();@]
@@ -4408,18 +4439,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
-
- -10
-
-
- 2
- :)( E const & x );@]
+ 0
@@ -4430,27 +4450,7 @@
- 5
- 2
- [@(:link
- 1
-
- 0
-
- -11
-
-
- 2
- mod="m":)( (:link
- 1
-
- 0
-
- -50
-
-
- 2
- mod="m":) const & v );@]
+ 0
@@ -4461,7 +4461,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
+
+ -12
+
+
+ 2
+ :)( E const & x );@]
@@ -4474,16 +4485,7 @@
52
- [@template <class T>
(:link
- 1
-
- 0
-
- -31
-
-
- 2
- :) (:link
+ [@(:link 10
@@ -4492,7 +4494,16 @@
2
- :)( T const & e );@]
+ mod="m":)( (:link
+ 1
+
+ 0
+
+ -47
+
+
+ 2
+ mod="m":) const & v );@]
@@ -4506,99 +4517,6 @@
0
-
-
- 0
-
- -17
-
-
-
- 5
- 2
- [@template <class E, class Tag, class T>
E const & (:link
- 1
-
- 0
-
- -17
-
-
- 2
- mod="/":)( E const & x, (:link
- 1
-
- 0
-
- -29
-
-
- 2
- :)<Tag,T> const & v );@]
-
-
-
-
- 0
-
- -18
-
-
-
- 7
- 2
- [@template <class E, class Tag1, class T1, ..., class TagN, class TN>
E const & (:link
- 1
-
- 0
-
- -18
-
-
- 2
- mod="/":)( E const & x,
(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)<
(:link
- 1
-
- 0
-
- -29
-
-
- 2
- :)<Tag1,T1>,
...,
(:link
- 1
-
- 0
-
- -29
-
-
- 2
- :)<TagN,TN> > const & v );@]
-
-
-
-
- 0
-
- -19
-
-
-
- 0
-
-
-
-
- 0
-
- -20
-
-
-
- 0
-
- 0
@@ -4614,13 +4532,99 @@
0
- -21
+ -16
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -17
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -18
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -19
+
+
+
+ 5
+ 2
+ [@template <class E, class Tag, class T>
E const & (:link
+ 1
+
+ 0
+
+ -19
+
+
+ 2
+ mod="/":)( E const & x, (:link
+ 1
+
+ 0
+
+ -31
+
+
+ 2
+ :)<Tag,T> const & v );@]
+
+
+
+
+ 0
+
+ -2032
- [@(:link
+ [@template <class T>
---unspecified--- (:link
+ 1
+
+ 0
+
+ -20
+
+
+ 2
+ :)( T const & e );@]
+
+
+
+
+ 0
+
+ -21
+
+
+
+ 7
+ 2
+ [@template <class E, class Tag1, class T1, ..., class TagN, class TN>
E const & (:link 10
@@ -4629,7 +4633,25 @@
2
- mod="m":)();@]
+ mod="/":)( 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 );@]
@@ -4661,50 +4683,19 @@
-24
-
- 5
- 2
- [@#ifdef BOOST_NO_EXCEPTIONS
void (:link
- 1
-
- 0
-
- -24
-
-
- 2
- :)( std::exception const & e ); // user defined
#else
template <class E>
void (:link
- 1
-
- 0
-
- -24
-
-
- 2
- :)( E const & e );
#endif@]
-
-
-
-
- 0
-
- -32
-
- 32
- [@template <class T>
---unspecified--- (:link
+ [@(:link 10
- -32
+ -242
- :)( T const & e );@]
+ mod="m":)();@]
@@ -4729,17 +4720,6 @@
0
-
-
- 0
-
- -39
-
-
-
- 0
-
- 0
@@ -4748,51 +4728,27 @@
- 0
-
-
-
-
- 0
-
- -28
-
-
-
- 3
+ 52
- [@class (:link
+ [@#ifdef BOOST_NO_EXCEPTIONS
void (:link 10
- -28
+ -272
- :);@]
-
-
-
-
- 0
-
- -29
-
-
-
- 3
- 2
- [@template <class Tag,class T>
class (:link
+ :)( std::exception const & e ); // user defined
#else
template <class E>
void (:link 10
- -29
+ -272
- :);@]
+ :)( E const & e );
#endif@]
@@ -4819,13 +4775,46 @@
0
- -28
+ -302
{
---unspecified---
};@]
+
+
+ 0
+
+ -28
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -36
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -29
+
+
+
+ 0
+
+ 0
@@ -4836,7 +4825,7 @@
32
- [@template <class T>
---unspecified--- (:link
+ [@class (:link 10
@@ -4845,7 +4834,7 @@
2
- :)( T const & x );@]
+ :);@]
@@ -4858,7 +4847,7 @@
32
- [@typedef ---unspecified--- (:link
+ [@template <class Tag,class T>
class (:link 10
@@ -4870,6 +4859,39 @@
:);@]
+
+
+ 0
+
+ -39
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -32
+
+
+
+ 3
+ 2
+ [@typedef ---unspecified--- (:link
+ 1
+
+ 0
+
+ -32
+
+
+ 2
+ :);@]
+
+ 0
@@ -4894,7 +4916,7 @@
0
- -28
+ -302
@@ -4925,24 +4947,13 @@
0
- -31
+ -322:) const & ep );
-
-
- 0
-
- -36
-
-
-
- 0
-
- 0
@@ -4954,6 +4965,17 @@
0
+
+
+ 0
+
+ -46
+
+
+
+ 0
+
+ 0
@@ -4965,6 +4987,28 @@
0
+
+
+ 0
+
+ -47
+
+
+
+ 3
+ 2
+ [@typedef T (:link
+ 1
+
+ 0
+
+ -47
+
+
+ 2
+ mod="m":);@]
+
+ 0
@@ -5020,17 +5064,6 @@
0
-
-
- 0
-
- -16
-
-
-
- 0
-
- 0
@@ -5042,48 +5075,6 @@
0
-
-
- 0
-
- -46
-
-
-
- 5
- 2
- [@(:link
- 1
-
- 0
-
- -50
-
-
- 2
- mod="m":) const & (:link
- 1
-
- 0
-
- -46
-
-
- 2
- mod="m":)() const;@]
-
-
-
-
- 0
-
- -47
-
-
-
- 0
-
- 0
@@ -5092,7 +5083,27 @@
- 0
+ 5
+ 2
+ [@(:link
+ 1
+
+ 0
+
+ -47
+
+
+ 2
+ mod="m":) const & (:link
+ 1
+
+ 0
+
+ -48
+
+
+ 2
+ mod="m":)() const;@]
@@ -5103,7 +5114,36 @@
- 0
+ 7
+ 2
+ [@(:link
+ 1
+
+ 0
+
+ -49
+
+
+ 2
+ mod="m":)();
(:link
+ 1
+
+ 0
+
+ -49
+
+
+ 2
+ mod="m":)( (:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :) const & x );@]
@@ -5114,18 +5154,7 @@
- 3
- 2
- [@typedef T (:link
- 1
-
- 0
-
- -50
-
-
- 2
- mod="m":);@]
+ 0
@@ -5147,36 +5176,7 @@
- 7
- 2
- [@(:link
- 1
-
- 0
-
- -52
-
-
- 2
- mod="m":)();
(:link
- 1
-
- 0
-
- -52
-
-
- 2
- mod="m":)( (:link
- 1
-
- 0
-
- -28
-
-
- 2
- :) const & x );@]
+ 0
@@ -5200,145 +5200,6 @@
-5
-
- 29
- 2
- (:auto !!!:)
(:include synopsis:)
!!!!Requirements:
The (:link
- 1
-
- 0
-
- -5
-
-
- 2
- :) function must not be called outside of a catch block.
!!!!Returns:
* An (:link
- 1
-
- 0
-
- -31
-
-
- 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
-
- -31
-
-
- 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
-
- -32
-
-
- 2
- :) was used at the time the currently handled exception object was passed to throw. If (:link
- 1
-
- 0
-
- -32
-
-
- 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
-
- -31
-
-
- 2
- :) that refers to an instance of (:link
- 1
-
- 0
-
- -34
-
-
- 2
- :). In this case, if the original exception object derives from boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :), then the boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :) sub-object of the (:link
- 1
-
- 0
-
- -34
-
-
- 2
- :) object is initialized by the boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :) copy constructor.
-
-
-
-
- 0
-
- -6
-
- 72
@@ -5347,7 +5208,7 @@
0
- -24
+ -272
@@ -5356,7 +5217,7 @@
0
- -10
+ -122
@@ -5372,6 +5233,37 @@
.
+
+
+ 0
+
+ -6
+
+
+
+ 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
+
+ -30
+
+
+ 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
+
+ -30
+
+
+ 2
+ :). The T sub-object is initialized from x by the T copy constructor.
!!!!Throws:
Nothing.
+
+ 0
@@ -5379,6 +5271,176 @@
-7
+
+ 5
+ 2
+ (:auto !!!:)
(:include synopsis:)
!!!!Effects:
As if
[@try
{
throw
+ 1
+
+ 0
+
+ -20
+
+
+ 2
+ (e);
}
catch(...)
{
return (:link
+ 1
+
+ 0
+
+ -8
+
+
+ 2
+ :)();
}@]
+
+
+
+
+ 0
+
+ -8
+
+
+
+ 29
+ 2
+ (:auto !!!:)
(:include synopsis:)
!!!!Requirements:
The (:link
+ 1
+
+ 0
+
+ -8
+
+
+ 2
+ :) function must not be called outside of a catch block.
!!!!Returns:
* An (:link
+ 1
+
+ 0
+
+ -32
+
+
+ 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
+
+ -32
+
+
+ 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
+
+ -8
+
+
+ 2
+ :) refer to the same exception object.
* Correct implementation of (:link
+ 1
+
+ 0
+
+ -8
+
+
+ 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
+
+ -8
+
+
+ 2
+ :) may return an (:link
+ 1
+
+ 0
+
+ -32
+
+
+ 2
+ :) that refers to an instance of (:link
+ 1
+
+ 0
+
+ -34
+
+
+ 2
+ :). In this case, if the original exception object derives from boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :), then the boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :) sub-object of the (:link
+ 1
+
+ 0
+
+ -34
+
+
+ 2
+ :) object is initialized by the boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :) copy constructor.
+
+
+
+
+ 0
+
+ -9
+
+ 272
@@ -5387,7 +5449,7 @@
0
- -28
+ -302
@@ -5396,7 +5458,7 @@
0
- -30
+ -62
@@ -5405,7 +5467,7 @@
0
- -28
+ -302
@@ -5423,7 +5485,7 @@
0
- -29
+ -312
@@ -5432,7 +5494,7 @@
0
- -29
+ -312
@@ -5441,7 +5503,7 @@
0
- -29
+ -312
@@ -5450,7 +5512,7 @@
0
- -30
+ -62
@@ -5459,7 +5521,7 @@
0
- -30
+ -62
@@ -5468,7 +5530,7 @@
0
- -28
+ -302
@@ -5477,7 +5539,7 @@
0
- -17
+ -192
@@ -5486,7 +5548,7 @@
0
- -28
+ -302
@@ -5495,7 +5557,7 @@
0
- -25
+ -152
@@ -5506,7 +5568,7 @@
0
- -8
+ -10
@@ -5519,7 +5581,7 @@
0
- -9
+ -11
@@ -5530,7 +5592,7 @@
0
- -28
+ -302
@@ -5548,7 +5610,7 @@
0
- -29
+ -312
@@ -5557,7 +5619,7 @@
0
- -28
+ -302
@@ -5575,7 +5637,7 @@
0
- -29
+ -312
@@ -5584,7 +5646,7 @@
0
- -28
+ -302
@@ -5593,7 +5655,7 @@
0
- -28
+ -302
@@ -5602,7 +5664,7 @@
0
- -28
+ -302
@@ -5613,7 +5675,7 @@
0
- -10
+ -12
@@ -5624,7 +5686,7 @@
0
- -29
+ -312
@@ -5633,7 +5695,7 @@
0
- -10
+ -122
@@ -5642,7 +5704,7 @@
0
- -28
+ -302
@@ -5651,7 +5713,7 @@
0
- -17
+ -192
@@ -5660,7 +5722,7 @@
0
- -10
+ -122
@@ -5680,7 +5742,7 @@
0
- -11
+ -13
@@ -5691,7 +5753,7 @@
0
- -29
+ -312
@@ -5702,7 +5764,7 @@
0
- -12
+ -14
@@ -5713,7 +5775,7 @@
0
- -5
+ -82
@@ -5722,7 +5784,7 @@
0
- -31
+ -322
@@ -5740,7 +5802,7 @@
0
- -28
+ -302
@@ -5749,7 +5811,7 @@
0
- -31
+ -322
@@ -5758,7 +5820,7 @@
0
- -31
+ -322
@@ -5767,7 +5829,7 @@
0
- -5
+ -82
@@ -5776,7 +5838,7 @@
0
- -5
+ -82
@@ -5794,7 +5856,7 @@
0
- -31
+ -322
@@ -5812,7 +5874,7 @@
0
- -5
+ -82
@@ -5821,7 +5883,7 @@
0
- -31
+ -322
@@ -5830,7 +5892,7 @@
0
- -32
+ -202
@@ -5839,7 +5901,7 @@
0
- -31
+ -322
@@ -5857,7 +5919,7 @@
0
- -5
+ -82
@@ -5877,38 +5939,65 @@
0
- -13
+ -15
- 5
+ 112
- (:auto !!!:)
(:include synopsis:)
!!!!Effects:
As if
[@try
{
throw
+ (:auto !!:)
All exception types that derive from boost::(:link 10
- -32
+ -302
- (e);
}
catch(...)
{
return (: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.
When exceptions derive from boost::(:link 10
- -5
+ -302
- :)();
}@]
+ :), arbitrary data can be added to exception objects:
*At the point of the throw;
*At a later time as exceptions bubble up the call stack.
(:include
+ 1
+
+ 0
+
+ -46
+
+
+ 2
+ :)
(:include
+ 1
+
+ 0
+
+ -11
+
+
+ 2
+ :)
(:include
+ 1
+
+ 0
+
+ -50
+
+
+ 2
+ :)
0
- -14
+ -16
@@ -5919,7 +6008,7 @@
0
- -28
+ -302
@@ -5928,7 +6017,7 @@
0
- -28
+ -302
@@ -5937,7 +6026,7 @@
0
- -29
+ -312
@@ -5946,7 +6035,7 @@
0
- -17
+ -192
@@ -5955,7 +6044,7 @@
0
- -28
+ -302
@@ -5964,7 +6053,7 @@
0
- -29
+ -312
@@ -5973,7 +6062,7 @@
0
- -28
+ -302
@@ -5982,7 +6071,7 @@
0
- -17
+ -192
@@ -5991,7 +6080,7 @@
0
- -28
+ -302
@@ -6000,7 +6089,7 @@
0
- -17
+ -192
@@ -6009,7 +6098,7 @@
0
- -28
+ -302
@@ -6018,7 +6107,7 @@
0
- -10
+ -122
@@ -6027,7 +6116,7 @@
0
- -10
+ -122
@@ -6045,7 +6134,7 @@
0
- -29
+ -312
@@ -6054,7 +6143,7 @@
0
- -28
+ -302
@@ -6068,103 +6157,6 @@
-17
-
- 7
- 2
- (:auto !!!:)
(:include synopsis:)
!!!!Requirements:
E must be boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :), or a type that derives (indirectly) from boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :).
!!!!Effects:
Stores a copy of v into x. If x already contains data of type (:link
- 1
-
- 0
-
- -29
-
-
- 2
- :)<Tag,T>, that data is overwritten.
!!!!Returns:
x.
(:include throws:)
-
-
-
-
- 0
-
- -18
-
-
-
- 5
- 2
- (:auto !!!:)
(:include synopsis:)
!!!!Requirements:
E must be boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :), or a type that derives (indirectly) from boost::(:link
- 1
-
- 0
-
- -28
-
-
- 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
-
- -19
-
-
-
- 1
- 2
- (:auto !!:)
!!!Synopsis
(:include synopsis:)
-
-
-
-
- 0
-
- -20
-
-
-
- 1
- 2
- (:auto !!:)
!!!Synopsis
(:include synopsis:)
-
-
-
-
- 0
-
- -15
-
- 72
@@ -6173,7 +6165,7 @@
0
- -28
+ -302
@@ -6182,7 +6174,7 @@
0
- -28
+ -302
@@ -6191,7 +6183,7 @@
0
- -28
+ -302
@@ -6202,122 +6194,13 @@
0
- -21
+ -18
- 3
+ 572
- (:auto !!!:)
(:include decl:)
!!!!Effects:
Frees all resources associated with a boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :) object.
!!!!Throws:
Nothing.
-
-
-
-
- 0
-
- -22
-
-
-
- 0
-
-
-
-
- 0
-
- -23
-
-
-
- 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
-
- -32
-
-
- 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
-
- -24
-
-
- 2
- :) are guaranteed to derive from boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :) and to support cloning.
(:include
- 1
-
- 0
-
- -49
-
-
- 2
- :)
(:include
- 1
-
- 0
-
- -12
-
-
- 2
- :)
-
-
-
-
- 0
-
- -24
-
-
-
- 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
-
- -24
-
-
- 2
- :)(e) is equivalent to throw boost::(:link
- 1
-
- 0
-
- -32
-
-
- 2
- :)(boost::(:link
+ (:auto !!!:)
!!!Why use operator<< overload for adding info to exceptions?
Before throwing an object of type that derives from boost::(:link 10
@@ -6326,41 +6209,297 @@
2
- :)(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::(:link
+ :), it is often desirable to add one or more (:link 10
- -24
+ -312
- :)(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
+ :) objects in it. The syntactic sugar provided by (:link 10
- -24
+ -192
- :) are allowed to assume that the function never returns; therefore, if the user-defined (:link
+ :) allows this to be done directly in a throw expression:
[@throw error() (:link 10
- -24
+ -192
- :) returns, the behavior is undefined.
+ |<<:) foo_info(foo) (:link
+ 1
+
+ 0
+
+ -19
+
+
+ 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
+
+ -31
+
+
+ 2
+ :) to an active exception object:
[@catch( boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :) & e )
{
e (:link
+ 1
+
+ 0
+
+ -19
+
+
+ 2
+ |<<:) foo_info(foo);
throw e; //Compile error: boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :) is abstract
}@]
The correct code is:
[@catch( boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :) & e )
{
e (:link
+ 1
+
+ 0
+
+ -19
+
+
+ 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
+
+ -29
+
+
+ 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
+
+ -30
+
+
+ 2
+ :) derives from std::exception, using the
+ 1
+
+ 0
+
+ -6
+
+
+ 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
+
+ -30
+
+
+ 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
+
+ -30
+
+
+ 2
+ :) does not by itself cause dynamic memory allocations.
Deriving from boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 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
+
+ -27
+
+
+ 2
+ :) function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :) as a base of any exception passed to boost::(:link
+ 1
+
+ 0
+
+ -27
+
+
+ 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
+
+ -30
+
+
+ 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
+
+ -32
+
+
+ 2
+ :), but this requires that Boost Serialization throws exceptions using boost::(:link
+ 1
+
+ 0
+
+ -20
+
+
+ 2
+ :). If Boost Serialization calls boost::(:link
+ 1
+
+ 0
+
+ -27
+
+
+ 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
+
+ -5
+
+
+ 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
+ 1
+
+ 0
+
+ -35
+
+
+ 2
+ :) to compose a more useful, if not user-friendly message.
Typical use of boost::(:link
+ 1
+
+ 0
+
+ -35
+
+
+ 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
+
+ -5
+
+
+ 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@]
0
- -32
+ -19
+
+
+
+ 7
+ 2
+ (:auto !!!:)
(:include synopsis:)
!!!!Requirements:
E must be boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :), or a type that derives (indirectly) from boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :).
!!!!Effects:
Stores a copy of v into x. If x already contains data of type (:link
+ 1
+
+ 0
+
+ -31
+
+
+ 2
+ :)<Tag,T>, that data is overwritten.
!!!!Returns:
x.
(:include throws:)
+
+
+
+
+ 0
+
+ -20
@@ -6371,7 +6510,7 @@
0
- -31
+ -322
@@ -6380,7 +6519,7 @@
0
- -32
+ -202
@@ -6389,7 +6528,7 @@
0
- -32
+ -202
@@ -6398,7 +6537,7 @@
0
- -5
+ -82
@@ -6407,7 +6546,7 @@
0
- -31
+ -322
@@ -6425,7 +6564,7 @@
0
- -5
+ -82
@@ -6434,7 +6573,7 @@
0
- -24
+ -272
@@ -6443,7 +6582,7 @@
0
- -28
+ -302
@@ -6452,13 +6591,92 @@
0
- -31
+ -322:) functionality.
+
+
+ 0
+
+ -21
+
+
+
+ 5
+ 2
+ (:auto !!!:)
(:include synopsis:)
!!!!Requirements:
E must be boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :), or a type that derives (indirectly) from boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 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
+
+ -22
+
+
+
+ 1
+ 2
+ (:auto !!:)
!!!Synopsis
(:include synopsis:)
+
+
+
+
+ 0
+
+ -23
+
+
+
+ 1
+ 2
+ (:auto !!:)
!!!Synopsis
(:include synopsis:)
+
+
+
+
+ 0
+
+ -24
+
+
+
+ 3
+ 2
+ (:auto !!!:)
(:include decl:)
!!!!Effects:
Frees all resources associated with a boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :) object.
!!!!Throws:
Nothing.
+
+ 0
@@ -6466,33 +6684,53 @@
-25
+
+ 0
+
+
+
+
+ 0
+
+ -26
+
+ 112
- (:auto !!:)
All exception types that derive from boost::(:link
+ (: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 10
- -28
+ -202
- :) can be used as type-safe containers of arbitrary data objects, while complying with the no-throw requirements (15.5.1) of the ANSI C++ standard for exception types.
When exceptions derive from boost::(:link
+ :) at the time of the throw is required in order to use cloning.
!!!!Note:
All exceptions emitted by the familiar function boost::(:link 10
- -28
+ -272
- :), arbitrary data can be added to exception objects:
*At the point of the throw;
*At a later time as exceptions bubble up the call stack.
(:include
+ :) are guaranteed to derive from boost::(:link 10
- -48
+ -30
+
+
+ 2
+ :) and to support cloning.
(:include
+ 1
+
+ 0
+
+ -512
@@ -6501,16 +6739,7 @@
0
- -9
-
-
- 2
- :)
(:include
- 1
-
- 0
-
- -47
+ -142
@@ -6521,7 +6750,105 @@
0
- -26
+ -27
+
+
+
+ 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
+
+ -27
+
+
+ 2
+ :)(e) is equivalent to throw boost::(:link
+ 1
+
+ 0
+
+ -20
+
+
+ 2
+ :)(boost::(:link
+ 1
+
+ 0
+
+ -6
+
+
+ 2
+ :)(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::(:link
+ 1
+
+ 0
+
+ -27
+
+
+ 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
+
+ -27
+
+
+ 2
+ :) are allowed to assume that the function never returns; therefore, if the user-defined (:link
+ 1
+
+ 0
+
+ -27
+
+
+ 2
+ :) returns, the behavior is undefined.
+
+
+
+
+ 0
+
+ -34
+
+
+
+ 5
+ 2
+ (:auto !!!:)
(:include synopsis:)
This type is used by the (:link
+ 1
+
+ 0
+
+ -32
+
+
+ 2
+ :) support in Boost Exception. Please see (:link
+ 1
+
+ 0
+
+ -8
+
+
+ 2
+ :).
+
+
+
+
+ 0
+
+ -28
@@ -6541,7 +6868,7 @@
0
- -28
+ -302
@@ -6550,7 +6877,7 @@
0
- -28
+ -302
@@ -6559,7 +6886,7 @@
0
- -17
+ -192
@@ -6577,7 +6904,7 @@
0
- -28
+ -302
@@ -6586,7 +6913,7 @@
0
- -28
+ -302
@@ -6604,13 +6931,362 @@
0
- -51
+ -522:)
+
+
+ 0
+
+ -36
+
+
+
+ 15
+ 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
+
+ -12
+
+
+ 2
+ :) function template can be called with any exception type. If BOOST_NO_RTTI is defined, (:link
+ 1
+
+ 0
+
+ -12
+
+
+ 2
+ :) can be used only with objects of type boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :).
'''BOOST_EXCEPTION_DISABLE'''
By default, (:link
+ 1
+
+ 0
+
+ -20
+
+
+ 2
+ :) and (:link
+ 1
+
+ 0
+
+ -6
+
+
+ 2
+ :) are integrated directly in the (:link
+ 1
+
+ 0
+
+ -27
+
+
+ 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
+
+ -44
+
+
+ 2
+ :).
+
+
+
+
+ 0
+
+ -29
+
+
+
+ 5
+ 2
+ (:auto !!!:)
Exception types should use virtual inheritance when deriving from other exception types. This insight is due to Andrew Koenig. Using virtual inheritance prevents ambiguity problems in the exception handler:
[@#include <iostream>
struct my_exc1 : std::exception { char const* what() const throw(); };
struct my_exc2 : std::exception { char const* what() const throw(); };
struct your_exc3 : my_exc1, my_exc2 {};
int
main()
{
try { throw your_exc3(); }
catch(std::exception const& e) {}
catch(...) { std::cout << "whoops!" << std::endl; }
}@]
The program above outputs "whoops!" because the conversion to std::exception is ambiguous.
The overhead introduced by virtual inheritance is always negligible in the context of exception handling. Note that virtual bases are initialized directly by the constructor of the most-derived-type (the type passed to the throw statement, in case of exceptions.) However, typically this detail is of no concern when boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :) is used, because it enables exception types to be trivial structs with no members (there's nothing to initialize.) See (:link
+ 1
+
+ 0
+
+ -17
+
+
+ 2
+ mod="w":).
+
+
+
+
+ 0
+
+ -30
+
+
+
+ 13
+ 2
+ (:auto !!!:)
(:include synopsis:)
Class boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 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
+
+ -30
+
+
+ 2
+ :) can store data of arbitrary types, using the (:link
+ 1
+
+ 0
+
+ -31
+
+
+ 2
+ :) wrapper and (:link
+ 1
+
+ 0
+
+ -19
+
+
+ 2
+ mod="/":).
To retrieve data from a boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :) object, use the (:link
+ 1
+
+ 0
+
+ -12
+
+
+ 2
+ :) function template.
+
+
+
+
+ 0
+
+ -31
+
+
+
+ 37
+ 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
+
+ -31
+
+
+ 2
+ :)<Tag,T> can be passed to (:link
+ 1
+
+ 0
+
+ -19
+
+
+ 2
+ mod="/":) to be stored in objects of type boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :).
!!!!Usage:
The header <(:link
+ 1
+
+ 0
+
+ -40
+
+
+ 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, for example:
[@#include <(:link
+ 1
+
+ 0
+
+ -40
+
+
+ 2
+ :)>
struct tag_errno;
typedef boost::(:link
+ 1
+
+ 0
+
+ -31
+
+
+ 2
+ :)<tag_errno,int> errno_info;@]
Or, the shorter equivalent:
[@#include <(:link
+ 1
+
+ 0
+
+ -40
+
+
+ 2
+ :)>
typedef boost::(:link
+ 1
+
+ 0
+
+ -31
+
+
+ 2
+ :)<struct tag_errno,int> errno_info;@]
This errno_info typedef can be passed to (:link
+ 1
+
+ 0
+
+ -19
+
+
+ 2
+ mod="/":) (#include <(:link
+ 1
+
+ 0
+
+ -41
+
+
+ 2
+ :)> first) to store an int named tag_errno in exceptions of types that derive from boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :):
[@throw file_read_error() (:link
+ 1
+
+ 0
+
+ -19
+
+
+ 2
+ |<<:) errno_info(errno);@]
It can also be passed to
+ 1
+
+ 0
+
+ -12
+
+
+ 2
+ (#include <
+ 1
+
+ 0
+
+ -23
+
+
+ 2
+ > first) to retrieve the tag_errno int from a boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :):
[@catch( boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :) & x )
{
if( boost::shared_ptr<int const> e=boost::
+ 1
+
+ 0
+
+ -12
+
+
+ 2
+ <errno_info>(x) )
....
}@]
+
+ 0
@@ -6628,342 +7304,7 @@
0
- -27
-
-
-
- 5
- 2
- (:auto !!!:)
Exception types should use virtual inheritance when deriving from other exception types. This insight is due to Andrew Koenig. Using virtual inheritance prevents ambiguity problems in the exception handler:
[@#include <iostream>
struct my_exc1 : std::exception { char const* what() const throw(); };
struct my_exc2 : std::exception { char const* what() const throw(); };
struct your_exc3 : my_exc1, my_exc2 {};
int
main()
{
try { throw your_exc3(); }
catch(std::exception const& e) {}
catch(...) { std::cout << "whoops!" << std::endl; }
}@]
The program above outputs "whoops!" because the conversion to std::exception is ambiguous.
The overhead introduced by virtual inheritance is always negligible in the context of exception handling. Note that virtual bases are initialized directly by the constructor of the most-derived-type (the type passed to the throw statement, in case of exceptions.) However, typically this detail is of no concern when boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :) is used, because it enables exception types to be trivial structs with no members (there's nothing to initialize.) See (:link
- 1
-
- 0
-
- -15
-
-
- 2
- mod="w":).
-
-
-
-
- 0
-
- -28
-
-
-
- 13
- 2
- (:auto !!!:)
(:include synopsis:)
Class boost::(:link
- 1
-
- 0
-
- -28
-
-
- 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
-
- -28
-
-
- 2
- :) can store data of arbitrary types, using the (:link
- 1
-
- 0
-
- -29
-
-
- 2
- :) wrapper and (:link
- 1
-
- 0
-
- -17
-
-
- 2
- mod="/":).
To retrieve data from a boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :) object, use the (:link
- 1
-
- 0
-
- -10
-
-
- 2
- :) function template.
-
-
-
-
- 0
-
- -29
-
-
-
- 37
- 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
-
- -29
-
-
- 2
- :)<Tag,T> can be passed to (:link
- 1
-
- 0
-
- -17
-
-
- 2
- mod="/":) to be stored in objects of type boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :).
!!!!Usage:
The header <(:link
- 1
-
- 0
-
- -40
-
-
- 2
- :)> provides a declaration of the (:link
- 1
-
- 0
-
- -29
-
-
- 2
- :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, for example:
[@#include <(:link
- 1
-
- 0
-
- -40
-
-
- 2
- :)>
struct tag_errno;
typedef boost::(:link
- 1
-
- 0
-
- -29
-
-
- 2
- :)<tag_errno,int> errno_info;@]
Or, the shorter equivalent:
[@#include <(:link
- 1
-
- 0
-
- -40
-
-
- 2
- :)>
typedef boost::(:link
- 1
-
- 0
-
- -29
-
-
- 2
- :)<struct tag_errno,int> errno_info;@]
This errno_info typedef can be passed to (:link
- 1
-
- 0
-
- -17
-
-
- 2
- mod="/":) (#include <(:link
- 1
-
- 0
-
- -41
-
-
- 2
- :)> first) to store an int named tag_errno in exceptions of types that derive from boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :):
[@throw file_read_error() (:link
- 1
-
- 0
-
- -17
-
-
- 2
- |<<:) errno_info(errno);@]
It can also be passed to
- 1
-
- 0
-
- -10
-
-
- 2
- (#include <
- 1
-
- 0
-
- -20
-
-
- 2
- > first) to retrieve the tag_errno int from a boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :):
[@catch( boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :) & x )
{
if( boost::shared_ptr<int const> e=boost::
- 1
-
- 0
-
- -10
-
-
- 2
- <errno_info>(x) )
....
}@]
-
-
-
-
- 0
-
- -34
-
-
-
- 5
- 2
- (:auto !!!:)
(:include synopsis:)
This type is used by the (:link
- 1
-
- 0
-
- -31
-
-
- 2
- :) support in Boost Exception. Please see (:link
- 1
-
- 0
-
- -5
-
-
- 2
- :).
-
-
-
-
- 0
-
- -30
-
-
-
- 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
-
- -28
-
-
- 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
-
- -28
-
-
- 2
- :). The T sub-object is initialized from x by the T copy constructor.
!!!!Throws:
Nothing.
-
-
-
-
- 0
-
- -31
+ -32
@@ -6974,7 +7315,7 @@
0
- -31
+ -322
@@ -6983,7 +7324,7 @@
0
- -31
+ -322
@@ -6992,7 +7333,7 @@
0
- -31
+ -322
@@ -7001,7 +7342,7 @@
0
- -31
+ -322
@@ -7010,7 +7351,7 @@
0
- -31
+ -322
@@ -7019,7 +7360,7 @@
0
- -31
+ -322
@@ -7028,7 +7369,7 @@
0
- -5
+ -82
@@ -7059,7 +7400,7 @@
0
- -29
+ -312
@@ -7068,7 +7409,7 @@
0
- -28
+ -302
@@ -7077,7 +7418,7 @@
0
- -17
+ -192
@@ -7086,7 +7427,7 @@
0
- -29
+ -312
@@ -7095,7 +7436,7 @@
0
- -29
+ -312
@@ -7104,7 +7445,7 @@
0
- -29
+ -312
@@ -7113,7 +7454,7 @@
0
- -46
+ -482
@@ -7122,7 +7463,7 @@
0
- -46
+ -482
@@ -7140,7 +7481,7 @@
0
- -29
+ -312
@@ -7149,7 +7490,7 @@
0
- -51
+ -522
@@ -7169,82 +7510,6 @@
(:auto !!!:)
(:include synopsis:)
!!!!Precondition:
ep shall not be null.
!!!!Throws:
The exception to which ep refers.
-
-
- 0
-
- -36
-
-
-
- 15
- 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
-
- -10
-
-
- 2
- :) function template can be called with any exception type. If BOOST_NO_RTTI is defined, (:link
- 1
-
- 0
-
- -10
-
-
- 2
- :) can be used only with objects of type boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :).
'''BOOST_EXCEPTION_DISABLE'''
By default, (:link
- 1
-
- 0
-
- -32
-
-
- 2
- :) and (:link
- 1
-
- 0
-
- -30
-
-
- 2
- :) are integrated directly in the (:link
- 1
-
- 0
-
- -24
-
-
- 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
-
- -44
-
-
- 2
- :).
-
- 0
@@ -7258,6 +7523,91 @@
(:auto !!:)
!!!Synopsis
(:include synopsis:)
+
+
+ 0
+
+ -46
+
+
+
+ 17
+ 2
+ (:auto !!!:)
The following example demonstrates how errno can be stored in exception objects using Boost Exception:
[@#include <(:link
+ 1
+
+ 0
+
+ -37
+
+
+ 2
+ :)>
#include <errno.h>
#include <iostream>
typedef boost::(:link
+ 1
+
+ 0
+
+ -31
+
+
+ 2
+ :)<struct tag_errno,int> errno_info; //(1)
class my_error: public boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :), public std::exception { }; //(2)
void
f()
{
throw my_error() << errno_info(errno); //(3)
}
@]
First, we instantiate the (:link
+ 1
+
+ 0
+
+ -31
+
+
+ 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
+
+ -30
+
+
+ 2
+ :).
Finally, (3) illustrates how the typedef from (1) can be used with (:link
+ 1
+
+ 0
+
+ -19
+
+
+ 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
+
+ -12
+
+
+ 2
+ :)<errno_info>(x) )
std::cerr << "Error code: " << *err;
}
}@]
The (:link
+ 1
+
+ 0
+
+ -12
+
+
+ 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.
+
+ 0
@@ -7271,6 +7621,37 @@
(:auto !!:)
!!!Synopsis
(:include synopsis:)
+
+
+ 0
+
+ -47
+
+
+
+ 5
+ 2
+ (:auto !!!:)
(:include synopsis:)
!!!!Definition:
The expression
+ 1
+
+ 0
+
+ -31
+
+
+ 2
+ <Tag,T>::(:link
+ 1
+
+ 0
+
+ -47
+
+
+ 2
+ mod="m":) evaluates to T.
+
+ 0
@@ -7336,235 +7717,6 @@
(:auto !!:)
!!!Synopsis
(:include synopsis:)
-
-
- 0
-
- -16
-
-
-
- 49
- 2
- (:auto !!!:)
!!!Why use operator<< overload for adding info to exceptions?
Before throwing an object of type that derives from boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :), it is often desirable to add one or more (:link
- 1
-
- 0
-
- -29
-
-
- 2
- :) objects in it. The syntactic sugar provided by (:link
- 1
-
- 0
-
- -17
-
-
- 2
- :) allows this to be done directly in a throw expression:
[@throw error() (:link
- 1
-
- 0
-
- -17
-
-
- 2
- |<<:) foo_info(foo) (:link
- 1
-
- 0
-
- -17
-
-
- 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
-
- -29
-
-
- 2
- :) to an active exception object:
[@catch( boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :) & e )
{
e (:link
- 1
-
- 0
-
- -17
-
-
- 2
- |<<:) foo_info(foo);
throw e; //Compile error: boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :) is abstract
}@]
The correct code is:
[@catch( boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :) & e )
{
e (:link
- 1
-
- 0
-
- -17
-
-
- 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
-
- -28
-
-
- 2
- :) does not by itself cause dynamic memory allocations.
Deriving from boost::(:link
- 1
-
- 0
-
- -28
-
-
- 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
-
- -24
-
-
- 2
- :) function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :) as a base of any exception passed to boost::(:link
- 1
-
- 0
-
- -24
-
-
- 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
-
- -28
-
-
- 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
-
- -31
-
-
- 2
- :), but this requires that Boost Serialization throws exceptions using boost::(:link
- 1
-
- 0
-
- -32
-
-
- 2
- :). If Boost Serialization calls boost::(:link
- 1
-
- 0
-
- -24
-
-
- 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
-
- -6
-
-
- 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
- 1
-
- 0
-
- -35
-
-
- 2
- :) to compose a more useful, if not user-friendly message.
Typical use of boost::(:link
- 1
-
- 0
-
- -35
-
-
- 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
-
- -6
-
-
- 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@]
-
- 0
@@ -7580,7 +7732,7 @@
0
- -46
+ -48
@@ -7591,7 +7743,7 @@
0
- -29
+ -312
@@ -7600,7 +7752,7 @@
0
- -29
+ -312
@@ -7611,7 +7763,47 @@
0
- -47
+ -49
+
+
+
+ 7
+ 2
+ (:auto !!!:)
(:include decl:)
!!!!Effects:
* Default constructor: initializes an empty boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :) object.
* Copy constructor: initializes a boost::(:link
+ 1
+
+ 0
+
+ -30
+
+
+ 2
+ :) object which shares ownership with x of all data added through (:link
+ 1
+
+ 0
+
+ -19
+
+
+ 2
+ mod="/":), including data that is added at a future time.
!!!!Throws:
Nothing.
+
+
+
+
+ 0
+
+ -50
@@ -7631,7 +7823,7 @@
0
- -29
+ -312
@@ -7640,7 +7832,7 @@
0
- -29
+ -312
@@ -7649,7 +7841,7 @@
0
- -29
+ -312
@@ -7658,7 +7850,7 @@
0
- -28
+ -302
@@ -7667,7 +7859,7 @@
0
- -10
+ -122
@@ -7678,92 +7870,7 @@
0
- -48
-
-
-
- 17
- 2
- (:auto !!!:)
The following example demonstrates how errno can be stored in exception objects using Boost Exception:
[@#include <(:link
- 1
-
- 0
-
- -37
-
-
- 2
- :)>
#include <errno.h>
#include <iostream>
typedef boost::(:link
- 1
-
- 0
-
- -29
-
-
- 2
- :)<struct tag_errno,int> errno_info; //(1)
class my_error: public boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :), public std::exception { }; //(2)
void
f()
{
throw my_error() << errno_info(errno); //(3)
}
@]
First, we instantiate the (:link
- 1
-
- 0
-
- -29
-
-
- 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
-
- -28
-
-
- 2
- :).
Finally, (3) illustrates how the typedef from (1) can be used with (:link
- 1
-
- 0
-
- -17
-
-
- 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
-
- -10
-
-
- 2
- :)<errno_info>(x) )
std::cerr << "Error code: " << *err;
}
}@]
The (:link
- 1
-
- 0
-
- -10
-
-
- 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.
-
-
-
-
- 0
-
- -49
+ -51
@@ -7783,7 +7890,7 @@
0
- -28
+ -302
@@ -7792,7 +7899,7 @@
0
- -32
+ -202
@@ -7801,7 +7908,7 @@
0
- -32
+ -202
@@ -7810,7 +7917,7 @@
0
- -28
+ -302
@@ -7821,38 +7928,7 @@
0
- -50
-
-
-
- 5
- 2
- (:auto !!!:)
(:include synopsis:)
!!!!Definition:
The expression
- 1
-
- 0
-
- -29
-
-
- 2
- <Tag,T>::(:link
- 1
-
- 0
-
- -50
-
-
- 2
- mod="m":) evaluates to T.
-
-
-
-
- 0
-
- -51
+ -52
@@ -7870,46 +7946,6 @@
:) function, as used in ''libs/exception/example/example_io.cpp:''
[@libs\exception\example\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
-
- -52
-
-
-
- 7
- 2
- (:auto !!!:)
(:include decl:)
!!!!Effects:
* Default constructor: initializes an empty boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :) object.
* Copy constructor: initializes a boost::(:link
- 1
-
- 0
-
- -28
-
-
- 2
- :) object which shares ownership with x of all data added through (:link
- 1
-
- 0
-
- -17
-
-
- 2
- mod="/":), including data that is added at a future time.
!!!!Throws:
Nothing.
-
-
@@ -7998,9 +8034,7 @@
- 1
- 2
- !!!!Throws:
Any exception emitted by v's copy constructor.
+ 0
@@ -8022,7 +8056,9 @@
- 0
+ 1
+ 2
+ !!!!Throws:
Any exception emitted by v's copy constructor.
@@ -8036,54 +8072,6 @@
0
-
-
- 0
-
- -17
-
-
-
- 1
- 2
- !!!!Throws:
std::bad_alloc, or any exception emitted by the T copy constructor.
-
-
-
-
- 0
-
- -18
-
-
-
- 1
- 2
- !!!!Throws:
std::bad_alloc, or any exception emitted by T1..TN copy constructor.
-
-
-
-
- 0
-
- -19
-
-
-
- 0
-
-
-
-
- 0
-
- -20
-
-
-
- 0
-
- 0
@@ -8099,13 +8087,72 @@
0
- -21
+ -160
+
+
+ 0
+
+ -17
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -18
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -19
+
+
+
+ 1
+ 2
+ !!!!Throws:
std::bad_alloc, or any exception emitted by the T copy constructor.
+
+
+
+
+ 0
+
+ -20
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -21
+
+
+
+ 1
+ 2
+ !!!!Throws:
std::bad_alloc, or any exception emitted by T1..TN copy constructor.
+
+ 0
@@ -8139,17 +8186,6 @@
0
-
-
- 0
-
- -32
-
-
-
- 0
-
- 0
@@ -8176,7 +8212,7 @@
0
- -39
+ -27
@@ -8187,7 +8223,7 @@
0
- -27
+ -34
@@ -8209,7 +8245,7 @@
0
- -29
+ -36
@@ -8220,7 +8256,7 @@
0
- -34
+ -29
@@ -8249,6 +8285,28 @@
0
+
+
+ 0
+
+ -39
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -32
+
+
+
+ 0
+
+ 0
@@ -8271,17 +8329,6 @@
0
-
-
- 0
-
- -36
-
-
-
- 0
-
- 0
@@ -8293,6 +8340,17 @@
0
+
+
+ 0
+
+ -46
+
+
+
+ 0
+
+ 0
@@ -8304,6 +8362,17 @@
0
+
+
+ 0
+
+ -47
+
+
+
+ 0
+
+ 0
@@ -8359,17 +8428,6 @@
0
-
-
- 0
-
- -16
-
-
-
- 0
-
- 0
@@ -8381,28 +8439,6 @@
0
-
-
- 0
-
- -46
-
-
-
- 0
-
-
-
-
- 0
-
- -47
-
-
-
- 0
-
- 0
@@ -8482,16 +8518,16 @@
32
- `#include <(:link
+ `#include <10
- -43
+ -442
- :)>
[@namespace
boost
{
(:include decl pre_indent="4":)
}@]
+ >
(:include decl:)
@@ -8509,11 +8545,11 @@
0
- -44
+ -392
- >
(:include decl:)
+ >
[@namespace
boost
{
(:include decl pre_indent="4":)
}@]
@@ -8524,7 +8560,18 @@
- 0
+ 3
+ 2
+ `#include <(:link
+ 1
+
+ 0
+
+ -43
+
+
+ 2
+ :)>
[@namespace
boost
{
(:include decl pre_indent="4":)
}@]
@@ -8537,16 +8584,16 @@
32
- [@#include <
+ `#include <(:link 10
- -19
+ -432
- >
namespace
boost
{
(:include api pre_indent="4":)
}@]
+ :)>
[@namespace
boost
{
(:include decl pre_indent="4":)
}@]
@@ -8567,6 +8614,39 @@
-10
+
+ 3
+ 2
+ [@#include <
+ 1
+
+ 0
+
+ -22
+
+
+ 2
+ >
namespace
boost
{
(:include api pre_indent="4":)
}@]
+
+
+
+
+ 0
+
+ -11
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -12
+
+ 32
@@ -8575,7 +8655,7 @@
0
- -20
+ -232
@@ -8586,7 +8666,7 @@
0
- -11
+ -13
@@ -8604,39 +8684,6 @@
:)>
[@(:include decl:)@]
-
-
- 0
-
- -12
-
-
-
- 0
-
-
-
-
- 0
-
- -13
-
-
-
- 3
- 2
- `#include <(:link
- 1
-
- 0
-
- -43
-
-
- 2
- :)>
[@namespace
boost
{
(:include decl pre_indent="4":)
}@]
-
- 0
@@ -8648,6 +8695,28 @@
0
+
+
+ 0
+
+ -15
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -16
+
+
+
+ 0
+
+ 0
@@ -8655,6 +8724,28 @@
-17
+
+ 0
+
+
+
+
+ 0
+
+ -18
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -19
+
+ 32
@@ -8674,7 +8765,29 @@
0
- -18
+ -20
+
+
+
+ 3
+ 2
+ `#include <
+ 1
+
+ 0
+
+ -10
+
+
+ 2
+ >
[@namespace
boost
{
(:include decl pre_indent="4":)
}@]
+
+
+
+
+ 0
+
+ -21
@@ -8694,7 +8807,7 @@
0
- -18
+ -212
@@ -8705,7 +8818,7 @@
0
- -19
+ -22
@@ -8718,7 +8831,7 @@
0
- -20
+ -23
@@ -8727,50 +8840,6 @@
[@#include <boost/shared_ptr.hpp>
namespace
boost
{
(:include api pre_indent="4":)
}@]
-
-
- 0
-
- -15
-
-
-
- 0
-
-
-
-
- 0
-
- -21
-
-
-
- 0
-
-
-
-
- 0
-
- -22
-
-
-
- 0
-
-
-
-
- 0
-
- -23
-
-
-
- 0
-
- 0
@@ -8779,40 +8848,7 @@
- 3
- 2
- `#include <(:link
- 1
-
- 0
-
- -44
-
-
- 2
- :)>
[@namespace
boost
{
(:include decl:)
}@]
-
-
-
-
- 0
-
- -32
-
-
-
- 3
- 2
- `#include <
- 1
-
- 0
-
- -8
-
-
- 2
- >
[@namespace
boost
{
(:include decl pre_indent="4":)
}@]
+ 0
@@ -8837,28 +8873,6 @@
0
-
-
- 0
-
- -39
-
-
-
- 3
- 2
- [@#include <
- 1
-
- 0
-
- -19
-
-
- 2
- >
namespace
boost
{
(:include api pre_indent="4":)
}@]
-
- 0
@@ -8866,17 +8880,6 @@
-27
-
- 0
-
-
-
-
- 0
-
- -28
-
- 32
@@ -8885,33 +8888,11 @@
0
- -19
+ -442
- :)>
[@namespace
boost
{
(:include def pre_indent="4":)
}@]
-
-
-
-
- 0
-
- -29
-
-
-
- 3
- 2
- `#include <(:link
- 1
-
- 0
-
- -41
-
-
- 2
- :)>
[@namespace
boost
{
(:include def pre_indent="4":)
}@]
+ :)>
[@namespace
boost
{
(:include decl:)
}@]
@@ -8936,6 +8917,39 @@
:)>
[@namespace
boost
{
(:include decl pre_indent="4":)
}@]
+
+
+ 0
+
+ -28
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -36
+
+
+
+ 0
+
+
+
+
+ 0
+
+ -29
+
+
+
+ 0
+
+ 0
@@ -8946,16 +8960,16 @@
32
- `#include <
+ `#include <(:link 10
- -39
+ -222
- >
[@namespace
boost
{
(:include decl pre_indent="4":)
}@]
+ :)>
[@namespace
boost
{
(:include def pre_indent="4":)
}@]
@@ -8965,6 +8979,50 @@
-31
+
+ 3
+ 2
+ `#include <(:link
+ 1
+
+ 0
+
+ -41
+
+
+ 2
+ :)>
[@namespace
boost
{
(:include def pre_indent="4":)
}@]
+
+
+
+
+ 0
+
+ -39
+
+
+
+ 3
+ 2
+ [@#include <
+ 1
+
+ 0
+
+ -22
+
+
+ 2
+ >
namespace
boost
{
(:include api pre_indent="4":)
}@]
+
+
+
+
+ 0
+
+ -32
+
+ 32
@@ -9024,17 +9082,6 @@
:)>
[@namespace
boost
{
(:include decl pre_indent="4":)
}@]
-
-
- 0
-
- -36
-
-
-
- 0
-
- 0
@@ -9050,13 +9097,24 @@
0
- -28
+ -302 decl pre_indent="4":)
(:include api pre_indent="4":)
}@]
+
+
+ 0
+
+ -46
+
+
+
+ 0
+
+ 0
@@ -9070,6 +9128,28 @@
[@(:include api:)@]
+
+
+ 0
+
+ -47
+
+
+
+ 3
+ 2
+ `#include <(:link
+ 1
+
+ 0
+
+ -41
+
+
+ 2
+ :)>
[@(:include decl:)@]
+
+ 0
@@ -9098,7 +9178,7 @@
0
- -19
+ -222
@@ -9133,7 +9213,7 @@
0
- -19
+ -222
@@ -9153,17 +9233,6 @@
(:include api:)
-
-
- 0
-
- -16
-
-
-
- 0
-
- 0
@@ -9179,7 +9248,7 @@
0
- -46
+ -48
@@ -9197,28 +9266,6 @@
:)>
[@(:include decl:)@]
-
-
- 0
-
- -47
-
-
-
- 0
-
-
-
-
- 0
-
- -48
-
-
-
- 0
-
- 0
@@ -9238,18 +9285,7 @@
- 3
- 2
- `#include <(:link
- 1
-
- 0
-
- -41
-
-
- 2
- :)>
[@(:include decl:)@]
+ 0
@@ -9322,6 +9358,12 @@
-14
+
+ -15
+
+
+ -16
+ -17
@@ -9334,9 +9376,6 @@
-20
-
- -15
- -21
@@ -9349,9 +9388,6 @@
-24
-
- -32
- -25
@@ -9359,19 +9395,19 @@
-26
- -39
+ -27
- -27
+ -34-28
- -29
+ -36
- -34
+ -29-30
@@ -9379,21 +9415,30 @@
-31
+
+ -39
+
+
+ -32
+ -35-33
-
- -36
- -38
+
+ -46
+ -37
+
+ -47
+ -40
@@ -9409,18 +9454,9 @@
-44
-
- -16
- -45
-
- -46
-
-
- -47
- -48
@@ -9441,40 +9477,6 @@
48
-
-
-
-
- 0
-
-
-
-
-
- 1
-
-
-
- -22
-
-
-
-
-
-
- 0
-
-
-
-
-
- 1
-
-
-
- -23
-
-
@@ -9492,6 +9494,40 @@
-25
+
+
+
+
+ 0
+
+
+
+
+
+ 1
+
+
+
+ -26
+
+
+
+
+
+
+ 0
+
+
+
+
+
+ 1
+
+
+
+ -15
+
+
@@ -9540,58 +9576,7 @@
- -8
-
-
-
-
-
-
- 0
-
-
-
-
-
- 1
-
-
-
- -14
-
-
-
-
-
-
- 0
-
-
-
-
-
- 1
-
-
-
- -27
-
-
-
-
-
-
- 0
-
-
-
-
-
- 1
-
-
-
- -15
+ -10
@@ -9611,6 +9596,57 @@
-16
+
+
+
+
+ 0
+
+
+
+
+
+ 1
+
+
+
+ -29
+
+
+
+
+
+
+ 0
+
+
+
+
+
+ 1
+
+
+
+ -17
+
+
+
+
+
+
+ 0
+
+
+
+
+
+ 1
+
+
+
+ -18
+
+
@@ -9636,7 +9672,7 @@
- -11
+ -13
@@ -9664,7 +9700,7 @@
- -17
+ -19
@@ -9712,7 +9748,7 @@
- -12
+ -14
@@ -9736,7 +9772,7 @@
- -20
+ -23
@@ -9760,7 +9796,7 @@
- -7
+ -9
@@ -9788,7 +9824,7 @@
- -10
+ -12
@@ -9812,7 +9848,7 @@
- -6
+ -5
@@ -9836,7 +9872,7 @@
- -26
+ -28
@@ -9888,7 +9924,7 @@
- -24
+ -27
@@ -9944,7 +9980,7 @@
- -51
+ -52
@@ -9972,7 +10008,7 @@
- -29
+ -31
@@ -10004,7 +10040,7 @@
- -50
+ -47
@@ -10036,7 +10072,7 @@
- -46
+ -48
@@ -10060,7 +10096,7 @@
- -19
+ -22
@@ -10088,7 +10124,7 @@
- -21
+ -24
@@ -10116,7 +10152,7 @@
- -32
+ -20
@@ -10144,7 +10180,7 @@
- -30
+ -6
@@ -10172,7 +10208,7 @@
- -28
+ -30
@@ -10204,7 +10240,7 @@
- -52
+ -49
@@ -10304,7 +10340,7 @@
- -49
+ -51
@@ -10352,7 +10388,7 @@
- -9
+ -11
@@ -10380,7 +10416,7 @@
- -5
+ -8
@@ -10408,7 +10444,7 @@
- -31
+ -32
@@ -10492,7 +10528,7 @@
- -13
+ -7
@@ -10548,7 +10584,7 @@
- -18
+ -21
@@ -10572,7 +10608,7 @@
- -48
+ -46
@@ -10596,7 +10632,7 @@
- -47
+ -50
@@ -10651,7 +10687,7 @@
-5
- exception_ptr free function
+
@@ -10660,7 +10696,7 @@
-6
-
+ error_info free function
@@ -10669,7 +10705,7 @@
-7
- tutorial
+ exception_ptr free function
@@ -10678,7 +10714,7 @@
-8
- exception_ptr
+ exception_ptr free function
@@ -10687,7 +10723,7 @@
-9
- noalso noindex tutorial
+ tutorial
@@ -10696,7 +10732,7 @@
-10
- error_info free function
+ exception_ptr
@@ -10705,7 +10741,7 @@
-11
- function member
+ noalso noindex tutorial
@@ -10714,7 +10750,7 @@
-12
- noindex tutorial
+ error_info free function
@@ -10723,25 +10759,25 @@
-13
- exception_ptr free function
+ function member0
- -17
+ -14
- error_info free function
+ noindex tutorial0
- -18
+ -15
- error_info free function
+ tutorial
@@ -10750,7 +10786,7 @@
-19
-
+ error_info free function
@@ -10759,7 +10795,7 @@
-20
- error_info
+ exception_ptr free function
@@ -10768,7 +10804,7 @@
-21
- function
+ error_info free function
@@ -10777,7 +10813,7 @@
-22
- noindex
+
@@ -10786,7 +10822,7 @@
-23
- tutorial
+ error_info
@@ -10795,16 +10831,7 @@
-24
- free function
-
-
-
- 0
-
- -32
-
-
- exception_ptr free function
+ function
@@ -10813,7 +10840,7 @@
-25
- tutorial
+ noindex
@@ -10822,16 +10849,7 @@
-26
- diagnostic_information tutorial
-
-
-
- 0
-
- -39
-
-
- error_info
+ tutorial
@@ -10840,25 +10858,7 @@
-27
- tutorial
-
-
-
- 0
-
- -28
-
-
- type
-
-
-
- 0
-
- -29
-
-
- type
+ free function
@@ -10869,6 +10869,24 @@
exception_ptr type
+
+
+ 0
+
+ -28
+
+
+ diagnostic_information tutorial
+
+
+
+ 0
+
+ -29
+
+
+ tutorial
+ 0
@@ -10876,7 +10894,7 @@
-30
- error_info free function
+ type
@@ -10887,6 +10905,24 @@
type
+
+
+ 0
+
+ -39
+
+
+ error_info
+
+
+
+ 0
+
+ -32
+
+
+ type
+ 0
@@ -10914,6 +10950,15 @@
+
+
+ 0
+
+ -46
+
+
+ noalso noindex tutorial
+ 0
@@ -10923,6 +10968,15 @@
+
+
+ 0
+
+ -47
+
+
+ type
+ 0
@@ -10981,29 +11035,11 @@
0
- -46
+ -48function member
-
-
- 0
-
- -47
-
-
- noalso noindex tutorial
-
-
-
- 0
-
- -48
-
-
- noalso noindex tutorial
- 0
@@ -11011,7 +11047,7 @@
-49
- noindex tutorial
+ function
@@ -11020,16 +11056,16 @@
-50
- type
+ noalso noindex tutorial0
- -52
+ -51
- function
+ noindex tutorial
diff --git a/doc/using_virtual_inheritance_in_exception_types.html b/doc/using_virtual_inheritance_in_exception_types.html
index 1f855ef..d7f5ce7 100644
--- a/doc/using_virtual_inheritance_in_exception_types.html
+++ b/doc/using_virtual_inheritance_in_exception_types.html
@@ -39,6 +39,7 @@ main()