Unrecognizable template declaration/definition

The compiler is complaining about Node<E>; there is no template named Node in global scope. The code has to say that it’s the member template:

template <typename E>
typename Heap<E>::Node * Heap<E>::getRoot() {
    return &root;
}

Leave a Comment