blob: aafbd98f30c4400318bd8e3afa5326a93c81618f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
%module member_template
%inline %{
template<class T> T max(T x, T y, T z) { return (x > y) ? x : y; }
template<class T> class Foo {
public:
template<class S> S max(S x, S y) { return (x > y) ? x : y; }
};
%}
%extend Foo {
%template(maxi) max<int>;
%template(maxd) max<double>;
};
%template(Fooint) Foo<int>;
%template(Foodouble) Foo<double>;
|