
24 May
2006
24 May
'06
1:16 p.m.
"Anand, Kumar"
Well marking the copy constructor as private is not required since dtor is already marked as private.
You will not be able to copy construct by saying something like A *a = new A(); A a' = A(*a) //This will fail because dtor of A is private.
However making the python wrapper class as boost::noncopyable works. It seems, if you do not mark the wrapper class as "noncopyable", boost python internally generates some code which requires public dtor.
It generates code that uses the copy ctor to create a Python object managing a new instance of the class. Naturally, that object can't be destroyed, so you get an error. -- Dave Abrahams Boost Consulting www.boost-consulting.com