force all the std::exceptions to be exceptionclasses
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6267 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d7b22b7d90
commit
22e70dac7b
1 changed files with 25 additions and 9 deletions
|
|
@ -5,6 +5,21 @@
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
namespace std {
|
||||||
|
/* Mark all of them as exception classes */
|
||||||
|
%feature("exceptionclass") exception;
|
||||||
|
%feature("exceptionclass") bad_exception;
|
||||||
|
%feature("exceptionclass") logic_error;
|
||||||
|
%feature("exceptionclass") domain_error;
|
||||||
|
%feature("exceptionclass") invalid_argument;
|
||||||
|
%feature("exceptionclass") length_error;
|
||||||
|
%feature("exceptionclass") out_of_range;
|
||||||
|
%feature("exceptionclass") runtime_error;
|
||||||
|
%feature("exceptionclass") range_error;
|
||||||
|
%feature("exceptionclass") overflow_error;
|
||||||
|
%feature("exceptionclass") underflow_error;
|
||||||
|
}
|
||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
struct exception
|
struct exception
|
||||||
{
|
{
|
||||||
|
|
@ -18,46 +33,47 @@ namespace std {
|
||||||
|
|
||||||
struct logic_error : exception
|
struct logic_error : exception
|
||||||
{
|
{
|
||||||
explicit logic_error(const string& msg);
|
logic_error(const string& msg);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct domain_error : logic_error
|
struct domain_error : logic_error
|
||||||
{
|
{
|
||||||
explicit domain_error(const string& msg);
|
domain_error(const string& msg);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct invalid_argument : logic_error
|
struct invalid_argument : logic_error
|
||||||
{
|
{
|
||||||
explicit invalid_argument(const string& msg);
|
invalid_argument(const string& msg);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct length_error : logic_error
|
struct length_error : logic_error
|
||||||
{
|
{
|
||||||
explicit length_error(const string& msg);
|
length_error(const string& msg);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct out_of_range : logic_error
|
struct out_of_range : logic_error
|
||||||
{
|
{
|
||||||
explicit out_of_range(const string& msg);
|
out_of_range(const string& msg);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct runtime_error : exception
|
struct runtime_error : exception
|
||||||
{
|
{
|
||||||
explicit runtime_error(const string& msg);
|
runtime_error(const string& msg);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct range_error : runtime_error
|
struct range_error : runtime_error
|
||||||
{
|
{
|
||||||
explicit range_error(const string& msg);
|
range_error(const string& msg);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct overflow_error : runtime_error
|
struct overflow_error : runtime_error
|
||||||
{
|
{
|
||||||
explicit overflow_error(const string& msg);
|
overflow_error(const string& msg);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct underflow_error : runtime_error
|
struct underflow_error : runtime_error
|
||||||
{
|
{
|
||||||
explicit underflow_error(const string& msg);
|
underflow_error(const string& msg);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue