Re: Copy constructor of TObjArray

From: Fons Rademakers <Fons.Rademakers_at_cern.ch>
Date: Tue, 20 Apr 2010 14:48:34 +0200


Hi Vassili,

   yes, TObjArray copies only the pointers, you'll have to keep track of which array has ownership of the objects (not the isowner bit is not copied, to avoid two obj arrays will become owners of the same objects). The TClonesArray deep copies the objects as that is the purpose of a clones array.

Cheers, Fons.

On 20/04/10 14:28, Vassili Maroussov wrote:
> Dear ROOTers,
>
> It seems the copy constructor of TObjArray and TClonesArray copies only
> the pointers' array but doesn't create copies of objects in collection,
> correct?
>
> Regards,
>
> Vassili
>

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers_at_cern.ch              Phone: +41 22 7679248
WWW:    http://fons.rademakers.org           Fax:   +41 22 7669640
Received on Tue Apr 20 2010 - 14:48:39 CEST

This archive was generated by hypermail 2.2.0 : Tue Apr 20 2010 - 17:50:02 CEST