lundi 22 novembre 2021

error when declaring an inner class template field

I have an error with the following code, using the inner template class Node. the error is when declaring the root private field:

"member root declared as a template".

template <typename KeyType, typename ValueType>
class TreapBST : public AbstractBST<KeyType, ValueType>
{
public:
    .....

private:
   template <typename K, typename V>
   struct Node
   {
       ....
   };

    template <typename K, typename V>
    typename TreapBST<K, V>::Node<K, V>* root = nullptr;

};

Aucun commentaire:

Enregistrer un commentaire