Unrecognizable template declaration/definition

Oren Bell

I'm trying to implement a heap, but I've got the above error on one of my functions.

Here's my header file:

template <typename E>
class Heap
{
private:
    class Node {
        E data;
        Node * left;
        Node * right;
    };

    Node root;
    int length;

    E * preorder(E * list, int length, Node node);
    E * inorder(E * list, int length, Node node);
    E * postorder(E * list, int length, Node node);
    void clear(Node node);  //Recursively clears all nodes and frees all pointers
public:
    Heap();
    Heap(E * list, int length);
    ~Heap();

    Node * getRoot();
    void buildHeap(E * list, int length);
    E * returnList();
};

And the specific function in question (although there's similar errors on others). There error is on the second line

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

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;
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

error: C2988: unrecognizable template declaration/definition

From Dev

Unrecognizable situation

From Dev

C++ unrecognizable template declaration when using 2 libraries in the same project (Cork+VTK)

From Dev

Unrecognizable WebApi routing scheme?

From Dev

unrecognizable code in scala Predef object

From Dev

unrecognizable code in scala Predef object

From Dev

SPARK: gnatprove with -gnato13 option unrecognizable?

From Dev

Python writing unrecognizable characters at end of line

From Dev

JPGs downloaded from Facebook unrecognizable to Shotwell

From Dev

Python writing unrecognizable characters at end of line

From Dev

Why are my properties unrecognizable when converting to pojo

From Dev

Why Regression Using Zoo Objects Yields Unrecognizable Results

From Dev

Why Regression Using Zoo Objects Yields Unrecognizable Results

From Dev

Binary file attachment "unrecognizable format" for postresql and rails 4

From Dev

String that is being read in by stream reader is producing unrecognizable characters

From Dev

Can't install Android SDK - Unrecognizable characters on setup wizard

From Dev

Java - prompting user to input commands and throw error if unrecognizable

From Dev

Overwriting a single byte in a binary file makes it unrecognizable by objdump?

From Dev

LINQ GroupBy to get top sales yields NotSupportedException about unrecognizable Select method

From Dev

Double template<> in template specialization

From Dev

Meteor template and template helper

From Dev

template template parameters not working

From Dev

variadic template of template metaprogramming

From Dev

template argument of template class

From Dev

inject a template into another template

From Dev

Template of template parameter with GCC

From Dev

Template function as template argument

From Dev

template repeat in template repeat

From Dev

template template parameters and clang

Related Related

  1. 1

    error: C2988: unrecognizable template declaration/definition

  2. 2

    Unrecognizable situation

  3. 3

    C++ unrecognizable template declaration when using 2 libraries in the same project (Cork+VTK)

  4. 4

    Unrecognizable WebApi routing scheme?

  5. 5

    unrecognizable code in scala Predef object

  6. 6

    unrecognizable code in scala Predef object

  7. 7

    SPARK: gnatprove with -gnato13 option unrecognizable?

  8. 8

    Python writing unrecognizable characters at end of line

  9. 9

    JPGs downloaded from Facebook unrecognizable to Shotwell

  10. 10

    Python writing unrecognizable characters at end of line

  11. 11

    Why are my properties unrecognizable when converting to pojo

  12. 12

    Why Regression Using Zoo Objects Yields Unrecognizable Results

  13. 13

    Why Regression Using Zoo Objects Yields Unrecognizable Results

  14. 14

    Binary file attachment "unrecognizable format" for postresql and rails 4

  15. 15

    String that is being read in by stream reader is producing unrecognizable characters

  16. 16

    Can't install Android SDK - Unrecognizable characters on setup wizard

  17. 17

    Java - prompting user to input commands and throw error if unrecognizable

  18. 18

    Overwriting a single byte in a binary file makes it unrecognizable by objdump?

  19. 19

    LINQ GroupBy to get top sales yields NotSupportedException about unrecognizable Select method

  20. 20

    Double template<> in template specialization

  21. 21

    Meteor template and template helper

  22. 22

    template template parameters not working

  23. 23

    variadic template of template metaprogramming

  24. 24

    template argument of template class

  25. 25

    inject a template into another template

  26. 26

    Template of template parameter with GCC

  27. 27

    Template function as template argument

  28. 28

    template repeat in template repeat

  29. 29

    template template parameters and clang

HotTag

Archive