swig/Examples/test-suite/template_classes.i
William S Fulton 416277b3a5 Python code generated with '-builtin -modernargs' segfaults for any method taking zero arguments.
Also fixes: "SystemError: error return without exception set" during error checking
when using just -builtin and the incorrect number of arguments is passed to a class
method expecting zero arguments.

Closes #256
Closes #382
2015-04-24 21:08:17 +01:00

43 lines
659 B
OpenEdge ABL

/* File : template_classes.i */
/* Tests the use of one templated class within another */
%module template_classes
%inline %{
template <class T>
class Point {
public:
T getX() {return x;}
private:
T x;
};
template <class T>
class RectangleTest {
public:
Point<T>& getPoint() {return point;}
void setPoint(Point<T>& value) {point = value;}
static int static_noargs() { return 0; }
static int static_onearg(int i) { return i; }
private:
Point<T> point;
template <class Data>
struct pair2nd_eq
{
};
struct Foo : Point<int>
{
};
Foo foo;
};
%}
%template(PointInt) Point<int>;
%template(RectangleInt) RectangleTest<int>;