相关疑难解决方法(0)

类'不是模板类型'

这个错误是什么意思?

Generic.h:25: error: 'Generic' is not a template type
Run Code Online (Sandbox Code Playgroud)

这是通用的.

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 …
Run Code Online (Sandbox Code Playgroud)

c++ templates

16
推荐指数
3
解决办法
3万
查看次数

标签 统计

c++ ×1

templates ×1