Compare commits

...

310 Commits

Author SHA1 Message Date
44fcc63f36 Merge branch 'develop' 2016-07-12 19:22:35 -07:00
c1e2284628 Improved errno printing in diagnostic information messages. 2016-07-12 19:21:53 -07:00
3003123b2b Merge branch 'develop' 2016-06-06 14:51:52 -07:00
c1dc3b8dcb Included missing declaration before specialization of set_info_rv. 2016-06-05 22:33:02 -07:00
dac601519d Merge branch 'develop' 2016-05-31 18:32:34 -07:00
1afb7e0372 Ticket #12230 2016-05-31 14:46:13 -07:00
c57eefbf42 More complete error_info testing 2015-03-25 14:28:54 -07:00
5a040eedf5 rvalue references support in error_info 2015-03-24 15:44:28 -07:00
c1f6b743e4 Merge pull request #5 from danieljames/metadata
Create metadata file (thanks danieljames)
2015-01-05 15:11:57 -08:00
e5e4652b75 Merge remote-tracking branch 'origin/develop' 2014-08-29 17:51:11 -07:00
af4de75bac Add metadata file. 2014-08-18 14:58:41 +01:00
38bfc39d10 Merge pull request #4 from Lastique/develop
Port to Boost.Core demangle() and typeinfo. Thanks Lastique.
2014-06-11 11:33:04 -07:00
5dea76a301 Port to Boost.Core demangle() and typeinfo. 2014-06-11 22:02:59 +04:00
8931eb2e0d Merge pull request #1 from Lastique/develop
Re-enable type name demangling (thanks Lastique)
2014-06-04 23:29:56 -07:00
2de5a8f4dd Merge branch 'develop' 2014-06-05 00:38:40 +03:00
fe3b1807b8 Merge pull request #3 from Lastique/patch-1
Switch to BOOST_NORETURN macro
2014-06-05 00:32:51 +03:00
73c3cb7e46 Switch to BOOST_NORETURN macro
Switch to BOOST_NORETURN macro provided by Boost.Config.
2014-06-05 01:30:40 +04:00
a129725e3e Switched from BOOST_ATTRIBUTE_NORETURN to BOOST_NORETURN. 2014-06-05 00:50:04 +04:00
a823cbe32a Merge branch 'develop' 2014-06-03 03:14:27 +03:00
7f937491f0 Remove headers that have been moved to throw_exception. 2014-06-03 03:05:06 +03:00
4de3efa73d Merge branch 'develop' 2014-06-03 02:48:11 +03:00
dc07696fd9 Add documentation source to master. 2014-06-03 02:47:44 +03:00
fdbb57b197 N3757
[SVN r85538]
2014-06-03 02:40:57 +03:00
c030775c84 Revert "Remove obsolete MSVC check from pragma guard"
This reverts commit f6c1ebece0.
2014-06-03 02:16:36 +03:00
29b0b87b6a Revert "Exception: Remove obsolete MSVC version check."
This reverts commit 73687f1f0f.
2014-06-03 02:16:08 +03:00
4edba2f8be Revert "Exception: Remove obsolete GCC version checks."
This reverts commit b2221bf92d.
2014-06-03 02:15:11 +03:00
8f097eb241 Comment fix. 2014-05-31 21:57:51 +04:00
7062572c8f Re-implemented type name demangling.
The new implementation does not depend on Boost.Units and is fully contained in Boost.Exception.
2014-05-31 21:54:52 +04:00
b2221bf92d Exception: Remove obsolete GCC version checks.
[SVN r86074]
2013-09-30 16:01:02 +00:00
73687f1f0f Exception: Remove obsolete MSVC version check.
[SVN r86036]
2013-09-30 00:20:56 +00:00
f6c1ebece0 Remove obsolete MSVC check from pragma guard
git grep -h -B1 "^#\s*pragma once" | grep -v pragma | sort | uniq

is now clean.

[SVN r85952]
2013-09-26 13:02:51 +00:00
fb463f9faf Disabled demangling to break the dependency Exception -> Units -> Algorithms -> Range -> Concepts.
[SVN r85783]
2013-09-19 06:01:46 +00:00
432b3090fe Disabled demangling for now, to break the dependency: Exeception -> Units -> Algorithms -> Range -> Concepts. UGH!
[SVN r85782]
2013-09-19 05:53:38 +00:00
107f265ead Merging recent changes from trunk.
[SVN r85636]
2013-09-10 05:54:53 +00:00
ac5ebbcd45 Ticket #8947, thanks Maciej Florek
[SVN r85635]
2013-09-10 05:44:02 +00:00
2a68f099bf Ticket 9069, thanks sarum9in
[SVN r85634]
2013-09-10 05:05:41 +00:00
e97bcb4c56 N3757
[SVN r85538]
2013-08-31 23:24:40 +00:00
831f73599a Ticket 8852. Thanks Alex.
[SVN r85076]
2013-07-18 20:54:13 +00:00
9e012e1fdf Ticket #8312, thanks Greg Julus
[SVN r83588]
2013-03-26 17:25:10 +00:00
a0d47fea34 Merging long-standing changes from Trunk, including the slightly more sophisticated handling of the to_string conversion done in boost::diagnostic_information.
[SVN r83354]
2013-03-08 02:01:44 +00:00
9b100b0c9d Added verbose parameter to boost::diagnostic_information.
[SVN r82179]
2012-12-23 03:31:48 +00:00
2ebfd49b4f Ticket #7094, thanks 1czajnik
[SVN r79398]
2012-07-10 03:43:13 +00:00
9508b38e22 Improved to_string(std::pair) support.
[SVN r79252]
2012-07-03 23:41:52 +00:00
e25f33aaf6 Ticket 6450 (thanks A Polukhin.)
[SVN r79033]
2012-06-23 00:32:43 +00:00
7e116a36b9 Merged changes from trunk: dealing with warnings, and a compile error on Win CE.
[SVN r79026]
2012-06-21 02:15:24 +00:00
c2c1728a5b Documentation update.
[SVN r79025]
2012-06-21 02:15:19 +00:00
886e9ee793 Removing tabs.
[SVN r79014]
2012-06-20 05:08:25 +00:00
4cdfbb9ec6 Ticket 6878, thanks Dave Deakins
[SVN r79013]
2012-06-19 22:30:12 +00:00
b43961cf94 Bug in exception_ptr_test.cpp.
[SVN r79012]
2012-06-19 20:51:02 +00:00
6fe16d80ef Making error_info's destructor virtual.
[SVN r78235]
2012-04-28 06:05:06 +00:00
b3640aa019 For Windows CE, rethrow_exception should use ::exit instead of ::abort (the CRT on Windows CE does not include ::abort).
[SVN r78187]
2012-04-25 03:54:37 +00:00
41ce8a3322 This should take care of #6349. Hopefully doesn't break some other configurations.
[SVN r77593]
2012-03-27 19:33:22 +00:00
b3b930b7f5 Merging minor tested bugfixes from trunk.
[SVN r77592]
2012-03-27 19:31:48 +00:00
c3e35e9d37 Making clone_impl derive virtually from clone_base, so that calling boost::copy_exception with a type that already derives from clone_impl doesn't make pointer conversions to clone_impl ambiguous.
[SVN r77339]
2012-03-15 02:13:52 +00:00
439ef89742 Added redundant include guard to error_info.hpp (ticket 6428)
[SVN r76590]
2012-01-20 07:57:48 +00:00
3d10233a6b Ticket 6414, thank you Petr Machata
[SVN r76549]
2012-01-17 03:59:33 +00:00
f576e14dbc Ticket 6374, thanks edA-qa
[SVN r76403]
2012-01-11 01:13:03 +00:00
192ffd0379 Applying the Boost Exception part of the patch mentioned in #4594.
[SVN r76109]
2011-12-22 21:27:10 +00:00
d4acff61be Better fix for the bug fixed by my previous commit.
[SVN r75646]
2011-11-24 21:07:14 +00:00
875bc71581 Bug fix in exception cloning (thanks Johan Soderback for reporting it.)
[SVN r75636]
2011-11-23 08:40:08 +00:00
c7bae18633 Fix for the problem reported by Pavel Lebedev. Thanks!
[SVN r74471]
2011-09-19 21:45:34 +00:00
b053deaf22 documentation update
[SVN r73005]
2011-07-11 17:56:47 +00:00
a73deaa3f3 Fixing a build glitch in the non-intrusive exception_ptr support (Authorized by Eric)
[SVN r72995]
2011-07-10 05:45:57 +00:00
32e2b33250 Fixing two issues with non-intrusive exception cloning support.
[SVN r72924]
2011-07-05 23:53:33 +00:00
5f6812b226 Hopefully fixing a GCC warning.
[SVN r72127]
2011-05-23 19:34:44 +00:00
f5dc3715bc merged changes from trunk: better boost::diagnostic_information
[SVN r71158]
2011-04-10 02:13:12 +00:00
f6e9b5808a doc update
[SVN r70990]
2011-04-05 00:48:19 +00:00
9bab07e9bc issue #5386
[SVN r70989]
2011-04-05 00:25:59 +00:00
cc0d73af9d bug 5384
[SVN r70988]
2011-04-05 00:11:42 +00:00
24f3292606 doc update
[SVN r70975]
2011-04-04 21:55:53 +00:00
ef12c8b8fb Committing changes merged from trunk, most notably optional non-intrusive exception_ptr support for MSVC.
[SVN r70974]
2011-04-04 21:19:48 +00:00
2a2cf697b1 Revert r69620.
It's breaking the tests and probably isn't appropriate for a bug fix release.


[SVN r69816]
2011-03-10 07:34:15 +00:00
b41047174d Committing changes merged from trunk, most notably optional non-intrusive exception_ptr support for MSVC.
[SVN r69620]
2011-03-07 07:45:38 +00:00
fb4ed73b5e Incorrect check in cloning_test fixed, and workaround for Metrowerks.
[SVN r69619]
2011-03-07 07:39:50 +00:00
a74d041bd5 Ticket 4282
[SVN r68794]
2011-02-12 00:09:06 +00:00
08f65cca73 Ticket #5178
[SVN r68793]
2011-02-11 23:46:38 +00:00
d1065c8a13 Remove extra semicolon. Fixes #5168.
[SVN r68771]
2011-02-11 02:54:04 +00:00
6b0bfad6bf Converted exception_ptr from a shared_ptr typedef to a stand-alone class to allow simpler declaration of namespace boost { class exception_ptr; }
[SVN r68202]
2011-01-17 07:01:35 +00:00
c210c38dae Revert [67111] (addition of boost/detail/iomanip.hpp) and all the commits that depend on it. ([68137], [68140], [68141], [68154], and [68165]).
[SVN r68168]
2011-01-15 08:11:51 +00:00
f1a4e59469 Updating line numbers in unit test.
[SVN r68154]
2011-01-14 14:41:20 +00:00
e43210c417 Replacing the use of <iomanip> with <boost/detail/iomanip.hpp> across Boost.
On Linux, GNU's libstdc++, which is the default stdlib for icc and clang,
cannot parse the <iomanip> header in version 4.5+ (which thankfully neither
compiler advises the use of yet), as it's original C++98-friendly
implementation has been replaced with a gnu++0x implementation.
<boost/detail/iomanip.hpp> is a portable implementation of <iomanip>, providing
boost::detail::setfill, boost::detail::setbase, boost::detail::setw,
boost::detail::setprecision, boost::detail::setiosflags and
boost::detail::resetiosflags. 



[SVN r68140]
2011-01-14 02:35:58 +00:00
56ae4311bb default gcc visibility for exception types, <link>static requirement in test Jamfile.
[SVN r65763]
2010-10-05 15:04:50 +00:00
6d41b399d0 addressing msvc 7.1 issues in the non-intrusive exception_ptr support.
[SVN r65361]
2010-09-09 00:32:37 +00:00
b48a7933c7 documentation update
[SVN r65353]
2010-09-08 07:28:24 +00:00
c98deb1e40 properly ifdeffing the X86 MSVC non-intrusive exception_ptr support
[SVN r65346]
2010-09-07 21:46:10 +00:00
976e89a137 fixing obscure, extremely rare double- free() bug in clone_current_exception_msvc.cpp
[SVN r65228]
2010-09-04 00:43:24 +00:00
d637e8efc7 fixing minor memory leak in the non-intrusive MSVC exception_ptr support.
[SVN r65206]
2010-09-03 07:15:47 +00:00
12903d4e49 cosmetic bug fix in the exception_ptr support when the attempt to copy the exception object throws.
[SVN r65205]
2010-09-03 02:24:45 +00:00
3b4cdfce47 Non-intrusive exception_ptr support for msvc 7.1/8.0/9.0 (thanks Anthony Williams)
[SVN r65204]
2010-09-03 02:03:15 +00:00
5dbd4c8f32 disabling the non-intrusive exception_ptr support in tests, seems buggy..
[SVN r65161]
2010-09-01 07:59:35 +00:00
17304c365c non-intrusive exception_ptr support for msvc 7.1 and 8.0 (for now) thanks Anthony Williams
[SVN r65159]
2010-09-01 06:05:11 +00:00
79964f73df fixing runtime errors in this test, hopefully
[SVN r63564]
2010-07-03 21:24:26 +00:00
9090f38cde Ticket 4337
[SVN r62892]
2010-06-13 02:35:15 +00:00
65845c7252 Removed #include <boost/detail/workaround.hpp> from exception.hpp, requested by Emil, see #4068.
[SVN r62824]
2010-06-11 23:01:31 +00:00
2bd34963cd Ticket #4104
[SVN r62820]
2010-06-11 22:18:30 +00:00
177fce2389 Added Borland/Codegear workaround to avoid compile error when doing #include <boost/exception/exception.hpp> -- see #4068
[SVN r62819]
2010-06-11 21:44:22 +00:00
8897ff6586 Fix some warnings
[SVN r61941]
2010-05-13 04:21:51 +00:00
787fb1f148 Fixing https://svn.boost.org/trac/boost/ticket/4210
[SVN r61938]
2010-05-12 23:36:29 +00:00
ad829e590a Applying patch submitted by Neal Becker
[SVN r61852]
2010-05-08 04:27:44 +00:00
c251404656 workaround for double-destruction bugs in compilers: with this, boost::exception objects should survive the case when the destructor is called twice.
[SVN r61602]
2010-04-27 01:14:03 +00:00
f10defd7a2 Fixed various issues in docs (mostly duplicate bookmarks and broken links) found by inspect tool
[SVN r61437]
2010-04-20 18:49:18 +00:00
11661f05d3 undoing previous commit.
[SVN r60679]
2010-03-17 19:39:36 +00:00
42b5b4b899 Warnings
[SVN r60638]
2010-03-16 02:41:49 +00:00
8a8705542f documentation update
[SVN r60160]
2010-03-05 01:20:35 +00:00
d3c27315d1 Fixing compile error due to __LINE__ not always being compile-time constant on MSVC
[SVN r60159]
2010-03-05 00:05:43 +00:00
f6588caf4e detab
[SVN r59945]
2010-02-26 07:58:55 +00:00
c5230be656 msvc 7.1 regression, thanks Joaquin
[SVN r59837]
2010-02-22 05:52:40 +00:00
0cebd7efbf Fixing problems found by the vacpp test.
[SVN r59743]
2010-02-18 05:58:00 +00:00
2f18eef27a copy_exception ambiguity problem with c++0x
[SVN r59465]
2010-02-04 08:14:27 +00:00
37c31a6622 A bit of type name mangling was left unmangled. Should be good now.
[SVN r59449]
2010-02-03 20:17:01 +00:00
2bbd6ae7b5 trying workaround for failures at Sandia-gcc-4.4.3_0x
[SVN r59436]
2010-02-03 08:24:01 +00:00
3013e991f1 exception_ptr bad_alloc refactoring
[SVN r59431]
2010-02-02 19:41:55 +00:00
1af9381775 fixing bug in printing failure info in exception_ptr_test.cpp
[SVN r59419]
2010-02-01 17:52:20 +00:00
a955aa431e prettier diagnostic information, using <boost/units/detail/utility.hpp>
[SVN r59398]
2010-02-01 00:25:15 +00:00
ab7a4ebb1a documentation update
[SVN r59373]
2010-01-30 20:59:15 +00:00
6b30091ee3 improved memory leak test.
[SVN r59372]
2010-01-30 20:05:31 +00:00
2dc075e6e8 Potential leak caused by previous commit.
[SVN r59370]
2010-01-30 18:44:45 +00:00
4ae002cbf8 Ticket #3848 (thanks Nikki Chumakov) and (unrelated) exception_ptr refactoring.
[SVN r59364]
2010-01-30 05:26:43 +00:00
9dee0fb9e6 fixing bogus FBSD failure in errinfos_test.cpp.
[SVN r59263]
2010-01-25 06:51:28 +00:00
3911cd2472 Adding another test for exception_ptr.
[SVN r59259]
2010-01-24 21:18:29 +00:00
6a92851a38 minor BOOST_THROW_EXCEPTION fix.
[SVN r58500]
2009-12-22 21:34:34 +00:00
21ecbb3614 Error in a comment.
[SVN r58420]
2009-12-16 22:25:34 +00:00
9d499676ae Simplified type_info support due to improvements in boost/detail/sp_typeinfo.hpp. A few tweaks to better deal with warnings.
[SVN r58132]
2009-12-04 06:33:47 +00:00
58a49ff77e minor diagnostic_information maintenance, updated documentation
[SVN r58131]
2009-12-04 01:29:22 +00:00
dc75da0dc4 Fix sp_typeinfo to match the interface of std::type_info.
[SVN r58127]
2009-12-03 20:31:01 +00:00
a870f8651b Ticket #3211
[SVN r58088]
2009-12-01 19:48:58 +00:00
8d24c87032 Suppressing warnings. Please report any problems (may have broken something!)
[SVN r58072]
2009-12-01 02:16:50 +00:00
3ab1c234f5 Bug ticket 3641, also merging other fixes from the Release branch.
[SVN r57765]
2009-11-18 23:05:55 +00:00
5630262c4d Fixed unqualified use of size_t in object_hex_dump.hpp
[SVN r57668]
2009-11-15 04:26:36 +00:00
e299f609b5 Prevent ADL from finding other dispatch functions or types. Required for #2094.
Richard Smith.

[SVN r57605]
2009-11-12 19:18:42 +00:00
4756dc6fe7 documentation update
[SVN r57058]
2009-10-22 07:10:26 +00:00
baece0983f rm cmake from trunk. I'm not entirely sure this is necessary to satisfy the inspect script, but I'm not taking any chances, and it is easy to put back
[SVN r56942]
2009-10-17 02:07:38 +00:00
17951c2b7d Added errinfo_nested_exception typedef. Fixed minor documentation error.
[SVN r56766]
2009-10-13 01:47:22 +00:00
2c0599b885 Another minor documentation bug.
[SVN r56450]
2009-09-27 21:24:09 +00:00
da4f20e998 Minor documentation update.
[SVN r56449]
2009-09-27 21:22:42 +00:00
c25d7d2ba0 New function: diagnostic_information_what.
[SVN r56448]
2009-09-27 21:17:48 +00:00
9683159e5c documentation bug
[SVN r55867]
2009-08-29 18:45:08 +00:00
920ae71b00 fixing compile errors with some compilers
[SVN r55744]
2009-08-23 22:34:19 +00:00
fa96125efb mutable get_error_info support
[SVN r55707]
2009-08-21 22:28:44 +00:00
7b4290bc76 Copyrights on CMakeLists.txt to keep them from clogging up the inspect
reports.  This is essentially the same commit as r55095 on the release
branch.



[SVN r55159]
2009-07-26 00:49:56 +00:00
0003622f9d documentation update
[SVN r54906]
2009-07-12 06:59:53 +00:00
96ed20d2d7 documentation update
[SVN r54870]
2009-07-10 19:03:29 +00:00
96e2ac573a Examples/documentation update
[SVN r54842]
2009-07-09 20:51:10 +00:00
a674ec2bb9 Minor fix in libs/exception/example/example_io.cpp.
[SVN r54840]
2009-07-09 18:52:35 +00:00
33bfe0bf65 documentation update
[SVN r54839]
2009-07-09 17:53:14 +00:00
f2d6ca64da Fixing Sun compile errors
[SVN r54835]
2009-07-09 17:34:39 +00:00
2b34528ef0 Documentation and examples update.
[SVN r54831]
2009-07-09 07:35:15 +00:00
953399846a Documentation update
[SVN r54828]
2009-07-09 03:51:30 +00:00
bd0ed9f83b Added commonly used error_info typedefs.
Added boost/exception/all.hpp.
Removed tabs from source files.

[SVN r54825]
2009-07-08 23:44:28 +00:00
a0614793b3 Please don't make unnecessary changes.
[SVN r54681]
2009-07-05 20:05:05 +00:00
bd19b50db3 Added support for GCC.
[SVN r54668]
2009-07-05 09:25:58 +00:00
e2882e8251 Added BOOST_ATTRIBUTE_NORETURN to suppress warnings in code calling BOOST_THROW_EXCEPTION.
[SVN r54614]
2009-07-03 21:45:37 +00:00
19b67c4983 avoid C style casts
[SVN r53669]
2009-06-06 09:39:27 +00:00
bfaa9b404e avoid C style casts
[SVN r53666]
2009-06-06 09:30:28 +00:00
e7c9f21a93 documentation update
[SVN r53240]
2009-05-25 07:14:17 +00:00
2b9c154563 documentation update
[SVN r53238]
2009-05-25 06:09:01 +00:00
8465a47472 Fixed most tab and min/max issues from trunk inspection report
[SVN r53141]
2009-05-20 19:19:00 +00:00
0372936d86 documentation fix
[SVN r53065]
2009-05-17 06:06:14 +00:00
d692895aab documentation update
[SVN r53040]
2009-05-15 23:11:14 +00:00
9cee59551d documentation typo
[SVN r53039]
2009-05-15 22:42:32 +00:00
1643ad2e81 support for exception_ptr and nesting in boost::diagnostic_information
documentation update

[SVN r53038]
2009-05-15 22:34:30 +00:00
15c0ff6130 documentation update
[SVN r52983]
2009-05-14 01:58:08 +00:00
bec171e234 exception_ptr improvements, documentation update.
[SVN r52981]
2009-05-14 00:36:46 +00:00
0ddded8e41 Added explicit handling for a few std exception types that were missing from boost::current_exception().
[SVN r52979]
2009-05-13 22:15:59 +00:00
2c959a4e43 Use local copies of the boost logo.
[SVN r52666]
2009-04-29 21:19:12 +00:00
0e1e2ad515 fixing an error that caused warnings in diagnostic_information.hpp
[SVN r52355]
2009-04-12 17:21:39 +00:00
90782a9fe6 documentation update
[SVN r52285]
2009-04-09 06:30:08 +00:00
25948347fe documentation update
[SVN r52284]
2009-04-09 06:22:05 +00:00
e020b0f282 documentation update
[SVN r52281]
2009-04-09 05:52:31 +00:00
f80f55143e documentation update
[SVN r52280]
2009-04-09 05:48:51 +00:00
bb8a3d3fff documentation update
[SVN r52278]
2009-04-09 04:49:19 +00:00
6da7fed23a Documentation update
[SVN r52267]
2009-04-08 20:23:27 +00:00
c9d1d02ec3 Documentation update
[SVN r52265]
2009-04-08 20:08:44 +00:00
2d5be208de BOOST_NO_EXCEPTIONS #ifdef
[SVN r52263]
2009-04-08 19:20:35 +00:00
e45ffc810e documentation update
[SVN r52235]
2009-04-07 18:04:57 +00:00
37c1020bc4 documentation update
[SVN r52234]
2009-04-07 18:02:18 +00:00
6aa4d2f93b comments
[SVN r52227]
2009-04-07 03:02:15 +00:00
87384d2116 get_error_info returns raw pointer instead of shared_ptr (breaking change)
diagnostic_information can now be called with boost::exception or std::exception object.
BOOST_THROW_EXCEPTION can now be used even if exceptions are disabled.
added functions: current_exception_diagnostic_information, current_exception_cast
documentation updated to match.

[SVN r52225]
2009-04-06 23:15:42 +00:00
b2e31a640e documentation update
[SVN r52135]
2009-04-02 17:06:53 +00:00
88c2d1f228 documentation update
[SVN r52129]
2009-04-02 06:16:23 +00:00
338ce71238 documentation update
[SVN r52128]
2009-04-02 05:39:42 +00:00
2649e88c52 documentation copyright message update
[SVN r52125]
2009-04-02 05:00:47 +00:00
17f36e5962 documentation typos
[SVN r52124]
2009-04-02 04:56:31 +00:00
3070a53e01 Documentation update
[SVN r52122]
2009-04-01 21:31:03 +00:00
62c6967dd2 documentation update
[SVN r52099]
2009-04-01 07:08:04 +00:00
4ebbc111b9 documentation update
[SVN r52097]
2009-04-01 05:58:18 +00:00
d2c197d4e6 Documentation update
[SVN r52092]
2009-03-31 22:20:46 +00:00
6e909aaf58 documentation update
[SVN r52046]
2009-03-29 04:58:33 +00:00
304003832f documentation update
[SVN r52045]
2009-03-29 04:55:13 +00:00
f8b8c60d69 documentation update
[SVN r52044]
2009-03-29 04:50:30 +00:00
d6ddb02ff7 documentation update
[SVN r52043]
2009-03-29 04:47:10 +00:00
0058740bab documentation update
[SVN r52042]
2009-03-29 04:44:37 +00:00
e93f4b811a Documentation update
[SVN r51630]
2009-03-05 23:00:26 +00:00
f6f09c16cd added #error in headers incompatible with BOOST_NO_EXCEPTIONS
[SVN r50887]
2009-01-30 00:06:01 +00:00
aef7275c0f documentation update
[SVN r50539]
2009-01-10 21:40:22 +00:00
cd1cb71367 documentation update
[SVN r50508]
2009-01-08 01:31:33 +00:00
f28285c073 Implemented support for custom to_string overloads for converting boost::error_info objects to string by the boost::diagnostic_information function.
[SVN r50507]
2009-01-08 01:26:15 +00:00
b52e6c7d6b Updating dependency information for modularized libraries.
[SVN r49628]
2008-11-07 17:05:27 +00:00
5d92a68e68 Updating CMake files to latest trunk. Added dependency information for regression tests and a few new macros for internal use.
[SVN r49627]
2008-11-07 17:02:56 +00:00
8e75a12330 Continuing merge of CMake build system files into trunk with the encouragement of Doug Gregor
[SVN r49510]
2008-11-01 13:15:41 +00:00
4182c3634e fixing a warning on sun-5.10-stdcxx-4.2.2_x86_64
[SVN r49091]
2008-10-01 18:24:56 +00:00
717997e014 Tests workarounds for CodeGear 2009. Thanks Nicola for all the CodeGear workarounds.
[SVN r48921]
2008-09-22 22:47:03 +00:00
7c47c0be86 documentation update
[SVN r48920]
2008-09-22 19:14:54 +00:00
ffa2e8d9e7 very minor change, making a constructor explicit.
[SVN r48919]
2008-09-22 18:57:20 +00:00
4cb98696a6 Improving CodeGear C++Builder 2009 compatibility
[SVN r48918]
2008-09-22 18:27:58 +00:00
1c5df6b59a #defined BOOST_EXCEPTION_DISABLE on any BCC until workarounds are found for the tests in libs/exception/test.
[SVN r48860]
2008-09-19 00:09:47 +00:00
2cde7922b2 Hopefully properly disabling boost exception integration in throw_exception.hpp for Borland <= 5.9.3
[SVN r48792]
2008-09-16 04:07:43 +00:00
da0c1fa744 Added 4 more tests
[SVN r48738]
2008-09-11 18:15:25 +00:00
f89533b81f documentation update
[SVN r48700]
2008-09-10 17:46:01 +00:00
a42693427f Workaround for the HP-UX_ia64_aCC failures.
[SVN r48690]
2008-09-09 23:44:16 +00:00
a416168862 Hopefully a workaround for an overload resolution bug in Sun compilers causing minor problems
[SVN r48668]
2008-09-08 18:27:24 +00:00
b5fc84025b minor type_info.hpp change
[SVN r48642]
2008-09-07 00:05:00 +00:00
c37744a228 documentation update
[SVN r48635]
2008-09-06 19:24:13 +00:00
76380aa2f6 Bug in type_info.hpp
[SVN r48634]
2008-09-06 18:40:02 +00:00
29fc99b378 documentation update
[SVN r48619]
2008-09-05 18:24:54 +00:00
49395913d0 documentation update
[SVN r48606]
2008-09-05 07:20:05 +00:00
475dbd4021 improved output from diagnostic_information()
[SVN r48604]
2008-09-05 03:15:18 +00:00
d094c3f41c revived enable_current_exception.hpp and enable_error_info.hpp.
[SVN r48582]
2008-09-04 19:48:32 +00:00
fc101598ba minor boost/exception/detail/type_info.hpp fix.
[SVN r48579]
2008-09-04 19:36:34 +00:00
783a0530ba documentation update
[SVN r48568]
2008-09-03 19:07:23 +00:00
6aecfeca3f documentation update
[SVN r48557]
2008-09-03 06:19:03 +00:00
546f093a33 missing inline
[SVN r48556]
2008-09-03 02:14:27 +00:00
f07a5a5923 documentation update
[SVN r48555]
2008-09-03 00:38:35 +00:00
474ed15d35 documentation update
[SVN r48554]
2008-09-02 23:20:49 +00:00
8310c9831f bug fix in the decoupling of info.hpp from get_error_info.hpp.
[SVN r48551]
2008-09-02 23:13:06 +00:00
5a9532783d documentation fix
[SVN r48545]
2008-09-02 21:24:55 +00:00
353bb95e2c documentation update
[SVN r48544]
2008-09-02 21:02:25 +00:00
2887a719c8 minor diagnostic_information fix.
[SVN r48543]
2008-09-02 18:44:05 +00:00
31a9264bf9 fix for sun compilers and documentation source update
[SVN r48538]
2008-09-02 17:47:51 +00:00
b84fb75a60 Optimization for error_info<throw_function>, error_info<throw_file>, error_info<throw_line>. Refactored exception_ptr to use shared_ptr.
[SVN r48521]
2008-09-01 21:06:09 +00:00
9a35c999a2 bug in refcount_ptr_test.cpp
[SVN r48509]
2008-09-01 00:23:59 +00:00
c50fd487fe documentation bug
[SVN r48498]
2008-08-31 19:10:32 +00:00
ab0c20a846 documentation update
[SVN r48489]
2008-08-31 07:25:28 +00:00
5d4c014f5b nitpicking
[SVN r48488]
2008-08-31 04:05:19 +00:00
5c84929742 documentation update
[SVN r48487]
2008-08-31 03:23:49 +00:00
6fc0e3ac1e simplified further
[SVN r48485]
2008-08-31 02:40:42 +00:00
6c3f38c45d removed #include <stddef.h>
[SVN r48484]
2008-08-31 02:04:34 +00:00
85e3d1f5c3 removed explicit copy ctor in boost::exception
[SVN r48483]
2008-08-31 01:58:48 +00:00
f12d40765b Both enable_error_info.hpp and enable_current_exception.hpp now do not depend on intrusive_ptr or any other Boost lib.
[SVN r48482]
2008-08-31 01:39:00 +00:00
f2b14ffa98 addressing what seems to be a bug in darwin-4.0.1
[SVN r48477]
2008-08-30 17:42:17 +00:00
fecfa21877 boost exception documentation update
[SVN r48471]
2008-08-30 06:13:10 +00:00
23923c1045 nit in diagnostic_information_test.cpp
[SVN r48470]
2008-08-30 03:05:26 +00:00
9dd2d64304 decoupled boost/exception/exception.hpp from boost/exception/detail/type_info.hpp
diagnostic_information improvements
documentation update

[SVN r48469]
2008-08-30 02:57:12 +00:00
e1aba12621 documentation source
[SVN r48456]
2008-08-29 19:38:49 +00:00
5258fbc2d1 Further simplified enable_current_exception. Improved exception_ptr testing.
[SVN r48455]
2008-08-29 19:27:38 +00:00
0c9d70964e enable_current_exception.hpp decoupled from atomic_count.hpp
[SVN r48439]
2008-08-29 04:56:02 +00:00
d7b98ba390 Boost Exception documentation update
[SVN r48432]
2008-08-29 02:48:23 +00:00
70a910d82c insignificant
[SVN r48430]
2008-08-28 23:58:26 +00:00
850b7d9618 Boost Exception now works with BOOST_NO_RTTI and/or BOOST_NO_TYPEID.
[SVN r48429]
2008-08-28 23:49:55 +00:00
14765312e2 fix for mutable problem, thanks Peter Klotz
[SVN r48270]
2008-08-20 21:48:35 +00:00
e05771c0c4 Fix: apply workaround to disable msvc warning 4265.
[SVN r48248]
2008-08-20 09:29:17 +00:00
8c89aef48e Documentation bug fix, thanks Daryle Walker
[SVN r48207]
2008-08-19 02:56:02 +00:00
2b457b1656 css used to refer to missing png.
[SVN r48007]
2008-08-06 20:24:23 +00:00
09c3747408 documentation update
[SVN r47496]
2008-07-17 00:13:09 +00:00
88ef777088 minor documentation update
[SVN r47492]
2008-07-16 21:00:44 +00:00
d7722921a7 removed tabs from source files
updated documentation


