PageRenderTime 41ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Swig | 48 lines | 38 code | 10 blank | 0 comment | 0 complexity | 8b1ef3b6cc6c6fef8bd9c06fc29b2b00 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module template_enum_ns_inherit
  2. %inline %{
  3. namespace oss
  4. {
  5. enum Polarization { UnaryPolarization, BinaryPolarization };
  6. template <Polarization P>
  7. struct Interface
  8. {
  9. };
  10. template <Polarization P, class C>
  11. struct Module
  12. {
  13. };
  14. }
  15. %}
  16. namespace oss
  17. {
  18. %template(Interface_UP) Interface<UnaryPolarization>;
  19. %template(Module_UPIUP) Module<UnaryPolarization,Interface<UnaryPolarization> >;
  20. }
  21. %inline %{
  22. namespace oss
  23. {
  24. namespace hello
  25. {
  26. struct HInterface1 :
  27. Interface<oss::UnaryPolarization> // this works (with fullns qualification)
  28. {
  29. };
  30. struct HInterface2 :
  31. Interface<UnaryPolarization> // this doesn't work
  32. {
  33. };
  34. struct HModule1 : Module<UnaryPolarization, Interface<UnaryPolarization> > {
  35. };
  36. }
  37. }
  38. %}