[pygccxml-development] Bug fix for noncopyable objects that are copyable
Brought to you by:
mbaas,
roman_yakovenko
From: Allen B. <al...@vr...> - 2006-05-18 13:21:08
|
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. -Allen |