Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

here's how you remove items from a vector:

vector<Rect>::iterator itc= rects.begin();
while (itc!=rects.end()) {
    if( NOT_A_HUMAN(*itc)) { // (*itc) is a Rect
        // erase needs an iterator, also be careful to use the returned iterator,
        //  not the previous one (that will be invalid)
        itc = rects.erase(itc);