[pygccxml-development] Default values for pointers?
Brought to you by:
mbaas,
roman_yakovenko
|
From: Matthias B. <ba...@ir...> - 2006-03-22 11:15:16
|
Hi,
this is probably a general Boost.Python question but anyway...
I have a couple of classes that have methods like the following:
bool isDone(MStatus* ReturnStatus=NULL) const;
The MStatus object is just used for error reporting. When the user
passes a MStatus object it will be filled with data specifying whether
an error has occurred or not, but the user can also decide not to pass
anything if he isn't interested in the error code.
pyplusplus generates the following code:
MItDag_exposer.def( "isDone"
, &MItDag::isDone
, ( bp::arg("ReturnStatus")=0 )
, bp::default_call_policies() );
The module compiles fine, I can use it, but why isn't the argument not
optional anymore? When I try to invoke the method without arguments I
get an error by Boost.Python:
Boost.Python.ArgumentError: Python argument types in
MItDag.isDone(MItDag)
did not match C++ signature:
isDone(class MItDag {lvalue}, class MStatus * ReturnStatus=0)
Shouldn't the argument be optional as there is the "=0" in
bp::arg("ReturnStatus")=0? Or should pyplusplus generate some other code?
- Matthias -
|