PageRenderTime 44ms CodeModel.GetById 22ms RepoModel.GetById 1ms 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 %{
  3. namespace oss
  4. {
  5. enum Test {One, Two};
  6. }
  7. %}
  8. namespace oss {
  9. %extend Foo<One> { //************ this doesn't work
  10. int test1(int x) { return x; }
  11. };
  12. }
  13. %extend oss::Foo<oss::One> { //******** this works
  14. int test2(int x) { return x; }
  15. };
  16. %inline %{
  17. namespace oss
  18. {
  19. template <Test>
  20. struct Foo {
  21. };
  22. }
  23. %}
  24. namespace oss
  25. {
  26. %template(Foo_One) Foo<One>;
  27. }