Что означает эта ошибка?
Generic.h:25: error: 'Generic' is not a template type
Здесь Generic.
template <class T>
class Generic: public QObject, public CFG, public virtual Evaluator {
Q_OBJECT
std::string key_;
std::vector<std::string> layouts_;
std::vector<std::string> static_widgets_;
std::map<std::string, std::vector<widget_template> > widget_templates_;
std::map<std::string, Widget *> widgets_;
int type_;
LCDWrapper *wrapper_;
protected:
LCDText *lcdText_;
public:
Generic(Json::Value *config, int type);
~Generic();
void CFGSetup(std::string key);
void BuildLayouts();
void StartLayout();
int GetType() { return type_; }
//T *GetLCD() { return lcd_; }
LCDText *GetLCDText() { return lcdText_; }
virtual void Connect(){};
virtual void SetupDevice(){};
std::map<std::string, Widget *> Widgets();
std::string CFG_Key();
LCDWrapper *GetWrapper() { return wrapper_; }
};
Проблема в том, что он подклассифицирует другие классы? Я попробовал эксперимент, проверяющий эту теорию, но это не вызвало этой ошибки.
Редактирование: Хорошо, поэтому пару из вас, ребята, указали, что я могу переслать объявление Generic в другом месте, не делая его классом шаблона. Это правда. И когда я создаю шаблон, я получаю еще одну ошибку.
Property.h: 15: ошибка: ISO С++ запрещает объявление "Generic" без типа
template <class T>
class Generic;
class Property : public CFG {
Generic *visitor; // line 15
bool is_valid;
QScriptValue result;
Json::Value *expression;
public:
Property(const Property &prop);
Property(Generic *v, Json::Value *section, std::string name, Json::Value *defval);
~Property();
bool Valid();
int Eval();
double P2N();
int P2INT();
std::string P2S();
void SetValue(Json::Value val);
Property operator=(Property prop);
};