[pygccxml-development] Two patches proposal
Brought to you by:
mbaas,
roman_yakovenko
From: Berserker <ber...@ho...> - 2009-12-23 11:07:32
|
Hi, I'd like to discuss about two issues 1) properties generation I have some classes like this one: class Foo { Bar getBar() const; void setBar(const Bar &bar); }; getBar returns a temporary object because the return value is created by a conversion from an internal stored string (setBar saves the value in the same way) . In this case name_based_recognizer_t creates a "readonly" property "Bar" instead of a read/write one, so I'm overriding the method in this way: def check_type_compatibility(self, fget, fset): if decl_wrappers.name_based_recognizer_t.check_type_compatibility(self, fget, fset): return True t1 = fget.return_type t2 = fset.arguments[0].type if declarations.is_reference(t2): t2 = declarations.remove_cv( declarations.remove_reference( t2 ) ) if declarations.is_same( t1, t2 ): return True return False What about this change? Is it reasonable to be "merged" in the svn? 2) Implicit conversions: class Foo { public: Foo(int v, bool flag = true); // convertible from int Foo(double v1, double v2); // not convertible from double because v2 hasn't default value }; I looked at constructor_t.does_define_implicit_conversion implementation and I think that the following two lines are "incomplete": if 1 != len( self.arguments ): return False Isn't supposed to be: if 1 != len( self.arguments ) and (arguments > 1 haven't default value): return False Using the above patch Foo should be implicit convertible from int right? How can I write it? Any hope to apply the code to the svn? Bye _________________________________________________________________ Giochi, radio, TV... E tutti i tuoi amici. Cercali su Messenger http://www.messenger.it/home_comunica.aspx |