Re: [pygccxml-development] Removing copy constructor
Brought to you by:
mbaas,
roman_yakovenko
From: Benoit L. <ben...@mo...> - 2010-04-13 14:58:50
|
Benoit Leveau wrote: > Roman Yakovenko wrote: >> On Tue, Apr 13, 2010 at 3:11 PM, Benoit Leveau >> <ben...@mo...> wrote: >>> That's really interesting...I didn't know py++ was supposed to detect this >>> case (when a class has a non-copyable member). >> :-) >> >> Take a look on: >> >> http://pygccxml.svn.sourceforge.net/viewvc/pygccxml/pyplusplus_dev/unittests/data/noncopyable_to_be_exported.hpp?view=markup >> http://pygccxml.svn.sourceforge.net/viewvc/pygccxml/pyplusplus_dev/unittests/noncopyable_tester.py?view=markup >> >> and the attached generated file >> >>> I'm going to try to reproduce >>> your example, then i'll introduce my types...hopefully at some point I'll >>> see what's causing the problem. >>> I'll let you know what I can find. >> Cool. > > Thanks a lot! I'll try this in a few minutes.. > I should have looked in the unit tests, I didn't think about it... using your example, I indeed don't get a copy-constructor, even after "complexifying" the class so it looks more like mine... this is probably something tricky! I'm not sure I really have to bind that class, but I'll let you know if I find where the problem was I was thinking about something. I had a few troubles now and then using the call_policies. I explain: If you want to use "copy_non_const_reference" you use: function.call_policies = call_policies.return_value_policy(call_policies.copy_non_const_reference) but if you want to use return_internal_reference you use: function.call_policies = call_policies.return_internal_reference() I had to look into call_policies.py and from time to time I forget and get some errors (even sometimes py++ doesn't complain but the errors appear at compilation). All these policies are listed in the same section, without any mention that one is a function, the others are string and need to be passed to return_value_policy(). It might be useful to add that to the documentation, if it's not already somewhere I missed. Benoit |