Nasty test with default args in templated methods. Also the 'using' statement for template methods that use default args.

Currently broken in Python only.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6363 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2004-10-07 20:04:36 +00:00
commit b7d7755c9e

View file

@ -1,6 +1,7 @@
%module template_default_arg
%warnfilter(801) hi; /* Ruby, wrong class name */
%warnfilter(801) Hello; /* Ruby, wrong class name */
%inline %{
template <class T>
@ -17,21 +18,29 @@
enum Hi { hi, hello };
void foo(Hi h = hi) { }
};
template <typename T>
struct X {
X(T t = T());
// and also:
X(double a, T t = T(0));
template <typename T> struct X {
X(T t = T()) {}
X(double a, T t = T(0)) {}
T meth(double a, T t = T(0)) { return t; }
T meth(T t = T(0)) { return t; }
};
template <typename T> class Y : private X<T> {
public:
// test using on templated class with default args in the method
using X<T>::meth;
};
%}
%template(Hello_int) Hello<int>;
%template(X_int) X<int>;
%template(X_longlong) X<long long>;
%template(X_unsigned) X<unsigned>;
%template(Y_unsigned) Y<unsigned>;
%template(X_hello_unsigned) X<Hello<int> >;
%template(Y_hello_unsigned) Y<Hello<int> >;
%inline %{