PageRenderTime 31ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/test-suite/template_ns_enum2.i

#
Swig | 38 lines | 30 code | 8 blank | 0 comment | 0 complexity | b803e8e004f04c4ed978f4bd50666716 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module template_ns_enum2
  2. %inline %{
  3. namespace hi
  4. {
  5. enum Hello { Hi, Hola };
  6. template <Hello>
  7. struct traits
  8. {
  9. };
  10. template <>
  11. struct traits<Hi>
  12. {
  13. typedef int value_type;
  14. };
  15. template <>
  16. struct traits<Hola>
  17. {
  18. typedef double value_type;
  19. };
  20. struct B
  21. {
  22. const traits<Hola>::value_type&
  23. evaluate(const traits<Hola>::value_type& e) const;
  24. };
  25. const traits<Hola>::value_type&
  26. B::evaluate(const traits<Hola>::value_type& e) const {
  27. return e;
  28. }
  29. }
  30. %}