%implicitconv will now accept None where the implicit conversion takes a C/C++ pointer.

Problem highlighted by Bo Peng on the swig-user mailing list. SF patch #230.
This commit is contained in:
William S Fulton 2013-08-16 08:12:09 +01:00
commit 1cc735df5e
4 changed files with 79 additions and 5 deletions

View file

@ -46,7 +46,6 @@
Foo(double){ ii = 2;}
explicit Foo(char *s){ii = 3;}
Foo(const Foo& f){ ii = f.ii;}
};
struct Bar
@ -57,11 +56,31 @@
Bar(const Foo& ff){ ii = ff.ii;}
};
int get_b(const Bar&b) { return b.ii; }
Foo foo;
}
%template(A_int) A_T<int>;
/****************** None handling *********************/
%inline
{
struct BB {};
struct AA
{
int ii;
AA(int i) { ii = 1; }
AA(double d) { ii = 2; }
AA(const B* b) { ii = 3; }
explicit AA(char *s) { ii = 4; }
AA(const BB& b) { ii = 5; }
int get() const { return ii; }
};
int get_AA_val(AA a) { return a.ii; }
int get_AA_ref(const AA& a) { return a.ii; }
}