[SVN r47250]
2008-07-09 00:18:09 +00:00
044d5767e2 Hopefully fixing the Como-specific problem reported by Robert Ramey.
[SVN r47126]
2008-07-06 04:50:53 +00:00
9ddb810b95 documentation source
[SVN r47089]
2008-07-05 08:27:12 +00:00
b1fbc58a9f documentation
[SVN r47067]
2008-07-04 04:21:55 +00:00
b8ae58b904 Redirection index.html
[SVN r47008]
2008-07-02 21:51:00 +00:00
475f37b9c4 BOOST_NO_TYPEID
[SVN r47007]
2008-07-02 21:50:29 +00:00
d0febca84b Removed boost::exception::what, to avoid ambiguity in user types deriving from both std::exception and boost::exception.
[SVN r46930]
2008-06-30 19:40:44 +00:00
ad1ef37b81 Documentation update.
[SVN r46822]
2008-06-28 20:26:16 +00:00
640d6cfc58 bug fix, thanks Steven Watanabe
[SVN r46802]
2008-06-28 03:53:39 +00:00
87b1b323d8 documentation bindings updated.
[SVN r46704]
2008-06-26 06:33:51 +00:00
f58ffdd643 documentation update, added function exception::diagnostic_information, added std::exception to_string overload, removed tabs from source files
[SVN r46697]
2008-06-25 23:27:56 +00:00
1d776ff363 Documentation source file format changed
[SVN r46344]
2008-06-12 08:20:48 +00:00
d54052b137 Added missing #include <ios>
[SVN r46341]
2008-06-11 22:25:06 +00:00
175c3e50e9 Bug in the previous bug fix!
[SVN r46335]
2008-06-11 19:20:27 +00:00
421a059421 Fixed exception info bug when boost::exception is derived virtually.
[SVN r46333]
2008-06-11 18:24:10 +00:00
3b2a6a2711 Documentation source updated.
[SVN r46087]
2008-06-03 20:18:04 +00:00
d04ddee87a Added required #include <stddef.h>
[SVN r45378]
2008-05-15 00:47:50 +00:00
8328f20b1a enable_error_info.hpp hacked to support Borland 0x582
[SVN r45339]
2008-05-13 19:59:48 +00:00
9f8623a2c9 Borland compatibility for enable_error_info.hpp,
Tabs removed from exception.hpp,
Documentation rebound.

[SVN r45273]
2008-05-11 02:15:49 +00:00
f243fadab2 Disable Boost.Exception for Borland 5.8.x as well.
[SVN r45268]
2008-05-10 19:55:16 +00:00
ebc9563ed0 Unconditionally #include <exception> for std::exception.
[SVN r45150]
2008-05-05 20:06:58 +00:00
ec0ae8105d Added missing include.
[SVN r45116]
2008-05-04 18:05:34 +00:00
7cc96d23ec Improved compatibility with various compilers.
[SVN r45087]
2008-05-03 19:51:41 +00:00
cde6de22d9 Disabled bogus GCC warnings.
[SVN r45082]
2008-05-03 18:20:15 +00:00
5ffd47553f Fixes for old compilers.
[SVN r45069]
2008-05-03 15:33:06 +00:00
4900711406 Boost Exception documentation update.
[SVN r45043]
2008-05-02 21:34:46 +00:00
d4a15cd9db tabs removed, added protected inline dtors.
[SVN r45042]
2008-05-02 20:51:31 +00:00
e1056d2f4a throw_exception() now ensures that the exception type passed to it derives publicly from std::exception.
[SVN r45041]
2008-05-02 20:40:39 +00:00
cc7d466f5d Integration of Boost Exception in boost::throw_exception().
[SVN r44954]
2008-04-30 21:45:00 +00:00
f3cfeeee57 Added required header #include <new>
[SVN r44886]
2008-04-29 17:17:45 +00:00
b5877b8d9a Added protected destructor to the base type error_info_base
[SVN r44781]
2008-04-26 17:43:58 +00:00
487235a7cc Fix for http://tinyurl.com/6owy6b.
[SVN r44742]
2008-04-23 17:31:56 +00:00
0dec4fed2c seems like <link>static causes errors
[SVN r44726]
2008-04-22 22:23:27 +00:00
628b06a2fa Fixed MSVC-specific compile errors when /Za command-line option is used, due to lack of throw() in std::~exception().
[SVN r44706]
2008-04-21 22:42:54 +00:00
ce9a26634c minor documentation fixes.
[SVN r44476]
2008-04-16 22:55:19 +00:00
a61063b8f5 Boost Exception documentation fix
[SVN r44446]
2008-04-15 22:25:11 +00:00
79f0253d94 Boost Exception documentation fix
[SVN r44445]
2008-04-15 22:23:19 +00:00
b1b9478cbc Boost Exception documentation update
[SVN r44444]
2008-04-15 21:56:34 +00:00
4ae983f5f0 Boost Exception documentation source
[SVN r44443]
2008-04-15 21:14:23 +00:00
eb7a736198 Boost Exception header compilation tests added.
[SVN r44442]
2008-04-15 21:13:24 +00:00
f29f86f65c introduced boost/exception_ptr.hpp, using Boost Exception
[SVN r44439]
2008-04-15 18:47:16 +00:00
c61e655ada N2179 compliance (pending documentation update)
[SVN r44438]
2008-04-15 18:24:46 +00:00
08607bca72 minor to_string fix
[SVN r44419]
2008-04-14 17:31:38 +00:00
9bac76a06d minor fix
[SVN r44404]
2008-04-14 06:27:40 +00:00
92fbda9a88 minor compile error fix
[SVN r44372]
2008-04-13 17:07:26 +00:00
bf5e44f798 documentation cleanup
[SVN r44342]
2008-04-12 06:08:10 +00:00
ec40d3d8ad removed tabs. what's wrong with tabs anyway?
[SVN r44246]
2008-04-12 03:27:57 +00:00
761ae0bc1e to_string adjustments
[SVN r44192]
2008-04-11 18:34:46 +00:00
3c7f53176f to_string fixes
[SVN r44164]
2008-04-11 03:51:06 +00:00
65d278a387 missing include
[SVN r44134]
2008-04-09 18:48:39 +00:00
0fbc4dc974 fixed compile errors, removed tabs as required.
[SVN r44114]
2008-04-08 21:29:37 +00:00
e0881a603d fixed compile errors on various platforms
[SVN r44104]
2008-04-07 19:00:45 +00:00
e961744baf fix for:
boost/exception/enable_exception_cloning.hpp uses std::bad_alloc
without #include'ing <new>. Because of this, some exception library
tests fail to compile on HP-UX.

[SVN r43555]
2008-03-10 20:18:19 +00:00
45fe1f6289 hooking up boost exception for testing
[SVN r43525]
2008-03-06 05:08:22 +00:00
bf515d83ca boost exception
[SVN r43485]
2008-03-04 01:41:17 +00:00
58 changed files with 16735 additions and 923 deletions

14
build/Jamfile.v2 Normal file
View File

@ -0,0 +1,14 @@
# Boost Exception Library build Jamfile
#
# Copyright (c) 2006-2009 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)
project boost/exception
: source-location ../src
: requirements <link>static
;
lib boost_exception : clone_current_exception_non_intrusive.cpp ;
boost-install boost_exception ;

View File

@ -27,15 +27,15 @@
#include &lt;boost/current_function.hpp&gt;
#define <span class="RenoLink">BOOST_THROW_EXCEPTION</span>(x)\
::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( ::boost::<span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>(x) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_function</a></span>(BOOST_CURRENT_FUNCTION) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_function</a></span>(<span class="RenoLink"><a href="configuration_macros.html">BOOST_THROW_EXCEPTION_CURRENT_FUNCTION</a></span>) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_file</a></span>(__FILE__) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_line</a></span>((int)__LINE__) )
#else
#define <span class="RenoLink">BOOST_THROW_EXCEPTION</span>(x) ::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>(x)
#endif</pre>
</div></div><p>This macro takes an exception object, records BOOST_CURRENT_FUNCTION, __FILE__ and __LINE__ in it, and forwards it to <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. To recover this information at the catch site, use <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>; the information is also included in the message returned by <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>.</p>
</div></div><p>This macro takes an exception object, records the current function name, __FILE__ and __LINE__ in it, and forwards it to <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. To recover this information at the catch site, use <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>; the information is also included in the message returned by <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>.</p>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a></span>
See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -40,7 +40,7 @@
#include &lt;<span class="RenoLink"><a href="boost_exception_ptr_hpp.html">boost/exception_ptr.hpp</a></span>&gt;
#endif</span></pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
See also: <span class="RenoPageList"><a href="boost_exception_hpp.html">boost/exception.hpp</a>&nbsp;| <a href="tutorial_diagnostic_information.html">Diagnostic Information</a>&nbsp;| <a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies</a>&nbsp;| <a href="synopsis.html">Synopsis</a></span>
See also: <span class="RenoPageList"><a href="tutorial_diagnostic_information.html">Diagnostic Information</a>&nbsp;| <a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies</a>&nbsp;| <a href="synopsis.html">Synopsis</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -30,11 +30,11 @@ boost
<span class="RenoIncludeSPAN"> class <span class="RenoLink"><a href="exception.html">exception</a></span>;</span>
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class E&gt;
std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( E const &amp; e );
std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( E const &amp; e, bool verbose=true );
std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const &amp; p );</span>
std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const &amp; p, bool verbose=true );</span>
<span class="RenoIncludeSPAN">char const * <span class="RenoLink"><a href="diagnostic_information_what.html">diagnostic_information_what</a></span>( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const &amp; e ) throw();</span>
<span class="RenoIncludeSPAN">char const * <span class="RenoLink"><a href="diagnostic_information_what.html">diagnostic_information_what</a></span>( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const &amp; e, bool verbose=true ) throw();</span>
<span class="RenoIncludeSPAN">std::string <span class="RenoLink"><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></span>();</span></span>
}</pre>

View File

@ -28,10 +28,10 @@ namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class ErrorInfo,class E&gt;
typename ErrorInfo::<span class="RenoLink"><a href="error_info_value_type.html">error_info::value_type</a></span> const * <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>( E const &amp; x );
typename ErrorInfo::<span class="RenoLink"><a href="error_info::value_type">error_info::value_type</a></span> const * <span class="RenoLink"><a href="get_error_info">get_error_info</a></span>( E const &amp; x );
template &lt;class ErrorInfo,class E&gt;
typename ErrorInfo::<span class="RenoLink"><a href="error_info_value_type.html">error_info::value_type</a></span> * <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>( E &amp; x );</span></span>
typename ErrorInfo::<span class="RenoLink"><a href="error_info::value_type">error_info::value_type</a></span> * <span class="RenoLink"><a href="get_error_info">get_error_info</a></span>( E &amp; x );</span></span>
}</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
See also: <span class="RenoPageList"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp</a>&nbsp;| <a href="error_info.html">error_info</a></span>

View File

@ -1,42 +0,0 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>boost/exception.hpp</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 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) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception.hpp</h2>
</div>
<p>This header has been deprecated.</p>
<p>Please #include &lt;<span class="RenoLink"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp</a></span>&gt; instead.</p>
</div><div class="RenoAutoDIV"></div>
<!-- Copyright (c) 2006-2009 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) -->
<div id="footer">
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -27,7 +27,7 @@
#include &lt;boost/current_function.hpp&gt;
#define <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(x)\
::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( ::boost::<span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>(x) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_function</a></span>(BOOST_CURRENT_FUNCTION) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_function</a></span>(<span class="RenoLink"><a href="configuration_macros.html">BOOST_THROW_EXCEPTION_CURRENT_FUNCTION</a></span>) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_file</a></span>(__FILE__) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_line</a></span>((int)__LINE__) )
#else

View File

@ -32,8 +32,10 @@
<p>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 <span class="RenoLink"><a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a></span>.</p>
<p><b>BOOST_NO_EXCEPTIONS</b></p>
<p>This macro disables exception handling in Boost, forwarding all exceptions to a user-defined non-template version of boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. However, unless BOOST_EXCEPTION_DISABLE is also defined, users can still examine the exception object for any data added at the point of the throw, or use boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> (of course under BOOST_NO_EXCEPTIONS, the user-defined boost::throw_exception is not allowed to return to the caller.)</p>
<p><b>BOOST_THROW_EXCEPTION_CURRENT_FUNCTION</b></p>
<p>The <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> macro uses BOOST_THROW_EXCEPTION_CURRENT_FUNCTION to record the name of the current function in the exception object. Unless overridden by the user, BOOST_THROW_EXCEPTION_CURRENT_FUNCTION expands to BOOST_CURRENT_FUNCTION.</p>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_all_hpp.html">boost/exception/all.hpp</a>&nbsp;| <a href="get_error_info.html">get_error_info</a></span>
See also: <span class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a>&nbsp;| <a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_all_hpp.html">boost/exception/all.hpp</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="get_error_info.html">get_error_info</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -52,7 +52,7 @@ main()
}
}</pre>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a>&nbsp;| <a href="diagnostic_information.html">diagnostic_information</a></span>
See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a>&nbsp;| <a href="diagnostic_information.html">diagnostic_information</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -26,25 +26,21 @@
boost
{
<span class="RenoIncludeSPAN"> template &lt;class E&gt;
std::string <span class="RenoLink">diagnostic_information</span>( E const &amp; e );
std::string <span class="RenoLink">diagnostic_information</span>( E const &amp; e, bool verbose=true );
std::string <span class="RenoLink">diagnostic_information</span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const &amp; p );</span>
std::string <span class="RenoLink">diagnostic_information</span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const &amp; p, bool verbose=true );</span>
}</pre>
</div><h4>Returns:</h4>
<p>A string value that contains varying amount of implementation-specific diagnostic information about the passed object:</p>
<div><ul><li>If E can be statically converted to boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, the returned value contains the string representations of all <span class="RenoLink"><a href="error_info.html">error_info</a></span> objects stored in the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> through <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span>, along with other diagnostic information relevant to the exception. If e can be dynamically converted to std::exception, the returned value also contains the what() string.</li>
<li>Otherwise, if E can be statically converted to std::exception:<div><ul><li>if e can be dynamically converted to boost::exception, the returned value is the same as if E could be statically converted to boost::<span class="RenoLink"><a href="exception.html">exception</a></span>;</li>
<li>otherwise the returned value contains the what() string.</li>
<p>A string value that contains varying amount of diagnostic information about the passed object:</p>
<div><ul><li> If E can be statically converted to either boost::<span class="RenoLink"><a href="exception.html">exception</a></span> or to std::exception, dynamic_cast is used to access both the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> and std::exception subobjects of e; otherwise, the boost::<span class="RenoLink">diagnostic_information</span> template is not available.</li>
<li> The returned value contains the string representations of all <span class="RenoLink"><a href="error_info.html">error_info</a></span> objects stored in the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> subobject through <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span>.</li>
<li> In addition, if verbose is true, it contains other diagnostic information relevant to the exception, including the string returned by std::exception::what().</li>
</ul></div>
</li>
<li>Otherwise, the boost::<span class="RenoLink">diagnostic_information</span> template is not available.</li>
</ul></div>
<p>The string representation of each <span class="RenoLink"><a href="error_info.html">error_info</a></span> object is deduced by a function call that is bound at the time the <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag,T&gt; template is instantiated. The following overload resolutions are attempted in order:</p>
<div><ol><li>Unqualified call to to_string(x), where x is of type <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag,T&gt; (the return value is expected to be of type std::string.)</li>
<li>Unqualified call to to_string(x.<span class="RenoLink"><a href="error_info_value.html">value</a></span>()) (the return value is expected to be of type std::string.)</li>
<p>The string representation of each <span class="RenoLink"><a href="error_info.html">error_info</a></span> object is deduced by an unqualified call to to_string(x), where x is of type <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag,T&gt;, for which Boost Exception defines a generic overload. It converts x.<span class="RenoLink"><a href="error_info_value.html">value</a></span>() to string, attempting to bind (at the time the <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag,T&gt; template is instantiated) the following functions in order:</p>
<div><ol><li>Unqualified call to to_string(x.<span class="RenoLink"><a href="error_info_value.html">value</a></span>()) (the return value is expected to be of type std::string.)</li>
<li>Unqualified call to s &lt;&lt; x.<span class="RenoLink"><a href="error_info_value.html">value</a></span>(), where s is a std::ostringstream.</li>
</ol></div>
<p>The first successfully bound function is used at the time <span class="RenoLink">diagnostic_information</span> is called; if all 3 overload resolutions are unsuccessful, the system is unable to convert the <span class="RenoLink"><a href="error_info.html">error_info</a></span> object to string, and <i>an unspecified stub string value is used without issuing a compile error.</i></p>
<p>The first successfully bound function is used at the time <span class="RenoLink">diagnostic_information</span> is called; if both overload resolutions are unsuccessful, the system is unable to convert the <span class="RenoLink"><a href="error_info.html">error_info</a></span> object to string, and <i>an unspecified stub string value is used without issuing a compile error.</i></p>
<p>The <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> overload of <span class="RenoLink">diagnostic_information</span> is equivalent to:</p>
<pre>if( p )
try
@ -53,14 +49,9 @@ boost
}
catch(...)
{
return <span class="RenoLink"><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></span>();
return <span class="RenoLink"><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></span>(verbose);
}
else return &lt;unspecified-string-value&gt;;</pre>
<h4>Notes:</h4>
<div><ul><li>The format of the returned string is unspecified.</li>
<li>The returned string is <i>not</i> user-friendly.</li>
<li>The returned string may include additional platform-specific diagnostic information.</li>
</ul></div>
<div class="RenoIncludeDIV"><h4>Example:</h4>
<p>this is a possible output from the <span class="RenoLink">diagnostic_information</span> function, as used in <i>libs/exception/example/example_io.cpp:</i></p>
<pre>example_io.cpp(70): Throw in function class boost::shared_ptr&lt;struct _iobuf&gt; __cdecl my_fopen(const char *,const char *)
@ -71,7 +62,7 @@ std::exception::what: example_io error
[struct boost::<span class="RenoLink"><a href="errinfo_file_name.html">errinfo_file_name</a></span>_ *] = tmp1.txt
[struct boost::<span class="RenoLink"><a href="errinfo_file_open_mode.html">errinfo_file_open_mode</a></span>_ *] = rb</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
See also: <span class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a>&nbsp;| <a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a>&nbsp;| <a href="tutorial_diagnostic_information.html">Diagnostic Information</a>&nbsp;| <a href="diagnostic_information_what.html">diagnostic_information_what</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="motivation.html">Motivation</a>&nbsp;| <a href="throw_exception.html">throw_exception</a></span>
See also: <span class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a>&nbsp;| <a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a>&nbsp;| <a href="tutorial_diagnostic_information.html">Diagnostic Information</a>&nbsp;| <a href="diagnostic_information_what.html">diagnostic_information_what</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="motivation.html">Motivation</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -25,7 +25,7 @@
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> char const * <span class="RenoLink">diagnostic_information_what</span>( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const &amp; e ) throw();</span>
<span class="RenoIncludeSPAN"> char const * <span class="RenoLink">diagnostic_information_what</span>( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const &amp; e, bool verbose=true ) throw();</span>
}</pre>
</div><p>The <span class="RenoLink">diagnostic_information_what</span> function is intended to be called from a user-defined std::exception::what() override. This allows diagnostic information to be returned as the what() string.</p>
<h4>Returns:</h4>

