Re: TClonesArray

From: Axel Naumann <axel_at_fnal.gov>
Date: Sun, 13 Mar 2005 15:34:19 -0600


Hi Maxim,

>> (*fpart)[m]=prt;

> // This operator should not be used for
> // lefthand side assignments, like a[2] = xxx. Only like,
> // new (a[2]) myClass, or xxx = a[2].

D'oh - you're totally right. You'll get a memory leak if you do it the way I suggested. Sorry about that. So could either use TObjArrays, or you'll have to copy the objects, just as you did. I believe Philippe already told you that you were not invoking the copy constructor properly.

> By the way, this operator is described as inline function on the page
> http://root.cern.ch/root/htmldoc/TClonesArray.html
> I think there is a problem with THtml...

That's right - seems like THtml is not picking up operators properly. There will be a new THtml version within the next two months which (hopefully) will do it right.

Axel. Received on Sun Mar 13 2005 - 22:39:33 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:06 MET