PageRenderTime 30ms CodeModel.GetById 26ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Swig | 38 lines | 30 code | 8 blank | 0 comment | 0 complexity | b803e8e004f04c4ed978f4bd50666716 MD5 | raw file
 1%module template_ns_enum2
 2 
 3%inline %{ 
 4  
 5  namespace hi 
 6  { 
 7    enum Hello { Hi, Hola }; 
 8    
 9    template <Hello> 
10    struct traits 
11    { 
12    }; 
13 
14    template <> 
15    struct traits<Hi> 
16    { 
17      typedef int value_type; 
18    }; 
19 
20    template <> 
21    struct traits<Hola> 
22    { 
23      typedef double value_type; 
24    }; 
25    
26    struct B 
27    { 
28      const traits<Hola>::value_type& 
29          evaluate(const traits<Hola>::value_type& e) const; 
30    
31    }; 
32    const traits<Hola>::value_type&
33    B::evaluate(const traits<Hola>::value_type& e) const {
34      return e;
35    }
36  } 
37 
38%}