TClonesArray "=" operator

From: Diego Faso <>
Date: Tue, 12 Sep 2006 14:36:47 +0200 (MET DST)

Hello, I'm using TClonesArray and I have some problem with the use of the "=" operator: I need to have a TClonesArray object as a data-member of my class, and then declare the contained-class-name in my constructor (macro "TestTClonesArray_Class.C").
Running the TestTClonesArray_Class.C macro I get the following error message:
Error in <TClonesArray::operator=>:

     cannot copy TClonesArray's when classes are different

Since I can not call TClonesArray constructor in my header file, I tried to use a TClonesArray pointer as data-member (TestTClonesArray_Class_Pointer.C).
It works, but I'd rather use "TClonesArray fContainerTest" instead of "TClonesArray *fContainerTest", since adding new objects is easier.

The attached macro "TestTClonesArray.C" is simply a test of TClonesArray.

In short my question is:
How can I fix the "TestTClonesArray_Class.C" in order to use "TClonesArray fContainerTest" instead of "TClonesArray *fContainerTest" as data-member?

I'm using root-5.13/02 on Gentoo-Linux-2006 (kernel 2.6.16-gentoo-r9) My gcc version is: 3.4.6

Thank you in advance.

Received on Tue Sep 12 2006 - 14:36:57 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:01 MET