diff --git a/doc/source/boost-exception.reno b/doc/source/boost-exception.reno index 35b9445..79b74f3 100644 --- a/doc/source/boost-exception.reno +++ b/doc/source/boost-exception.reno @@ -54,14 +54,14 @@ 2 - 4546B9848279614FBDF70D0FB35B6D7A3432BF205DC9EC15C6016A77D2124E53 - 737034355 - 10349 - 521 + 78F37A2801CADB066084578244BC93958EAD33507F30C07353EA7D161FFBF973 + 2089604779 + 11016 + 511 4B6ED02EA5B5A3B326838794C37ED01C5DC3E8D89FA78E62B9F7A0C78D4DB6FD 2715164371 116 - 10227 + 10894 @@ -103,14 +103,14 @@ 2 - AE3A2E2D2C5F64EF089B5E3B27F1D42E1D0FD99D0CF898C7D5F828D4401090DB - 2880991434 - 1268 - 472 - 40062E1E97460C1E0AB685CE189F5D6607389A5A533C9E7D28050B4037EE3A50 - 4283132066 - 1236 - 26 + F126A8CB9244BC9DE8BD1D89B47453028CEC694D7EF40BB4474018FA6F056E4C + 3161833426 + 1527 + 504 + 8E724ECF48FB144FBAC1B7F27AE077812CDA75F1A05A08F951DD7F9D54863425 + 4144026351 + 676 + 845 @@ -146,20 +146,63 @@ reno_context + + + + + + 1 + 5373E336DC4892A41D31694BCA1146382FC3137819A04689CA1F9FFAF1CFAB3B + 4050491732 + 466 + 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 + + 8 + + reno_context + 2 - 4546B9848279614FBDF70D0FB35B6D7A3432BF205DC9EC15C6016A77D2124E53 - 737034355 - 10349 - 521 + 78F37A2801CADB066084578244BC93958EAD33507F30C07353EA7D161FFBF973 + 2089604779 + 11016 + 511 F87D7E0321BDDAE23D5A6667CB12116411468AEC54E3B35FB9C8CA94BFECA41E 1149388739 296 - 9929 + 10596 @@ -191,7 +234,7 @@ 0 - 8 + 9 reno_context @@ -201,10 +244,10 @@ 2 - 4546B9848279614FBDF70D0FB35B6D7A3432BF205DC9EC15C6016A77D2124E53 - 737034355 - 10349 - 521 + 78F37A2801CADB066084578244BC93958EAD33507F30C07353EA7D161FFBF973 + 2089604779 + 11016 + 511 C84057F7B3954843F5360E9764B35DC5EB1D8ED65CA9F1B6B633D95B417E3AA9 1591300832 2322 @@ -240,7 +283,7 @@ 0 - 9 + 10 reno_context @@ -250,13 +293,13 @@ 2 - 3EFECC50102590C4E9074D4F86B0E8F831D933193CCF70B8D80E8A0CF345C150 - 877841526 - 4772 - 726 - 82BA37021947A2C641B3285537EB8841A6AC59067CE01D873BC19725BAADCFC1 - 1244314370 - 733 + 353C90D92FFBB5A5616E5A9FAA19868B8234159FB714A1631B4E415B941DC9D3 + 3466161861 + 4362 + 775 + CF9032A2CB14D66F0F004C0AFDE2BB94321F405D6D95AC46EC5350AB4843A4F1 + 1073329133 + 715 243 @@ -289,7 +332,7 @@ 0 - 10 + 11 reno_context @@ -330,44 +373,6 @@ (:include include:) (:auto also:) - - - 0 - - 11 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>transporting of arbitrary data to the catch site</string> - - - tutorial_transporting_data - - - - - - 1 - 2 - (:include include:) (:auto also:) - - 0 @@ -376,503 +381,6 @@ reno_context - - - - - - 1 - DA91A64CCC9A5B149DFB580E5466539607C9CE92A93F56CE4C03996A468C1145 - 2002159572 - 10547 - 323 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>boost/exception_ptr.hpp</string> - - - exception_cloning_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 13 - - reno_context - - - - - - - 2 - 3EFECC50102590C4E9074D4F86B0E8F831D933193CCF70B8D80E8A0CF345C150 - 877841526 - 4772 - 726 - C552A651ADC0B9506373CC1A78CB4D7D0342BC99BD24F2F2B8CAD3B555037FE7 - 141521629 - 382 - 4384 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - - <string>operator<</exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 14 - - reno_context - - - - - - - 1 - 0C00BEB179039380247D771B12C728884E9A3E5B483AC63CD5789852C7A5CC35 - 2506662970 - 2467 - 323 - - - - - - 0 - ../../../../boost/exception/enable_error_info.hpp - 0 - 0 - - - - - <string>boost/exception/enable_error_info.hpp</string> - - - exception_enable_error_info_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 15 - - reno_context - - - - - - - 1 - CE411E21EE9878B55B5906D033A0FC52574FB59D8A8CECB75405E9B1C9D782DB - 1173443713 - 308 - 302 - - - - - - 0 - ../../example/logging.cpp - 0 - 0 - - - - - <string>diagnostic information</string> - - - tutorial_diagnostic_information - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 16 - - reno_context - - - - - - - 1 - 285A4D5FBF3D13C5729697E61680A07DC52493A4A964D54F6B21FDAA35A3AC70 - 3873809619 - 448 - 323 - - - - - - 0 - ../../../../boost/exception.hpp - 0 - 0 - - - - - <string>boost/exception.hpp</string> - - - exception_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 17 - - reno_context - - - - - - - 1 - 3999B09B03466CF6F624CB20689AE32FEFBAF81B2ADDA4D0E6777BC052B1BE70 - 2497361403 - 3349 - 323 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>boost/exception/exception.hpp</string> - - - exception_exception_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 18 - - reno_context - - - - - - - 1 - F4C951B28F7DE500973AA3DFAA99F2BADA6EDAFA2B406C30BEF3B7FBE6FD57D7 - 2263754923 - 982 - 306 - - - - - - 0 - ../../example/error_info_2.cpp - 0 - 0 - - - - - <string>adding of arbitrary data to active exception objects</string> - - - adding_data_later - - - - - - 0 - - - - - 0 - - 19 - - reno_context - - - - - - - 2 - 566065B952135D9C2AAD7609E3CDEC4AE9D21A4EF5C318DE51C476C79EBE8277 - 1525247529 - 3149 - 523 - 9E33ECD747FA0BFFED4D2C8916E3A9B8CD737177200F3A4078DECECC94E3EF24 - 1676293364 - 2098 - 886 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>exception</string> - - - - - - - - - 1 - 2 - (:include include:) ---- !!!See Also: (:pagelist link="backlink" except_tags="exception,member" mod="w":) - - - - - 0 - - 20 - - reno_context - - - - - - - 1 - 49D31376D97691F7C84A134B5D8C7C66EF1ED6901D376CA250D634AE2B38AB5E - 549270010 - 163 - 561 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - - <string>BOOST_ERROR_INFO</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 21 - - reno_context - - - - - - - 1 - E444EE9697EEADFDE0767E1D0242FC0E70D98E61FB1F0FFA099648DE509B82F3 - 94503238 - 773 - 374 - - - - - - 0 - ../../example/info_tuple.cpp - 0 - 0 - - - - - <string>adding grouped data to exceptions</string> - - - grouping_data - - - - - - 0 - - - - - 0 - - 22 - - reno_context - - - - - - - 1 - 5373E336DC4892A41D31694BCA1146382FC3137819A04689CA1F9FFAF1CFAB3B - 4050491732 - 466 - 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 - - 23 - - reno_context - @@ -910,6 +418,498 @@ (:include include:) (:auto also:) + + + 0 + + 13 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>transporting of arbitrary data to the catch site</string> + + + tutorial_transporting_data + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 14 + + reno_context + + + + + + + 1 + EE6990C848AF26755A4A3D327073CC8122B3D2C0D00DA2B0F33E4D8805ACB911 + 465181157 + 11204 + 323 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>boost/exception_ptr.hpp</string> + + + exception_cloning_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 15 + + reno_context + + + + + + + 2 + 353C90D92FFBB5A5616E5A9FAA19868B8234159FB714A1631B4E415B941DC9D3 + 3466161861 + 4362 + 775 + C552A651ADC0B9506373CC1A78CB4D7D0342BC99BD24F2F2B8CAD3B555037FE7 + 141521629 + 382 + 3974 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>operator<</exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 16 + + reno_context + + + + + + + 1 + ABA5BB25BAD31B070056FA9595F73F6F0E7F2A1D36D8A2ECDEBE6A2872E0E966 + 980578466 + 2271 + 323 + + + + + + 0 + ../../../../boost/exception/enable_error_info.hpp + 0 + 0 + + + + + <string>boost/exception/enable_error_info.hpp</string> + + + exception_enable_error_info_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 17 + + reno_context + + + + + + + 1 + CE411E21EE9878B55B5906D033A0FC52574FB59D8A8CECB75405E9B1C9D782DB + 1173443713 + 308 + 302 + + + + + + 0 + ../../example/logging.cpp + 0 + 0 + + + + + <string>diagnostic information</string> + + + tutorial_diagnostic_information + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 18 + + reno_context + + + + + + + 1 + 285A4D5FBF3D13C5729697E61680A07DC52493A4A964D54F6B21FDAA35A3AC70 + 3873809619 + 448 + 323 + + + + + + 0 + ../../../../boost/exception.hpp + 0 + 0 + + + + + <string>boost/exception.hpp</string> + + + exception_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 19 + + reno_context + + + + + + + 1 + 3D62495D55F856D594F8BCFD89F283A1B55638AE7B7609C8EFE4A84371EF6867 + 1383536793 + 2830 + 323 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>boost/exception/exception.hpp</string> + + + exception_exception_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 20 + + reno_context + + + + + + + 1 + F4C951B28F7DE500973AA3DFAA99F2BADA6EDAFA2B406C30BEF3B7FBE6FD57D7 + 2263754923 + 982 + 306 + + + + + + 0 + ../../example/error_info_2.cpp + 0 + 0 + + + + + <string>adding of arbitrary data to active exception objects</string> + + + adding_data_later + + + + + + 0 + + + + + 0 + + 21 + + reno_context + + + + + + + 2 + B5B48CB1FFAE29EB28A92336685CBB1DCD53090C7A889BC99659CF306129265E + 3608148048 + 2740 + 413 + 242B7AD2C634B20F99722AD5EF05F11109D14C11A2F7EB2D794D5E01B8BBCBCC + 1650706135 + 1707 + 868 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>exception</string> + + + + + + + + + 1 + 2 + (:include include:) ---- !!!See Also: (:pagelist link="backlink" except_tags="exception,member" mod="w":) + + + + + 0 + + 22 + + reno_context + + + + + + + 1 + 49D31376D97691F7C84A134B5D8C7C66EF1ED6901D376CA250D634AE2B38AB5E + 549270010 + 163 + 610 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>BOOST_ERROR_INFO</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 23 + + reno_context + + + + + + + 1 + E444EE9697EEADFDE0767E1D0242FC0E70D98E61FB1F0FFA099648DE509B82F3 + 94503238 + 773 + 374 + + + + + + 0 + ../../example/info_tuple.cpp + 0 + 0 + + + + + <string>adding grouped data to exceptions</string> + + + grouping_data + + + + + + 0 + + 0 @@ -918,24 +918,69 @@ reno_context + + + + + + 1 + CAD6C404CB725D336A44920D2341ECA131149AB02C368B59028F8147F16737BF + 2258638601 + 94 + 227 + + + + + + 0 + ../../../../boost/exception/info_tuple.hpp + 0 + 0 + + + + + <string>boost/exception/info_tuple.hpp</string> + + + exception_error_info_group_hpp + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 25 + + reno_context + 3 - 566065B952135D9C2AAD7609E3CDEC4AE9D21A4EF5C318DE51C476C79EBE8277 - 1525247529 - 3149 - 523 - 9E33ECD747FA0BFFED4D2C8916E3A9B8CD737177200F3A4078DECECC94E3EF24 - 1676293364 - 2098 - 886 + B5B48CB1FFAE29EB28A92336685CBB1DCD53090C7A889BC99659CF306129265E + 3608148048 + 2740 + 413 + 242B7AD2C634B20F99722AD5EF05F11109D14C11A2F7EB2D794D5E01B8BBCBCC + 1650706135 + 1707 + 868 BACD79DFB4C710C1A67687FC6344DF2251E2379613C2DF5B2729B2CD37E24EA3 458367129 154 - 246 + 245 @@ -967,7 +1012,7 @@ 0 - 25 + 26 reno_context @@ -977,9 +1022,9 @@ 1 - A0BB65AB464BCD75627D942684603207867D3C5D1BAE93902A812A07677B596F - 3668753278 - 646 + FED4CEA991FBBA8DF26B5652CE68C929C38BEE74DFD6C8E89E2A623BF0A61503 + 1244906377 + 2548 323 @@ -1012,7 +1057,7 @@ 0 - 26 + 27 reno_context @@ -1057,7 +1102,7 @@ 0 - 27 + 28 reno_context @@ -1067,9 +1112,9 @@ 1 - 8DF6E9F9346E2A1297844433695E2BAE1AD14FBDB6D943D81B87200FB9F9AE66 - 4241576983 - 5175 + 0E1089A09F6986E4D1393EC178D2F0A5CA5CAFCF9D2F4B96AEACA14E95ED2B38 + 717228119 + 4814 323 @@ -1102,7 +1147,7 @@ 0 - 28 + 29 reno_context @@ -1151,7 +1196,7 @@ 0 - 29 + 30 reno_context @@ -1161,14 +1206,14 @@ 2 - 4546B9848279614FBDF70D0FB35B6D7A3432BF205DC9EC15C6016A77D2124E53 - 737034355 - 10349 - 521 - 8A536C83AAA6BF19C2B173BE32022C6363004D5F0B88F7982711F5D66F539FE9 - 3888149824 - 2495 - 7432 + 78F37A2801CADB066084578244BC93958EAD33507F30C07353EA7D161FFBF973 + 2089604779 + 11016 + 511 + 7890935423C731BD8E7DE2820DF7E85C72126B2EAB9A45B0AAFA5749DD1A9D57 + 2497085175 + 2528 + 8066 @@ -1200,7 +1245,7 @@ 0 - 30 + 31 reno_context @@ -1210,17 +1255,17 @@ 3 - 566065B952135D9C2AAD7609E3CDEC4AE9D21A4EF5C318DE51C476C79EBE8277 - 1525247529 - 3149 - 523 - 9E33ECD747FA0BFFED4D2C8916E3A9B8CD737177200F3A4078DECECC94E3EF24 - 1676293364 - 2098 - 886 - BAC52AC87CFA3174B3352140A8DC10BB7F48C945FC87787C3AC96F0FC2CFDB40 - 1066412964 - 165 + B5B48CB1FFAE29EB28A92336685CBB1DCD53090C7A889BC99659CF306129265E + 3608148048 + 2740 + 413 + 242B7AD2C634B20F99722AD5EF05F11109D14C11A2F7EB2D794D5E01B8BBCBCC + 1650706135 + 1707 + 868 + 9043738F71C025266AC2C0A2BEDC9DA3579175BE5BA672E59D136559D4269190 + 317401972 + 164 57 @@ -1253,7 +1298,7 @@ 0 - 31 + 32 reno_context @@ -1263,14 +1308,14 @@ 2 - 0C9E5FE5B32FD3F31875CF6AD87A485CACC42754EE56F0E72D9D9749734959D5 - 2969409401 - 544 - 425 - 1DE66DC4BD5E2E323BA4281B4BAB063AF5E9F7E4A5FE32BA3C0686A844FBA86E - 4200042321 - 512 - 26 + 214D17B425C1C447F952970DA6B1A778AD45CCA513405EB2DA6EBE87285A852A + 1906283610 + 2414 + 457 + 6B355BB18EB534B5221822257C7A7F834692C7256E5D118F5443C7D905731578 + 1509743294 + 810 + 1598 @@ -1302,7 +1347,7 @@ 0 - 32 + 33 reno_context @@ -1312,18 +1357,18 @@ 4 - 566065B952135D9C2AAD7609E3CDEC4AE9D21A4EF5C318DE51C476C79EBE8277 - 1525247529 - 3149 - 523 - 9E33ECD747FA0BFFED4D2C8916E3A9B8CD737177200F3A4078DECECC94E3EF24 - 1676293364 - 2098 - 886 + B5B48CB1FFAE29EB28A92336685CBB1DCD53090C7A889BC99659CF306129265E + 3608148048 + 2740 + 413 + 242B7AD2C634B20F99722AD5EF05F11109D14C11A2F7EB2D794D5E01B8BBCBCC + 1650706135 + 1707 + 868 85EE1980CFB24E054EDB1B3BDFA61FD4D65AD0EF248A1A42D4C2552700459327 2238151539 428 - 928 + 401 AD3F339F7126003907BCBDB3EF846FCACA895132E1100D202DA67D2B7846EE65 3032091776 60 @@ -1359,7 +1404,7 @@ 0 - 33 + 34 reno_context @@ -1402,7 +1447,7 @@ 0 - 34 + 35 reno_context @@ -1441,51 +1486,6 @@ 0 - - - 0 - - 35 - - reno_context - - - - - - - 1 - CAD6C404CB725D336A44920D2341ECA131149AB02C368B59028F8147F16737BF - 2258638601 - 94 - 227 - - - - - - 0 - ../../../../boost/exception/info_tuple.hpp - 0 - 0 - - - - - <string>boost/exception/info_tuple.hpp</string> - - - exception_error_info_group_hpp - - - - - - 1 - 2 - (:include include:) (:auto also:) - - 0 @@ -1545,10 +1545,10 @@ 2 - 4546B9848279614FBDF70D0FB35B6D7A3432BF205DC9EC15C6016A77D2124E53 - 737034355 - 10349 - 521 + 78F37A2801CADB066084578244BC93958EAD33507F30C07353EA7D161FFBF973 + 2089604779 + 11016 + 511 CCBCB5EADA66B82DFC7650F467A0E51CA5B10EFCD3729EDFB038A1C5DCB5722D 1007135774 701 @@ -1681,14 +1681,14 @@ 2 - 7ACC4E316D4EDB3EC7AEC35FED3ADB47DDF75D575028D7BCD11C5233E4F4A277 - 4268848542 - 2333 + 040AF162DE93F61F89B118788A02CEA76E19F2F9D66E8FC4D4F0B66C6C4CDCA6 + 1391149574 + 2137 457 - 61DE70107961C0B9A65674017F91FF85190CF84B4F3B0CA7AC04A7E16DE80B37 - 3187961206 - 2301 - 26 + B752D5E37E6F1F71AD491E0DEF2C7D7C3ED4C9E78F01443EC408B751C83D521F + 2684451358 + 412 + 1719 @@ -1848,7 +1848,7 @@ 0 - -11 + -13 2 @@ -1857,7 +1857,7 @@ 0 - -26 + -27 2 @@ -1875,7 +1875,7 @@ 0 - -15 + -17 2 @@ -1884,7 +1884,7 @@ 0 - -19 + -21 2 @@ -1893,7 +1893,7 @@ 0 - -9 + -10 2 @@ -1902,7 +1902,7 @@ 0 - -13 + -15 2 @@ -1911,7 +1911,7 @@ 0 - -28 + -29 2 @@ -1938,7 +1938,7 @@ 0 - -20 + -22 2 @@ -1947,7 +1947,7 @@ 0 - -8 + -9 2 @@ -1965,7 +1965,7 @@ 0 - -29 + -30 2 @@ -1974,7 +1974,7 @@ 0 - -7 + -8 2 @@ -2001,7 +2001,7 @@ 0 - -31 + -32 2 @@ -2016,6 +2016,33 @@ 2 :) ##Headers ###(:link 1 + + 0 + + -18 + + + 2 + :) ###(:link + 1 + + 0 + + -26 + + + 2 + :) ###(:link + 1 + + 0 + + -11 + + + 2 + :) ###(:link + 1 0 @@ -2028,7 +2055,7 @@ 0 - -25 + -12 2 @@ -2037,34 +2064,7 @@ 0 - -10 - - - 2 - :) ###(:link - 1 - - 0 - - -14 - - - 2 - :) ###(:link - 1 - - 0 - - -23 - - - 2 - :) ###(:link - 1 - - 0 - - -17 + -19 2 @@ -2083,9 +2083,9 @@ 1 - 86DE119A4A3E9251475D1291AF99B769E304A8E0172409FC2A4E02B8D4BF73A2 - 767141628 - 1417 + E6CCBC6F6FEAEF1E95E23AFC7A7268DB35549B5951BE08BC7B4429B7490195ED + 1344405806 + 1708 323 @@ -2114,7 +2114,7 @@ 0 - -27 + -28 2 @@ -2123,7 +2123,7 @@ 0 - -35 + -24 2 @@ -2132,7 +2132,7 @@ 0 - -12 + -14 2 @@ -2159,7 +2159,7 @@ 0 - -16 + -18 2 @@ -2168,7 +2168,7 @@ 0 - -17 + -19 2 @@ -2177,7 +2177,7 @@ 0 - -27 + -28 2 @@ -2186,7 +2186,25 @@ 0 - -35 + -24 + + + 2 + api pre_indent="4":) (:include + 1 + + 0 + + -16 + + + 2 + api pre_indent="4":) (:include + 1 + + 0 + + -26 2 @@ -2204,25 +2222,7 @@ 0 - -25 - - - 2 - api pre_indent="4":) (:include - 1 - - 0 - - -12 - - - 2 - api pre_indent="4":) (:include - 1 - - 0 - - -10 + -11 2 @@ -2240,7 +2240,7 @@ 0 - -19 + -21 2 @@ -2249,7 +2249,7 @@ 0 - -9 + -10 2 @@ -2258,7 +2258,7 @@ 0 - -13 + -15 2 @@ -2267,7 +2267,7 @@ 0 - -28 + -29 2 @@ -2294,7 +2294,7 @@ 0 - -20 + -22 2 @@ -2303,7 +2303,7 @@ 0 - -8 + -9 2 @@ -2321,7 +2321,7 @@ 0 - -29 + -30 2 @@ -2330,7 +2330,7 @@ 0 - -7 + -8 2 @@ -2357,7 +2357,7 @@ 0 - -31 + -32 2 @@ -2465,18 +2465,7 @@ - 3 - 2 - [@template <class Tag,class T> class (:link - 1 - - 0 - - -9 - - - 2 - :) { public: typedef T value_type; error_info( value_type const & ); };@] + 0 @@ -2487,7 +2476,18 @@ - 0 + 3 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -10 + + + 2 + :) { public: typedef T value_type; error_info( value_type const & ); };@] @@ -2586,45 +2586,7 @@ - 9 - 2 - [@class (:link - 1 - - 0 - - -19 - - - 2 - :) { public: (:include - 1 - - 0 - - -30 - - - 2 - decl pre_indent="4":) protected: (:include - 1 - - 0 - - -24 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -32 - - - 2 - decl pre_indent="4":) };@] + 0 @@ -2646,7 +2608,45 @@ - 0 + 9 + 2 + [@class (:link + 1 + + 0 + + -21 + + + 2 + :) { public: (:include + 1 + + 0 + + -31 + + + 2 + decl pre_indent="4":) protected: (:include + 1 + + 0 + + -25 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -33 + + + 2 + decl pre_indent="4":) };@] @@ -2978,6 +2978,17 @@ -10 + + 0 + + + + + 0 + + -11 + + 3 2 @@ -2993,17 +3004,6 @@ decl:)@] - - - 0 - - -11 - - - - 0 - - 0 @@ -3012,50 +3012,14 @@ - 11 + 3 2 [@(:include 1 0 - -37 - - - 2 - decl:) (:include - 1 - - 0 - - -8 - - - 2 - decl:) (:include - 1 - - 0 - - -7 - - - 2 - decl:) (:include - 1 - - 0 - - -29 - - - 2 - decl:) (:include - 1 - - 0 - - -5 + -10 2 @@ -3081,14 +3045,50 @@ - 3 + 11 2 [@(:include 1 0 - -40 + -37 + + + 2 + decl:) (:include + 1 + + 0 + + -9 + + + 2 + decl:) (:include + 1 + + 0 + + -8 + + + 2 + decl:) (:include + 1 + + 0 + + -30 + + + 2 + decl:) (:include + 1 + + 0 + + -5 2 @@ -3113,6 +3113,39 @@ -16 + + 3 + 2 + [@(:include + 1 + + 0 + + -40 + + + 2 + decl:)@] + + + + + 0 + + -17 + + + + 0 + + + + + 0 + + -18 + + 21 2 @@ -3121,7 +3154,7 @@ 0 - -25 + -26 2 @@ -3130,7 +3163,7 @@ 0 - -10 + -11 2 @@ -3139,7 +3172,7 @@ 0 - -14 + -16 2 @@ -3148,7 +3181,7 @@ 0 - -23 + -12 2 @@ -3157,7 +3190,7 @@ 0 - -17 + -19 2 @@ -3175,7 +3208,7 @@ 0 - -27 + -28 2 @@ -3184,7 +3217,7 @@ 0 - -35 + -24 2 @@ -3193,7 +3226,7 @@ 0 - -12 + -14 2 @@ -3213,7 +3246,7 @@ 0 - -17 + -19 @@ -3224,35 +3257,13 @@ 0 - -19 + -21 2 def:)@] - - - 0 - - -18 - - - - 0 - - - - - 0 - - -19 - - - - 0 - - 0 @@ -3294,18 +3305,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -9 - - - 2 - decl:)@] + 0 @@ -3316,7 +3316,18 @@ - 0 + 3 + 2 + [@(:include + 1 + + 0 + + -29 + + + 2 + decl:)@] @@ -3327,18 +3338,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -31 - - - 2 - decl:)@] + 0 @@ -3349,43 +3349,14 @@ - 0 - - - - - 0 - - -27 - - - - 7 + 3 2 [@(:include 1 0 - -9 - - - 2 - def:) (:include - 1 - - 0 - - -20 - - - 2 - decl:) (:include - 1 - - 0 - - -13 + -32 2 @@ -3396,13 +3367,53 @@ 0 - -28 + -27 0 + + + 0 + + -28 + + + + 7 + 2 + [@(:include + 1 + + 0 + + -10 + + + 2 + def:) (:include + 1 + + 0 + + -22 + + + 2 + decl:) (:include + 1 + + 0 + + -15 + + + 2 + decl:)@] + + 0 @@ -3477,18 +3488,7 @@ - 3 - 2 - [@(:include - 1 - - 0 - - -28 - - - 2 - decl:)@] + 0 @@ -3650,7 +3650,7 @@ 0 - -8 + -9 2 @@ -3687,27 +3687,7 @@ - 5 - 2 - [@template <class T> (:link - 1 - - 0 - - -8 - - - 2 - :) (:link - 1 - - 0 - - -7 - - - 2 - :)( T const & e );@] + 0 @@ -3718,9 +3698,18 @@ - 3 + 5 2 - [@typedef ---unspecified--- (:link + [@template <class T> (:link + 1 + + 0 + + -9 + + + 2 + :) (:link 1 0 @@ -3729,7 +3718,7 @@ 2 - :);@] + :)( T const & e );@] @@ -3742,7 +3731,7 @@ 3 2 - [@template <class Tag,class T> class (:link + [@typedef ---unspecified--- (:link 1 0 @@ -3762,7 +3751,18 @@ - 0 + 3 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -10 + + + 2 + :);@] @@ -3795,27 +3795,7 @@ - 5 - 2 - [@template <class E, class Tag, class T> E const & (:link - 1 - - 0 - - -13 - - - 2 - |operator<<:)( E const & x, (:link - 1 - - 0 - - -9 - - - 2 - :)<Tag,T> const & v );@] + 0 @@ -3837,7 +3817,27 @@ - 0 + 5 + 2 + [@template <class E, class Tag, class T> E const & (:link + 1 + + 0 + + -15 + + + 2 + |operator<<:)( E const & x, (:link + 1 + + 0 + + -10 + + + 2 + :)<Tag,T> const & v );@] @@ -3881,18 +3881,7 @@ - 3 - 2 - [@class - 1 - - 0 - - -19 - - - 2 - ;@] + 0 @@ -3903,45 +3892,7 @@ - 9 - 2 - [@typedef (:link - 1 - - 0 - - -9 - - - 2 - :)<struct tag_throw_function,char const *> throw_function; typedef (:link - 1 - - 0 - - -9 - - - 2 - :)<struct tag_throw_file,char const *> throw_file; typedef (:link - 1 - - 0 - - -9 - - - 2 - :)<struct tag_throw_line,int> throw_line; #define (:link - 1 - - 0 - - -20 - - - 2 - :)\ ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\ ::boost::throw_file(__FILE__) <<\ ::boost::throw_line((int)__LINE__)@] + 0 @@ -3952,7 +3903,18 @@ - 0 + 3 + 2 + [@class + 1 + + 0 + + -21 + + + 2 + ;@] @@ -3963,7 +3925,45 @@ - 0 + 9 + 2 + [@typedef (:link + 1 + + 0 + + -10 + + + 2 + :)<struct tag_throw_function,char const *> throw_function; typedef (:link + 1 + + 0 + + -10 + + + 2 + :)<struct tag_throw_file,char const *> throw_file; typedef (:link + 1 + + 0 + + -10 + + + 2 + :)<struct tag_throw_line,int> throw_line; #define (:link + 1 + + 0 + + -22 + + + 2 + :)\ ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\ ::boost::throw_file(__FILE__) <<\ ::boost::throw_line((int)__LINE__)@] @@ -3985,36 +3985,7 @@ - 7 - 2 - [@(:link - 1 - - 0 - - -24 - - - 2 - mod="m":)(); (:link - 1 - - 0 - - -24 - - - 2 - mod="m":)( (:link - 1 - - 0 - - -19 - - - 2 - :) const & x );@] + 0 @@ -4025,7 +3996,36 @@ - 0 + 7 + 2 + [@(:link + 1 + + 0 + + -25 + + + 2 + mod="m":)(); (:link + 1 + + 0 + + -25 + + + 2 + mod="m":)( (:link + 1 + + 0 + + -21 + + + 2 + :) const & x );@] @@ -4058,36 +4058,7 @@ - 7 - 2 - [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link - 1 - - 0 - - -28 - - - 2 - |operator<<:)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link - 1 - - 0 - - -9 - - - 2 - :)<Tag1,T1>, ..., (:link - 1 - - 0 - - -9 - - - 2 - :)<TagN,TN> > const & v );@] + 0 @@ -4098,18 +4069,9 @@ - 5 + 7 2 - [@(:link - 1 - - 0 - - -8 - - - 2 - :) (:link + [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link 1 0 @@ -4118,7 +4080,25 @@ 2 - :)();@] + |operator<<:)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link + 1 + + 0 + + -10 + + + 2 + :)<Tag1,T1>, ..., (:link + 1 + + 0 + + -10 + + + 2 + :)<TagN,TN> > const & v );@] @@ -4129,9 +4109,18 @@ - 3 + 5 2 - [@virtual char const * (:link + [@(:link + 1 + + 0 + + -9 + + + 2 + :) (:link 1 0 @@ -4140,7 +4129,7 @@ 2 - mod="m":)() const throw();@] + :)();@] @@ -4153,7 +4142,7 @@ 3 2 - [@std::string + [@virtual char const * (:link 1 0 @@ -4162,7 +4151,7 @@ 2 - ( std::exception const & x );@] + mod="m":)() const throw();@] @@ -4175,7 +4164,7 @@ 3 2 - [@(:link + [@template <class T> std::string (:link 1 0 @@ -4184,7 +4173,7 @@ 2 - mod="m":)();@] + :)( T const & x );@] @@ -4195,7 +4184,18 @@ - 0 + 3 + 2 + [@(:link + 1 + + 0 + + -33 + + + 2 + mod="m":)();@] @@ -4255,7 +4255,7 @@ 0 - -19 + -21 2 @@ -4423,7 +4423,7 @@ 0 - -9 + -10 2 @@ -4441,7 +4441,7 @@ 0 - -19 + -21 2 @@ -4450,7 +4450,7 @@ 0 - -13 + -15 2 @@ -4464,768 +4464,6 @@ -7 - - 3 - 2 - (:auto !!!:) (:include synopsis:) !!!!Effects: As if try { throw e; } catch( ... ) { return (:link - 1 - - 0 - - -29 - - - 2 - :)(); } - - - - - 0 - - -8 - - - - 9 - 2 - (:auto !!!:) (:include synopsis:) The (:link - 1 - - 0 - - -8 - - - 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 - - -8 - - - 2 - :)'s operations do not throw. Two instances of (:link - 1 - - 0 - - -8 - - - 2 - :) are equivalent and compare equal if and only if they refer to the same exception. The default constructor of (:link - 1 - - 0 - - -8 - - - 2 - :) produces the null value of the type. The null value is equivalent only to itself. - - - - - 0 - - -9 - - - - 25 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: T must have accessible copy constructor and must not be a reference (there is no requirement that T's copy constructor does not throw.) !!!!Description: This class template is used to associate a Tag type with a value type T. Objects of type (:link - 1 - - 0 - - -9 - - - 2 - :)<Tag,T> can be passed to (:link - 1 - - 0 - - -13 - - - 2 - |operator<<:) to be stored in objects of type boost::(:link - 1 - - 0 - - -19 - - - 2 - :). !!!!Note: The header <(:link - 1 - - 0 - - -23 - - - 2 - :)> provides a declaration of the (:link - 1 - - 0 - - -9 - - - 2 - :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, like this: [@#include <(:link - 1 - - 0 - - -23 - - - 2 - :)> typedef boost::(:link - 1 - - 0 - - -9 - - - 2 - :)<struct tag_errno,int> errno_info;@] Of course, to actually add an (:link - 1 - - 0 - - -9 - - - 2 - :) object to (:link - 1 - - 0 - - -19 - - - 2 - mod="p":) using (:link - 1 - - 0 - - -13 - - - 2 - |operator<<:), or to retrieve it using (:link - 1 - - 0 - - -6 - - - 2 - :), you must first #include <(:link - 1 - - 0 - - -27 - - - 2 - :)>. - - - - - 0 - - -10 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -11 - - - - 11 - 2 - (:auto !!:) All exception types that derive from boost::(:link - 1 - - 0 - - -19 - - - 2 - :) can be used as type-safe containers of arbitrary data objects, while complying with the no-throw requirements (15.5.1) of the ANSI C++ standard for exception types. Data can be added to a boost::(:link - 1 - - 0 - - -19 - - - 2 - :) at the time of the throw, or at a later time. (:include - 1 - - 0 - - -33 - - - 2 - :) (:include - 1 - - 0 - - -18 - - - 2 - :) (:include - 1 - - 0 - - -21 - - - 2 - :) - - - - - 0 - - -12 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -13 - - - - 7 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link - 1 - - 0 - - -19 - - - 2 - :), or a type that derives (indirectly) from boost::(:link - 1 - - 0 - - -19 - - - 2 - :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link - 1 - - 0 - - -9 - - - 2 - :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) - - - - - 0 - - -14 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -15 - - - - 21 - 2 - (:auto !!:) Class boost::(:link - 1 - - 0 - - -19 - - - 2 - :) provides a virtual member function (:link - 1 - - 0 - - -30 - - - 2 - mod="m":), with a signature similar to the familiar std::exception::what function. The default implementation returns a string value that is not presentable as a friendly user message, but because it is generated automatically, it is useful for debugging or logging purposes. Here is an example: [@#include <(:link - 1 - - 0 - - -16 - - - 2 - :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link - 1 - - 0 - - -19 - - - 2 - :). void g() { try { f(); } catch( boost::(:link - 1 - - 0 - - -19 - - - 2 - :) & e ) { std::cerr << e.(:link - 1 - - 0 - - -30 - - - 2 - mod="m":)(); } }@] The (:link - 1 - - 0 - - -30 - - - 2 - mod="m":) member function iterates over all data objects stored in the boost::(:link - 1 - - 0 - - -19 - - - 2 - :) through (:link - 1 - - 0 - - -13 - - - 2 - |operator<<:). The returned string is constructed by converting each data object to string and then concatenating these strings together. When the (:link - 1 - - 0 - - -9 - - - 2 - :)<Tag,T> template is instantiated, the system attempts overload resolution for an unqualified call to to_string(x), where x is of type T. If this is successful, the to_string overload is expected to return std::string and is used to convert objects of type T to string. Otherwise, the system attempts overload resolution for s << x, where s is a std::ostringstream and x is of type T. If this is successful, the operator<< overload is used to convert objects of type T to string. Otherwise the system is unable to convert objects of type T to string, and an unspecified stub string value is used without issuing a compile error. - - - - - 0 - - -16 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -17 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -18 - - - - 21 - 2 - (:auto !!!:) Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Here is an example: [@#include <stdio.h> #include <string> class file_read_error { public: explicit file_read_error( std::string const & fn ): fn_(fn) { }; std::string const & file_name() const { return fn_; } private: std::string fn_; }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error("????"); }@] We have defined an exception class file_read_error which can store a file name, so that when we catch a file_read_error object, we know which file the failure is related to. However, the file_read function does not have the file name at the time of the throw; all it has is a FILE handle. One possible solution is to not use FILE handles directly. We could have our own class file which stores both a FILE handle and a file name, and pass that to file_read. However, this could be problematic if we communicate with 3rd party code that does not use our class file (probably because they have their own similar class.) A better solution is to make class file_read_error derive (possibly indirectly) from boost::(:link - 1 - - 0 - - -19 - - - 2 - :), and free the file_read function from the burden of storing the file name in exceptions it throws: [@#include <(:link - 1 - - 0 - - -16 - - - 2 - :)> #include <stdio.h> #include <errno.h> typedef boost::(:link - 1 - - 0 - - -9 - - - 2 - :)<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link - 1 - - 0 - - -19 - - - 2 - :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error() << errno_info(errno); }@] If file_read detects a failure, it throws an exception which contains the information that is available at the time, namely the errno. Other relevant information, such as the file name, can be added in a context higher up the call stack, where it is known naturally: [@#include <(:link - 1 - - 0 - - -16 - - - 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> typedef boost::(:link - 1 - - 0 - - -9 - - - 2 - :)<struct tag_file_name,std::string> file_name_info; boost::shared_ptr<FILE> file_open( char const * file_name, char const * mode ); void file_read( FILE * f, void * buffer, size_t size ); void parse_file( char const * file_name ) { boost::shared_ptr<FILE> f = file_open(file_name,"rb"); assert(f); try { char buf[1024]; file_read( f.get(), buf, sizeof(buf) ); } catch( boost::(:link - 1 - - 0 - - -19 - - - 2 - :) & e ) { e << file_name_info(file_name); throw; } }@] The above function is (almost) exception-neutral -- if an exception is emitted by any function call within the try block, parse_file does not need to do any real work, but it intercepts any boost::(:link - 1 - - 0 - - -19 - - - 2 - :) object, stores the file name, and re-throws using a throw-expression with no operand (15.1.6). The rationale for catching any boost::(:link - 1 - - 0 - - -19 - - - 2 - :) object is that the file name is relevant to any failure that occurs in parse_file, ''even if the failure is unrelated to file I/O''. As usual, the stored data can be retrieved using (:link - 1 - - 0 - - -6 - - - 2 - :). - - - - - 0 - - -19 - - - - 19 - 2 - (:auto !!!:) (:include synopsis:) Class boost::(:link - 1 - - 0 - - -19 - - - 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 - - -19 - - - 2 - :) can store data of arbitrary types, using the (:link - 1 - - 0 - - -9 - - - 2 - :) wrapper and (:link - 1 - - 0 - - -13 - - - 2 - |operator<<:). To retrieve data from a boost::(:link - 1 - - 0 - - -19 - - - 2 - :) object, use the (:link - 1 - - 0 - - -6 - - - 2 - :) function template. (:include - 1 - - 0 - - -24 - - - 2 - :) (:include - 1 - - 0 - - -32 - - - 2 - :) (:include - 1 - - 0 - - -30 - - - 2 - :) - - - - - 0 - - -20 - - - - 7 - 2 - (:auto !!!:) (:include synopsis:) This macro is designed to be used with (:link - 1 - - 0 - - -13 - - - 2 - |operator<<:) when throwing a boost::(:link - 1 - - 0 - - -19 - - - 2 - :), to store information about the location of the throw statement. It can be chained with other (:link - 1 - - 0 - - -9 - - - 2 - mod="p":) in a single throw expression. - - - - - 0 - - -21 - - - - 13 - 2 - (:auto !!!:) The code snippet below demonstrates how boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) can be used to bundle the name of the function that failed, together with the reported errno so that they can be added to exception objects more conveniently together: [@#include <(:link - 1 - - 0 - - -35 - - - 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link - 1 - - 0 - - -9 - - - 2 - :)<struct tag_file_name,std::string> file_name_info; typedef boost::(:link - 1 - - 0 - - -9 - - - 2 - :)<struct tag_function,char const *> function_info; typedef boost::(:link - 1 - - 0 - - -9 - - - 2 - :)<struct tag_errno,int> errno_info; typedef boost::tuple<function_info,errno_info> clib_failure; class file_open_error: public boost::(:link - 1 - - 0 - - -19 - - - 2 - :) { }; boost::shared_ptr<FILE> file_open( char const * name, char const * mode ) { if( FILE * f=fopen(name,mode) ) return boost::shared_ptr<FILE>(f,fclose); else throw file_open_error() << file_name_info(name) << clib_failure("fopen",errno); }@] Note that the members of a boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) are stored separately in exception objects; they can only be retrieved individually, using (:link - 1 - - 0 - - -6 - - - 2 - :). - - - - - 0 - - -22 - - 13 2 @@ -5234,7 +4472,7 @@ 0 - -10 + -11 2 @@ -5243,7 +4481,7 @@ 0 - -27 + -28 2 @@ -5252,7 +4490,7 @@ 0 - -19 + -21 2 @@ -5279,7 +4517,7 @@ 0 - -19 + -21 2 @@ -5290,7 +4528,199 @@ 0 - -23 + -8 + + + + 3 + 2 + (:auto !!!:) (:include synopsis:) !!!!Effects: As if try { throw e; } catch( ... ) { return (:link + 1 + + 0 + + -30 + + + 2 + :)(); } + + + + + 0 + + -9 + + + + 9 + 2 + (:auto !!!:) (:include synopsis:) The (:link + 1 + + 0 + + -9 + + + 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 + + -9 + + + 2 + :)'s operations do not throw. Two instances of (:link + 1 + + 0 + + -9 + + + 2 + :) are equivalent and compare equal if and only if they refer to the same exception. The default constructor of (:link + 1 + + 0 + + -9 + + + 2 + :) produces the null value of the type. The null value is equivalent only to itself. + + + + + 0 + + -10 + + + + 25 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: T must have accessible copy constructor and must not be a reference (there is no requirement that T's copy constructor does not throw.) !!!!Description: This class template is used to associate a Tag type with a value type T. Objects of type (:link + 1 + + 0 + + -10 + + + 2 + :)<Tag,T> can be passed to (:link + 1 + + 0 + + -15 + + + 2 + |operator<<:) to be stored in objects of type boost::(:link + 1 + + 0 + + -21 + + + 2 + :). !!!!Note: The header <(:link + 1 + + 0 + + -12 + + + 2 + :)> provides a declaration of the (:link + 1 + + 0 + + -10 + + + 2 + :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, like this: [@#include <(:link + 1 + + 0 + + -12 + + + 2 + :)> typedef boost::(:link + 1 + + 0 + + -10 + + + 2 + :)<struct tag_errno,int> errno_info;@] Of course, to actually add an (:link + 1 + + 0 + + -10 + + + 2 + :) object to (:link + 1 + + 0 + + -21 + + + 2 + mod="p":) using (:link + 1 + + 0 + + -15 + + + 2 + |operator<<:), or to retrieve it using (:link + 1 + + 0 + + -6 + + + 2 + :), you must first #include <(:link + 1 + + 0 + + -28 + + + 2 + :)>. + + + + + 0 + + -11 @@ -5299,6 +4729,576 @@ (:auto !!:) !!!Synopsis (:include synopsis:) + + + 0 + + -12 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -13 + + + + 11 + 2 + (:auto !!:) All exception types that derive from boost::(:link + 1 + + 0 + + -21 + + + 2 + :) can be used as type-safe containers of arbitrary data objects, while complying with the no-throw requirements (15.5.1) of the ANSI C++ standard for exception types. Data can be added to a boost::(:link + 1 + + 0 + + -21 + + + 2 + :) at the time of the throw, or at a later time. (:include + 1 + + 0 + + -34 + + + 2 + :) (:include + 1 + + 0 + + -20 + + + 2 + :) (:include + 1 + + 0 + + -23 + + + 2 + :) + + + + + 0 + + -14 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -15 + + + + 7 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + 1 + + 0 + + -21 + + + 2 + :), or a type that derives (indirectly) from boost::(:link + 1 + + 0 + + -21 + + + 2 + :). !!!!Effects: Stores a copy of v into x. If x already contains data of type (:link + 1 + + 0 + + -10 + + + 2 + :)<Tag,T>, that data is overwritten. !!!!Returns: x. (:include throws:) + + + + + 0 + + -16 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -17 + + + + 21 + 2 + (:auto !!:) Class boost::(:link + 1 + + 0 + + -21 + + + 2 + :) provides a virtual member function (:link + 1 + + 0 + + -31 + + + 2 + mod="m":), with a signature similar to the familiar std::exception::what function. The default implementation returns a string value that is not presentable as a friendly user message, but because it is generated automatically, it is useful for debugging or logging purposes. Here is an example: [@#include <(:link + 1 + + 0 + + -18 + + + 2 + :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link + 1 + + 0 + + -21 + + + 2 + :). void g() { try { f(); } catch( boost::(:link + 1 + + 0 + + -21 + + + 2 + :) & e ) { std::cerr << e.(:link + 1 + + 0 + + -31 + + + 2 + mod="m":)(); } }@] The (:link + 1 + + 0 + + -31 + + + 2 + mod="m":) member function iterates over all data objects stored in the boost::(:link + 1 + + 0 + + -21 + + + 2 + :) through (:link + 1 + + 0 + + -15 + + + 2 + |operator<<:). The returned string is constructed by converting each data object to string and then concatenating these strings together. When the (:link + 1 + + 0 + + -10 + + + 2 + :)<Tag,T> template is instantiated, the system attempts overload resolution for an unqualified call to to_string(x), where x is of type T. If this is successful, the to_string overload is expected to return std::string and is used to convert objects of type T to string. Otherwise, the system attempts overload resolution for s << x, where s is a std::ostringstream and x is of type T. If this is successful, the operator<< overload is used to convert objects of type T to string. Otherwise the system is unable to convert objects of type T to string, and an unspecified stub string value is used without issuing a compile error. + + + + + 0 + + -18 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -19 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -20 + + + + 21 + 2 + (:auto !!!:) Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Here is an example: [@#include <stdio.h> #include <string> class file_read_error { public: explicit file_read_error( std::string const & fn ): fn_(fn) { }; std::string const & file_name() const { return fn_; } private: std::string fn_; }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error("????"); }@] We have defined an exception class file_read_error which can store a file name, so that when we catch a file_read_error object, we know which file the failure is related to. However, the file_read function does not have the file name at the time of the throw; all it has is a FILE handle. One possible solution is to not use FILE handles directly. We could have our own class file which stores both a FILE handle and a file name, and pass that to file_read. However, this could be problematic if we communicate with 3rd party code that does not use our class file (probably because they have their own similar class.) A better solution is to make class file_read_error derive (possibly indirectly) from boost::(:link + 1 + + 0 + + -21 + + + 2 + :), and free the file_read function from the burden of storing the file name in exceptions it throws: [@#include <(:link + 1 + + 0 + + -18 + + + 2 + :)> #include <stdio.h> #include <errno.h> typedef boost::(:link + 1 + + 0 + + -10 + + + 2 + :)<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link + 1 + + 0 + + -21 + + + 2 + :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error() << errno_info(errno); }@] If file_read detects a failure, it throws an exception which contains the information that is available at the time, namely the errno. Other relevant information, such as the file name, can be added in a context higher up the call stack, where it is known naturally: [@#include <(:link + 1 + + 0 + + -18 + + + 2 + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> typedef boost::(:link + 1 + + 0 + + -10 + + + 2 + :)<struct tag_file_name,std::string> file_name_info; boost::shared_ptr<FILE> file_open( char const * file_name, char const * mode ); void file_read( FILE * f, void * buffer, size_t size ); void parse_file( char const * file_name ) { boost::shared_ptr<FILE> f = file_open(file_name,"rb"); assert(f); try { char buf[1024]; file_read( f.get(), buf, sizeof(buf) ); } catch( boost::(:link + 1 + + 0 + + -21 + + + 2 + :) & e ) { e << file_name_info(file_name); throw; } }@] The above function is (almost) exception-neutral -- if an exception is emitted by any function call within the try block, parse_file does not need to do any real work, but it intercepts any boost::(:link + 1 + + 0 + + -21 + + + 2 + :) object, stores the file name, and re-throws using a throw-expression with no operand (15.1.6). The rationale for catching any boost::(:link + 1 + + 0 + + -21 + + + 2 + :) object is that the file name is relevant to any failure that occurs in parse_file, ''even if the failure is unrelated to file I/O''. As usual, the stored data can be retrieved using (:link + 1 + + 0 + + -6 + + + 2 + :). + + + + + 0 + + -21 + + + + 19 + 2 + (:auto !!!:) (:include synopsis:) Class boost::(:link + 1 + + 0 + + -21 + + + 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 + + -21 + + + 2 + :) can store data of arbitrary types, using the (:link + 1 + + 0 + + -10 + + + 2 + :) wrapper and (:link + 1 + + 0 + + -15 + + + 2 + |operator<<:). To retrieve data from a boost::(:link + 1 + + 0 + + -21 + + + 2 + :) object, use the (:link + 1 + + 0 + + -6 + + + 2 + :) function template. (:include + 1 + + 0 + + -25 + + + 2 + :) (:include + 1 + + 0 + + -33 + + + 2 + :) (:include + 1 + + 0 + + -31 + + + 2 + :) + + + + + 0 + + -22 + + + + 7 + 2 + (:auto !!!:) (:include synopsis:) This macro is designed to be used with (:link + 1 + + 0 + + -15 + + + 2 + |operator<<:) when throwing a boost::(:link + 1 + + 0 + + -21 + + + 2 + :), to store information about the location of the throw statement. It can be chained with other (:link + 1 + + 0 + + -10 + + + 2 + mod="p":) in a single throw expression. + + + + + 0 + + -23 + + + + 13 + 2 + (:auto !!!:) The code snippet below demonstrates how boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) can be used to bundle the name of the function that failed, together with the reported errno so that they can be added to exception objects more conveniently together: [@#include <(:link + 1 + + 0 + + -24 + + + 2 + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link + 1 + + 0 + + -10 + + + 2 + :)<struct tag_file_name,std::string> file_name_info; typedef boost::(:link + 1 + + 0 + + -10 + + + 2 + :)<struct tag_function,char const *> function_info; typedef boost::(:link + 1 + + 0 + + -10 + + + 2 + :)<struct tag_errno,int> errno_info; typedef boost::tuple<function_info,errno_info> clib_failure; class file_open_error: public boost::(:link + 1 + + 0 + + -21 + + + 2 + :) { }; boost::shared_ptr<FILE> file_open( char const * name, char const * mode ) { if( FILE * f=fopen(name,mode) ) return boost::shared_ptr<FILE>(f,fclose); else throw file_open_error() << file_name_info(name) << clib_failure("fopen",errno); }@] Note that the members of a boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) are stored separately in exception objects; they can only be retrieved individually, using (:link + 1 + + 0 + + -6 + + + 2 + :). + + 0 @@ -5306,6 +5306,19 @@ -24 + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -25 + + 7 2 @@ -5314,7 +5327,7 @@ 0 - -19 + -21 2 @@ -5323,7 +5336,7 @@ 0 - -19 + -21 2 @@ -5332,7 +5345,7 @@ 0 - -13 + -15 2 @@ -5343,7 +5356,7 @@ 0 - -25 + -26 @@ -5356,7 +5369,7 @@ 0 - -26 + -27 @@ -5367,7 +5380,7 @@ 0 - -19 + -21 2 @@ -5385,7 +5398,7 @@ 0 - -19 + -21 2 @@ -5394,7 +5407,7 @@ 0 - -16 + -18 2 @@ -5403,7 +5416,7 @@ 0 - -9 + -10 2 @@ -5412,7 +5425,7 @@ 0 - -9 + -10 2 @@ -5421,7 +5434,7 @@ 0 - -9 + -10 2 @@ -5448,7 +5461,7 @@ 0 - -19 + -21 2 @@ -5457,7 +5470,7 @@ 0 - -13 + -15 2 @@ -5466,7 +5479,7 @@ 0 - -19 + -21 2 @@ -5475,7 +5488,7 @@ 0 - -11 + -13 2 @@ -5486,7 +5499,7 @@ 0 - -27 + -28 @@ -5499,7 +5512,7 @@ 0 - -28 + -29 @@ -5510,7 +5523,7 @@ 0 - -19 + -21 2 @@ -5519,7 +5532,7 @@ 0 - -19 + -21 2 @@ -5530,7 +5543,7 @@ 0 - -29 + -30 @@ -5541,7 +5554,7 @@ 0 - -29 + -30 2 @@ -5550,7 +5563,7 @@ 0 - -8 + -9 2 @@ -5559,7 +5572,7 @@ 0 - -8 + -9 2 @@ -5568,7 +5581,7 @@ 0 - -29 + -30 2 @@ -5577,7 +5590,7 @@ 0 - -29 + -30 2 @@ -5604,7 +5617,7 @@ 0 - -29 + -30 2 @@ -5613,7 +5626,7 @@ 0 - -8 + -9 2 @@ -5631,7 +5644,7 @@ 0 - -19 + -21 2 @@ -5640,7 +5653,7 @@ 0 - -19 + -21 2 @@ -5658,7 +5671,7 @@ 0 - -19 + -21 2 @@ -5669,7 +5682,7 @@ 0 - -30 + -31 @@ -5680,7 +5693,7 @@ 0 - -19 + -21 2 @@ -5689,7 +5702,7 @@ 0 - -13 + -15 2 @@ -5698,7 +5711,7 @@ 0 - -15 + -17 2 @@ -5707,7 +5720,7 @@ 0 - -25 + -26 2 @@ -5716,7 +5729,7 @@ 0 - -31 + -32 2 @@ -5725,7 +5738,7 @@ 0 - -30 + -31 2 @@ -5734,7 +5747,7 @@ 0 - -19 + -21 2 @@ -5745,13 +5758,22 @@ 0 - -31 + -32 - 7 + 5 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: The + (:auto !!!:) (:include synopsis:) !!!!Returns: Platform-specific diagnostic information about x. !!!!Note: If dynamic_cast<boost::(:link + 1 + + 0 + + -21 + + + 2 + :) const *>(&x) is not null, the returned string includes the output from (:link 1 0 @@ -5760,47 +5782,7 @@ 2 - function must not be called outside of a catch block. !!!!Returns: If dynamic_cast<boost::(:link - 1 - - 0 - - -19 - - - 2 - :) const *>(&x) is not null, the returned string is initialized by a call to (:link - 1 - - 0 - - -30 - - - 2 - :); otherwise, the returned string combines the output of x.what() and typeid(x).name(). - - - - - 0 - - -32 - - - - 3 - 2 - (:auto !!!:) (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link - 1 - - 0 - - -19 - - - 2 - :) object. !!!!Throws: Nothing. + :). @@ -5810,6 +5792,28 @@ -33 + + 3 + 2 + (:auto !!!:) (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link + 1 + + 0 + + -21 + + + 2 + :) object. !!!!Throws: Nothing. + + + + + 0 + + -34 + + 17 2 @@ -5818,7 +5822,7 @@ 0 - -16 + -18 2 @@ -5827,7 +5831,7 @@ 0 - -9 + -10 2 @@ -5836,7 +5840,7 @@ 0 - -19 + -21 2 @@ -5845,7 +5849,7 @@ 0 - -9 + -10 2 @@ -5854,7 +5858,7 @@ 0 - -19 + -21 2 @@ -5863,7 +5867,7 @@ 0 - -13 + -15 2 @@ -5892,7 +5896,7 @@ 0 - -34 + -35 @@ -5903,7 +5907,7 @@ 0 - -29 + -30 2 @@ -5912,7 +5916,7 @@ 0 - -8 + -9 2 @@ -5921,7 +5925,7 @@ 0 - -12 + -14 2 @@ -5930,7 +5934,7 @@ 0 - -19 + -21 2 @@ -5939,7 +5943,7 @@ 0 - -8 + -9 2 @@ -5948,7 +5952,7 @@ 0 - -8 + -9 2 @@ -5957,7 +5961,7 @@ 0 - -29 + -30 2 @@ -5966,7 +5970,7 @@ 0 - -29 + -30 2 @@ -5984,7 +5988,7 @@ 0 - -8 + -9 2 @@ -6002,7 +6006,7 @@ 0 - -29 + -30 2 @@ -6011,7 +6015,7 @@ 0 - -8 + -9 2 @@ -6029,7 +6033,7 @@ 0 - -8 + -9 2 @@ -6047,7 +6051,7 @@ 0 - -29 + -30 2 @@ -6063,19 +6067,6 @@ :) in the above examples is well-formed. - - - 0 - - -35 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - 0 @@ -6104,7 +6095,7 @@ 0 - -8 + -9 2 @@ -6113,7 +6104,7 @@ 0 - -29 + -30 2 @@ -6135,7 +6126,7 @@ 0 - -8 + -9 2 @@ -6162,7 +6153,7 @@ 0 - -29 + -30 2 @@ -6171,7 +6162,7 @@ 0 - -8 + -9 2 @@ -6189,7 +6180,7 @@ 0 - -29 + -30 2 @@ -6207,7 +6198,7 @@ 0 - -19 + -21 2 @@ -6216,7 +6207,7 @@ 0 - -8 + -9 2 @@ -6249,7 +6240,7 @@ 0 - -19 + -21 2 @@ -6258,7 +6249,7 @@ 0 - -19 + -21 2 @@ -6298,7 +6289,7 @@ 0 - -19 + -21 2 @@ -6307,7 +6298,7 @@ 0 - -22 + -7 2 @@ -6316,7 +6307,7 @@ 0 - -34 + -35 2 @@ -6524,9 +6515,7 @@ - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. + 0 @@ -6548,7 +6537,9 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. @@ -6691,9 +6682,7 @@ - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. + 0 @@ -6704,7 +6693,9 @@ - 0 + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. @@ -6901,7 +6892,7 @@ 0 - -12 + -14 2 @@ -6938,18 +6929,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -12 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -6967,7 +6947,7 @@ 0 - -12 + -14 2 @@ -6989,11 +6969,11 @@ 0 - -27 + -14 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7006,16 +6986,16 @@ 3 2 - [@#include <(:link + `#include <(:link 1 0 - -17 + -28 2 - :)> namespace boost { (:include api pre_indent="4":) }@] + :)> [@namespace boost { (:include def pre_indent="4":) }@] @@ -7025,17 +7005,6 @@ -11 - - 0 - - - - - 0 - - -12 - - 3 2 @@ -7044,13 +7013,26 @@ 0 - -17 + -19 2 :)> namespace boost { (:include api pre_indent="4":) }@] + + + 0 + + -12 + + + + 1 + 2 + [@namespace boost { (:include api pre_indent="4":) }@] + + 0 @@ -7059,18 +7041,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -27 - - - 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -7088,7 +7059,7 @@ 0 - -17 + -19 2 @@ -7103,7 +7074,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -28 + + + 2 + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7113,6 +7095,39 @@ -16 + + 3 + 2 + [@#include <(:link + 1 + + 0 + + -19 + + + 2 + :)> namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -17 + + + + 0 + + + + + 0 + + -18 + + 1 2 @@ -7123,7 +7138,7 @@ 0 - -17 + -19 @@ -7132,39 +7147,6 @@ [@namespace boost { (:include api pre_indent="4":) }@] - - - 0 - - -18 - - - - 0 - - - - - 0 - - -19 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -17 - - - 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] - - 0 @@ -7173,18 +7155,7 @@ - 3 - 2 - `#include <(:link - 1 - - 0 - - -27 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + 0 @@ -7195,7 +7166,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -19 + + + 2 + :)> [@namespace boost { (:include def pre_indent="4":) }@] @@ -7206,7 +7188,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -28 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] @@ -7217,9 +7210,7 @@ - 1 - 2 - [@namespace boost { (:include api pre_indent="4":) }@] + 0 @@ -7230,7 +7221,9 @@ - 0 + 1 + 2 + [@#include <boost/tuple/tuple.hpp> namespace boost { (:include api pre_indent="4":) }@] @@ -7240,23 +7233,23 @@ -25 + + 0 + + + + + 0 + + -26 + + 1 2 [@#include <exception> namespace boost { (:include api pre_indent="4":) }@] - - - 0 - - -26 - - - - 0 - - 0 @@ -7265,18 +7258,7 @@ - 3 - 2 - [@#include <(:link - 1 - - 0 - - -17 - - - 2 - :)> #include <boost/current_function.hpp> #include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] + 0 @@ -7287,27 +7269,18 @@ - 5 + 3 2 - `#include <(:link + [@#include <(:link 1 0 - -35 + -19 2 - :)> [@namespace boost { (:include - 1 - - 0 - - -28 - - - 2 - decl pre_indent="4":) }@] + :)> #include <boost/current_function.hpp> #include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] @@ -7318,18 +7291,27 @@ - 3 + 5 2 `#include <(:link 1 0 - -12 + -24 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + :)> [@namespace boost { (:include + 1 + + 0 + + -29 + + + 2 + decl pre_indent="4":) }@] @@ -7339,17 +7321,6 @@ -30 - - 0 - - - - - 0 - - -31 - - 3 2 @@ -7358,7 +7329,7 @@ 0 - -25 + -14 2 @@ -7369,13 +7340,35 @@ 0 - -32 + -31 0 + + + 0 + + -32 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -26 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] + + 0 @@ -7406,9 +7399,7 @@ - 1 - 2 - [@#include <boost/tuple/tuple.hpp> namespace boost { (:include api pre_indent="4":) }@] + 0 @@ -7426,7 +7417,7 @@ 0 - -10 + -11 2 @@ -7435,7 +7426,7 @@ 0 - -14 + -16 2 @@ -7457,7 +7448,7 @@ 0 - -12 + -14 2 @@ -7479,7 +7470,7 @@ 0 - -10 + -11 2 @@ -7512,7 +7503,7 @@ 0 - -14 + -16 2 @@ -7767,7 +7758,7 @@ - -11 + -13 @@ -7787,6 +7778,54 @@ -39 + + + + + 1 + FED4CEA991FBBA8DF26B5652CE68C929C38BEE74DFD6C8E89E2A623BF0A61503 + 1244906377 + 2548 + 323 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + -26 + + + + + + + 1 + EE6990C848AF26755A4A3D327073CC8122B3D2C0D00DA2B0F33E4D8805ACB911 + 465181157 + 11204 + 323 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -14 + + @@ -7832,7 +7871,35 @@ - -34 + -35 + + + + + + + 2 + 214D17B425C1C447F952970DA6B1A778AD45CCA513405EB2DA6EBE87285A852A + 1906283610 + 2414 + 457 + 6B355BB18EB534B5221822257C7A7F834692C7256E5D118F5443C7D905731578 + 1509743294 + 810 + 1598 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + -32 @@ -7856,7 +7923,7 @@ - -26 + -27 @@ -7864,9 +7931,9 @@ 1 - 0C00BEB179039380247D771B12C728884E9A3E5B483AC63CD5789852C7A5CC35 - 2506662970 - 2467 + 0E1089A09F6986E4D1393EC178D2F0A5CA5CAFCF9D2F4B96AEACA14E95ED2B38 + 717228119 + 4814 323 @@ -7874,13 +7941,13 @@ 0 - ../../../../boost/exception/enable_error_info.hpp + ../../../../boost/exception/info.hpp 0 0 - -14 + -28 @@ -7903,114 +7970,6 @@ 0 - - -22 - - - - - - - 1 - DA91A64CCC9A5B149DFB580E5466539607C9CE92A93F56CE4C03996A468C1145 - 2002159572 - 10547 - 323 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - -12 - - - - - - - 2 - 3EFECC50102590C4E9074D4F86B0E8F831D933193CCF70B8D80E8A0CF345C150 - 877841526 - 4772 - 726 - 82BA37021947A2C641B3285537EB8841A6AC59067CE01D873BC19725BAADCFC1 - 1244314370 - 733 - 243 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - -9 - - - - - - - 2 - 3EFECC50102590C4E9074D4F86B0E8F831D933193CCF70B8D80E8A0CF345C150 - 877841526 - 4772 - 726 - C552A651ADC0B9506373CC1A78CB4D7D0342BC99BD24F2F2B8CAD3B555037FE7 - 141521629 - 382 - 4384 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - -13 - - - - - - - 2 - 4546B9848279614FBDF70D0FB35B6D7A3432BF205DC9EC15C6016A77D2124E53 - 737034355 - 10349 - 521 - F87D7E0321BDDAE23D5A6667CB12116411468AEC54E3B35FB9C8CA94BFECA41E - 1149388739 - 296 - 9929 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - -7 @@ -8020,10 +7979,290 @@ 2 - 4546B9848279614FBDF70D0FB35B6D7A3432BF205DC9EC15C6016A77D2124E53 - 737034355 - 10349 - 521 + F126A8CB9244BC9DE8BD1D89B47453028CEC694D7EF40BB4474018FA6F056E4C + 3161833426 + 1527 + 504 + 8E724ECF48FB144FBAC1B7F27AE077812CDA75F1A05A08F951DD7F9D54863425 + 4144026351 + 676 + 845 + + + + + + 0 + ../../../../boost/exception/get_error_info.hpp + 0 + 0 + + + + -6 + + + + + + + 2 + B5B48CB1FFAE29EB28A92336685CBB1DCD53090C7A889BC99659CF306129265E + 3608148048 + 2740 + 413 + 242B7AD2C634B20F99722AD5EF05F11109D14C11A2F7EB2D794D5E01B8BBCBCC + 1650706135 + 1707 + 868 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + -21 + + + + + + + 4 + B5B48CB1FFAE29EB28A92336685CBB1DCD53090C7A889BC99659CF306129265E + 3608148048 + 2740 + 413 + 242B7AD2C634B20F99722AD5EF05F11109D14C11A2F7EB2D794D5E01B8BBCBCC + 1650706135 + 1707 + 868 + 85EE1980CFB24E054EDB1B3BDFA61FD4D65AD0EF248A1A42D4C2552700459327 + 2238151539 + 428 + 401 + AD3F339F7126003907BCBDB3EF846FCACA895132E1100D202DA67D2B7846EE65 + 3032091776 + 60 + 369 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + -33 + + + + + + + 3 + B5B48CB1FFAE29EB28A92336685CBB1DCD53090C7A889BC99659CF306129265E + 3608148048 + 2740 + 413 + 242B7AD2C634B20F99722AD5EF05F11109D14C11A2F7EB2D794D5E01B8BBCBCC + 1650706135 + 1707 + 868 + 9043738F71C025266AC2C0A2BEDC9DA3579175BE5BA672E59D136559D4269190 + 317401972 + 164 + 57 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + -31 + + + + + + + 3 + B5B48CB1FFAE29EB28A92336685CBB1DCD53090C7A889BC99659CF306129265E + 3608148048 + 2740 + 413 + 242B7AD2C634B20F99722AD5EF05F11109D14C11A2F7EB2D794D5E01B8BBCBCC + 1650706135 + 1707 + 868 + BACD79DFB4C710C1A67687FC6344DF2251E2379613C2DF5B2729B2CD37E24EA3 + 458367129 + 154 + 245 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + -25 + + + + + + + 1 + 49D31376D97691F7C84A134B5D8C7C66EF1ED6901D376CA250D634AE2B38AB5E + 549270010 + 163 + 610 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + -22 + + + + + + + 1 + ABA5BB25BAD31B070056FA9595F73F6F0E7F2A1D36D8A2ECDEBE6A2872E0E966 + 980578466 + 2271 + 323 + + + + + + 0 + ../../../../boost/exception/enable_error_info.hpp + 0 + 0 + + + + -16 + + + + + + + 1 + 3D62495D55F856D594F8BCFD89F283A1B55638AE7B7609C8EFE4A84371EF6867 + 1383536793 + 2830 + 323 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + -19 + + + + + + + 1 + 285A4D5FBF3D13C5729697E61680A07DC52493A4A964D54F6B21FDAA35A3AC70 + 3873809619 + 448 + 323 + + + + + + 0 + ../../../../boost/exception.hpp + 0 + 0 + + + + -18 + + + + + + + 2 + 78F37A2801CADB066084578244BC93958EAD33507F30C07353EA7D161FFBF973 + 2089604779 + 11016 + 511 + F87D7E0321BDDAE23D5A6667CB12116411468AEC54E3B35FB9C8CA94BFECA41E + 1149388739 + 296 + 10596 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -8 + + + + + + + 2 + 78F37A2801CADB066084578244BC93958EAD33507F30C07353EA7D161FFBF973 + 2089604779 + 11016 + 511 CCBCB5EADA66B82DFC7650F467A0E51CA5B10EFCD3729EDFB038A1C5DCB5722D 1007135774 701 @@ -8048,10 +8287,38 @@ 2 - 4546B9848279614FBDF70D0FB35B6D7A3432BF205DC9EC15C6016A77D2124E53 - 737034355 - 10349 - 521 + 78F37A2801CADB066084578244BC93958EAD33507F30C07353EA7D161FFBF973 + 2089604779 + 11016 + 511 + 7890935423C731BD8E7DE2820DF7E85C72126B2EAB9A45B0AAFA5749DD1A9D57 + 2497085175 + 2528 + 8066 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + -30 + + + + + + + 2 + 78F37A2801CADB066084578244BC93958EAD33507F30C07353EA7D161FFBF973 + 2089604779 + 11016 + 511 C84057F7B3954843F5360E9764B35DC5EB1D8ED65CA9F1B6B633D95B417E3AA9 1591300832 2322 @@ -8068,7 +8335,7 @@ - -8 + -9 @@ -8076,42 +8343,14 @@ 2 - 4546B9848279614FBDF70D0FB35B6D7A3432BF205DC9EC15C6016A77D2124E53 - 737034355 - 10349 - 521 - 8A536C83AAA6BF19C2B173BE32022C6363004D5F0B88F7982711F5D66F539FE9 - 3888149824 - 2495 - 7432 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - -29 - - - - - - - 2 - 4546B9848279614FBDF70D0FB35B6D7A3432BF205DC9EC15C6016A77D2124E53 - 737034355 - 10349 - 521 + 78F37A2801CADB066084578244BC93958EAD33507F30C07353EA7D161FFBF973 + 2089604779 + 11016 + 511 4B6ED02EA5B5A3B326838794C37ED01C5DC3E8D89FA78E62B9F7A0C78D4DB6FD 2715164371 116 - 10227 + 10894 @@ -8127,282 +8366,6 @@ -5 - - - - - 1 - 49D31376D97691F7C84A134B5D8C7C66EF1ED6901D376CA250D634AE2B38AB5E - 549270010 - 163 - 561 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - -20 - - - - - - - 1 - 8DF6E9F9346E2A1297844433695E2BAE1AD14FBDB6D943D81B87200FB9F9AE66 - 4241576983 - 5175 - 323 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - -27 - - - - - - - 1 - A0BB65AB464BCD75627D942684603207867D3C5D1BAE93902A812A07677B596F - 3668753278 - 646 - 323 - - - - - - 0 - ../../../../boost/exception/diagnostic_information.hpp - 0 - 0 - - - - -25 - - - - - - - 1 - 285A4D5FBF3D13C5729697E61680A07DC52493A4A964D54F6B21FDAA35A3AC70 - 3873809619 - 448 - 323 - - - - - - 0 - ../../../../boost/exception.hpp - 0 - 0 - - - - -16 - - - - - - - 1 - 3999B09B03466CF6F624CB20689AE32FEFBAF81B2ADDA4D0E6777BC052B1BE70 - 2497361403 - 3349 - 323 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - -17 - - - - - - - 2 - 566065B952135D9C2AAD7609E3CDEC4AE9D21A4EF5C318DE51C476C79EBE8277 - 1525247529 - 3149 - 523 - 9E33ECD747FA0BFFED4D2C8916E3A9B8CD737177200F3A4078DECECC94E3EF24 - 1676293364 - 2098 - 886 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - -19 - - - - - - - 4 - 566065B952135D9C2AAD7609E3CDEC4AE9D21A4EF5C318DE51C476C79EBE8277 - 1525247529 - 3149 - 523 - 9E33ECD747FA0BFFED4D2C8916E3A9B8CD737177200F3A4078DECECC94E3EF24 - 1676293364 - 2098 - 886 - 85EE1980CFB24E054EDB1B3BDFA61FD4D65AD0EF248A1A42D4C2552700459327 - 2238151539 - 428 - 928 - AD3F339F7126003907BCBDB3EF846FCACA895132E1100D202DA67D2B7846EE65 - 3032091776 - 60 - 369 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - -32 - - - - - - - 3 - 566065B952135D9C2AAD7609E3CDEC4AE9D21A4EF5C318DE51C476C79EBE8277 - 1525247529 - 3149 - 523 - 9E33ECD747FA0BFFED4D2C8916E3A9B8CD737177200F3A4078DECECC94E3EF24 - 1676293364 - 2098 - 886 - BAC52AC87CFA3174B3352140A8DC10BB7F48C945FC87787C3AC96F0FC2CFDB40 - 1066412964 - 165 - 57 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - -30 - - - - - - - 3 - 566065B952135D9C2AAD7609E3CDEC4AE9D21A4EF5C318DE51C476C79EBE8277 - 1525247529 - 3149 - 523 - 9E33ECD747FA0BFFED4D2C8916E3A9B8CD737177200F3A4078DECECC94E3EF24 - 1676293364 - 2098 - 886 - BACD79DFB4C710C1A67687FC6344DF2251E2379613C2DF5B2729B2CD37E24EA3 - 458367129 - 154 - 246 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - -24 - - - - - - - 2 - 7ACC4E316D4EDB3EC7AEC35FED3ADB47DDF75D575028D7BCD11C5233E4F4A277 - 4268848542 - 2333 - 457 - 61DE70107961C0B9A65674017F91FF85190CF84B4F3B0CA7AC04A7E16DE80B37 - 3187961206 - 2301 - 26 - - - - - - 0 - ../../../../boost/exception/enable_error_info.hpp - 0 - 0 - - - - -40 - - @@ -8431,30 +8394,6 @@ -43 - - - - - 1 - 86DE119A4A3E9251475D1291AF99B769E304A8E0172409FC2A4E02B8D4BF73A2 - 767141628 - 1417 - 323 - - - - - - 0 - ../../../../boost/exception/get_error_info.hpp - 0 - 0 - - - - -44 - - @@ -8476,7 +8415,35 @@ - -23 + -12 + + + + + + + 2 + 040AF162DE93F61F89B118788A02CEA76E19F2F9D66E8FC4D4F0B66C6C4CDCA6 + 1391149574 + 2137 + 457 + B752D5E37E6F1F71AD491E0DEF2C7D7C3ED4C9E78F01443EC408B751C83D521F + 2684451358 + 412 + 1719 + + + + + + 0 + ../../../../boost/exception/enable_error_info.hpp + 0 + 0 + + + + -40 @@ -8528,7 +8495,7 @@ - -35 + -24 @@ -8552,7 +8519,7 @@ - -10 + -11 @@ -8560,27 +8527,55 @@ 2 - 0C9E5FE5B32FD3F31875CF6AD87A485CACC42754EE56F0E72D9D9749734959D5 - 2969409401 - 544 - 425 - 1DE66DC4BD5E2E323BA4281B4BAB063AF5E9F7E4A5FE32BA3C0686A844FBA86E - 4200042321 - 512 - 26 + 353C90D92FFBB5A5616E5A9FAA19868B8234159FB714A1631B4E415B941DC9D3 + 3466161861 + 4362 + 775 + C552A651ADC0B9506373CC1A78CB4D7D0342BC99BD24F2F2B8CAD3B555037FE7 + 141521629 + 382 + 3974 0 - ../../../../boost/exception/diagnostic_information.hpp + ../../../../boost/exception/info.hpp 0 0 - -31 + -15 + + + + + + + 2 + 353C90D92FFBB5A5616E5A9FAA19868B8234159FB714A1631B4E415B941DC9D3 + 3466161861 + 4362 + 775 + CF9032A2CB14D66F0F004C0AFDE2BB94321F405D6D95AC46EC5350AB4843A4F1 + 1073329133 + 715 + 243 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + -10 @@ -8604,7 +8599,7 @@ - -18 + -20 @@ -8628,22 +8623,18 @@ - -15 + -17 - 2 - AE3A2E2D2C5F64EF089B5E3B27F1D42E1D0FD99D0CF898C7D5F828D4401090DB - 2880991434 - 1268 - 472 - 40062E1E97460C1E0AB685CE189F5D6607389A5A533C9E7D28050B4037EE3A50 - 4283132066 - 1236 - 26 + 1 + E6CCBC6F6FEAEF1E95E23AFC7A7268DB35549B5951BE08BC7B4429B7490195ED + 1344405806 + 1708 + 323 @@ -8656,7 +8647,7 @@ - -6 + -44 @@ -8684,7 +8675,7 @@ - -28 + -29 @@ -8708,7 +8699,7 @@ - -33 + -34 @@ -8732,7 +8723,7 @@ - -21 + -23 @@ -8781,7 +8772,7 @@ -7 - exception_ptr free function + noalso noindex tutorial @@ -8790,7 +8781,7 @@ -8 - type + exception_ptr free function @@ -8808,7 +8799,7 @@ -10 - + type @@ -8817,7 +8808,7 @@ -11 - tutorial + @@ -8835,7 +8826,7 @@ -13 - error_info free function + tutorial @@ -8844,7 +8835,7 @@ -14 - error_info + @@ -8853,7 +8844,7 @@ -15 - diagnostic_information tutorial + error_info free function @@ -8862,7 +8853,7 @@ -16 - + error_info @@ -8871,7 +8862,7 @@ -17 - + diagnostic_information tutorial @@ -8880,7 +8871,7 @@ -18 - noalso noindex tutorial + @@ -8889,7 +8880,7 @@ -19 - type + @@ -8898,7 +8889,7 @@ -20 - + noalso noindex tutorial @@ -8907,7 +8898,7 @@ -21 - noalso noindex tutorial + type @@ -8916,7 +8907,7 @@ -22 - noalso noindex tutorial + @@ -8925,7 +8916,7 @@ -23 - + noalso noindex tutorial @@ -8934,7 +8925,7 @@ -24 - function + @@ -8943,7 +8934,7 @@ -25 - + function @@ -8952,7 +8943,7 @@ -26 - tutorial + @@ -8961,7 +8952,7 @@ -27 - + tutorial @@ -8970,7 +8961,7 @@ -28 - error_info free function + @@ -8979,7 +8970,7 @@ -29 - exception_ptr free function + error_info free function @@ -8988,7 +8979,7 @@ -30 - function + exception_ptr free function @@ -8997,7 +8988,7 @@ -31 - diagnostic_information free function + function @@ -9006,7 +8997,7 @@ -32 - function + diagnostic_information free function @@ -9015,7 +9006,7 @@ -33 - noalso noindex tutorial + function @@ -9033,7 +9024,7 @@ -35 - + noalso noindex tutorial diff --git a/example/example_io.cpp b/example/example_io.cpp index 3777e9a..e656fc0 100644 --- a/example/example_io.cpp +++ b/example/example_io.cpp @@ -41,7 +41,7 @@ error: //Base for all exception objects we throw. char const * what() const throw() { - return boost::exception::diagnostic_information(); + return "example_io error"; } protected: @@ -170,7 +170,7 @@ dump_all_info( boost::exception const & x ) dump_file_info(x); dump_clib_info(x); std::cout << "\nOutput from diagnostic_information():\n"; - std::cout << x.diagnostic_information(); + std::cout << diagnostic_information(x); } int diff --git a/include/boost/exception/detail/get_boost_exception.hpp b/include/boost/exception/detail/get_boost_exception.hpp deleted file mode 100644 index d7bf6a0..0000000 --- a/include/boost/exception/detail/get_boost_exception.hpp +++ /dev/null @@ -1,47 +0,0 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. - -//Distributed under the Boost Software License, Version 1.0. (See accompanying -//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef UUID_B9A8291074CA11DD94BFC77156D89593 -#define UUID_B9A8291074CA11DD94BFC77156D89593 - -#include - -namespace -boost - { - namespace - exception_detail - { -#ifdef BOOST_NO_RTTI - template - exception const * - get_boost_exception( T const * ) - { - try - { - throw; - } - catch( - exception & x ) - { - return &x; - } - catch(...) - { - return 0; - } - } -#else - template - exception const * - get_boost_exception( T const * x ) - { - return dynamic_cast(x); - } -#endif - } - } - -#endif diff --git a/include/boost/exception/detail/type_info.hpp b/include/boost/exception/detail/type_info.hpp index f6a1c93..9e53d42 100644 --- a/include/boost/exception/detail/type_info.hpp +++ b/include/boost/exception/detail/type_info.hpp @@ -12,10 +12,10 @@ namespace boost { - template + template inline char const * - error_info_value() + type_name() { return BOOST_CURRENT_FUNCTION; } @@ -23,40 +23,99 @@ boost namespace exception_detail { - typedef detail::sp_typeinfo type_info_; - #ifdef BOOST_NO_TYPEID - typedef type_info_ type_info_wrapper; -#else struct - type_info_wrapper + type_info_ { - type_info_ const * type; + detail::sp_typeinfo type_; + char const * name_; explicit - type_info_wrapper( type_info_ const & t ): - type(&t) + type_info_( detail::sp_typeinfo type, char const * name ): + type_(type), + name_(name) { } + friend bool - operator<( type_info_wrapper const & b ) const + operator==( type_info_ const & a, type_info_ const & b ) { - return 0!=(type->before(*b.type)); + return a.type_==b.type_; + } + + friend + bool + operator!=( type_info_ const & a, type_info_ const & b ) + { + return !(a==b); + } + + friend + bool + operator<( type_info_ const & a, type_info_ const & b ) + { + return a.type_before(*b.type_)); + } + + char const * + name() const + { + return type_->name(); } }; #endif - - template - inline - char const * - type_name() - { - return error_info_value(); - } } } -#define BOOST_EXCEPTION_STATIC_TYPEID(T) BOOST_SP_TYPEID(T) +#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_SP_TYPEID(T),::boost::type_name()) + +#ifndef BOOST_NO_RTTI +#define BOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::boost::exception_detail::type_info_(typeid(x)) +#endif #endif diff --git a/include/boost/exception/diagnostic_information.hpp b/include/boost/exception/diagnostic_information.hpp index 3a22a8f..8c5e0d6 100644 --- a/include/boost/exception/diagnostic_information.hpp +++ b/include/boost/exception/diagnostic_information.hpp @@ -6,27 +6,87 @@ #ifndef UUID_0552D49838DD11DD90146B8956D89593 #define UUID_0552D49838DD11DD90146B8956D89593 -#include +#include +#include #include #include namespace boost { + namespace + exception_detail + { + template + std::string + std_exception_diagnostic_information( std::exception const * x, T const & ) + { + if( char const * s=x->what() ) + if( *s ) + return std::string("std::exception::what(): ")+s; + return std::string(); + } + + template + std::string + std_exception_diagnostic_information( void const *, T const & e ) + { +#ifndef BOOST_NO_RTTI + if( std::exception const * x=dynamic_cast(&e) ) + return std_exception_diagnostic_information(x,e); + else +#endif + return std::string(); + } + + template + std::string + boost_exception_diagnostic_information( boost::exception const * x, T const & ) + { + if( char const * s=x->diagnostic_information() ) + if( *s ) + return std::string("boost::exception::diagnostic_information():\n")+s; + return std::string(); + } + + template + std::string + boost_exception_diagnostic_information( void const *, T const & e ) + { +#ifndef BOOST_NO_RTTI + if( exception const * x=dynamic_cast(&e) ) + return boost_exception_diagnostic_information(x,e); + else +#endif + return std::string(); + } + } + + template inline std::string - diagnostic_information( std::exception const & x ) + diagnostic_information( T const & x ) { - if( exception const * be = exception_detail::get_boost_exception(&x) ) - return be->diagnostic_information(); - else - return std::string("[ what: ") + x.what() + ", type: " + std::string di= #if defined(BOOST_NO_RTTI) || defined(BOOST_NO_TYPEID) - "Unknown type deriving from std::exception" + std::string("Static exception type: ")+BOOST_EXCEPTION_STATIC_TYPEID(T) #else - + typeid(x).name() + + std::string("Dynamic exception type: ")+BOOST_EXCEPTION_DYNAMIC_TYPEID(x) #endif - " ]"; + .name(); + std::string di1=exception_detail::std_exception_diagnostic_information(&x,x); + if( !di1.empty() ) + { + di+='\n'; + di+=di1; + } + std::string di2=exception_detail::boost_exception_diagnostic_information(&x,x); + if( !di2.empty() ) + { + di+='\n'; + di+=di2; + } + return di; } } diff --git a/include/boost/exception/enable_error_info.hpp b/include/boost/exception/enable_error_info.hpp index fe1e5ad..4b8effd 100644 --- a/include/boost/exception/enable_error_info.hpp +++ b/include/boost/exception/enable_error_info.hpp @@ -32,12 +32,6 @@ boost ~error_info_injector() throw() { } - - char const * - diagnostic_information() const throw() - { - return boost::exception::_diagnostic_information(T::what()); - } }; struct large_size { char c[256]; }; diff --git a/include/boost/exception/exception.hpp b/include/boost/exception/exception.hpp index 8ea1d7e..b3a754d 100644 --- a/include/boost/exception/exception.hpp +++ b/include/boost/exception/exception.hpp @@ -6,11 +6,8 @@ #ifndef UUID_274DA366004E11DCB1DDFE2E56D89593 #define UUID_274DA366004E11DCB1DDFE2E56D89593 -#include -#include #include #include -#include namespace boost @@ -24,12 +21,13 @@ boost exception_detail { class error_info_base; + struct type_info_; struct error_info_container: public exception_detail::counted_base { - virtual char const * diagnostic_information( char const *, char const * ) const = 0; + virtual char const * diagnostic_information() const = 0; virtual shared_ptr get( type_info_ const & ) const = 0; virtual void set( shared_ptr const &, type_info_ const & ) = 0; }; @@ -37,7 +35,7 @@ boost template shared_ptr get_data( exception const & ); - void set_data( exception const *, shared_ptr const &, exception_detail::type_info_ const & ); + void set_data( exception const *, shared_ptr const &, type_info_ const & ); } class @@ -49,7 +47,7 @@ boost char const * diagnostic_information() const throw() { - return _diagnostic_information(0); + return _diagnostic_information(); } protected: @@ -63,22 +61,6 @@ boost { } - char const * - _diagnostic_information( char const * std_what ) const throw() - { - if( data_ ) - try - { - char const * w = data_->diagnostic_information(std_what,dynamic_type_name()); - BOOST_ASSERT(w!=0); - return w; - } - catch(...) - { - } - return std_what ? std_what : dynamic_type_name(); - } - #if BOOST_WORKAROUND( BOOST_MSVC, BOOST_TESTED_AT(1500) ) //Force class exception to be abstract. //Otherwise, MSVC bug allows throw exception(), even though the copy constructor is protected. @@ -92,6 +74,22 @@ boost } #endif + char const * + _diagnostic_information() const throw() + { + if( data_ ) + try + { + char const * w = data_->diagnostic_information(); + BOOST_ASSERT(w!=0); + return w; + } + catch(...) + { + } + return ""; + } + private: friend void exception_detail::set_data( exception const *, shared_ptr const &, exception_detail::type_info_ const & ); @@ -99,18 +97,6 @@ boost template friend shared_ptr exception_detail::get_data( exception const & ); - char const * - dynamic_type_name() const - { - return -#if defined(BOOST_NO_RTTI) || defined(BOOST_NO_TYPEID) - "Unknown type deriving from boost::exception" -#else - typeid(*this).name() -#endif - ; - } - mutable intrusive_ptr data_; }; diff --git a/include/boost/exception/get_error_info.hpp b/include/boost/exception/get_error_info.hpp index 78d8eb4..e512737 100644 --- a/include/boost/exception/get_error_info.hpp +++ b/include/boost/exception/get_error_info.hpp @@ -6,9 +6,10 @@ #ifndef UUID_1A590226753311DD9E4CCF6156D89593 #define UUID_1A590226753311DD9E4CCF6156D89593 -#include -#include +#include #include +#include +#include namespace boost @@ -34,16 +35,26 @@ boost } } +#ifdef BOOST_NO_RTTI + template + inline + shared_ptr + get_error_info( boost::exception const & x ) + { + return exception_detail::get_data(x); + } +#else template inline shared_ptr get_error_info( E const & some_exception ) { - if( exception const * x = exception_detail::get_boost_exception(&some_exception) ) + if( exception const * x = dynamic_cast(&some_exception) ) return exception_detail::get_data(*x); else return shared_ptr(); } +#endif } #endif diff --git a/include/boost/exception/info.hpp b/include/boost/exception/info.hpp index 7ca9079..552ff0a 100644 --- a/include/boost/exception/info.hpp +++ b/include/boost/exception/info.hpp @@ -7,9 +7,10 @@ #define UUID_8D22C4CA9CC811DCAA9133D256D89593 #include -#include #include #include +#include +#include #include #include @@ -50,7 +51,7 @@ boost char const * tag_typeid_name() const { - return exception_detail::type_name(); + return type_name(); } std::string @@ -84,19 +85,19 @@ boost set( shared_ptr const & x, type_info_ const & typeid_ ) { BOOST_ASSERT(x); - info_[type_info_wrapper(typeid_)] = x; - what_.clear(); + info_[typeid_] = x; + diagnostic_info_str_.clear(); } shared_ptr get( type_info_ const & ti ) const { - error_info_map::const_iterator i=info_.find(type_info_wrapper(ti)); + error_info_map::const_iterator i=info_.find(ti); if( info_.end()!=i ) { shared_ptr const & p = i->second; #ifndef BOOST_NO_RTTI - BOOST_ASSERT( typeid(*p)==ti ); + BOOST_ASSERT( BOOST_EXCEPTION_DYNAMIC_TYPEID(*p)==ti ); #endif return p; } @@ -104,20 +105,11 @@ boost } char const * - diagnostic_information( char const * std_what, char const * exception_type_name ) const + diagnostic_information() const { - BOOST_ASSERT(exception_type_name!=0 && *exception_type_name ); - if( what_.empty() ) + if( diagnostic_info_str_.empty() ) { std::string tmp; - if( std_what ) - { - tmp += std_what; - tmp += '\n'; - } - tmp += "Dynamic exception type: "; - tmp += exception_type_name; - tmp += '\n'; for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i ) { shared_ptr const & x = i->second; @@ -127,18 +119,18 @@ boost tmp += x->value_as_string(); tmp += '\n'; } - what_.swap(tmp); + diagnostic_info_str_.swap(tmp); } - return what_.c_str(); + return diagnostic_info_str_.c_str(); } private: friend class exception; - typedef std::map< type_info_wrapper, shared_ptr > error_info_map; + typedef std::map< type_info_, shared_ptr > error_info_map; error_info_map info_; - mutable std::string what_; + mutable std::string diagnostic_info_str_; mutable int count_; void diff --git a/include/boost/exception_ptr.hpp b/include/boost/exception_ptr.hpp index fad6002..088e5b6 100644 --- a/include/boost/exception_ptr.hpp +++ b/include/boost/exception_ptr.hpp @@ -6,8 +6,8 @@ #ifndef UUID_FA5836A2CADA11DC8CD47C8555D89593 #define UUID_FA5836A2CADA11DC8CD47C8555D89593 -#include #include +#include #include #include #include @@ -257,6 +257,34 @@ boost } }; +#ifdef BOOST_NO_RTTI + template + exception const * + get_boost_exception( T const * ) + { + try + { + throw; + } + catch( + exception & x ) + { + return &x; + } + catch(...) + { + return 0; + } + } +#else + template + exception const * + get_boost_exception( T const * x ) + { + return dynamic_cast(x); + } +#endif + template inline exception_ptr @@ -340,6 +368,7 @@ boost { return exception_detail::current_exception_std_exception(e); } +#ifndef BOOST_NO_TYPEID catch( std::bad_cast & e ) { @@ -350,6 +379,7 @@ boost { return exception_detail::current_exception_std_exception(e); } +#endif catch( std::bad_exception & e ) { diff --git a/test/cloning_test.cpp b/test/cloning_test.cpp index a6146d6..3e5c2af 100644 --- a/test/cloning_test.cpp +++ b/test/cloning_test.cpp @@ -351,8 +351,10 @@ main() test_std_exception_what(); test_std_exception_what(); test_std_exception(); +#ifndef BOOST_NO_TYPEID test_std_exception(); test_std_exception(); +#endif test_std_exception(); try diff --git a/test/diagnostic_information_test.cpp b/test/diagnostic_information_test.cpp index fe79ab6..252c04e 100644 --- a/test/diagnostic_information_test.cpp +++ b/test/diagnostic_information_test.cpp @@ -38,12 +38,6 @@ error3: { }; -std::string -get_diagnostic_information( std::exception const & x ) - { - return boost::diagnostic_information(x); - } - int main() { @@ -57,7 +51,7 @@ main() catch( std::exception & x ) { - std::string di=get_diagnostic_information(x); + std::string di=boost::diagnostic_information(x); BOOST_TEST(di.find("type:")!=std::string::npos); BOOST_TEST(di.find("error1")!=std::string::npos); } @@ -75,11 +69,26 @@ main() catch( std::exception & x ) { - std::string di=get_diagnostic_information(x); + std::string di=boost::diagnostic_information(x); BOOST_TEST(di.find("type:")!=std::string::npos); -#ifndef BOOST_NO_RTTI BOOST_TEST(di.find("error2")!=std::string::npos); -#endif + } + catch( + ... ) + { + BOOST_TEST(false); + } + try + { + error2 x; x << tag_int(42); + BOOST_TEST(x.what()==std::string("error2")); + throw x; + } + catch( + boost::exception & x ) + { + std::string di=boost::diagnostic_information(x); + BOOST_TEST(di.find("type:")!=std::string::npos); BOOST_TEST(di.find("test_tag")!=std::string::npos); } catch( @@ -96,9 +105,9 @@ main() catch( boost::exception & x ) { - std::string w1 = x.diagnostic_information(); + std::string w1 = diagnostic_information(x); x << tag_int(2); - std::string w2 = x.diagnostic_information(); + std::string w2 = diagnostic_information(x); BOOST_TEST( w1!=w2 ); BOOST_TEST(w1.find("test_tag")!=std::string::npos); BOOST_TEST(w2.find("test_tag")!=std::string::npos); diff --git a/test/enable_error_info_test.cpp b/test/enable_error_info_test.cpp index d7a94ac..e1a743d 100644 --- a/test/enable_error_info_test.cpp +++ b/test/enable_error_info_test.cpp @@ -45,7 +45,26 @@ main() catch( std::exception & x ) { - BOOST_TEST( 42==*boost::get_error_info(x) ); +#ifdef BOOST_NO_RTTI + try + { + throw; + } + catch( + boost::exception & x ) + { +#endif + BOOST_TEST( boost::get_error_info(x) ); + if( boost::shared_ptr p=boost::get_error_info(x) ) + BOOST_TEST( 42==*p ); +#ifdef BOOST_NO_RTTI + } + catch( + ... ) + { + BOOST_TEST(false); + } +#endif BOOST_TEST( std::string(x.what())==std::string("exception test length error") ); } catch( diff --git a/test/error_info_test.cpp b/test/error_info_test.cpp index 51715c8..557aa8f 100644 --- a/test/error_info_test.cpp +++ b/test/error_info_test.cpp @@ -10,12 +10,37 @@ struct throws_on_copy; struct non_printable { }; +struct +user_data + { + int & count; + + explicit + user_data( int & count ): + count(count) + { + ++count; + } + + user_data( user_data const & x ): + count(x.count) + { + ++count; + } + + ~user_data() + { + --count; + } + }; + typedef boost::error_info test_1; typedef boost::error_info test_2; typedef boost::error_info test_3; typedef boost::error_info test_4; typedef boost::error_info test_5; typedef boost::error_info test_6; +typedef boost::error_info test_7; struct test_exception: @@ -135,7 +160,9 @@ test_empty() catch( test_exception & x ) { - BOOST_TEST( boost::exception_detail::get_boost_exception(&x) ); +#ifndef BOOST_NO_RTTI + BOOST_TEST( dynamic_cast(&x)!=0 ); +#endif } catch( ... ) @@ -256,6 +283,29 @@ test_add_tuple() } } +void +test_lifetime() + { + int count=0; + try + { + throw test_exception() << test_7(user_data(count)); + BOOST_TEST(false); + } + catch( + boost::exception & x ) + { + BOOST_TEST(count==1); + BOOST_TEST( boost::get_error_info(x) ); + } + catch( + ... ) + { + BOOST_TEST(false); + } + BOOST_TEST(!count); + } + int main() { @@ -265,5 +315,6 @@ main() test_basic_throw_catch(); test_catch_add_info(); test_add_tuple(); + test_lifetime(); return boost::report_errors(); } diff --git a/test/throw_exception_test.cpp b/test/throw_exception_test.cpp index 113f40a..d4b4615 100644 --- a/test/throw_exception_test.cpp +++ b/test/throw_exception_test.cpp @@ -47,9 +47,26 @@ tester() catch( T & y ) { - BOOST_TEST(boost::get_error_info(y)); - if( boost::shared_ptr d=boost::get_error_info(y) ) - BOOST_TEST(*d==42); +#ifdef BOOST_NO_RTTI + try + { + throw; + } + catch( + boost::exception & y ) + { +#endif + BOOST_TEST(boost::get_error_info(y)); + if( boost::shared_ptr d=boost::get_error_info(y) ) + BOOST_TEST(*d==42); +#ifdef BOOST_NO_RTTI + } + catch( + ... ) + { + BOOST_TEST(false); + } +#endif BOOST_TEST(y.x_==42); } catch(