TList vs. TObjArray

From: Rudi Lutter (Rudi.Lutter@Physik.uni-muenchen.de)
Date: Tue Mar 30 1999 - 14:07:02 MEST


Hi Rooters,

there seem to be unexpected differences between methods in TList and
TObjArray classes, respectively.

I use TObjArray to be able to address members by index via the operator[],
but would like to step thru the array by methods First()/After() also.
When I then remove a member by method Remove(), First/After sequence stops at
the empty slot, no way to go behind the hole.

In case of TList things work as expected.

Ok, TObjArray's docs tell me to use method Compress() to throw away the hole.

But I think it is dangerous to have same methods in similar classes with
different behaviour. And I can't see any reason to keep an empty slot in
the array. At least After() should skip it.

Cheers,

Rudi
-- 
         __     __  __            / Rudi Lutter                                /
  ____  / /_ __/ /_/ /____ ____  /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/
 / __/ / / // / __/ __/ -_) __/ / Email: Rudi.Lutter@Physik.Uni-Muenchen.DE  /
/_/   /_/\_,_/\__/\__/\__/_/   / WWW: www.bl.physik.tu-muenchen.de/~rudi    /
                              /                                            /
-----------------------------/ Tel:   (+49) 89 289 1 4287                 /
                            / Fax:   (+49) 89 289 1 4280                 /
                           /--------------------------------------------/
                          / Beschleunigerlabor der LMU und TU Muenchen /
                         / Hochschulgelaende, D-85748 GARCHING, Germany
                        *--------------------------------------------*



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