force all the std::exceptions to be exceptionclasses
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6267 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
3d5d0f535a
commit
a7c7a06c22
1 changed files with 25 additions and 9 deletions
|
|
@ -5,6 +5,21 @@
|
|||
#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 {
|
||||
struct exception
|
||||
{
|
||||
|
|
@ -18,46 +33,47 @@ namespace std {
|
|||
|
||||
struct logic_error : exception
|
||||
{
|
||||
explicit logic_error(const string& msg);
|
||||
logic_error(const string& msg);
|
||||
};
|
||||
|
||||
struct domain_error : logic_error
|
||||
{
|
||||
explicit domain_error(const string& msg);
|
||||
domain_error(const string& msg);
|
||||
};
|
||||
|
||||
struct invalid_argument : logic_error
|
||||
{
|
||||
explicit invalid_argument(const string& msg);
|
||||
invalid_argument(const string& msg);
|
||||
};
|
||||
|
||||
struct length_error : logic_error
|
||||
{
|
||||
explicit length_error(const string& msg);
|
||||
length_error(const string& msg);
|
||||
};
|
||||
|
||||
struct out_of_range : logic_error
|
||||
{
|
||||
explicit out_of_range(const string& msg);
|
||||
out_of_range(const string& msg);
|
||||
};
|
||||
|
||||
struct runtime_error : exception
|
||||
{
|
||||
explicit runtime_error(const string& msg);
|
||||
runtime_error(const string& msg);
|
||||
};
|
||||
|
||||
struct range_error : runtime_error
|
||||
{
|
||||
explicit range_error(const string& msg);
|
||||
range_error(const string& msg);
|
||||
};
|
||||
|
||||
struct overflow_error : runtime_error
|
||||
{
|
||||
explicit overflow_error(const string& msg);
|
||||
overflow_error(const string& msg);
|
||||
};
|
||||
|
||||
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