Hey man, if you are erasing, don't increment the variable. The "erase" erases the one pointing and then it goes to the next one.
Example:
You want to erase top 11 and 12. So you have 1,2,...,10,11,12.
You are pointing at top 11. Erase it and then you have 1,2,...,10,12 are pointing at 12. If you increment it, you will go past it.
//erase all entries that are not in the top ten
//but only if there are more than ten!
if (m_numInput.size() > 10){
for (auto it = m_numInput.begin() + 10; it != m_numInput.end();){
it = m_numInput.erase(it);
//it++; Don't increment it!
}
}
Besides that, I think you are trying to resize the vector. Simply use
resize! It also
works with lists.
So the final extract will be
if (m_numInput.size() > 10){
m_numInput.resize(10);
}