Files
cpp-thirdparty/winx64/bin/swig-3.0.12/Examples/test-suite/constructor_exception.i
Bassem Girgis 81b4b9e273 Initial commit
2018-12-20 17:34:07 -06:00

28 lines
314 B
OpenEdge ABL

%module constructor_exception
%inline %{
class MyError {
};
class SomeClass {
public:
SomeClass(int x) {
if (x < 0) {
throw MyError();
}
}
};
class Test {
SomeClass o;
public:
Test(int x) try : o(x) { }
catch (MyError &) {
}
catch (int) {
}
catch (...) {
}
};
%}