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

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

#
Swig | 63 lines | 45 code | 18 blank | 0 comment | 0 complexity | caaa427ffd631e4d7626f0b91c6a3a6b MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module template_specialization_enum
  2. %warnfilter(801) Hello; /* Ruby, wrong class name */
  3. %warnfilter(801) Hi; /* Ruby, wrong class name */
  4. %inline %{
  5. enum Hello
  6. {
  7. hi, hello
  8. };
  9. template <Hello, class A>
  10. struct C
  11. {
  12. };
  13. template <Hello, class BB>
  14. struct Base
  15. {
  16. };
  17. template <class A>
  18. struct C<hello , A> : Base<hello, A>
  19. {
  20. int fhello()
  21. {
  22. return hello;
  23. }
  24. protected:
  25. C()
  26. {
  27. }
  28. };
  29. template <class A>
  30. struct C<hi , A> : Base<hi, A>
  31. {
  32. int fhi()
  33. {
  34. return hi;
  35. }
  36. protected:
  37. C()
  38. {
  39. }
  40. };
  41. %}
  42. %template(Base_dd) Base<hi, int>;
  43. %template(Base_ii) Base<hello, int>;
  44. %template(C_i) C<hi, int>;
  45. %template(C_d) C<hello, int>;