View File

@ -48,7 +48,7 @@ throw boost::<span class="RenoLink">enable_current_exception</span>(my_exception
<h4>Note:</h4>
<p>Instead of using the throw keyword directly, it is preferable to call boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. This is guaranteed to throw an exception that derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> and supports the <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> functionality.</p>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="copy_exception.html">copy_exception</a>&nbsp;| <a href="current_exception.html">current_exception</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads</a>&nbsp;| <a href="throw_exception.html">throw_exception</a></span>
See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="copy_exception.html">copy_exception</a>&nbsp;| <a href="current_exception.html">current_exception</a>&nbsp;| <a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -37,7 +37,7 @@ boost
<h4>Throws:</h4>
<p>Nothing.</p>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
See also: <span class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a>&nbsp;| <a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies</a>&nbsp;| <a href="throw_exception.html">throw_exception</a></span>
See also: <span class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a>&nbsp;| <a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -40,7 +40,7 @@ boost
<p>To retrieve data from a boost::<span class="RenoLink">exception</span> object, use the <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> function template.</p>
</div><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="current_exception.html">current_exception</a>&nbsp;| <a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a>&nbsp;| <a href="tutorial_diagnostic_information.html">Diagnostic Information</a>&nbsp;| <a href="diagnostic_information.html">diagnostic_information</a>&nbsp;| <a href="diagnostic_information_what.html">diagnostic_information_what</a>&nbsp;| <a href="enable_current_exception.html">enable_current_exception</a>&nbsp;| <a href="enable_error_info.html">enable_error_info</a>&nbsp;| <a href="error_info.html">error_info</a>&nbsp;| <a href="exception_ptr.html">exception_ptr</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="get_error_info.html">get_error_info</a>&nbsp;| <a href="motivation.html">Motivation</a>&nbsp;| <a href="tutorial_transporting_data.html">Transporting of Arbitrary Data to the Catch Site</a>&nbsp;| <a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads</a>&nbsp;| <a href="tuple_operator_shl.html">tuple/operator&lt;&lt;</a>&nbsp;| <a href="unknown_exception.html">unknown_exception</a></div>
<div class="RenoPageList"><a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="current_exception.html">current_exception</a>&nbsp;| <a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a>&nbsp;| <a href="tutorial_diagnostic_information.html">Diagnostic Information</a>&nbsp;| <a href="diagnostic_information.html">diagnostic_information</a>&nbsp;| <a href="diagnostic_information_what.html">diagnostic_information_what</a>&nbsp;| <a href="enable_current_exception.html">enable_current_exception</a>&nbsp;| <a href="enable_error_info.html">enable_error_info</a>&nbsp;| <a href="error_info.html">error_info</a>&nbsp;| <a href="exception_ptr.html">exception_ptr</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="get_error_info.html">get_error_info</a>&nbsp;| <a href="motivation.html">Motivation</a>&nbsp;| <a href="tutorial_transporting_data.html">Transporting of Arbitrary Data to the Catch Site</a>&nbsp;| <a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads</a>&nbsp;| <a href="throw_exception.html">throw_exception</a>&nbsp;| <a href="tuple_operator_shl.html">tuple/operator&lt;&lt;</a>&nbsp;| <a href="unknown_exception.html">unknown_exception</a></div>
<!-- Copyright (c) 2006-2009 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) -->

View File

@ -40,7 +40,7 @@ boost
<h4>Nesting of exceptions:</h4>
<p>An <span class="RenoLink">exception_ptr</span> can be added as <span class="RenoLink"><a href="error_info.html">error_info</a></span> to any boost::<span class="RenoLink"><a href="exception.html">exception</a></span>. This is a convenient way to nest exceptions. There is no limit on the depth of the nesting, however cyclic references result in undefined behavior.</p>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_errinfo_nested_exception_hpp.html">boost/exception/errinfo_nested_exception.hpp</a>&nbsp;| <a href="boost_exception_ptr_hpp.html">boost/exception_ptr.hpp</a>&nbsp;| <a href="copy_exception.html">copy_exception</a>&nbsp;| <a href="current_exception.html">current_exception</a>&nbsp;| <a href="diagnostic_information.html">diagnostic_information</a>&nbsp;| <a href="enable_current_exception.html">enable_current_exception</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="original_exception_type.html">original_exception_type</a>&nbsp;| <a href="rethrow_exception.html">rethrow_exception</a>&nbsp;| <a href="unknown_exception.html">unknown_exception</a></span>
See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_errinfo_nested_exception_hpp.html">boost/exception/errinfo_nested_exception.hpp</a>&nbsp;| <a href="boost_exception_ptr_hpp.html">boost/exception_ptr.hpp</a>&nbsp;| <a href="copy_exception.html">copy_exception</a>&nbsp;| <a href="current_exception.html">current_exception</a>&nbsp;| <a href="diagnostic_information.html">diagnostic_information</a>&nbsp;| <a href="enable_current_exception.html">enable_current_exception</a>&nbsp;| <a href="original_exception_type.html">original_exception_type</a>&nbsp;| <a href="rethrow_exception.html">rethrow_exception</a>&nbsp;| <a href="throw_exception.html">throw_exception</a>&nbsp;| <a href="unknown_exception.html">unknown_exception</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -21,9 +21,35 @@
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Frequently Asked Questions</h2>
</div>
<h3>What is the cost of calling boost::throw_exception?</h3>
<p>The cost is that boost::<span class="RenoLink"><a href="exception.html">exception</a></span> is added as a base of the exception emitted by boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> (unless the passed type already derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.)</p>
<p>Calling boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> does not cause dynamic memory allocations.</p>
<h3>What is the cost of BOOST_THROW_EXCEPTION?</h3>
<p>In addition to calling boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>, <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> invokes __FILE__, __LINE__ and the <span class="RenoLink"><a href="configuration_macros.html">BOOST_THROW_EXCEPTION_CURRENT_FUNCTION</a></span> macros. The space required to store the information is already included in sizeof(boost::<span class="RenoLink"><a href="exception.html">exception</a></span>).</p>
<p>Calling <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> does not cause dynamic memory allocations.</p>
<h3>Should I use boost::throw_exception or BOOST_THROW_EXCEPTION or just throw?</h3>
<p>The benefit of calling boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> instead of using throw directly is that it ensures that the emitted exception derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> and that it is compatible with boost::<span class="RenoLink"><a href="current_exception.html">current_exception</a></span>.</p>
<p>The <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> macro also results in a call to boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>, but in addition it records in the exception object the __FILE__ and __LINE__ of the throw, as well as the pretty name of the function that throws. This enables boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> to compose a more useful, if not user-friendly message.</p>
<p>Typical use of boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> is:</p>
<pre>catch(...)
{
std::cerr &lt;&lt;
"Unexpected exception, diagnostic information follows:\n" &lt;&lt;
<span class="RenoLink"><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></span>();
}</pre>
<p>This is a possible message it may display -- the information in the first line is only available if <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> was used to throw:</p>
<pre>example_io.cpp(70): Throw in function class boost::shared_ptr&lt;struct _iobuf&gt; __cdecl my_fopen(const char *,const char *)
Dynamic exception type: class boost::exception_detail::clone_impl&lt;class fopen_error&gt;
std::exception::what: example_io error
[struct boost::<span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>_ *] = fopen
[struct boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>_ *] = 2, "No such file or directory"
[struct boost::<span class="RenoLink"><a href="errinfo_file_name.html">errinfo_file_name</a></span>_ *] = tmp1.txt
[struct boost::<span class="RenoLink"><a href="errinfo_file_open_mode.html">errinfo_file_open_mode</a></span>_ *] = rb</pre>
<p>In some development environments, the first line in that message can be clicked to show the location of the throw in the debugger, so it's easy to set a break point and run again to see the unexpected throw in the context of its call stack.</p>
<h3>Why doesn't boost::exception derive from std::exception?</h3>
<p>Despite that <span class="RenoLink"><a href="using_virtual_inheritance_in_exception_types.html">virtual inheritance should be used in deriving from base exception types</a></span>, many programmers fail to follow this principle when deriving from std::exception. If boost::<span class="RenoLink"><a href="exception.html">exception</a></span> derives from std::exception, using the <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span> function with such user-defined types would introduce dangerous ambiguity which would break all catch(std::exception &amp;) statements.</p>
<p>Of course, boost::<span class="RenoLink"><a href="exception.html">exception</a></span> 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.)</p>
<p>Despite that <span class="RenoLink"><a href="using_virtual_inheritance_in_exception_types.html">virtual inheritance should be used in deriving from base exception types</a></span>, quite often exception types (including the ones defined in the standard library) don't derive from std::exception virtually.</p>
<p>If boost::<span class="RenoLink"><a href="exception.html">exception</a></span> derives from std::exception, using the <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span> function with such user-defined types would introduce dangerous ambiguity which would break all catch(std::exception &amp;) statements.</p>
<p>Of course, boost::<span class="RenoLink"><a href="exception.html">exception</a></span> 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 probably also be derived virtually.)</p>
<h3>Why is boost::exception abstract?</h3>
<p>To prevent exception-neutral contexts from erroneously erasing the type of the original exception when adding <span class="RenoLink"><a href="error_info.html">error_info</a></span> to an active exception object:</p>
<pre>catch( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> &amp; e )
@ -37,55 +63,16 @@
e <span class="RenoLink"><a href="exception_operator_shl.html">&lt;&lt;</a></span> foo_info(foo);
throw; //Okay, re-throwing the original exception object.
}</pre>
<h3>What is the space overhead of the boost::exception base class?</h3>
<p>The space overhead for the boost::exception data members is negligible in the context of exception handling. Throwing objects that derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> does not by itself cause dynamic memory allocations.</p>
<p>Deriving from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> 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.</p>
<h3>Should I use boost::throw_exception or BOOST_THROW_EXCEPTION or just throw?</h3>
<p>The benefit of calling boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> instead of using throw directly is that it ensures that the emitted exception derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> and that it is compatible with boost::<span class="RenoLink"><a href="current_exception.html">current_exception</a></span>.</p>
<p>The <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> macro also results in a call to boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>, but in addition it records in the exception object the __FILE__ and __LINE__ of the throw, as well as the pretty name of the function that throws. This has virtually no overhead, yet enables boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> to compose a more useful, if not user-friendly message.</p>
<p>Typical use of boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> is:</p>
<pre>catch( boost::exception &amp; e )
{
std::cerr &lt;&lt; "OMG!" &lt;&lt; boost::diagnostic_information(e);
}
catch( ... )
{
std::cerr &lt;&lt; "OMG!!!";
}</pre>
<p>This is a possible message it may display, the first line is only possible if <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> is used:</p>
<pre>example_io.cpp(70): Throw in function class boost::shared_ptr&lt;struct _iobuf&gt; __cdecl my_fopen(const char *,const char *)
Dynamic exception type: class boost::exception_detail::clone_impl&lt;class fopen_error&gt;
std::exception::what: example_io error
[struct boost::<span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>_ *] = fopen
[struct boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>_ *] = 2, "No such file or directory"
[struct boost::<span class="RenoLink"><a href="errinfo_file_name.html">errinfo_file_name</a></span>_ *] = tmp1.txt
[struct boost::<span class="RenoLink"><a href="errinfo_file_open_mode.html">errinfo_file_open_mode</a></span>_ *] = rb</pre>
<h3>Why is boost::exception integrated in boost::throw_exception?</h3>
<p>The boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::<span class="RenoLink"><a href="exception.html">exception</a></span> as a base of any exception passed to boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. 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.</p>
<p>The problem is that users of Boost Exception can't by themselves cause a library to throw types that derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, and without this they can't use any of the Boost Exception facilities.</p>
<p>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::<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>, but this requires that Boost Serialization throws exceptions using boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>. If Boost Serialization calls boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> to throw, this behavior happens automatically and transparently.</p>
<p>The cost of this integration is:</p>
<div><ul><li> In terms of space: a pointer and 3 ints are added to the static size of exception objects.</li>
<li> In terms of speed: the pointer is initialized to null at the point of the throw.</li>
<li> In terms of coupling: about 400 self-contained lines of C++ with no external includes.</li>
</ul></div>
<h3>Why use operator&lt;&lt; overload for adding info to exceptions?</h3>
<p>Before throwing an object of type that derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, it is often desirable to add one or more <span class="RenoLink"><a href="error_info.html">error_info</a></span> objects in it. The syntactic sugar provided by <span class="RenoLink"><a href="exception_operator_shl.html">exception/operator&lt;&lt;</a></span> allows this to be done directly in a throw expression:</p>
<p>Before throwing an object of type that derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, it is often desirable to add one or more <span class="RenoLink"><a href="error_info.html">error_info</a></span> objects in it. The syntactic sugar provided by <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span> allows this to be done directly in a throw expression:</p>
<pre>throw error() <span class="RenoLink"><a href="exception_operator_shl.html">&lt;&lt;</a></span> foo_info(foo) <span class="RenoLink"><a href="exception_operator_shl.html">&lt;&lt;</a></span> bar_info(bar);</pre>
<p>which saves typing compared to this possible alternative:</p>
<pre>error e;
e.add(foo_info(foo));
e.add(bar_info(bar));
throw e;</pre>
<p>and looks better than something like:</p>
<pre>throw error().add(foo_info(foo)).add(bar_info(bar));</pre>
<h3>Why is operator&lt;&lt; allowed to throw?</h3>
<p>This question is referring to the following issue. Consider this throw statement example:</p>
<pre>throw file_open_error() <span class="RenoLink"><a href="exception_operator_shl.html">&lt;&lt;</a></span> file_name(fn);</pre>
<p>The intention here is to throw a file_open_error, however if <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span> fails to copy the std::string contained in the file_name <span class="RenoLink"><a href="error_info.html">error_info</a></span> wrapper, a std::bad_alloc could propagate instead. This behavior seems undesirable to some programmers.</p>
<p>Bjarne Stroustrup, The C++ Programming Language, 3rd Edition, page 371:</p>
<blockquote><p><i>"Throwing an exception requires an object to throw. A C++ implementation is required to have enough spare memory to be able to throw bad_alloc in case of memory exhaustion. However, it is possible that throwing some other exception will cause memory exhaustion."</i></p></blockquote>
<p>So, an attempt to throw any exception may already result in propagating std::bad_alloc instead.</p>
<p>Therefore, the language itself does not guarantee that an attempt to throw an exception is guaranteed to throw an object of the specified type; propagating a std::bad_alloc seems to be a possibility even outside of the scope of Boost Exception.</p>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="motivation.html">Motivation</a></span>
</div>

View File

@ -25,10 +25,10 @@
boost
{
<span class="RenoIncludeSPAN"> template &lt;class ErrorInfo,class E&gt;
typename ErrorInfo::<span class="RenoLink"><a href="error_info_value_type.html">error_info::value_type</a></span> const * get_error_info( E const &amp; x );
typename ErrorInfo::<span class="RenoLink"><a href="error_info::value_type">error_info::value_type</a></span> const * <span class="RenoLink"><a href="get_error_info">get_error_info</a></span>( E const &amp; x );
template &lt;class ErrorInfo,class E&gt;
typename ErrorInfo::<span class="RenoLink"><a href="error_info_value_type.html">error_info::value_type</a></span> * get_error_info( E &amp; x );</span>
typename ErrorInfo::<span class="RenoLink"><a href="error_info::value_type">error_info::value_type</a></span> * <span class="RenoLink"><a href="get_error_info">get_error_info</a></span>( E &amp; x );</span>
}</pre>
</div><h4>Requirements:</h4>
<div><ul><li> ErrorInfo must be an instance of the <span class="RenoLink"><a href="error_info.html">error_info</a></span> template.</li>
@ -43,7 +43,7 @@ boost
<h4>Note:</h4>
<p>The interface of <span class="RenoLink">get_error_info</span> may be affected by the build <span class="RenoLink"><a href="configuration_macros.html">configuration macros</a></span>.</p>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
See also: <span class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a>&nbsp;| <a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="current_exception.html">current_exception</a>&nbsp;| <a href="error_info.html">error_info</a>&nbsp;| <a href="exception.html">exception</a>&nbsp;| <a href="motivation.html">Motivation</a>&nbsp;| <a href="throw_exception.html">throw_exception</a></span>
See also: <span class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a>&nbsp;| <a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="current_exception.html">current_exception</a>&nbsp;| <a href="error_info.html">error_info</a>&nbsp;| <a href="exception.html">exception</a>&nbsp;| <a href="motivation.html">Motivation</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,21 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>%s</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 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) -->

View File

@ -0,0 +1,16 @@
<!-- Copyright (c) 2006-2009 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) -->
<div id="footer">
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -103,11 +103,11 @@ boost
<span class="RenoIncludeSPAN"> class <span class="RenoLink"><a href="exception.html">exception</a></span>;</span>
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class E&gt;
std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( E const &amp; e );
std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( E const &amp; e, bool verbose=true );
std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const &amp; p );</span>
std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const &amp; p, bool verbose=true );</span>
<span class="RenoIncludeSPAN">char const * <span class="RenoLink"><a href="diagnostic_information_what.html">diagnostic_information_what</a></span>( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const &amp; e ) throw();</span>
<span class="RenoIncludeSPAN">char const * <span class="RenoLink"><a href="diagnostic_information_what.html">diagnostic_information_what</a></span>( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const &amp; e, bool verbose=true ) throw();</span>
<span class="RenoIncludeSPAN">std::string <span class="RenoLink"><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></span>();</span></span>
}</span></pre>
@ -158,7 +158,7 @@ boost
#include &lt;boost/current_function.hpp&gt;
#define <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(x)\
::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( ::boost::<span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>(x) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_function</a></span>(BOOST_CURRENT_FUNCTION) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_function</a></span>(<span class="RenoLink"><a href="configuration_macros.html">BOOST_THROW_EXCEPTION_CURRENT_FUNCTION</a></span>) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_file</a></span>(__FILE__) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_line</a></span>((int)__LINE__) )
#else

View File

@ -32,14 +32,17 @@ boost
void <span class="RenoLink">throw_exception</span>( E const &amp; e );
#endif</span>
}</pre>
</div><h4>Requirements:</h4>
<p>E must derive publicly from std::exception.</p>
<h4>Effects:</h4>
<div><ul><li> If BOOST_NO_EXCEPTIONS is not defined, boost::<span class="RenoLink">throw_exception</span>(e) is equivalent to throw boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>(boost::<span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::<span class="RenoLink">throw_exception</span>(e) is equivalent to throw e;</li>
</div><h4>Effects:</h4>
<div><ul><li> If BOOST_NO_EXCEPTIONS is not defined, boost::<span class="RenoLink">throw_exception</span>(e) throws an exception of unspecified type that derives publicly from E and from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</li>
<li> If BOOST_NO_EXCEPTIONS is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of <span class="RenoLink">throw_exception</span> are allowed to assume that the function never returns; therefore, if the user-defined <span class="RenoLink">throw_exception</span> returns, the behavior is undefined.</li>
</ul></div>
<h4>Note:</h4>
<p>Under BOOST_NO_EXCEPTIONS, unless BOOST_EXCEPTION_DISABLE is also defined, users can examine the passed exception object using boost::<span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>, or format an automatic diagnostic message using boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>.</p>
<h4>Requirements:</h4>
<p>E must derive publicly from std::exception. E may or may not derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
<h4>Notes:</h4>
<div><ul><li> The emitted exception can be intercepted as E &amp;, std::exception &amp;, or boost::exception &amp;.</li>
<li> The emitted exception supports boost::<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>.</li>
<li> If BOOST_EXCEPTION_DISABLE is defined and BOOST_NO_EXCEPTIONS is not defined, boost::<span class="RenoLink">throw_exception</span>(e) equivalent to throw e.</li>
</ul></div>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
See also: <span class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a>&nbsp;| <a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="enable_current_exception.html">enable_current_exception</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads</a></span>
</div>

View File

@ -0,0 +1,46 @@
//Copyright (c) 2006-2013 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_9011016A11A711E3B46CD9FA6088709B
#define UUID_9011016A11A711E3B46CD9FA6088709B
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
#include <boost/exception/info.hpp>
#include <boost/exception/get_error_info.hpp>
namespace
boost
{
//Here we're using the boost::error_info machinery to store the info in the exception
//object. Within the context of N3757, this is strictly an implementation detail.
template <class Tag>
inline
void
exception::
set( typename Tag::type const & v )
{
exception_detail::set_info(*this,error_info<Tag,typename Tag::type>(v));
}
template <class Tag>
inline
typename Tag::type const *
exception::
get() const
{
return get_error_info<error_info<Tag,typename Tag::type> >(*this);
}
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif

View File

@ -5,7 +5,7 @@
#ifndef UUID_316FDA946C0D11DEA9CBAE5255D89593
#define UUID_316FDA946C0D11DEA9CBAE5255D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)

View File

@ -5,7 +5,7 @@
#ifndef UUID_7E83C166200811DE885E826156D89593
#define UUID_7E83C166200811DE885E826156D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)

View File

@ -1,17 +0,0 @@
//Copyright (c) 2009 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_61531AB0680611DEADD5846855D89593
#define UUID_61531AB0680611DEADD5846855D89593
#if defined(_MSC_VER)
#define BOOST_ATTRIBUTE_NORETURN __declspec(noreturn)
#elif defined(__GNUC__)
#define BOOST_ATTRIBUTE_NORETURN __attribute__((noreturn))
#else
#define BOOST_ATTRIBUTE_NORETURN
#endif
#endif

View File

@ -0,0 +1,56 @@
//Copyright (c) 2006-2013 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_81522C0EB56511DFAB613DB0DFD72085
#define UUID_81522C0EB56511DFAB613DB0DFD72085
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
#ifdef BOOST_NO_EXCEPTIONS
# error This header requires exception handling to be enabled.
#endif
namespace
boost
{
namespace
exception_detail
{
class clone_base;
#ifdef BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR
int clone_current_exception_non_intrusive( clone_base const * & cloned );
#endif
namespace
clone_current_exception_result
{
int const success=0;
int const bad_alloc=1;
int const bad_exception=2;
int const not_supported=3;
}
inline
int
clone_current_exception( clone_base const * & cloned )
{
#ifdef BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR
return clone_current_exception_non_intrusive(cloned);
#else
return clone_current_exception_result::not_supported;
#endif
}
}
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif

View File

@ -5,13 +5,15 @@
#ifndef UUID_CE6983AC753411DDA764247956D89593
#define UUID_CE6983AC753411DDA764247956D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
#include <boost/config.hpp>
#include <utility>
#include <string>
namespace
@ -25,11 +27,11 @@ boost
{
public:
virtual std::string tag_typeid_name() const = 0;
virtual std::string value_as_string() const = 0;
virtual std::string name_value_string() const = 0;
protected:
virtual
~error_info_base() throw()
{
}
@ -41,11 +43,16 @@ boost
error_info:
public exception_detail::error_info_base
{
public:
public:
typedef T value_type;
error_info( value_type const & value );
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
error_info( error_info const & );
error_info( value_type && value ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(value))));
error_info( error_info && x ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(x.value_))));
#endif
~error_info() throw();
value_type const &
@ -60,10 +67,13 @@ boost
return value_;
}
private:
private:
error_info & operator=( error_info const & );
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
error_info & operator=( error_info && x );
#endif
std::string tag_typeid_name() const;
std::string value_as_string() const;
std::string name_value_string() const;
value_type value_;
};

View File

@ -5,7 +5,7 @@
#ifndef UUID_618474C2DE1511DEB74A388C56D89593
#define UUID_618474C2DE1511DEB74A388C56D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
@ -20,18 +20,55 @@
#include <boost/exception/info.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <boost/exception/detail/type_info.hpp>
#include <boost/exception/detail/clone_current_exception.hpp>
#ifndef BOOST_NO_RTTI
#include <boost/core/demangle.hpp>
#endif
#include <boost/shared_ptr.hpp>
#include <stdexcept>
#include <new>
#include <ios>
#include <stdlib.h>
namespace
boost
{
typedef shared_ptr<exception_detail::clone_base const> exception_ptr;
class exception_ptr;
BOOST_NORETURN void rethrow_exception( exception_ptr const & );
exception_ptr current_exception();
class
exception_ptr
{
typedef boost::shared_ptr<exception_detail::clone_base const> impl;
impl ptr_;
friend void rethrow_exception( exception_ptr const & );
typedef exception_detail::clone_base const * (impl::*unspecified_bool_type)() const;
public:
exception_ptr()
{
}
explicit
exception_ptr( impl const & ptr ):
ptr_(ptr)
{
}
bool
operator==( exception_ptr const & other ) const
{
return ptr_==other.ptr_;
}
bool
operator!=( exception_ptr const & other ) const
{
return ptr_!=other.ptr_;
}
operator unspecified_bool_type() const
{
return ptr_?&impl::get:0;
}
};
template <class T>
inline
exception_ptr
@ -55,7 +92,7 @@ boost
std::string
to_string( original_exception_type const & x )
{
return x.value()->name();
return core::demangle(x.value()->name());
}
#endif
@ -67,35 +104,51 @@ boost
boost::exception,
std::bad_alloc
{
~bad_alloc_() throw() { }
};
template <int Dummy>
struct
bad_exception_:
boost::exception,
std::bad_exception
{
~bad_exception_() throw() { }
};
template <class Exception>
exception_ptr
get_bad_alloc()
get_static_exception_object()
{
bad_alloc_ ba;
exception_detail::clone_impl<bad_alloc_> c(ba);
Exception ba;
exception_detail::clone_impl<Exception> c(ba);
#ifndef BOOST_EXCEPTION_DISABLE
c <<
throw_function(BOOST_CURRENT_FUNCTION) <<
throw_file(__FILE__) <<
throw_line(__LINE__);
static exception_ptr ep(new exception_detail::clone_impl<bad_alloc_>(c));
#endif
static exception_ptr ep(shared_ptr<exception_detail::clone_base const>(new exception_detail::clone_impl<Exception>(c)));
return ep;
}
template <int Dummy>
template <class Exception>
struct
exception_ptr_bad_alloc
exception_ptr_static_exception_object
{
static exception_ptr const e;
};
template <int Dummy>
template <class Exception>
exception_ptr const
exception_ptr_bad_alloc<Dummy>::
e = get_bad_alloc<Dummy>();
exception_ptr_static_exception_object<Exception>::
e = get_static_exception_object<Exception>();
}
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility push (default)
# endif
#endif
class
unknown_exception:
public boost::exception,
@ -135,6 +188,11 @@ boost
#endif
}
};
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility pop
# endif
#endif
namespace
exception_detail
@ -244,101 +302,131 @@ boost
exception_ptr
current_exception_impl()
{
try
exception_detail::clone_base const * e=0;
switch(
exception_detail::clone_current_exception(e) )
{
throw;
}
catch(
exception_detail::clone_base & e )
{
return exception_ptr(e.clone());
}
catch(
std::domain_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::invalid_argument & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::length_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::out_of_range & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::logic_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::range_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::overflow_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::underflow_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::ios_base::failure & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::runtime_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::bad_alloc & e )
{
return exception_detail::current_exception_std_exception(e);
}
case exception_detail::clone_current_exception_result::
success:
{
BOOST_ASSERT(e!=0);
return exception_ptr(shared_ptr<exception_detail::clone_base const>(e));
}
case exception_detail::clone_current_exception_result::
bad_alloc:
{
BOOST_ASSERT(!e);
return exception_detail::exception_ptr_static_exception_object<bad_alloc_>::e;
}
case exception_detail::clone_current_exception_result::
bad_exception:
{
BOOST_ASSERT(!e);
return exception_detail::exception_ptr_static_exception_object<bad_exception_>::e;
}
default:
BOOST_ASSERT(0);
case exception_detail::clone_current_exception_result::
not_supported:
{
BOOST_ASSERT(!e);
try
{
throw;
}
catch(
exception_detail::clone_base & e )
{
return exception_ptr(shared_ptr<exception_detail::clone_base const>(e.clone()));
}
catch(
std::domain_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::invalid_argument & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::length_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::out_of_range & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::logic_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::range_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::overflow_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::underflow_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::ios_base::failure & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::runtime_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::bad_alloc & e )
{
return exception_detail::current_exception_std_exception(e);
}
#ifndef BOOST_NO_TYPEID
catch(
std::bad_cast & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::bad_typeid & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::bad_cast & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::bad_typeid & e )
{
return exception_detail::current_exception_std_exception(e);
}
#endif
catch(
std::bad_exception & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::exception & e )
{
return exception_detail::current_exception_unknown_std_exception(e);
}
catch(
boost::exception & e )
{
return exception_detail::current_exception_unknown_boost_exception(e);
}
catch(
... )
{
return exception_detail::current_exception_unknown_exception();
catch(
std::bad_exception & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::exception & e )
{
return exception_detail::current_exception_unknown_std_exception(e);
}
catch(
boost::exception & e )
{
return exception_detail::current_exception_unknown_boost_exception(e);
}
catch(
... )
{
return exception_detail::current_exception_unknown_exception();
}
}
}
}
}
@ -348,7 +436,6 @@ boost
current_exception()
{
exception_ptr ret;
BOOST_ASSERT(!ret);
try
{
ret=exception_detail::current_exception_impl();
@ -356,41 +443,36 @@ boost
catch(
std::bad_alloc & )
{
ret=exception_detail::exception_ptr_bad_alloc<42>::e;
ret=exception_detail::exception_ptr_static_exception_object<exception_detail::bad_alloc_>::e;
}
catch(
... )
{
try
{
ret=exception_detail::current_exception_std_exception(std::bad_exception());
}
catch(
std::bad_alloc & )
{
ret=exception_detail::exception_ptr_bad_alloc<42>::e;
}
catch(
... )
{
BOOST_ASSERT(0);
}
ret=exception_detail::exception_ptr_static_exception_object<exception_detail::bad_exception_>::e;
}
BOOST_ASSERT(ret);
return ret;
}
BOOST_NORETURN
inline
void
rethrow_exception( exception_ptr const & p )
{
BOOST_ASSERT(p);
p->rethrow();
p.ptr_->rethrow();
BOOST_ASSERT(0);
#if defined(UNDER_CE)
// some CE platforms don't define ::abort()
exit(-1);
#else
abort();
#endif
}
inline
std::string
diagnostic_information( exception_ptr const & p )
diagnostic_information( exception_ptr const & p, bool verbose=true )
{
if( p )
try
@ -400,7 +482,7 @@ boost
catch(
... )
{
return current_exception_diagnostic_information();
return current_exception_diagnostic_information(verbose);
}
return "<empty>";
}

View File

@ -5,7 +5,7 @@
#ifndef UUID_898984B4076411DD973EDFA055D89593
#define UUID_898984B4076411DD973EDFA055D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)

View File

@ -5,7 +5,7 @@
#ifndef UUID_6F463AC838DF11DDA3E6909F56D89593
#define UUID_6F463AC838DF11DDA3E6909F56D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)

View File

@ -5,19 +5,17 @@
#ifndef UUID_C3E1741C754311DDB2834CCA55D89593
#define UUID_C3E1741C754311DDB2834CCA55D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
#include <boost/detail/sp_typeinfo.hpp>
#include <boost/core/typeinfo.hpp>
#include <boost/core/demangle.hpp>
#include <boost/current_function.hpp>
#include <boost/config.hpp>
#ifndef BOOST_NO_TYPEID
#include <boost/units/detail/utility.hpp>
#endif
#include <string>
namespace
@ -31,7 +29,7 @@ boost
#ifdef BOOST_NO_TYPEID
return BOOST_CURRENT_FUNCTION;
#else
return units::detail::demangle(typeid(T*).name());
return core::demangle(typeid(T*).name());
#endif
}
@ -43,7 +41,7 @@ boost
#ifdef BOOST_NO_TYPEID
return BOOST_CURRENT_FUNCTION;
#else
return units::detail::demangle(typeid(T).name());
return core::demangle(typeid(T).name());
#endif
}
@ -53,11 +51,11 @@ boost
struct
type_info_
{
detail::sp_typeinfo const & type_;
core::typeinfo const * type_;
explicit
type_info_( detail::sp_typeinfo const & type ):
type_(type)
type_info_( core::typeinfo const & type ):
type_(&type)
{
}
@ -65,13 +63,13 @@ boost
bool
operator<( type_info_ const & a, type_info_ const & b )
{
return 0!=(a.type_.before(b.type_));
return 0!=(a.type_->before(*b.type_));
}
};
}
}
#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_SP_TYPEID(T))
#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_CORE_TYPEID(T))
#ifndef BOOST_NO_RTTI
#define BOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::boost::exception_detail::type_info_(typeid(x))

