PageRenderTime 46ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/ttn-post-libtool-1-4-3-upgrade/SWIG/Examples/test-suite/template_default_inherit.i

#
Swig | 25 lines | 18 code | 7 blank | 0 comment | 0 complexity | 20e8b28e5aa37c9a916b3d9fe821f82c MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module template_default_inherit
  2. %warnfilter(801) A::nindex; /* Ruby, wrong constant name */
  3. %inline %{
  4. template <class C>
  5. struct A
  6. {
  7. typedef unsigned int size_type;
  8. static const size_type nindex = static_cast<size_type>(-1);
  9. };
  10. template <class C>
  11. struct B : A<C>
  12. {
  13. typedef typename A<C>::size_type size_type;
  14. void say_hi(size_type index = nindex) {}
  15. };
  16. %}
  17. %template(A_int) A<int>;
  18. %template(B_int) B<int>;