PageRenderTime 38ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1-3-26/SWIG/Examples/test-suite/template_retvalue.i

#
Swig | 32 lines | 25 code | 7 blank | 0 comment | 0 complexity | 6cdc18e30032dccaa270f9828ee216cb MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module template_retvalue
  2. %inline %{
  3. enum Hello
  4. {
  5. Hi, Hola
  6. };
  7. struct C
  8. {
  9. C(int) {}
  10. };
  11. template <Hello>
  12. class A
  13. {
  14. public:
  15. A(int) {}
  16. };
  17. template <Hello h>
  18. struct B
  19. {
  20. C get_c() { return C(0); } // this works
  21. A<h> get_a() { return A<h>(0); } // this doesn't
  22. };
  23. %}
  24. %template(A_Hi) A<Hi>;
  25. %template(B_Hola) B<Hola>;