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

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

#
Swig | 38 lines | 21 code | 10 blank | 7 comment | 0 complexity | 60a4cb7d6370801675c33a4019db0fdb MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module("templatereduce") template_typedef_ptr
  2. %warnfilter(SWIGWARN_RUBY_WRONG_NAME) Test<int, C*>; /* Ruby, wrong constant name */
  3. /*
  4. Use the "templatereduce" feature to force swig to reduce the template
  5. typedef as much as possible.
  6. This fixes cases like this one, but it can prevent some
  7. typemaps from working.
  8. */
  9. %inline %{
  10. struct C{};
  11. typedef C* pC;
  12. template <class A, class B>
  13. struct Test
  14. {
  15. Test (A a, B b)
  16. {
  17. }
  18. };
  19. template <class A, class B>
  20. struct Test<A, B*>
  21. {
  22. Test (B* a)
  23. {
  24. }
  25. };
  26. %}
  27. %template(test_pC) Test<int, pC>;