beter comptability for cpp not having std::vector.erase()