Optimization for error_info<throw_function>, error_info<throw_file>, error_info<throw_line>. Refactored exception_ptr to use shared_ptr.

[SVN r48521]
This commit is contained in:
Emil Dotchevski
2008-09-01 21:06:09 +00:00
parent 9a35c999a2
commit b84fb75a60
16 changed files with 418 additions and 455 deletions

View File

@ -11,7 +11,8 @@ typedef boost::error_info<struct test_tag,int> tag_int;
struct
error1:
public std::exception
public std::exception,
public boost::exception
{
char const *
what() const throw()
@ -22,18 +23,6 @@ error1:
struct
error2:
public std::exception,
public boost::exception
{
char const *
what() const throw()
{
return "error2";
}
};
struct
error3:
public boost::exception
{
};
@ -44,56 +33,17 @@ main()
using namespace boost;
try
{
error1 x;
error1 x; x << tag_int(42);
BOOST_TEST(x.what()==std::string("error1"));
throw x;
}
catch(
std::exception & x )
{
std::string di=boost::diagnostic_information(x);
BOOST_TEST(di.find("type:")!=std::string::npos);
BOOST_TEST(di.find("error1")!=std::string::npos);
}
catch(
... )
{
BOOST_TEST(false);
}
try
{
error2 x; x << tag_int(42);
BOOST_TEST(x.what()==std::string("error2"));
throw x;
}
catch(
std::exception & x )
{
std::string di=boost::diagnostic_information(x);
BOOST_TEST(di.find("type:")!=std::string::npos);
BOOST_TEST(di.find("error2")!=std::string::npos);
#ifndef BOOST_NO_RTTI
BOOST_TEST(di.find("test_tag")!=std::string::npos);
#endif
}
catch(
... )
{
BOOST_TEST(false);
}
try
{
error2 x; x << tag_int(42);
BOOST_TEST(x.what()==std::string("error2"));
throw x;
}
catch(
boost::exception & x )
{
std::string di=boost::diagnostic_information(x);
BOOST_TEST(di.find("type:")!=std::string::npos);
#ifndef BOOST_NO_RTTI
BOOST_TEST(di.find("error2")!=std::string::npos);
BOOST_TEST(di.find("type:")!=std::string::npos);
BOOST_TEST(di.find("error1")!=std::string::npos);
#endif
BOOST_TEST(di.find("test_tag")!=std::string::npos);
}
@ -104,7 +54,7 @@ main()
}
try
{
error3 x;
error2 x;
x << tag_int(1);
throw x;
}