1 %module typemap_various
3 // %copyctor need to be disables since 'const SWIGTYPE &' is intended to generate errors
6 %typemap(in) SWIGTYPE "_this_will_not_compile_SWIGTYPE_"
7 %typemap(in) const SWIGTYPE & "_this_will_not_compile_const_SWIGTYPE_REF_"
10 template <class T> struct Foo {
13 // These typemaps should be used by foo1 and foo2
14 %typemap(in) Foo<T> "/*in typemap for Foo<T> */"
15 %typemap(in) const Foo & "/*in typemap for const Foo&, with type T*/"
20 %template(FooInt) Foo<int>;
21 %template() Foo<short>; // previously Foo<short> typemaps were being picked up for Python only
24 void foo1(Foo<int> f, const Foo<int>& ff) {}
25 void foo2(Foo<short> f, const Foo<short>& ff) {}
29 %typemap(ret) int Bar1::foo() { /* hello1 */ };
30 %typemap(ret) int Bar2::foo() { /* hello2 */ };
31 %typemap(ret) int foo() {/* hello3 */ };
36 int foo() { return 1;}
40 int foo() { return 1;}
46 %newobject FFoo::Bar(bool) const ;
47 %typemap(newfree) char* Bar(bool) {
48 /* hello */ delete[] result;
54 char * Bar(bool b) const { return (char *)"x"; }