This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: help with STL needed
- From: Eljay Love-Jensen <eljay at adobe dot com>
- To: gnuml <gnuml at bootweb dot nl>, gcc-help at gcc dot gnu dot org
- Date: Thu, 06 May 2004 10:36:49 -0500
- Subject: Re: help with STL needed
- References: <Pine.LNX.4.53.0405061708030.3510@www2.autoweb.nl>
Hi Martin,
The key in your set is the POINTER, not the object. The pointer is
different between obj1 and obj3, so they are different objects.
Use a std::map, not a std::set. For the key in your std::map, use the
public key of the object you are sticking in the std::map.
Or make your classes monostate or singleton. But that's not really what
you'd want, I'd think.
--Eljay