Added broken test for template + extend + overload
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4172 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
62d765933e
commit
c048546bde
2 changed files with 46 additions and 0 deletions
|
|
@ -46,6 +46,7 @@ CPP_TEST_BROKEN = \
|
|||
abstract_typedef \
|
||||
namespace_nested \
|
||||
template_default_arg \
|
||||
template_extend_overload \
|
||||
template_specialization_defarg \
|
||||
template_specialization_enum \
|
||||
using_namespace
|
||||
|
|
|
|||
45
Examples/test-suite/template_extend_overload.i
Normal file
45
Examples/test-suite/template_extend_overload.i
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
%module template_extend_overload
|
||||
|
||||
|
||||
%inline %{
|
||||
|
||||
template <class T>
|
||||
struct A
|
||||
{
|
||||
};
|
||||
|
||||
template <class Arg, class Res>
|
||||
struct B
|
||||
{
|
||||
};
|
||||
%}
|
||||
|
||||
|
||||
%define __compose_unary(Class, ArgType, ResType)
|
||||
Class<ResType> compose(const B<ArgType, ResType>& f)
|
||||
{
|
||||
return Class<ResType>();
|
||||
}
|
||||
%enddef
|
||||
|
||||
%define __compose_unary_3(Class, Type)
|
||||
%extend Class<Type>
|
||||
{
|
||||
__compose_unary(Class, Type, bool);
|
||||
__compose_unary(Class, Type, double);
|
||||
__compose_unary(Class, Type, int);
|
||||
}
|
||||
%enddef
|
||||
|
||||
%define compose_unary(Class)
|
||||
__compose_unary_3(Class, bool)
|
||||
__compose_unary_3(Class, double)
|
||||
__compose_unary_3(Class, int)
|
||||
%enddef
|
||||
|
||||
compose_unary(A);
|
||||
|
||||
%template(A_double) A<double>;
|
||||
%template(A_int) A<int>;
|
||||
%template(A_bool) A<bool>;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue