Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. STL Qs

STL Qs

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++graphicsquestionannouncement
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RalfPeter
    wrote on last edited by
    #1

    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

    C J 2 Replies Last reply
    0
    • R RalfPeter

      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

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      calling erase on a sequence invalidates any iterators on that sequence. Cleek | Image Toolkits | Thumbnail maker

      1 Reply Last reply
      0
      • R RalfPeter

        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

        J Offline
        J Offline
        Jorgen Sigvardsson
        wrote on last edited by
        #3

        ivfKey = szvCopy.erase(ivFKey)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups