Re: [pygccxml-development] Two patches proposal
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2009-12-23 21:29:16
|
On Wed, Dec 23, 2009 at 4:04 PM, Berserker <ber...@ho...> wrote: > Yes, I'm actually using that solution. I'm sad about "user expectations" but > what > about this case then (without the patch): > > foo = Foo() > b1 = foo.Bar > b1.x = 2 > b2 = foo.Bar > b2.x = ? > > I think that this is another case where we can discuss about "user > expectations", what about? Look, I don't want to argue - my experience is different from yours. I believe, in this case Py++ provides a good way to change the default behavior. The code you are using is in the "public interface" and I am not going to break it without very, very good reason. > I'm not a "standard expert" too, but I can confirm that your code does > compile > on MSVC (tested on VC2005 and VC2008). Thanks. I read MSDN (http://msdn.microsoft.com/en-us/library/s2ff0fz8%28VS.100%29.aspx) and it defines "conversion constructor" as "...A constructor that can be called with a single argument is used for conversions from the type of the argument to the class type. ..." I changed and committed the code: http://pygccxml.svn.sourceforge.net/viewvc/pygccxml?view=rev&revision=1782 > Actually I "tweaked" the method in this way (probably it could be written > better...): Yes :-) take a look on the difference > > decl_wrappers.calldef_wrapper.constructor_t.does_define_implicit_conversion > = override_does_define_implicit_conversion > > It works but as you probably know I don't like this solution :) In this case I completely agree with you and hoe you will like SVN version better. > Thanks for your help as usual ;) You are welcome. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |