fork download
  1. class EntityCollection
  2. {
  3. public:
  4. typedef std::list<Entity*> EntityList;
  5. typedef EntityList::iterator iterator;
  6.  
  7. EntityCollection(EventType event){
  8. EventSystem::listenToEvent(event, this);
  9. }
  10.  
  11. ~EntityCollection(){
  12. clear();
  13. }
  14.  
  15. void onEvent(Entity* entity){
  16. mQueue.push_back(entity);
  17. }
  18.  
  19. bool emtpy() const{
  20. return mQueue.empty();
  21. }
  22.  
  23. iterator begin(){
  24. return mQueue.begin();
  25. }
  26.  
  27. iterator end(){
  28. return mQueue.end();
  29. }
  30.  
  31. void clear(){
  32. // Delete entities.
  33. }
  34.  
  35. private:
  36. EntityList mEntities;
  37. };
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4: error: ISO C++ forbids declaration of ‘list’ with no type
prog.cpp:4: error: typedef name may not be a nested-name-specifier
prog.cpp:4: error: expected ‘;’ before ‘<’ token
prog.cpp:5: error: ‘EntityList’ has not been declared
prog.cpp:5: error: ISO C++ forbids declaration of ‘iterator’ with no type
prog.cpp:5: error: typedef name may not be a nested-name-specifier
prog.cpp:5: error: expected ‘;’ before ‘iterator’
prog.cpp:7: error: expected `)' before ‘event’
prog.cpp:15: error: ‘Entity’ has not been declared
prog.cpp:23: error: ‘iterator’ does not name a type
prog.cpp:27: error: ‘iterator’ does not name a type
prog.cpp:36: error: ‘EntityList’ does not name a type
prog.cpp: In member function ‘void EntityCollection::onEvent(int*)’:
prog.cpp:16: error: ‘mQueue’ was not declared in this scope
prog.cpp: In member function ‘bool EntityCollection::emtpy() const’:
prog.cpp:20: error: ‘mQueue’ was not declared in this scope
stdout

Standard output is empty