error no match for 'operator ='

getting above error when using iterator. please help

Page 1 of 1

3 Replies - 2744 Views - Last Post: 10 October 2009 - 11:50 PM Rate Topic: -----

#1 bluebear1608  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 82
  • Joined: 03-June 08

error no match for 'operator ='

Posted 10 October 2009 - 10:54 PM

im trying to iterate through a list, but im getting the error 'no match for operator =' and 'no match for operator '!='

this is where im trying to iterate
list<Vertex>::iterator i;
for(i=vertices.begin();i != vertices.end(); vertices.begin()++)
{
			
}



the Vertex class is as follow
class Vertex
{
public:
	Vertex() {}
	Vertex(const float x, const float y);
	Vertex(const Point &p1);
	~Vertex() {}

	const Point &point() const { return _point; }

private:
	Point _point;
};


im just new to c++ so i dont really understand whats wrong. please help

Is This A Good Question/Topic? 0
  • +

Replies To: error no match for 'operator ='

#2 ccubed  Icon User is offline

  • It's That Guy
  • member icon

Reputation: 162
  • View blog
  • Posts: 1,409
  • Joined: 13-June 08

Re: error no match for 'operator ='

Posted 10 October 2009 - 11:06 PM

You don't increment vertices.begin(), you increment I. it should be I++. Vertices.Begin() you can't change. See if that helps.
Was This Post Helpful? 0
  • +
  • -

#3 bluebear1608  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 82
  • Joined: 03-June 08

Re: error no match for 'operator ='

Posted 10 October 2009 - 11:12 PM

changed it but still recieveing the same errors
Was This Post Helpful? 0
  • +
  • -

#4 ccubed  Icon User is offline

  • It's That Guy
  • member icon

Reputation: 162
  • View blog
  • Posts: 1,409
  • Joined: 13-June 08

Re: error no match for 'operator ='

Posted 10 October 2009 - 11:50 PM

Before I give you a final answer, are you sure the error is on that line? Also, where are you getting the = error? Since = isn't in the code you posted.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1