/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
- %module template_ns_scope
- // Tests a scoping bug reported by Marcelo Matus.
- %inline %{
- namespace hi {
- enum Hello { Hi, Hola };
-
- template <Hello h>
- struct A
- {
- public:
- A() {} // *** Here, the const. breaks swig ***
- // *** swig works without it ***
- };
-
- namespace hello
- {
- template <Hello H>
- struct B : A<H>
- {
- int say_hi() { return 0; }
- };
- }
- }
-
- %}
- namespace hi
- {
- %template(A_Hi) A<Hi>;
- namespace hello
- {
- %template(B_Hi) B<Hi>;
- }
- }