swig -go: treat a nil argument as NULL
Let Go code pass "nil" when calling a C++ function that accepts a pointer to a class. The Go "nil" will be treated as a C++ "nullptr". Fixes #2203
This commit is contained in:
parent
7ebe5cead3
commit
70d530adfc
4 changed files with 53 additions and 12 deletions
|
|
@ -50,4 +50,8 @@ func main() {
|
|||
fmt.Println("for c2.M got", pm, "want", want)
|
||||
panic(pm)
|
||||
}
|
||||
|
||||
c1 := go_inout.NewC1()
|
||||
c2.M2(c1)
|
||||
c2.M2(nil)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -239,5 +239,7 @@ class C1 {
|
|||
};
|
||||
|
||||
class C2 : public C1 {
|
||||
public:
|
||||
void M2(C1*) {}
|
||||
};
|
||||
%}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue