Re: use of TMap

Fons Rademakers (rdm@pcsalo.cern.ch)
Wed, 2 Sep 1998 18:02:56 +0200 (METDST)


Hi Richard,

what you want can be done with TObjectTable.

Cheers, Fons.

>
> I would like to use a TMap in a way that I would use an STL map: I have
> an ascii file I am parsing and want to use the map to find out whether
> an entry (an int) has occurred already.
>
> With an STL map, I would use the find on the key (which would be the
> int) and be told if it is already in the map. With TMap I must create an
> object inheriting from TObject which contains the int. TMap's FindObject
> requires a pointer to the key. But I would have to make a new key object
> to hold the int; then it wouldn't be in the TMap since it is new.
>
> Is TMap not meant to be used in this way?
>
> Thanks,
>
> Richard
>

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland          Phone: +41 22 7679248
E-Mail: Fons.Rademakers@cern.ch              Fax:   +41 22 7677910