import source from 1.3.40
[external/swig.git] / Examples / test-suite / member_template.i
1 %module member_template
2
3 %{
4 #ifdef max
5 #undef max
6 #endif
7 %}
8
9   
10
11 %inline %{
12 template<class T> T max(T x, T y, T z) { return (x > y) ? x : y; }
13
14 template<class T> class Foo {
15  public:
16   template<class S> S max(S x, S y) { return (x > y) ? x : y; }
17 };
18
19 %}
20
21 %extend Foo {
22   %template(maxi)   max<int>;
23   %template(maxd)   max<double>;
24 };
25
26 %template(Fooint)    Foo<int>;
27 %template(Foodouble) Foo<double>;
28