2017-04-03 19 views
0

私は関数 "getCurSize"を定義しようとしていますが、何らかの理由で定義していますが、その定義を認識していないのに緑色で下線が引かれています。 (感謝忍耐ので、ここで初級)関数定義が見つかりませんか?

template<class ItemType> 
class FDHPolynomial 
{ 
private: 
    FDHNode<ItemType>* headPtr; 
    int itemcount; 
    FDHNode<ItemType>* getPointedTo(const ItemType& nodenum) const; 

public: 
    FDHPolynomial(); 
    FDHPolynomial(const FDHPolynomial <ItemType>& aPoly); 
    virtual ~FDHPolynomial(); 

    int getCurSize() const; 
    bool isEmpty() const; 
    bool add(const ItemType& newCoeffi, const ItemType& newExpon); 
    bool remove(const ItemType& anExpon); 
    void clear(); 
    bool contains(const ItemType& aExpon) const; 
    ItemType degree() const; 
    ItemType coefficient(const ItemType& power) const; 
    void changeCoefficient(const ItemType& newCoeffi, const ItemType&power); 
    std::vector<ItemType> toVector() const; 

void print(); 


}; 

template<class ItemType> 
int Polynomial<ItemType>::getCurSize() const 
{ 
    return itemCount; 
} 
+2

'多項式 :: getCurSize()' - > 'FDHPolynomial :: getCurSize()' –

答えて

3

あなたのスコープ演算子(:Polynomialがクラスとして存在していないので:)、宣言された関数にPolynomial<ItemType>::getCurSize() constと一致することはできません。クラスFDHPolynomialgetCurSize() const機能を持っているので、これにあなたの定義を変更します。

template<class ItemType> 
int FDHPolynomial<ItemType>::getCurSize() const { 
    return itemCount; 
} 
+0

うわーうわーうわー!私はそれのために自分の額を叩いています。ありがとうございました。 – Student1860

+0

いいえ問題の男:)喜んで助けて! – 0xDEFACED

関連する問題