View File

@ -5,7 +5,7 @@
#ifndef UUID_0552D49838DD11DD90146B8956D89593
#define UUID_0552D49838DD11DD90146B8956D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
@ -14,9 +14,10 @@
#include <boost/config.hpp>
#include <boost/exception/get_error_info.hpp>
#include <boost/exception/info.hpp>
#include <boost/utility/enable_if.hpp>
#ifndef BOOST_NO_RTTI
#include <boost/units/detail/utility.hpp>
#include <boost/core/demangle.hpp>
#endif
#include <exception>
#include <sstream>
@ -30,17 +31,17 @@ boost
namespace
exception_detail
{
std::string diagnostic_information_impl( boost::exception const *, std::exception const *, bool );
std::string diagnostic_information_impl( boost::exception const *, std::exception const *, bool, bool );
}
inline
std::string
current_exception_diagnostic_information()
current_exception_diagnostic_information( bool verbose=true)
{
boost::exception const * be=current_exception_cast<boost::exception const>();
std::exception const * se=current_exception_cast<std::exception const>();
if( be || se )
return exception_detail::diagnostic_information_impl(be,se,true);
return exception_detail::diagnostic_information_impl(be,se,true,verbose);
else
return "No diagnostic information available.";
}
@ -85,24 +86,28 @@ boost
char const *
get_diagnostic_information( exception const & x, char const * header )
{
if( error_info_container * c=x.data_.get() )
#ifndef BOOST_NO_EXCEPTIONS
try
{
try
{
#endif
return c->diagnostic_information(header);
error_info_container * c=x.data_.get();
if( !c )
x.data_.adopt(c=new exception_detail::error_info_container_impl);
char const * di=c->diagnostic_information(header);
BOOST_ASSERT(di!=0);
return di;
#ifndef BOOST_NO_EXCEPTIONS
}
catch(...)
{
}
}
catch(...)
{
return 0;
}
#endif
return 0;
}
inline
std::string
diagnostic_information_impl( boost::exception const * be, std::exception const * se, bool with_what )
diagnostic_information_impl( boost::exception const * be, std::exception const * se, bool with_what, bool verbose )
{
if( !be && !se )
return "Unknown exception.";
@ -120,53 +125,65 @@ boost
return wh;
}
std::ostringstream tmp;
if( be )
if( be && verbose )
{
if( char const * const * f=get_error_info<throw_file>(*be) )
{
tmp << *f;
if( int const * l=get_error_info<throw_line>(*be) )
tmp << '(' << *l << "): ";
}
tmp << "Throw in function ";
if( char const * const * fn=get_error_info<throw_function>(*be) )
tmp << *fn;
char const * const * f=get_error_info<throw_file>(*be);
int const * l=get_error_info<throw_line>(*be);
char const * const * fn=get_error_info<throw_function>(*be);
if( !f && !l && !fn )
tmp << "Throw location unknown (consider using BOOST_THROW_EXCEPTION)\n";
else
tmp << "(unknown)";
tmp << '\n';
{
if( f )
{
tmp << *f;
if( int const * l=get_error_info<throw_line>(*be) )
tmp << '(' << *l << "): ";
}
tmp << "Throw in function ";
if( char const * const * fn=get_error_info<throw_function>(*be) )
tmp << *fn;
else
tmp << "(unknown)";
tmp << '\n';
}
}
#ifndef BOOST_NO_RTTI
tmp << std::string("Dynamic exception type: ") <<
units::detail::demangle((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se))).type_.name()) << '\n';
if ( verbose )
tmp << std::string("Dynamic exception type: ") <<
core::demangle((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se))).type_->name()) << '\n';
#endif
if( with_what && se )
if( with_what && se && verbose )
tmp << "std::exception::what: " << wh << '\n';
if( be )
if( char const * s=exception_detail::get_diagnostic_information(*be,tmp.str().c_str()) )
if( *s )
return s;
return std::string(s);
return tmp.str();
}
}
template <class T>
std::string
diagnostic_information( T const & e )
diagnostic_information( T const & e, bool verbose=true )
{
return exception_detail::diagnostic_information_impl(exception_detail::get_boost_exception(&e),exception_detail::get_std_exception(&e),true);
return exception_detail::diagnostic_information_impl(exception_detail::get_boost_exception(&e),exception_detail::get_std_exception(&e),true,verbose);
}
inline
char const *
diagnostic_information_what( exception const & e ) throw()
diagnostic_information_what( exception const & e, bool verbose=true ) throw()
{
char const * w=0;
#ifndef BOOST_NO_EXCEPTIONS
try
{
#endif
(void) exception_detail::diagnostic_information_impl(&e,0,false);
return exception_detail::get_diagnostic_information(e,0);
(void) exception_detail::diagnostic_information_impl(&e,0,false,verbose);
if( char const * di=exception_detail::get_diagnostic_information(e,0) )
return di;
else
return "Failed to produce boost::diagnostic_information_what()";
#ifndef BOOST_NO_EXCEPTIONS
}
catch(

View File

@ -5,11 +5,12 @@
#ifndef UUID_F0EE17BE6C1211DE87FF459155D89593
#define UUID_F0EE17BE6C1211DE87FF459155D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#pragma warning(disable:4996)
#endif
#include "boost/exception/info.hpp"
@ -33,7 +34,7 @@ boost
{
std::ostringstream tmp;
int v=e.value();
tmp << v << ", \"" << strerror(v) << "\"";
tmp << '[' << error_info_name(e) << "] = " << v << ", \"" << strerror(v) << "\"\n";
return tmp.str();
}
}

View File

@ -9,10 +9,9 @@
namespace
boost
{
namespace exception_detail { class clone_base; };
namespace exception_detail { class clone_base; }
template <class Tag,class T> class error_info;
template <class T> class shared_ptr;
typedef shared_ptr<exception_detail::clone_base const> exception_ptr;
class exception_ptr;
typedef error_info<struct errinfo_nested_exception_,exception_ptr> errinfo_nested_exception;
}

View File

@ -3,4 +3,7 @@
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_EE7ECCA0433B11E1923E37064924019B
#define UUID_EE7ECCA0433B11E1923E37064924019B
namespace boost { template <class Tag,class T> class error_info; }
#endif

View File

@ -1,436 +0,0 @@
//Copyright (c) 2006-2009 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_274DA366004E11DCB1DDFE2E56D89593
#define UUID_274DA366004E11DCB1DDFE2E56D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
namespace
boost
{
namespace
exception_detail
{
template <class T>
class
refcount_ptr
{
public:
refcount_ptr():
px_(0)
{
}
~refcount_ptr()
{
release();
}
refcount_ptr( refcount_ptr const & x ):
px_(x.px_)
{
add_ref();
}
refcount_ptr &
operator=( refcount_ptr const & x )
{
adopt(x.px_);
return *this;
}
void
adopt( T * px )
{
release();
px_=px;
add_ref();
}
T *
get() const
{
return px_;
}
private:
T * px_;
void
add_ref()
{
if( px_ )
px_->add_ref();
}
void
release()
{
if( px_ && px_->release() )
px_=0;
}
};
}
////////////////////////////////////////////////////////////////////////
template <class Tag,class T>
class error_info;
typedef error_info<struct throw_function_,char const *> throw_function;
typedef error_info<struct throw_file_,char const *> throw_file;
typedef error_info<struct throw_line_,int> throw_line;
template <>
class
error_info<throw_function_,char const *>
{
public:
typedef char const * value_type;
value_type v_;
explicit
error_info( value_type v ):
v_(v)
{
}
};
template <>
class
error_info<throw_file_,char const *>
{
public:
typedef char const * value_type;
value_type v_;
explicit
error_info( value_type v ):
v_(v)
{
}
};
template <>
class
error_info<throw_line_,int>
{
public:
typedef int value_type;
value_type v_;
explicit
error_info( value_type v ):
v_(v)
{
}
};
class exception;
template <class T>
class shared_ptr;
namespace
exception_detail
{
class error_info_base;
struct type_info_;
struct
error_info_container
{
virtual char const * diagnostic_information( char const * ) const = 0;
virtual shared_ptr<error_info_base> get( type_info_ const & ) const = 0;
virtual void set( shared_ptr<error_info_base> const &, type_info_ const & ) = 0;
virtual void add_ref() const = 0;
virtual bool release() const = 0;
virtual refcount_ptr<exception_detail::error_info_container> clone() const = 0;
protected:
~error_info_container() throw()
{
}
};
template <class>
struct get_info;
template <>
struct get_info<throw_function>;
template <>
struct get_info<throw_file>;
template <>
struct get_info<throw_line>;
char const * get_diagnostic_information( exception const &, char const * );
void copy_boost_exception( exception *, exception const * );
template <class E,class Tag,class T>
E const & set_info( E const &, error_info<Tag,T> const & );
template <class E>
E const & set_info( E const &, throw_function const & );
template <class E>
E const & set_info( E const &, throw_file const & );
template <class E>
E const & set_info( E const &, throw_line const & );
}
class
exception
{
protected:
exception():
throw_function_(0),
throw_file_(0),
throw_line_(-1)
{
}
#ifdef __HP_aCC
//On HP aCC, this protected copy constructor prevents throwing boost::exception.
//On all other platforms, the same effect is achieved by the pure virtual destructor.
exception( exception const & x ) throw():
data_(x.data_),
throw_function_(x.throw_function_),
throw_file_(x.throw_file_),
throw_line_(x.throw_line_)
{
}
#endif
virtual ~exception() throw()
#ifndef __HP_aCC
= 0 //Workaround for HP aCC, =0 incorrectly leads to link errors.
#endif
;
#if (defined(__MWERKS__) && __MWERKS__<=0x3207) || (defined(_MSC_VER) && _MSC_VER<=1310)
public:
#else
private:
template <class E>
friend E const & exception_detail::set_info( E const &, throw_function const & );
template <class E>
friend E const & exception_detail::set_info( E const &, throw_file const & );
template <class E>
friend E const & exception_detail::set_info( E const &, throw_line const & );
template <class E,class Tag,class T>
friend E const & exception_detail::set_info( E const &, error_info<Tag,T> const & );
friend char const * exception_detail::get_diagnostic_information( exception const &, char const * );
template <class>
friend struct exception_detail::get_info;
friend struct exception_detail::get_info<throw_function>;
friend struct exception_detail::get_info<throw_file>;
friend struct exception_detail::get_info<throw_line>;
friend void exception_detail::copy_boost_exception( exception *, exception const * );
#endif
mutable exception_detail::refcount_ptr<exception_detail::error_info_container> data_;
mutable char const * throw_function_;
mutable char const * throw_file_;
mutable int throw_line_;
};
inline
exception::
~exception() throw()
{
}
namespace
exception_detail
{
template <class E>
E const &
set_info( E const & x, throw_function const & y )
{
x.throw_function_=y.v_;
return x;
}
template <class E>
E const &
set_info( E const & x, throw_file const & y )
{
x.throw_file_=y.v_;
return x;
}
template <class E>
E const &
set_info( E const & x, throw_line const & y )
{
x.throw_line_=y.v_;
return x;
}
}
////////////////////////////////////////////////////////////////////////
namespace
exception_detail
{
template <class T>
struct
error_info_injector:
public T,
public exception
{
explicit
error_info_injector( T const & x ):
T(x)
{
}
~error_info_injector() throw()
{
}
};
struct large_size { char c[256]; };
large_size dispatch_boost_exception( exception const * );
struct small_size { };
small_size dispatch_boost_exception( void const * );
template <class,int>
struct enable_error_info_helper;
template <class T>
struct
enable_error_info_helper<T,sizeof(large_size)>
{
typedef T type;
};
template <class T>
struct
enable_error_info_helper<T,sizeof(small_size)>
{
typedef error_info_injector<T> type;
};
template <class T>
struct
enable_error_info_return_type
{
typedef typename enable_error_info_helper<T,sizeof(exception_detail::dispatch_boost_exception((T*)0))>::type type;
};
}
template <class T>
inline
typename
exception_detail::enable_error_info_return_type<T>::type
enable_error_info( T const & x )
{
typedef typename exception_detail::enable_error_info_return_type<T>::type rt;
return rt(x);
}
////////////////////////////////////////////////////////////////////////
namespace
exception_detail
{
class
clone_base
{
public:
virtual clone_base const * clone() const = 0;
virtual void rethrow() const = 0;
virtual
~clone_base() throw()
{
}
};
inline
void
copy_boost_exception( exception * a, exception const * b )
{
refcount_ptr<error_info_container> data;
if( error_info_container * d=b->data_.get() )
data = d->clone();
a->throw_file_ = b->throw_file_;
a->throw_line_ = b->throw_line_;
a->throw_function_ = b->throw_function_;
a->data_ = data;
}
inline
void
copy_boost_exception( void *, void const * )
{
}
template <class T>
class
clone_impl:
public T,
public clone_base
{
public:
explicit
clone_impl( T const & x ):
T(x)
{
copy_boost_exception(this,&x);
}
~clone_impl() throw()
{
}
private:
clone_base const *
clone() const
{
return new clone_impl(*this);
}
void
rethrow() const
{
throw*this;
}
};
}
template <class T>
inline
exception_detail::clone_impl<T>
enable_current_exception( T const & x )
{
return exception_detail::clone_impl<T>(x);
}
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif

View File

@ -5,7 +5,7 @@
#ifndef UUID_1A590226753311DD9E4CCF6156D89593
#define UUID_1A590226753311DD9E4CCF6156D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)

View File

@ -5,7 +5,7 @@
#ifndef UUID_8D22C4CA9CC811DCAA9133D256D89593
#define UUID_8D22C4CA9CC811DCAA9133D256D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
@ -24,10 +24,18 @@ boost
{
template <class Tag,class T>
inline
typename enable_if<has_to_string<T>,std::string>::type
std::string
error_info_name( error_info<Tag,T> const & x )
{
return tag_type_name<Tag>();
}
template <class Tag,class T>
inline
std::string
to_string( error_info<Tag,T> const & x )
{
return to_string(x.value());
return '[' + error_info_name(x) + "] = " + to_string_stub(x.value()) + '\n';
}
template <class Tag,class T>
@ -38,6 +46,30 @@ boost
{
}
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template <class Tag,class T>
inline
error_info<Tag,T>::
error_info( error_info const & x ):
value_(x.value_)
{
}
template <class Tag,class T>
inline
error_info<Tag,T>::
error_info( value_type && value ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(value)))):
value_(std::move(value))
{
}
template <class Tag,class T>
inline
error_info<Tag,T>::
error_info( error_info && x ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(x.value_)))):
value_(std::move(x.value_))
{
}
#endif
template <class Tag,class T>
inline
error_info<Tag,T>::
@ -49,16 +81,7 @@ boost
inline
std::string
error_info<Tag,T>::
tag_typeid_name() const
{
return tag_type_name<Tag>();
}
template <class Tag,class T>
inline
std::string
error_info<Tag,T>::
value_as_string() const
name_value_string() const
{
return to_string_stub(*this);
}
@ -97,7 +120,7 @@ boost
{
shared_ptr<error_info_base> const & p = i->second;
#ifndef BOOST_NO_RTTI
BOOST_ASSERT( BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==ti.type_ );
BOOST_ASSERT( *BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==*ti.type_ );
#endif
return p;
}
@ -109,13 +132,12 @@ boost
{
if( header )
{
BOOST_ASSERT(*header!=0);
std::ostringstream tmp;
tmp << header;
for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i )
{
error_info_base const & x = *i->second;
tmp << '[' << x.tag_typeid_name() << "] = " << x.value_as_string() << '\n';
tmp << x.name_value_string();
}
tmp.str().swap(diagnostic_info_str_);
}
@ -177,6 +199,85 @@ boost
return x;
}
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template <class E,class Tag,class T>
E const & set_info( E const &, error_info<Tag,T> && );
template <class T>
class set_info_rv;
template <class Tag,class T>
class
set_info_rv<error_info<Tag,T> >
{
template <class E,class Tag1,class T1>
friend E const & set_info( E const &, error_info<Tag1,T1> && );
template <class E>
static
E const &
set( E const & x, error_info<Tag,T> && v )
{
typedef error_info<Tag,T> error_info_tag_t;
shared_ptr<error_info_tag_t> p( new error_info_tag_t(std::move(v)) );
exception_detail::error_info_container * c=x.data_.get();
if( !c )
x.data_.adopt(c=new exception_detail::error_info_container_impl);
c->set(p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t));
return x;
}
};
template <>
class
set_info_rv<throw_function>
{
template <class E,class Tag1,class T1>
friend E const & set_info( E const &, error_info<Tag1,T1> && );
template <class E>
static
E const &
set( E const & x, throw_function && y )
{
x.throw_function_=y.v_;
return x;
}
};
template <>
class
set_info_rv<throw_file>
{
template <class E,class Tag1,class T1>
friend E const & set_info( E const &, error_info<Tag1,T1> && );
template <class E>
static
E const &
set( E const & x, throw_file && y )
{
x.throw_file_=y.v_;
return x;
}
};
template <>
class
set_info_rv<throw_line>
{
template <class E,class Tag1,class T1>
friend E const & set_info( E const &, error_info<Tag1,T1> && );
template <class E>
static
E const &
set( E const & x, throw_line && y )
{
x.throw_line_=y.v_;
return x;
}
};
template <class E,class Tag,class T>
inline
E const &
set_info( E const & x, error_info<Tag,T> && v )
{
return set_info_rv<error_info<Tag,T> >::template set<E>(x,std::move(v));
}
#endif
template <class T>
struct
derives_boost_exception
@ -192,6 +293,16 @@ boost
{
return exception_detail::set_info(x,v);
}
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template <class E,class Tag,class T>
inline
typename enable_if<exception_detail::derives_boost_exception<E>,E const &>::type
operator<<( E const & x, error_info<Tag,T> && v )
{
return exception_detail::set_info(x,std::move(v));
}
#endif
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)

