Constant iterator through a set
This is probably really obvious, but im at a loss.
So I have to iterate with a constant iterator through a set of objects to display them, but I am getting errors when I implement the for loop.
1 2 3
|
set<Item> itemList;
pair<set<Item>::const_iterator,bool> pairSet;
iterator<set<Item>::const_iterator,bool> key;
|
Later on in the code, I have a display function that is sent the set and iterator and has the code:
1 2 3
|
for( loc = vehicleList.begin();loc = vehicleList.end(); ++loc){
cout << *loc << ". " << item << endl;
}
|
which has the error that says there is no operand for it.
I've only overloaded the < and the == and that's all we are supposed to do
I feel like I'm missing an obvious step, any help is appreciated.
Thanks!
What error message do you get? The second = in the loop should be !=.
Topic archived. No new replies allowed.