Commit Graph

14 Commits

Author SHA1 Message Date
af98afb3d1 Attempt to solve issue #10 (#24)
* Attempt to solve issue #10

In boost::current_exception(), after all supported types of exception have
been checked for, a boost::unknown_exception is stored in the
boost::exception_ptr as a last resort to signal that an exception was indeed
stored, but that the actual type and value of the exception was lost.

Now, in case C++11 std::current_exception() is supported, the
std::exception_ptr result of calling std::current_exception() is what
gets stored inside the boost::exception_ptr. Later, inside
boost::rethrow_exception, the std::exception_ptr is retrieved from
the boost::exception_ptr and whatever exception it stores is thrown via
std::rethrow_exception().

The main benefit is than now any exception thrown via plain 'throw'
can be trasnported via boost::exception_ptr. Before this change it was
required that the throw site either used boost::enable_current_exception()
or boost::throw_exception() or threw an exception type inheriting from
boost::exception, which was impossible for third party software
that does not use Boost.Exception.

The detection of std::current_exception() is currently done via config macro
BOOST_NO_CXX11_NOEXCEPT, assuming that if 'noexcept' is supported then
std::exception_ptr is also supported. A better solution would require a new
dedicated macro in Boost.Config.

* Detect support for std::current_exception() via config macro BOOST_NO_CXX11_HDR_EXCEPTION

The temporary solution via BOOST_NO_CXX11_NOEXCEPT was an ugly hack
that is no longer necessary now that Boost.Config has
BOOST_NO_CXX11_HDR_EXCEPTION (pending merge to develop).

* Attempt to solve issue #10

In boost::current_exception(), after all supported types of exception have
been checked for, a boost::unknown_exception is stored in the
boost::exception_ptr as a last resort to signal that an exception was indeed
stored, but that the actual type and value of the exception was lost.

Now, in case C++11 std::current_exception() is supported, the
std::exception_ptr result of calling std::current_exception() is what
gets stored inside the boost::exception_ptr. Later, inside
boost::rethrow_exception, the std::exception_ptr is retrieved from
the boost::exception_ptr and whatever exception it stores is thrown via
std::rethrow_exception().

The main benefit is than now any exception thrown via plain 'throw'
can be trasnported via boost::exception_ptr. Before this change it was
required that the throw site either used boost::enable_current_exception()
or boost::throw_exception() or threw an exception type inheriting from
boost::exception, which was impossible for third party software
that does not use Boost.Exception.

The detection of std::current_exception() is currently done via config macro
BOOST_NO_CXX11_NOEXCEPT, assuming that if 'noexcept' is supported then
std::exception_ptr is also supported. A better solution would require a new
dedicated macro in Boost.Config.

* Detect support for std::current_exception() via config macro BOOST_NO_CXX11_HDR_EXCEPTION

The temporary solution via BOOST_NO_CXX11_NOEXCEPT was an ugly hack
that is no longer necessary now that Boost.Config has
BOOST_NO_CXX11_HDR_EXCEPTION (pending merge to develop).

* Document detection of C++11 std::current_exception through BOOST_NO_CXX11_HDR_EXCEPTION

* Added dist: trusty for Travis config, as recommended by pdimov in issue #10

* Stupid gcc 4.7 and 4.8 are confused initializing a reference with braces, using equal sign hoping it works (tested similar code on godbolt).
2020-01-29 13:41:48 -08:00
ab7a4ebb1a documentation update
[SVN r59373]
2010-01-30 20:59:15 +00:00
4756dc6fe7 documentation update
[SVN r57058]
2009-10-22 07:10:26 +00:00
bec171e234 exception_ptr improvements, documentation update.
[SVN r52981]
2009-05-14 00:36:46 +00:00
2c959a4e43 Use local copies of the boost logo.
[SVN r52666]
2009-04-29 21:19:12 +00:00
f80f55143e documentation update
[SVN r52280]
2009-04-09 05:48:51 +00:00
c9d1d02ec3 Documentation update
[SVN r52265]
2009-04-08 20:08:44 +00:00
2649e88c52 documentation copyright message update
[SVN r52125]
2009-04-02 05:00:47 +00:00
6e909aaf58 documentation update
[SVN r52046]
2009-03-29 04:58:33 +00:00
ab0c20a846 documentation update
[SVN r48489]
2008-08-31 07:25:28 +00:00
d7722921a7 removed tabs from source files
updated documentation


[SVN r47250]
2008-07-09 00:18:09 +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
ce9a26634c minor documentation fixes.
[SVN r44476]
2008-04-16 22:55:19 +00:00
b1b9478cbc Boost Exception documentation update
[SVN r44444]
2008-04-15 21:56:34 +00:00