C++ : List iterator not incrementable

后端 未结 3 846
抹茶落季
抹茶落季 2020-12-10 18:41

Getting this error while trying to erase the last element of a list. I debugged the code and was able to figure out what causes it and where, here\'s my code:



        
3条回答
  •  有刺的猬
    2020-12-10 19:32

    You want:

    if(Player->BoundingBox.Intersect(&(*i)->BoundingBox))
    {
        i = Drop_System.erase(i);
    }
    else {
        ++i; 
    }
    

提交回复
热议问题