Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2006-05-24 09:16:39


"Anand, Kumar" <kanand_at_[hidden]> writes:

> 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

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net