Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Halp Computer (stop all the list iterator)

Name: Anonymous 2009-03-22 2:50

Hey guys, harassing you for a simple reason: we're both pretty bored, I'm coding, and I hit a problem that google doesn't want to give its secrets for.
I'm making a game as a final project for this semester in C++, and I have a class "Actor" defined that is the root class for the "enemy", "sprite" and all other classes - essientially, it's a bitmap (i'm using Allegro) in an object with useful functions. I have a game engine which hold a list to pointers to all these objects, a list of Actors*. However, when I attempt to iterate through the list, on decleration of my iterator, g++ tells me,
"Engine.h:48: error: no match for call to '(std::list<Actor*, std::allocator<Actor*> >) (std::_List_iterator<Actor*>&)'
"
The line of code is "list<Actor*>::iterator pos = gameObjects.begin();"

So, any ideas?

Also, I am not a bbcode expert.

Name: Anonymous 2009-03-23 13:02

>> The line of code is "list<Actor*>::iterator pos = gameObjects.begin();"

Make your iterator part of the class declaration, obviously.  Put it in private sector, right under the list declaration.

I know this isn't constructive but this thread has taught me everyone on this board is fucking retarded, yes, including you OP.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List