add template+using test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7287 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f9dd5f5684
commit
d5b3e4a091
2 changed files with 18 additions and 0 deletions
|
|
@ -272,6 +272,7 @@ CPP_TEST_CASES += \
|
||||||
template_typedef_fnc \
|
template_typedef_fnc \
|
||||||
template_typedef_ns \
|
template_typedef_ns \
|
||||||
template_typedef_ptr \
|
template_typedef_ptr \
|
||||||
|
template_using \
|
||||||
template_virtual \
|
template_virtual \
|
||||||
template_whitespace \
|
template_whitespace \
|
||||||
threads \
|
threads \
|
||||||
|
|
|
||||||
17
SWIG/Examples/test-suite/template_using.i
Normal file
17
SWIG/Examples/test-suite/template_using.i
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
%module template_using
|
||||||
|
|
||||||
|
%inline
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace foo {
|
||||||
|
template<typename T> class Foo { };
|
||||||
|
template<typename T> T maxk(T a, T b) { return a > b ? a : b; }
|
||||||
|
}
|
||||||
|
using foo::maxk;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
%template(maxint) foo::maxk<int>;
|
||||||
|
%template(Foofloat) foo::Foo<float>;
|
||||||
|
%template(maxfloat) maxk<float>;
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue