That's why vector has iterators. You start at begin(), and you go until you get to end(), and ... well whatever you need to do, you do.
Code:
for (vector<indexWord>::iterator current=data.begin(); current!=data.end(); ++current) {
    // do whatever you need to do to the current object, which is *current
}