PageRenderTime 51ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/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. %inline %{
  4. namespace hi {
  5. enum Hello { Hi, Hola };
  6. template <Hello h>
  7. struct A
  8. {
  9. public:
  10. A() {} // *** Here, the const. breaks swig ***
  11. // *** swig works without it ***
  12. };
  13. namespace hello
  14. {
  15. template <Hello H>
  16. struct B : A<H>
  17. {
  18. int say_hi() { return 0; }
  19. };
  20. }
  21. }
  22. %}
  23. namespace hi
  24. {
  25. %template(A_Hi) A<Hi>;
  26. namespace hello
  27. {
  28. %template(B_Hi) B<Hi>;
  29. }
  30. }