/tags/rel-1-3-26/SWIG/Examples/test-suite/template_ns_scope.i
Swig | 38 lines | 30 code | 8 blank | 0 comment | 0 complexity | 8af72f535b2e79e8bf07c455efdc835a MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
1%module template_ns_scope 2// Tests a scoping bug reported by Marcelo Matus. 3 4%inline %{ 5 namespace hi { 6 enum Hello { Hi, Hola }; 7 8 template <Hello h> 9 struct A 10 { 11 public: 12 A() {} // *** Here, the const. breaks swig *** 13 // *** swig works without it *** 14 }; 15 16 namespace hello 17 { 18 template <Hello H> 19 struct B : A<H> 20 { 21 int say_hi() { return 0; } 22 }; 23 } 24 } 25 26%} 27namespace hi 28{ 29 %template(A_Hi) A<Hi>; 30 namespace hello 31 { 32 %template(B_Hi) B<Hi>; 33 } 34} 35 36 37 38