diff options
Diffstat (limited to 'Examples/test-suite/conversion_ns_template.i')
-rw-r--r-- | Examples/test-suite/conversion_ns_template.i | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Examples/test-suite/conversion_ns_template.i b/Examples/test-suite/conversion_ns_template.i new file mode 100644 index 000000000..34102f98f --- /dev/null +++ b/Examples/test-suite/conversion_ns_template.i @@ -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>; +} |