Re: [pygccxml-development] Printing declarations...
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-03-20 05:58:26
|
On 3/19/06, Roman Yakovenko <rom...@gm...> wrote: > On 3/19/06, Matthias Baas <ba...@ir...> wrote: > > Roman Yakovenko wrote: > > >> Should the fix for the copy constructor also be available yet? (they= are > > >> still not wrapped automatically) > > > > > > I am doing something wrong with constructors. I do not know what :-(. > > > > What's wrong with the other constructors? For me, it's only the copy > > constructor that doesn't get wrapped, all other constructors have been > > fine so far. > > I don't know exactly. I have take into account constructor for > wrapper, artificial > constructors, private and protected and ... . > > > Ahem, I forgot that I was explicitly ignoring it..... > > The actual problem is that the generated code won't compile on Windows > > (using VC7.1). pyplusplus generates the following code: > > > > MVector_exposer.def( "__call__" > > , (double ( ::MVector::* )( unsigned int ) > > const)(&MVector::operator()) > > , ( bp::arg("i") ) > > , bp::default_call_policies() ); > > > > When I try to compile this I get a syntax error because of the > > "operator()" (VC7.1 gets confused by the brackets). Whereas when I > > create the following typedef > > > > typedef double (::MVector::*bracket_op)(unsigned int i) const; > > > > and then rewrite the above as > > > > MVector_exposer.def( "__call__" > > , (bracket_op)(&MVector::operator()) > > , ( bp::arg("i") ) > > , bp::default_call_policies() ); > > > > then it compiles fine. Could this scheme be incorporated in pyplusplus? Also, untill I add this code to pyplusplus and you don't have an other operator () on MVector you can set create_with_signature to false. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |