[ROOT] class data member TList

From: Stephen Bailey (bailey@SLAC.stanford.edu)
Date: Fri Jun 01 2001 - 04:23:34 MEST


Hello.

The following class works fine when loaded interactively
with .L Blat.cc.  When I try to make it into a compiled ROOT
object by making it inherit from TObject, etc. (see attached
files) and then compile it with .L Blat.cc+, I get the errors:

TCollection.h: In method `TSeqCollection::TSeqCollection(const
class TSeqCollection &)': TCollection.h:53:
`TCollection::TCollection(const class TCollection &)' is private
within this context

It seems confused about what the default constructor for TList
should be.  If I use a TObjArray instead of a TList, it works
fine for the compiled version.  It also works fine if I use a
pointer to a TList or a TObjArray.  But it seems to choke when
my class has a TList as a data member.

I'm using Root 3.01/02 on Linux.  The test class is:

class Blat {

public:
  Blat() {}

  void Print(void);
  void Add(TObject *x);

private:
  TList _list;
  //  TObjArray _list;

};

void Blat::Print(void) { cout << _list.GetSize() << endl; }

void Blat::Add(TObject *x) { _list.Add(x); }


Any ideas/comments/assistance?  Thanks.

Stephen







This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:47 MET