Forst of all here is my code
Code:
#include <list>
#include <string>
typedef std::string String;
template<class DT>
class State{
public:
class Transition;
public:
State();
State(const DT name);
void setName(const DT name);
const DT getName() const;
bool addTransition(State<DT>::Transition);
bool removeTransition(State<DT>::Transition);
private:
DT name;
// static Transition __useless__("USELESS");
std::list< State<DT>::Transition > mmap;
/*
*
*Sub-class transition
*
*/
public:
class Transition{
public:
Transition(const char *);
void setLabel(const char *label);
const char *getLabel() const;
void setTarget(const State<DT> *state);
const State<DT> *getTarget() const;
bool operator==(State<DT>::Transition);
bool operator<(State<DT>::Transition);
private:
String label;
State<DT> *next;
};
};
#endif
Now when I instanciate a variable of
State<unsigned int> st;
Visual C gives me error
Code:
use of undefined type 'State<unsigned int>::Transition';
at line std::list< State<DT>::Transition > mmap;
what to do? Do any body knows how to use subclass instance?