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-22 14:40

>>28


#ifndef _WHBT_
#define _WHBT_
/* Actor.h */
  class Engine; // forward declaration #1, you faggot

  class Actor {
  public:
    Actor();
    ~Actor();
    // ... rest of class definition here
  };
#endif

/* Actor.sepples */
  #include "engine.h"
  #include "actor.h"

  Actor::Actor() {}
  Actor::~Actor() {}
  // ... rest of method definitions here


/* Engine.h */
#ifndef _EXPONENTIALLY_
#define _EXPONENTIALLY_
  class Actor; // forward declaration #2

  class Engine {
    // class definition here
  }
#endif


/* Engine.sepples */
  // method definitions here

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