Re: [pygccxml-development] Printing declarations...
Brought to you by:
mbaas,
roman_yakovenko
|
From: Matthias B. <ba...@ir...> - 2006-03-19 19:38:30
|
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.
>> The call operator also doesn't seem to
>> get wrapped (hasn't that been already done by earlier versions)?
>
> I think you find a bug. I just run special_operators_tester.py and it pass.
> Can you reproduce it? Thanks
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?
>> Now to my main question for this mail: Is there already a way to obtain
>> a "full" string representation of a declaration (for printing)? I'm only
>> aware of the full_name() function but (as the name already implies) this
>> only returns the name whereas for methods I'd like to see the full
>> signature as well (to be able to distinguish between overloaded methods).
>
> x.decl_string
>
> This should do it.
Almost, the signature is there but the actual method name is missing.
- Matthias -
|