blob: ebe13bd9fbdd55ce17f87ce01b2868b65b86818c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
/* 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;}
private:
Point<T> point;
template <class Data>
struct pair2nd_eq
{
};
struct Foo : Point<int>
{
};
Foo foo;
};
%}
%template(PointInt) Point<int>;
%template(RectangleInt) RectangleTest<int>;
|