STL Qs
-
Hi all, could any one help me with an STL problem? the code below throws an assertion error [_SCL_SECURE_VALIDATE(this->_Mycont != NULL); from vector.h, line 117] when executing line #5 only after executing line #4. Line #5 works fine as long as the 'if' block is not entered. I am using MSVC 2005 and did not have this problem with the previous version. Is there any change to the way STLs are handled now? Thx everyone, Ralf. 1 ivFKey = szvCopy.begin(); 2 while (ivFKey != szvCopy.end()) { 3 if (*ivFKey == szFKey) //delete all equal; what's left are 0-catches 4 szvCopy.erase(ivFKey); 5 ++ivFKey; 6 } ralf.riedel@usm.edu
-
Hi all, could any one help me with an STL problem? the code below throws an assertion error [_SCL_SECURE_VALIDATE(this->_Mycont != NULL); from vector.h, line 117] when executing line #5 only after executing line #4. Line #5 works fine as long as the 'if' block is not entered. I am using MSVC 2005 and did not have this problem with the previous version. Is there any change to the way STLs are handled now? Thx everyone, Ralf. 1 ivFKey = szvCopy.begin(); 2 while (ivFKey != szvCopy.end()) { 3 if (*ivFKey == szFKey) //delete all equal; what's left are 0-catches 4 szvCopy.erase(ivFKey); 5 ++ivFKey; 6 } ralf.riedel@usm.edu
calling erase on a sequence invalidates any iterators on that sequence. Cleek | Image Toolkits | Thumbnail maker
-
Hi all, could any one help me with an STL problem? the code below throws an assertion error [_SCL_SECURE_VALIDATE(this->_Mycont != NULL); from vector.h, line 117] when executing line #5 only after executing line #4. Line #5 works fine as long as the 'if' block is not entered. I am using MSVC 2005 and did not have this problem with the previous version. Is there any change to the way STLs are handled now? Thx everyone, Ralf. 1 ivFKey = szvCopy.begin(); 2 while (ivFKey != szvCopy.end()) { 3 if (*ivFKey == szFKey) //delete all equal; what's left are 0-catches 4 szvCopy.erase(ivFKey); 5 ++ivFKey; 6 } ralf.riedel@usm.edu
ivfKey = szvCopy.erase(ivFKey)