1 //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
3 //Distributed under the Boost Software License, Version 1.0. (See accompanying
4 //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #define BOOST_NO_EXCEPTIONS
7 #include <boost/config.hpp>
8 #include <boost/throw_exception.hpp>
9 #include <boost/exception/info.hpp>
10 #include <boost/exception/diagnostic_information.hpp>
11 #include <boost/core/lightweight_test.hpp>
20 what() const BOOST_NOEXCEPT_OR_NOTHROW
22 return "my_exception";
26 typedef boost::error_info
<struct my_tag
,int> my_int
;
34 throw_exception( std::exception
const & x
)
37 std::string s
=boost::diagnostic_information(x
);
40 BOOST_TEST(s
.find("my_tag")!=std::string::npos
);
42 exit(boost::report_errors());
49 BOOST_THROW_EXCEPTION( my_exception() << my_int(42) );
51 return boost::report_errors();