Menu

Remove items from a valueArray?

2012-08-07
2013-04-22
  • Tommy Greene

    Tommy Greene - 2012-08-07

    What is the correct way to remove/delete items from a valueArray?

    I tried using Value::removeMember but that only works for valueObjects.  The only other way that I have figured out is to iterate through the map on my own and call    erase()   on the iterator which seems to cause a memory leak.
     

     
  • Tommy Greene

    Tommy Greene - 2012-09-10

    So evidently there is no way to do this.  You can only add but not delete???  Is that a limitation of the std::map???
    I noticed it keeps leaving null s everywhere if you delete an object from the middle of an array.  Resize after that just messes the whole thing up.  After a while you just get a memory exception crash.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.