[C++-sig] Lost Again! :)

Nicolas Tessore wz_ at gmx.net
Fri Sep 1 01:07:57 CEST 2006


Roman Yakovenko wrote:
> This is what I understand until now:
> 
> struct MyClass{...};
> struct HisClass : MyClass
> {};
> struct HerClass : MyClass
> {};
> 
> And you want to cast from HisClass to HerClass, right?
> ( I don't want to know why you have to do this, really :) )

That's right. This is the way the lib is build.

> If HisClass derives from HerClass, than you don't need to introduce
> casting.

I have to, they are siblings, not ancestors. Even if, I have to use what 
I'm given by the library.

> from pygccxml import declarations
> 
> def rename_cast( cast ):
>     cls_to = declarations.class_traits.get_declaration( cast.return_type )
>     cast.rename( 'DynamicCastTo' + cls_to.name )
> 
> casts = mb.free_functions ( lambda decl: decl.name.startswith( 
> 'DynamicCast<' ) )
> map( rename_cast, casts )

This always leaves me with a "query returned no matches" error :(

> May be you can debug the code? I can do it too, but you will have to send me
> GCCXML generated xml file and script that reporoduce the error. C++ source
> code is not requiered.

I cannot even reproduce it anymore myself. I will try to go back to my 
original tests, and see if I can bring it up again.

Thanks for the continued effort! N.



More information about the Cplusplus-sig mailing list