Non-void methods using call by reference
- Dominant language
- C++
- Stars
- 197
- Forks
- 47
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 6
Description
There are quite a few methods in OCP that use call by reference but return a value instead of void. The current implementation of pywrap classifies functions as call by reference only when the return is void.
One example in OCP is the GeomLib_Tool.Parameter_s function - the computation result is stored in the 4th argument and the function returns a Standard_Boolean indicating whether the function succeeded in finding a value. However because the function does not return void, it's not classified as call by reference and therefore the actual computed value is not accessible from callers side.
I've opened an issue to cadquery/pywrap#45 and a draft PR cadquery/pywrap#46 demonstrating a possible solution (only for functions returning Standard_Boolean). This solution adds the boolean return value to the tuple returned by the wrapper.
A downside in implementing a change like this is that it breaks backwards compatibility as some functions return signature will change.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.