I'm new to iterators in C++ and I'm facing problem with incompatible iterators. I've spent on this over 5 hours and still I can't figure out why it's not compatible or what I did wrong. I'm sure, I messed up iterator's operators or something close to it.
Iterator header
1 2 3 4 5 6 7 8 9 10 11
class iterator : public std::iterator < std::input_iterator_tag, Agent > {
list<Agent> agentList;
list<Agent>::iterator it;
public:
iterator(list<Agent>** env, int rows, int cols);
voidoperator ++(int);
booloperator ==(const iterator& a) const;
booloperator !=(iterator& a) const;
Agent& operator*();
void setEnd();
};