/*
Vertices.h
Created by Matthew Dunson on May 13 2010
*/
#ifndef VERTICES_H
#define VERTICES_H
#include <list>
class Vertices
{
private:
bool mark;
int fromVertex;
list<int> toVertices;
int parent;
int discover_time;
int finish_time;
public:
Vertices (int vertexNumber);
bool getMark();
int getFromVertex ();
list<int> getToVertices ();
int getParent ();
int getDiscoverTime ();
int getFinishTime ();
void setMark (bool isVisited);
void setFromVertex (int theVertex);
void addVertex (int toVertex);
void setParent (int parentVertex);
void setDiscoverTime (int timeDiscovered);
void setFinishTime (int timeFinished);
};
#endif
I tried to compile this class and got the following error:
% In file included from detect_cycle.cpp:5:
Vertices.h:18: 'list' is used as a type, but is not defined as a type.
Vertices.h:27: parse error before `)' token
What am i doing wrong? I included the list library so why is there a problem?
I didn't realize it was bad to use using in headers. I myself have never even used using before because from day one of starting c++, I was told - "Never use using namespace std" from my tutor :D
He was a great person, great tutor and has so much knowledge. Sadly the few game titles his worked on weren't shipped. But he does have a few under his belt. But he was working on a Doctor who game, which died at the end sadly.
About using... always/never rules are circumspect. To say "never use using namespace std" is not good advice. (Heck, there may even be times when using 'using' in a header might be correct.)