Added another broken test for template + extend + overload
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4195 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
0d298a55e2
commit
a2f1194c0f
2 changed files with 116 additions and 0 deletions
|
|
@ -47,6 +47,7 @@ CPP_TEST_BROKEN = \
|
||||||
namespace_nested \
|
namespace_nested \
|
||||||
template_default_arg \
|
template_default_arg \
|
||||||
template_extend_overload \
|
template_extend_overload \
|
||||||
|
template_extend_overload_2 \
|
||||||
template_specialization_defarg \
|
template_specialization_defarg \
|
||||||
template_specialization_enum \
|
template_specialization_enum \
|
||||||
using_namespace
|
using_namespace
|
||||||
|
|
|
||||||
115
SWIG/Examples/test-suite/template_extend_overload_2.i
Normal file
115
SWIG/Examples/test-suite/template_extend_overload_2.i
Normal file
|
|
@ -0,0 +1,115 @@
|
||||||
|
%module template_extend_overload_2
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
|
||||||
|
struct A
|
||||||
|
{
|
||||||
|
A()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
A(int)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int hi()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
struct AT
|
||||||
|
{
|
||||||
|
AT()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
AT(int)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int hi()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
struct BT
|
||||||
|
{
|
||||||
|
BT()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
BT(int)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int hi()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
%extend A
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// this works
|
||||||
|
//
|
||||||
|
|
||||||
|
int hi(int)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
A(double i)
|
||||||
|
{
|
||||||
|
A* a = new A();
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
%template(AT_double) AT<double>;
|
||||||
|
%extend AT<double>
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// this doesn't work
|
||||||
|
//
|
||||||
|
|
||||||
|
int hi(int)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
AT<double>(double i)
|
||||||
|
{
|
||||||
|
AT<double>* a = new AT<double>();
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
%extend BT<double>
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// this doesn't work either
|
||||||
|
//
|
||||||
|
|
||||||
|
int hi(int)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
BT<double>(double i)
|
||||||
|
{
|
||||||
|
BT<double>* a = new BT<double>();
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%template(BT_double) BT<double>;
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue