PageRenderTime 36ms CodeModel.GetById 18ms app.highlight 15ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1.3.35/Examples/test-suite/extend_template_ns.i

#
Swig | 32 lines | 9 code | 1 blank | 22 comment | 0 complexity | 8538d803fe1befdc7d384e595b57953f MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1%module extend_template_ns
 2%inline %{ 
 3namespace oss 
 4{ 
 5  enum Test {One, Two}; 
 6} 
 7%} 
 8 
 9namespace oss { 
10   %extend Foo<One> {           //************ this doesn't  work 
11     int test1(int x) { return x; } 
12   };
13} 
14 
15%extend oss::Foo<oss::One> {  //******** this works 
16int test2(int x) { return x; } 
17}; 
18 
19%inline %{ 
20namespace oss 
21{ 
22  template <Test> 
23  struct Foo { 
24  }; 
25 } 
26%} 
27 
28namespace oss 
29{ 
30%template(Foo_One) Foo<One>; 
31} 
32