Add basic C++ test for template functions.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-c@13567 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a95e257fe8
commit
0a646835d2
1 changed files with 13 additions and 0 deletions
13
Examples/test-suite/cpp_basic_template_function.i
Normal file
13
Examples/test-suite/cpp_basic_template_function.i
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
%module cpp_basic_template_function
|
||||||
|
|
||||||
|
%inline
|
||||||
|
{
|
||||||
|
template <class T>
|
||||||
|
T GetMax (T a, T b) {
|
||||||
|
T result;
|
||||||
|
result = (a>b)? a : b;
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
%template(GetMaxInt) GetMax<int>;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue