William Fulton - 2014-04-15

A C++ compiler doesn't like your code, g++ gives:

example_wrap.cxx:216:40: error: redefinition of default argument for ‘int N’
template <typename T,="" int="" N="0"> class A : public A<T, 0="">
example_wrap.cxx:214:31: note: original definition appeared here
template <typename T,="" int="" N="0"> class A;
If you change:

template <typename T, int N = 0> class A;


template <typename T, int N> class A;

and put the specialization after the full template declaration then

%template(tA) A<char, 0>;

will work. There are of course still problems with SWIG, but you at least have a workaround.