TObjArray function AddAtFree

From: Eddy Offermann (eddy@puma.rentec.com)
Date: Fri May 14 1999 - 22:12:34 MEST


Dear ROOT-ers

I just want to report a problem I had with the TObjArray class.
Suppose you have something like:

TObjArray a();
for (Int_t = 0; i < 100; i++)
{
  TString file = .....;
  a.AddAtFree(new TObjString(file))
}

This will not give 100 entries in 'a' but
only 100 - 16 (the default size when a is initialized).
Reason is the fact that fLast will only be set after
AddAtAndExpand is called when i = 16.

I guess one is not supposed to use AddAtFree but
Add instead. Maybe AddAtFree can be removed from the
public list ??

Best Regards,
Eddy Offermann



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:33 MET