stl set bug ?
-
I have a stl set with pointers to objects. When I
insert()
a reference to one of these objects in the empty set I get an access violation in the while loop of the following code:void _Dec() {if (_Color(_Ptr) == _Red && _Parent(_Parent(_Ptr)) == _Ptr) _Ptr = _Right(_Ptr); else if (_Left(_Ptr) != _Nil) _Ptr = _Max(_Left(_Ptr)); else {_Nodeptr _P; while (_Ptr == _Left(_P = _Parent(_Ptr))) _Ptr = _P; _Ptr = _P; }}
When I change the set to a list anpush_back()
the same object I works fine. Is this an stl bug, or must I be doing something wrong? -
I have a stl set with pointers to objects. When I
insert()
a reference to one of these objects in the empty set I get an access violation in the while loop of the following code:void _Dec() {if (_Color(_Ptr) == _Red && _Parent(_Parent(_Ptr)) == _Ptr) _Ptr = _Right(_Ptr); else if (_Left(_Ptr) != _Nil) _Ptr = _Max(_Left(_Ptr)); else {_Nodeptr _P; while (_Ptr == _Left(_P = _Parent(_Ptr))) _Ptr = _P; _Ptr = _P; }}
When I change the set to a list anpush_back()
the same object I works fine. Is this an stl bug, or must I be doing something wrong?