"模板参数2无效"同时声明矢量

时间:2015-05-07 21:51:17

标签: c++ templates

我收到错误"模板参数2无效"当试图宣布船的矢量。错误发生在以下行:

vector<Ship> ships;

我还没有在任何地方使用此向量或初始化它。如何解决此错误?

这是我的船级,只是为了确保:

class Ship {
public:
    Ship(char symb, PositionChar pos, char ori, unsigned int tam, unsigned int cor);
    //other methods
    bool move(char direction, bool rotate, unsigned int lineMin, unsigned int columnMin, unsigned int lineMax, unsigned int
        columnMax);

    bool moveRand(unsigned int lineMin, unsigned int columnMin, unsigned int lineMax, unsigned int columnMax);
    bool attack(size_t partNumber);
    bool isDestroyed() const;
    void show() const;
private:
    char symbol;
    PositionChar position;
    unsigned int size;
    unsigned int color;
    string status;
};

0 个答案:

没有答案