mardi 4 avril 2017

State Error C2440:" '=': cannot convert from 'const FDHNode

I keep getting the error "C2440:" '=': cannot convert from 'const FDHNode *' to 'FDHNode *" and I cannot for the life of me figure it out. Here is my code and the defining function where the issue is coming from apparently.

template<class ItemType>
class FDHNode
{
  private:
    ItemType coeff; //Data item representing coefficient
    ItemType expon; //Data item representing exponent
    FDHNode<ItemType>* next; //Pointer to a next node 
  public:
    FDHNode();
    FDHNode(const ItemType& coeffi, const ItemType& expone);
    FDHNode(const ItemType& coeffi, FDHNode<ItemType>* nextNodePtr);
    void setCoeffi(const ItemType& aCoeffi);
    void setExpon(const ItemType& anExpon);
    void setNext(const FDHNode<ItemType>* NEXTPTR);
    ItemType getCoeffi();
    ItemType getExpon();
    FDHNode<ItemType>* getNext();

    void print();


 };

template<class ItemType>
void FDHNode<ItemType>::setNext(const FDHNode<ItemType>* NEXTPTR)
{
    next = NEXTPTR;
}

Aucun commentaire:

Enregistrer un commentaire