View File

@ -5,7 +5,7 @@
#ifndef UUID_63EE924290FB11DC87BB856555D89593
#define UUID_63EE924290FB11DC87BB856555D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
@ -18,6 +18,30 @@
namespace
boost
{
template <
class E >
inline
E const &
operator<<(
E const & x,
tuple< > const & v )
{
return x;
}
template <
class E,
class Tag1,class T1 >
inline
E const &
operator<<(
E const & x,
tuple<
error_info<Tag1,T1> > const & v )
{
return x << v.template get<0>();
}
template <
class E,
class Tag1,class T1,

View File

@ -5,7 +5,7 @@
#ifndef UUID_7E48761AD92811DC9011477D56D89593
#define UUID_7E48761AD92811DC9011477D56D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
@ -19,11 +19,16 @@
namespace
boost
{
template <class T,class U>
std::string to_string( std::pair<T,U> const & );
std::string to_string( std::exception const & );
namespace
to_string_detail
{
template <class T>
typename disable_if<is_output_streamable<T>,char>::type to_string( T const & );
using boost::to_string;
template <class,bool IsOutputStreamable>
struct has_to_string_impl;

View File

@ -5,7 +5,7 @@
#ifndef UUID_E788439ED9F011DCB181F25B55D89593
#define UUID_E788439ED9F011DCB181F25B55D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
@ -101,6 +101,14 @@ boost
{
return exception_detail::to_string_dispatch::dispatch(x,s);
}
template <class T,class U,class Stub>
inline
std::string
to_string_stub( std::pair<T,U> const & x, Stub s )
{
return std::string("(") + to_string_stub(x.first,s) + ',' + to_string_stub(x.second,s) + ')';
}
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)

View File

@ -1,91 +0,0 @@
#ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED
#define BOOST_THROW_EXCEPTION_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
//
// boost/throw_exception.hpp
//
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2008-2009 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)
//
// http://www.boost.org/libs/utility/throw_exception.html
//
#include <boost/exception/detail/attribute_noreturn.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/config.hpp>
#include <exception>
#if !defined( BOOST_EXCEPTION_DISABLE ) && defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x593) )
# define BOOST_EXCEPTION_DISABLE
#endif
#if !defined( BOOST_EXCEPTION_DISABLE ) && defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1310 )
# define BOOST_EXCEPTION_DISABLE
#endif
#if !defined( BOOST_EXCEPTION_DISABLE )
# include <boost/exception/exception.hpp>
# include <boost/current_function.hpp>
# define BOOST_THROW_EXCEPTION(x) ::boost::exception_detail::throw_exception_(x,BOOST_CURRENT_FUNCTION,__FILE__,__LINE__)
#else
# define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x)
#endif
namespace boost
{
#ifdef BOOST_NO_EXCEPTIONS
void throw_exception( std::exception const & e ); // user defined
#else
inline void throw_exception_assert_compatibility( std::exception const & ) { }
template<class E> BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const & e )
{
//All boost exceptions are required to derive from std::exception,
//to ensure compatibility with BOOST_NO_EXCEPTIONS.
throw_exception_assert_compatibility(e);
#ifndef BOOST_EXCEPTION_DISABLE
throw enable_current_exception(enable_error_info(e));
#else
throw e;
#endif
}
#endif
#if !defined( BOOST_EXCEPTION_DISABLE )
namespace
exception_detail
{
template <class E>
BOOST_ATTRIBUTE_NORETURN
void
throw_exception_( E const & x, char const * current_function, char const * file, int line )
{
boost::throw_exception(
set_info(
set_info(
set_info(
boost::enable_error_info(x),
throw_function(current_function)),
throw_file(file)),
throw_line(line)));
}
}
#endif
} // namespace boost
#endif // #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED

15
meta/libraries.json Normal file
View File

@ -0,0 +1,15 @@
{
"key": "exception",
"name": "Exception",
"authors": [
"Emil Dotchevski"
],
"description": "The Boost Exception library supports transporting of arbitrary data in exception objects, and transporting of exceptions between threads.",
"documentation": "doc/boost-exception.html",
"category": [
"Emulation"
],
"maintainers": [
"Emil Dotchevski <emil -at- revergestudios.com>"
]
}

View File

@ -0,0 +1,320 @@
//Copyright (c) 2006-2009 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)
//This MSVC-specific cpp file implements non-intrusive cloning of exception objects.
//Based on an exception_ptr implementation by Anthony Williams.
#ifdef BOOST_NO_EXCEPTIONS
#error This file requires exception handling to be enabled.
#endif
#include <boost/exception/detail/clone_current_exception.hpp>
#if defined(BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR) && defined(_MSC_VER) && defined(_M_IX86) && !defined(_M_X64)
//Non-intrusive cloning support implemented below, only for MSVC versions mentioned above.
//Thanks Anthony Williams!
#include <boost/exception/exception.hpp>
#include <boost/shared_ptr.hpp>
#ifndef BOOST_NO_RTTI
#include <typeinfo>
#endif
#include <windows.h>
#include <malloc.h>
namespace
{
unsigned const exception_maximum_parameters=15;
unsigned const exception_noncontinuable=1;
#if _MSC_VER==1310
int const exception_info_offset=0x74;
#elif (_MSC_VER==1400 || _MSC_VER==1500)
int const exception_info_offset=0x80;
#else
int const exception_info_offset=-1;
#endif
struct
exception_record
{
unsigned long ExceptionCode;
unsigned long ExceptionFlags;
exception_record * ExceptionRecord;
void * ExceptionAddress;
unsigned long NumberParameters;
ULONG_PTR ExceptionInformation[exception_maximum_parameters];
};
struct
exception_pointers
{
exception_record * ExceptionRecord;
void * ContextRecord;
};
unsigned const cpp_exception_code=0xE06D7363;
unsigned const cpp_exception_magic_flag=0x19930520;
unsigned const cpp_exception_parameter_count=3;
struct
dummy_exception_type
{
};
typedef int(dummy_exception_type::*normal_copy_constructor_ptr)(void * src);
typedef int(dummy_exception_type::*copy_constructor_with_virtual_base_ptr)(void * src,void * dst);
typedef void (dummy_exception_type::*destructor_ptr)();
union
cpp_copy_constructor
{
normal_copy_constructor_ptr normal_copy_constructor;
copy_constructor_with_virtual_base_ptr copy_constructor_with_virtual_base;
};
enum
cpp_type_flags
{
class_is_simple_type=1,
class_has_virtual_base=4
};
struct
cpp_type_info
{
unsigned flags;
#ifndef BOOST_NO_RTTI
void const * type_info;
#else
std::type_info * type_info;
#endif
int this_offset;
int vbase_descr;
int vbase_offset;
unsigned long size;
cpp_copy_constructor copy_constructor;
};
struct
cpp_type_info_table
{
unsigned count;
const cpp_type_info * info[1];
};
struct
cpp_exception_type
{
unsigned flags;
destructor_ptr destructor;
void(*custom_handler)();
cpp_type_info_table const * type_info_table;
};
struct
exception_object_deleter
{
cpp_exception_type const & et_;
exception_object_deleter( cpp_exception_type const & et ):
et_(et)
{
}
void
operator()( void * obj )
{
BOOST_ASSERT(obj!=0);
dummy_exception_type * dummy_exception_ptr=reinterpret_cast<dummy_exception_type *>(obj);
(dummy_exception_ptr->*(et_.destructor))();
free(obj);
}
};
cpp_type_info const &
get_cpp_type_info( cpp_exception_type const & et )
{
cpp_type_info const * ti = et.type_info_table->info[0];
BOOST_ASSERT(ti!=0);
return *ti;
}
void
copy_msvc_exception( void * dst, void * src, cpp_type_info const & ti )
{
if( !(ti.flags & class_is_simple_type) && ti.copy_constructor.normal_copy_constructor )
{
dummy_exception_type * dummy_exception_ptr = reinterpret_cast<dummy_exception_type *>(dst);
if( ti.flags & class_has_virtual_base )
(dummy_exception_ptr->*(ti.copy_constructor.copy_constructor_with_virtual_base))(src,dst);
else
(dummy_exception_ptr->*(ti.copy_constructor.normal_copy_constructor))(src);
}
else
memmove(dst,src,ti.size);
}
boost::shared_ptr<void>
clone_msvc_exception( void * src, cpp_exception_type const & et )
{
assert(src!=0);
cpp_type_info const & ti=get_cpp_type_info(et);
if( void * dst = malloc(ti.size) )
{
try
{
copy_msvc_exception(dst,src,ti);
}
catch(
... )
{
free(dst);
throw;
}
return boost::shared_ptr<void>(dst,exception_object_deleter(et));
}
else
throw std::bad_alloc();
}
class
cloned_exception:
public boost::exception_detail::clone_base
{
cloned_exception( cloned_exception const & );
cloned_exception & operator=( cloned_exception const & );
cpp_exception_type const & et_;
boost::shared_ptr<void> exc_;
public:
cloned_exception( void * exc, cpp_exception_type const & et ):
et_(et),
exc_(clone_msvc_exception(exc,et_))
{
}
~cloned_exception() throw()
{
}
boost::exception_detail::clone_base const *
clone() const
{
return new cloned_exception(exc_.get(),et_);
}
void
rethrow() const
{
cpp_type_info const & ti=get_cpp_type_info(et_);
void * dst = _alloca(ti.size);
copy_msvc_exception(dst,exc_.get(),ti);
ULONG_PTR args[cpp_exception_parameter_count];
args[0]=cpp_exception_magic_flag;
args[1]=reinterpret_cast<ULONG_PTR>(dst);
args[2]=reinterpret_cast<ULONG_PTR>(&et_);
RaiseException(cpp_exception_code,EXCEPTION_NONCONTINUABLE,cpp_exception_parameter_count,args);
}
};
bool
is_cpp_exception( EXCEPTION_RECORD const * record )
{
return record &&
(record->ExceptionCode==cpp_exception_code) &&
(record->NumberParameters==cpp_exception_parameter_count) &&
(record->ExceptionInformation[0]==cpp_exception_magic_flag);
}
unsigned long
exception_cloning_filter( int & result, boost::exception_detail::clone_base const * & ptr, void * info_ )
{
BOOST_ASSERT(exception_info_offset>=0);
BOOST_ASSERT(info_!=0);
EXCEPTION_POINTERS * info=reinterpret_cast<EXCEPTION_POINTERS *>(info_);
EXCEPTION_RECORD * record=info->ExceptionRecord;
if( is_cpp_exception(record) )
{
if( !record->ExceptionInformation[2] )
record = *reinterpret_cast<EXCEPTION_RECORD * *>(reinterpret_cast<char *>(_errno())+exception_info_offset);
if( is_cpp_exception(record) && record->ExceptionInformation[2] )
try
{
ptr = new cloned_exception(
reinterpret_cast<void *>(record->ExceptionInformation[1]),
*reinterpret_cast<cpp_exception_type const *>(record->ExceptionInformation[2]));
result = boost::exception_detail::clone_current_exception_result::success;
}
catch(
std::bad_alloc & )
{
result = boost::exception_detail::clone_current_exception_result::bad_alloc;
}
catch(
... )
{
result = boost::exception_detail::clone_current_exception_result::bad_exception;
}
}
return EXCEPTION_EXECUTE_HANDLER;
}
}
namespace
boost
{
namespace
exception_detail
{
int
clone_current_exception_non_intrusive( clone_base const * & cloned )
{
BOOST_ASSERT(!cloned);
int result = clone_current_exception_result::not_supported;
if( exception_info_offset>=0 )
{
clone_base const * ptr=0;
__try
{
throw;
}
__except(exception_cloning_filter(result,ptr,GetExceptionInformation()))
{
}
if( result==clone_current_exception_result::success )
cloned=ptr;
}
BOOST_ASSERT(result!=clone_current_exception_result::success || cloned);
return result;
}
}
}
#else
//On all other compilers, return clone_current_exception_result::not_supported.
//On such platforms, only the intrusive enable_current_exception() cloning will work.
#include <boost/config.hpp>
namespace
boost
{
namespace
exception_detail
{
int
clone_current_exception_non_intrusive( clone_base const * & )
{
return clone_current_exception_result::not_supported;
}
}
}
#endif

