#include <algorithm> and do std::remove(m_hardpoints.begin(), m_hardpoints.end(), hardpoint) or use a std::list to hold the hardpoints and do m_hardpoints.erase(hardpoint).