[pygccxml-development] py++ generating invalid default args code
Brought to you by:
mbaas,
roman_yakovenko
From: Allen B. <al...@vr...> - 2008-01-14 23:02:20
|
I am wrapping a method that looks something like this: class MyClass { public: void init(const unsigned value=0, const ClassB valueb=ClassB(-10.0, 11.0), const float other_val=2.0); }; When py++ wraps this it creates code like this: { //::MyClass::init typedef void ( ::MyClass::*init_function_type )( ::unsigned const,::ClassB const,::float const ) ; MyClass_exposer.def( "init" , init_function_type( &::MyClass::init ) , ( bp::arg("value")=(unsigned char const)(0) , bp::arg("valueb")=::ClassB( (&-1.0e+1), (&1.1e+1) , bp::arg("other_val")=2.0e+0 ) ); } As you can see the "&-1.0e+1" style values are invalid code and the compiler fails to build the code. Is this a know issue and is there a simple work around or way to prevent py++ from generating code that won't compile? Thanks, Allen PS. Sorry that I could not include the "real" sample, the code for it is internal use only. |