PageRenderTime 29ms CodeModel.GetById 19ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 1ms

/tags/rel-1-3-26/SWIG/Examples/test-suite/template_specialization_enum.i

#
Swig | 63 lines | 45 code | 18 blank | 0 comment | 0 complexity | caaa427ffd631e4d7626f0b91c6a3a6b MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1%module template_specialization_enum
 2
 3%warnfilter(801) Hello;	/* Ruby, wrong class name */
 4%warnfilter(801) Hi;	/* Ruby, wrong class name */
 5
 6
 7%inline %{
 8
 9  enum Hello 
10  {
11    hi, hello
12  };
13  
14
15  template <Hello, class A>
16    struct C
17    {
18    };
19  
20
21  template <Hello, class BB>
22    struct Base
23    {
24    };  
25  
26  
27  template <class A>
28    struct C<hello , A>  : Base<hello, A>
29    {
30      int fhello()
31      {
32	return hello;
33      }
34      
35    protected:
36      C()
37      {
38      }
39    };
40  
41
42  template <class A>
43    struct C<hi , A> : Base<hi, A>
44    {
45      int fhi()
46      {
47	return hi;
48      }
49
50    protected:
51      C()
52      {
53      }
54    };
55  
56      
57%}
58
59%template(Base_dd) Base<hi, int>;
60%template(Base_ii) Base<hello, int>;
61
62%template(C_i) C<hi, int>;
63%template(C_d) C<hello, int>;