PageRenderTime 3ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/template_static.i

#
Swig | 33 lines | 26 code | 7 blank | 0 comment | 0 complexity | 617dae915e45b3b1230312455b270977 MD5 | raw file
 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 %{
 7template<class T> class foo {
 8public:
 9    static int test;
10};
11template<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 %{
19namespace 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>;