View File

@ -1,13 +1,17 @@
# Boost Exception Library test Jamfile
#
# Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
# Copyright (c) 2006-2013 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)
import testing ;
project : requirements <exception-handling>on ;
project
: requirements
<link>static
<exception-handling>on
;
#to_string
@ -24,19 +28,25 @@ run 2-throw_exception_no_exceptions_test.cpp ;
run 3-throw_exception_no_integration_test.cpp ;
run 4-throw_exception_no_both_test.cpp ;
run cloning_test.cpp ;
run copy_exception_test.cpp /boost//thread : : : <threading>multi ;
run copy_exception_test.cpp ../../thread/src/tss_null.cpp /boost//thread : : : <threading>multi ;
run unknown_exception_test.cpp ;
run exception_test.cpp ;
run enable_error_info_test.cpp helper1.cpp ;
run throw_exception_test.cpp helper2.cpp ;
run errno_test.cpp ;
run error_info_test.cpp ;
run error_info_lv_test.cpp ;
run error_info_lv_const_test.cpp ;
run error_info_rv_test.cpp ;
run error_info_rv_const_test.cpp ;
run diagnostic_information_test.cpp ;
run refcount_ptr_test.cpp ;
run current_exception_cast_test.cpp ;
run no_exceptions_test.cpp : : : <exception-handling>off ;
run errinfos_test.cpp ;
run exception_ptr_test.cpp /boost//thread : : : <threading>multi ;
run exception_ptr_test.cpp/<define>BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR ../../thread/src/tss_null.cpp /boost/exception /boost//thread : : : <threading>multi : non_intrusive_exception_ptr_test ;
run exception_ptr_test.cpp ../../thread/src/tss_null.cpp /boost//thread : : : <threading>multi ;
run N3757_test.cpp ;
compile-fail exception_fail.cpp ;
compile-fail throw_exception_fail.cpp ;
compile-fail error_info_const_fail.cpp ;

67
test/N3757_test.cpp Normal file
View File

@ -0,0 +1,67 @@
//Copyright (c) 2006-2013 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)
//This file tests the N3757 syntax for adding error info to std::exception, which is
//different from the syntax used by Boost Exception.
#include <boost/exception/N3757.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <ostream>
struct tag1 { typedef int type; };
struct tag2 { typedef std::string type; };
struct tag3 { typedef int type; };
struct my_error_code { int ec; my_error_code(int ec):ec(ec){ } };
struct tag_error_code { typedef my_error_code type; };
bool my_error_code_to_string_called=false;
std::ostream &
operator<<( std::ostream & s, my_error_code const & x )
{
my_error_code_to_string_called=true;
return s << "my_error_code(" << x.ec << ')';
}
struct my_exception: virtual std::exception, virtual boost::exception { };
int
main()
{
try
{
throw my_exception();
}
catch(
boost::exception & e )
{
e.set<tag1>(42);
e.set<tag2>("42");
e.set<tag_error_code>(42); //Implicit conversion
try
{
throw;
}
catch(
my_exception & e )
{
BOOST_TEST(e.get<tag1>() && *e.get<tag1>()==42);
BOOST_TEST(e.get<tag2>() && *e.get<tag2>()=="42");
BOOST_TEST(!e.get<tag3>());
BOOST_TEST(e.get<tag_error_code>() && e.get<tag_error_code>()->ec==42);
//Below we're verifying that an error code wrapped in a user-defined type
//invokes the correct op<< to convert the error code to string.
//Note that N3757 diagnostic_information uses different syntax, it is a
//member of of std::exception.
std::string di=boost::diagnostic_information(e);
BOOST_TEST(!di.empty());
BOOST_TEST(my_error_code_to_string_called);
}
}
return boost::report_errors();
}

View File

@ -143,9 +143,15 @@ test_std_exception()
#ifndef BOOST_NO_RTTI
std::type_info const * const * t=boost::get_error_info<boost::original_exception_type>(x);
BOOST_TEST(t!=0 && *t!=0 && **t==typeid(T));
std::string s=diagnostic_information(x);
BOOST_TEST(!s.empty());
#endif
}
catch(
T & )
{
}
catch(
... )
{
BOOST_TEST(false);
@ -176,7 +182,7 @@ test_std_exception_what()
catch(
T & x )
{
BOOST_TEST(std::string("what")==x.what());
BOOST_TEST(std::string(x.what()).find("what")!=std::string::npos);
boost::exception_ptr p = boost::current_exception();
BOOST_TEST(!(p==boost::exception_ptr()));
BOOST_TEST(p!=boost::exception_ptr());
@ -189,7 +195,7 @@ test_std_exception_what()
catch(
T & x )
{
BOOST_TEST(std::string("what")==x.what());
BOOST_TEST(std::string(x.what()).find("what")!=std::string::npos);
}
catch(
... )
@ -216,6 +222,10 @@ test_std_exception_what()
#endif
}
catch(
T & )
{
}
catch(
... )
{
BOOST_TEST(false);
@ -385,6 +395,11 @@ main()
BOOST_TEST(false);
}
catch(
derives_std_exception & )
{
//Yay! Non-intrusive cloning supported!
}
catch(
boost::unknown_exception & e )
{
#ifndef BOOST_NO_RTTI
@ -434,6 +449,14 @@ main()
BOOST_TEST(false);
}
catch(
derives_std_boost_exception & x )
{
//Yay! Non-intrusive cloning supported!
BOOST_TEST(boost::get_error_info<my_info>(x));
if( int const * p=boost::get_error_info<my_info>(x) )
BOOST_TEST(*p==42);
}
catch(
boost::unknown_exception & x )
{
BOOST_TEST(boost::get_error_info<my_info>(x));
@ -495,6 +518,14 @@ main()
BOOST_TEST(false);
}
catch(
derives_boost_exception & x )
{
//Yay! Non-intrusive cloning supported!
BOOST_TEST(boost::get_error_info<my_info>(x));
if( int const * p=boost::get_error_info<my_info>(x) )
BOOST_TEST(*p==42);
}
catch(
boost::unknown_exception & x )
{
BOOST_TEST(boost::get_error_info<my_info>(x));

View File

@ -6,15 +6,37 @@
#include <boost/exception_ptr.hpp>
#include <boost/exception/get_error_info.hpp>
#include <boost/thread.hpp>
#include <boost/detail/atomic_count.hpp>
#include <boost/detail/lightweight_test.hpp>
typedef boost::error_info<struct tag_answer,int> answer;
boost::detail::atomic_count exc_count(0);
struct
err:
virtual boost::exception,
virtual std::exception
{
err()
{
++exc_count;
}
err( err const & )
{
++exc_count;
}
virtual
~err() throw()
{
--exc_count;
}
private:
err & operator=( err const & );
};
class
@ -116,7 +138,9 @@ simple_test()
int
main()
{
BOOST_TEST(++exc_count==1);
simple_test();
thread_test();
BOOST_TEST(!--exc_count);
return boost::report_errors();
}

View File

@ -19,10 +19,7 @@ typedef boost::error_info<struct test_tag2,int> tagged_int2;
std::string
to_string( tagged_int2 const & x )
{
if( x.value()==42 )
return "fourty-two";
else
return "bad value";
return '[' +boost::error_info_name(x) + "] = " + (x.value()==42 ? "fourty-two" : "bad value");
}
struct
@ -200,6 +197,17 @@ main()
std::string di=current_exception_diagnostic_information();
test3(di);
}
try
{
throw error4();
}
catch(
error4 & x )
{
std::string di1=boost::diagnostic_information(x);
std::string wh1=x.what();
BOOST_TEST(wh1==di1);
}
try
{
error4 x; x << tagged_int1(42) << tagged_int2(42);

View File

@ -0,0 +1,13 @@
//Copyright (c) 2006-2015 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)
#include "boost/exception/info.hpp"
template <class E,class I>
E const &
add_info( E const & e, I const & i )
{
return e << i;
}
#include "error_info_test.hpp"

View File

@ -0,0 +1,13 @@
//Copyright (c) 2006-2015 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)
#include "boost/exception/info.hpp"
template <class E,class I>
E const &
add_info( E const & e, I i )
{
return e << i;
}
#include "error_info_test.hpp"

View File

@ -0,0 +1,28 @@
//Copyright (c) 2006-2015 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)
#include "boost/exception/info.hpp"
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
int
main()
{
return 0;
}
#else
template <class I>
I const
rv_const( I i )
{
return i;
}
template <class E,class I>
E const &
add_info( E const & e, I i )
{
return e << rv_const(i);
}
#include "error_info_test.hpp"
#endif

View File

@ -0,0 +1,22 @@
//Copyright (c) 2006-2015 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)
#include "boost/exception/info.hpp"
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
int
main()
{
return 0;
}
#else
template <class E,class I>
E const &
add_info( E const & e, I i )
{
return e << std::move(i);
}
#include "error_info_test.hpp"
#endif

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Copyright (c) 2006-2015 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)
@ -69,7 +69,7 @@ basic_test()
try
{
test_exception x;
x << test_1(1) << test_2(2u) << test_3(3.14159f);
add_info(add_info(add_info(x,test_1(1)),test_2(2u)),test_3(3.14159f));
throw x;
}
catch(
@ -86,7 +86,7 @@ basic_test()
try
{
test_exception x;
x << test_1(1) << test_2(2u) << test_3(3.14159f);
add_info(add_info(add_info(x,test_1(1)),test_2(2u)),test_3(3.14159f));
throw x;
}
catch(
@ -105,7 +105,7 @@ exception_safety_test()
test_exception x;
try
{
x << test_4(throws_on_copy());
add_info(x,test_4(throws_on_copy()));
BOOST_TEST(false);
}
catch(
@ -124,13 +124,13 @@ throw_empty()
void
throw_test_1( char const * value )
{
throw test_exception() << test_5(std::string(value));
throw add_info(test_exception(),test_5(std::string(value)));
}
void
throw_test_2()
{
throw test_exception() << test_6(non_printable());
throw add_info(test_exception(),test_6(non_printable()));
}
void
@ -144,7 +144,7 @@ throw_catch_add_file_name( char const * name )
catch(
boost::exception & x )
{
x << test_5(std::string(name));
add_info(x,test_5(std::string(name)));
throw;
}
}
@ -249,12 +249,41 @@ test_catch_add_info()
void
test_add_tuple()
{
typedef boost::tuple<test_1,test_2> test_12;
typedef boost::tuple<test_1,test_2,test_3> test_123;
typedef boost::tuple<test_1,test_2,test_3,test_5> test_1235;
typedef boost::tuple<> tuple_test_;
typedef boost::tuple<test_1> tuple_test_1;
typedef boost::tuple<test_1,test_2> tuple_test_12;
typedef boost::tuple<test_1,test_2,test_3> tuple_test_123;
typedef boost::tuple<test_1,test_2,test_3,test_5> tuple_test_1235;
try
{
throw test_exception() << test_12(42,42u);
throw add_info(test_exception(),tuple_test_());
}
catch(
test_exception & )
{
}
catch(
... )
{
BOOST_TEST(false);
}
try
{
throw add_info(test_exception(),tuple_test_1(42));
}
catch(
test_exception & x )
{
BOOST_TEST( *boost::get_error_info<test_1>(x)==42 );
}
catch(
... )
{
BOOST_TEST(false);
}
try
{
throw add_info(test_exception(),tuple_test_12(42,42u));
}
catch(
test_exception & x )
@ -269,7 +298,7 @@ test_add_tuple()
}
try
{
throw test_exception() << test_123(42,42u,42.0f);
throw add_info(test_exception(),tuple_test_123(42,42u,42.0f));
}
catch(
test_exception & x )
@ -285,7 +314,7 @@ test_add_tuple()
}
try
{
throw test_exception() << test_1235(42,42u,42.0f,std::string("42"));
throw add_info(test_exception(),tuple_test_1235(42,42u,42.0f,std::string("42")));
}
catch(
test_exception & x )
@ -308,7 +337,7 @@ test_lifetime1()
int count=0;
try
{
throw test_exception() << test_7(user_data(count));
throw add_info(test_exception(),test_7(user_data(count)));
}
catch(
boost::exception & x )
@ -330,7 +359,7 @@ test_lifetime2()
int count=0;
{
boost::exception_ptr ep;
test_exception e; e<<test_7(user_data(count));
test_exception e; add_info(e,test_7(user_data(count)));
ep=boost::copy_exception(e);
BOOST_TEST(count>0);
}

View File

@ -10,6 +10,7 @@
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include <boost/thread.hpp>
#include <boost/detail/atomic_count.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <iostream>
@ -43,7 +44,7 @@ thread_handle
explicit
thread_handle( boost::function<void()> const & f ):
t_(boost::bind(thread_wrapper,f,err_))
t_(boost::bind(thread_wrapper,f,boost::ref(err_)))
{
}
@ -62,11 +63,40 @@ void
join( thread_handle & t )
{
t.t_.join();
if( t.err_ )
rethrow_exception(t.err_);
assert(t.err_);
rethrow_exception(t.err_);
}
struct exc: boost::exception, std::exception { };
boost::detail::atomic_count exc_count(0);
struct
exc:
virtual boost::exception,
virtual std::exception
{
exc()
{
++exc_count;
}
exc( exc const & e ):
boost::exception(e),
std::exception(e)
{
++exc_count;
}
virtual
~exc() throw()
{
--exc_count;
}
private:
exc & operator=( exc const & );
};
typedef boost::error_info<struct answer_,int> answer;
void
@ -81,6 +111,7 @@ check( boost::shared_ptr<thread_handle> const & t )
try
{
join(*t);
BOOST_TEST(false);
}
catch(
exc & e )
@ -93,10 +124,11 @@ check( boost::shared_ptr<thread_handle> const & t )
int
main()
{
BOOST_TEST(++exc_count==1);
try
{
std::vector< boost::shared_ptr<thread_handle> > threads;
std::generate_n(std::inserter(threads,threads.end()),256,boost::bind(create_thread,thread_func));
std::generate_n(std::inserter(threads,threads.end()),1,boost::bind(create_thread,thread_func));
std::for_each(threads.begin(),threads.end(),check);
return boost::report_errors();
}
@ -109,4 +141,5 @@ main()
boost::current_exception_diagnostic_information() << std::endl;
return 42;
}
BOOST_TEST(!--exc_count);
}

View File

@ -35,8 +35,8 @@ boost_throw_exception_test()
catch(
boost::exception & x )
{
char const * const * file=boost::get_error_info<boost::throw_function>(x);
char const * const * function=boost::get_error_info<boost::throw_file>(x);
char const * const * function=boost::get_error_info<boost::throw_function>(x);
char const * const * file=boost::get_error_info<boost::throw_file>(x);
int const * line=boost::get_error_info<boost::throw_line>(x);
BOOST_TEST( file && *file );
BOOST_TEST( function && *function );
@ -55,8 +55,8 @@ boost_throw_exception_test()
catch(
boost::exception & x )
{
char const * const * file=boost::get_error_info<boost::throw_function>(x);
char const * const * function=boost::get_error_info<boost::throw_file>(x);
char const * const * function=boost::get_error_info<boost::throw_function>(x);
char const * const * file=boost::get_error_info<boost::throw_file>(x);
int const * line=boost::get_error_info<boost::throw_line>(x);
int const * data=boost::get_error_info<test_data>(x);
BOOST_TEST( file && *file );

View File

@ -62,6 +62,15 @@ main()
BOOST_TEST(false);
}
catch(
boost::exception & x )
{
//Yay! Non-intrusive cloning supported!
if( int const * d=boost::get_error_info<test>(x) )
BOOST_TEST( 42==*d );
else
BOOST_TEST(false);
}
catch(
... )
{
BOOST_TEST(false);
@ -101,6 +110,11 @@ main()
{
}
catch(
std::exception & )
{
//Yay! Non-intrusive cloning supported!
}
catch(
... )
{
BOOST_TEST(false);
@ -114,6 +128,11 @@ main()
{
}
catch(
std::exception & )
{
//Yay! Non-intrusive cloning supported!
}
catch(
... )
{
BOOST_TEST(false);