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

# · Swig · 25 lines · 18 code · 7 blank · 0 comment · 0 complexity · 6e30178e8c9673812b0101c331047753 MD5 · raw file

  1. %module template_default_inherit
  2. %warnfilter(SWIGWARN_RUBY_WRONG_NAME) 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 = A<C>::nindex) {}
  15. };
  16. %}
  17. %template(A_int) A<int>;
  18. %template(B_int) B<int>;