PageRenderTime 21ms CodeModel.GetById 17ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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

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