2020-12-20 08:03:11 +08:00
|
|
|
// Copyright 2020 Peter Dimov
|
|
|
|
// Distributed under the Boost Software License, Version 1.0.
|
|
|
|
// http://www.boost.org/LICENSE_1_0.txt
|
|
|
|
|
|
|
|
#if defined(_MSC_VER)
|
|
|
|
# pragma warning(disable: 4702) // unreachable code
|
|
|
|
# pragma warning(disable: 4577) // noexcept used without /EHsc
|
2021-10-01 01:44:56 +08:00
|
|
|
# pragma warning(disable: 4530) // C++ exception handler used
|
2020-12-20 08:03:11 +08:00
|
|
|
#endif
|
|
|
|
|
2021-10-01 01:49:40 +08:00
|
|
|
#include <boost/exception_ptr.hpp>
|
2020-12-20 08:03:11 +08:00
|
|
|
|
|
|
|
class my_exception: public std::exception {};
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2021-10-01 01:49:40 +08:00
|
|
|
boost::make_exception_ptr( my_exception() );
|
2020-12-20 08:03:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace boost
|
|
|
|
{
|
|
|
|
|
|
|
|
// shared_ptr needs this
|
|
|
|
void throw_exception( std::exception const & )
|
|
|
|
{
|
|
|
|
std::exit( 1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace boost
|