better support for the %throws directive
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8350 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
38c8cf2cb8
commit
b044703d0d
5 changed files with 71 additions and 32 deletions
|
|
@ -15,7 +15,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
%throws(E1,E2) A::barfoo(int i);
|
||||
%throws(E1,E2*,ET<int>,ET<double>) A::barfoo(int i);
|
||||
|
||||
|
||||
%inline %{
|
||||
|
|
@ -31,6 +31,11 @@
|
|||
{
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct ET
|
||||
{
|
||||
};
|
||||
|
||||
struct A
|
||||
{
|
||||
/* caught by the user's throw definition */
|
||||
|
|
@ -58,10 +63,18 @@
|
|||
{
|
||||
if (i == 1) {
|
||||
throw E1();
|
||||
} else {
|
||||
throw E2();
|
||||
} else if (i == 2) {
|
||||
static E2 *ep = new E2();
|
||||
throw ep;
|
||||
} else if (i == 3) {
|
||||
throw ET<int>();
|
||||
} else {
|
||||
throw ET<double>();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
%}
|
||||
|
||||
%template(ET_i) ET<int>;
|
||||
%template(ET_d) ET<double>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue