I have a the following code.
vector* irds = myotherobj->getIRDs();//gets a pointer to the vector
for(vector::iterator it = ir
Why do you want to get a pointer?
Use a reference:
for(vector::iterator it = irds->begin(); it != irds->end(); ++it)
{
IRD & ird = *it;
ird.doSomething();
}
Alternatively:
for(vector::iterator it = irds->begin(); it != irds->end(); ++it)
{
it->doSomething();
}
Also, as everyone said, use !=
when comparing iterators, not <
. While it'll work in this case, it'll stop working if you use a different container (and that's what iterators are for: abstracting the underlying container).