templated functions in a namespace tests added
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6451 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
adc692e531
commit
e5c054f749
1 changed files with 17 additions and 0 deletions
|
|
@ -126,3 +126,20 @@ class Klass {};
|
||||||
%template(overload) overload<Klass>;
|
%template(overload) overload<Klass>;
|
||||||
%template(overload) overload<double>;
|
%template(overload) overload<double>;
|
||||||
|
|
||||||
|
|
||||||
|
// everything put in a namespace
|
||||||
|
%inline %{
|
||||||
|
namespace space {
|
||||||
|
int nsoverload(const char *c) { return 1000; }
|
||||||
|
template<typename T> int nsoverload(T t) { return 1010; }
|
||||||
|
template<typename T> int nsoverload(T t, const T &tref) { return 1020; }
|
||||||
|
template<typename T> int nsoverload(T t, const char *c) { return 1030; }
|
||||||
|
template<> int nsoverload<double>(double t, const char *c) { return 1040; }
|
||||||
|
int nsoverload() { return 1050; }
|
||||||
|
}
|
||||||
|
%}
|
||||||
|
|
||||||
|
%template(nsoverload) space::nsoverload<int>;
|
||||||
|
%template(nsoverload) space::nsoverload<Klass>;
|
||||||
|
%template(nsoverload) space::nsoverload<double>;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue