genbindings/clang: skip self pointer return from operator= overloads

This commit is contained in:
mappu 2024-08-25 12:48:33 +12:00
parent fc62d963ea
commit 03f4f21d16
1 changed files with 6 additions and 0 deletions

View File

@ -490,6 +490,12 @@ func parseMethod(node map[string]interface{}, mm *CppMethod) error {
mm.ReturnType = CppParameter{ParameterType: "void"}
}
// Change operator= (assign) to always return void. By default it returns *self which
// is a trick for more ergnonomic C++ that has no real effect
if mm.MethodName == "operator=" {
mm.ReturnType = CppParameter{ParameterType: "void"}
}
return nil
}