Re: [pygccxml-development] Bug fix for noncopyable objects that are copyable
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-05-18 15:10:09
|
On 5/18/06, Allen Bierbaum <al...@vr...> wrote: > > I have attached a patch that fixes a bug I ran into in pyplusplus. > > The problem was that I have something that looks like this. > > class Base > { > protected: > Base(Base& r); > Base(); > } > > class Derived : public Base > { > public: > Derived(); > Derived(Derived& r); > } > > As you can see in the code, the base class has a protected constructor. > In my case this is fine because it is a pure virtual base class. The > problem was that when I tried to wrap Derived, pyplusplus thought is was > noncopyable because Base didn't have a trivial copy (ie. public). This > led pyplusplus to introduce boost::noncopyable into the exposer > generated. This was a bug because as you can see the Derived class is > actually quite copyable. > > The patch fixes the is_noncopyable method in type_traits to understand > that the base classes can have either a public or protected copy > constructor. > > I regenerated bindings for a couple of libraries using this code and it > seems to work fine. Thank you. This is a right patch. I checked it on few libraries also and it works. Committed --=20 Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |