R
Rob
I'm trying to use the set<my_class>::insert( my_class const & )
method, but have run into some problems. It seems like I'm seeing it
insert an object when a similar object is already in the set.
After calling insert(), I see the .second of the return value set to
"true", meaning it was inserted. The size() of the set increases by
1, but the count() of the object I insert doesn't change (it was 1, it
is still 1). I do a quick check and see that my new object is not
less than the one already in the set, and the one already in the set
is not less than the new object.
Does that make any sense? I can't really post all the code, but I
could post some pseudocode if that helps...
I tried reproducing outside the program but didn't have much luck.
Does anybody have a suggestion for something in general I might be
doing wrong? My operator< is defined and looks fine to me. I'm using
GCC 3.4.6.
Thanks!
Rob
method, but have run into some problems. It seems like I'm seeing it
insert an object when a similar object is already in the set.
After calling insert(), I see the .second of the return value set to
"true", meaning it was inserted. The size() of the set increases by
1, but the count() of the object I insert doesn't change (it was 1, it
is still 1). I do a quick check and see that my new object is not
less than the one already in the set, and the one already in the set
is not less than the new object.
Does that make any sense? I can't really post all the code, but I
could post some pseudocode if that helps...
I tried reproducing outside the program but didn't have much luck.
Does anybody have a suggestion for something in general I might be
doing wrong? My operator< is defined and looks fine to me. I'm using
GCC 3.4.6.
Thanks!
Rob