I am getting the error from the title, when I try to execute this piece of code :
list<Part>::iterator i = bullets.end();
--i;
if (!dartCollided) {
dartCollided = true;
Part temp = &(i);
&(i) = new BrokenPart(i); //line giving the error
delete temp;
}
Could someone help me point out the error?