import source from 1.3.40
[external/swig.git] / Examples / test-suite / template_static.i
1 %module template_static
2
3 %warnfilter(SWIGWARN_RUBY_WRONG_NAME) foo<int>;    /* Ruby, wrong class name */
4 %warnfilter(SWIGWARN_RUBY_WRONG_NAME) foo<double>; /* Ruby, wrong class name */
5
6 %inline %{
7 template<class T> class foo {
8 public:
9     static int test;
10 };
11 template<class T> int foo<T>::test = 0;
12 %}
13
14 %template(foo_i) foo<int>;
15 %template(foo_d) foo<double>;
16
17
18 %inline %{
19 namespace toto {
20   class Foo {
21   public:
22       template<class T>
23       static double bar(int i) {
24         return 1.0;
25       }
26
27     private:
28       int i;
29   };
30
31 %}
32
33 %template(bar_double) toto::Foo::bar<double>;