The great merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5fcae5eb66
commit
12a43edc2d
1508 changed files with 125983 additions and 44037 deletions
49
Examples/test-suite/conversion_ns_template.i
Normal file
49
Examples/test-suite/conversion_ns_template.i
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
%module conversion_ns_template
|
||||
%{
|
||||
namespace oss
|
||||
{
|
||||
enum Test {One, Two};
|
||||
template <Test>
|
||||
struct Foo {
|
||||
};
|
||||
template <Test T>
|
||||
struct Bar {
|
||||
operator int() { return 0; }
|
||||
operator int&() { static int num = 0; return num; }
|
||||
operator Foo<T>() { return Foo<T>(); }
|
||||
operator Foo<T>&() { return *(new Foo<T>()); }
|
||||
};
|
||||
}
|
||||
%}
|
||||
|
||||
namespace oss
|
||||
{
|
||||
enum Test {One, Two};
|
||||
|
||||
template <Test>
|
||||
struct Foo {
|
||||
};
|
||||
|
||||
// these two works
|
||||
%rename(hello1) Bar<One>::operator int&();
|
||||
%ignore Bar<One>::operator int();
|
||||
|
||||
// these don't
|
||||
%rename(hello2) Bar<One>::operator Foo<oss::One>&();
|
||||
%ignore Bar<One>::operator Foo<oss::One>();
|
||||
|
||||
template <Test T>
|
||||
struct Bar {
|
||||
operator int();
|
||||
operator int&();
|
||||
operator Foo<T>();
|
||||
operator Foo<T>&();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
namespace oss
|
||||
{
|
||||
%template(Foo_One) Foo<One>;
|
||||
%template(Bar_One) Bar<One>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue