上下文:我有Node
这样的课程:
#ifndef NODE_H_
#define NODE_H_
template <class T>
class Node
{
private:
T data;
Node* next;
Node* previous;
public:
Node();
Node(T);
~Node();
};
#endif /* NODE_H_ */
像这样的课程ListDE
:
/*
* ListDE.h
*
* Created on: Apr 22, 2013
* Author: x
*/
#ifndef LIST_H_
#define LIST_H_
#include <iostream>
#include <fstream>
#include <string>
#include "Node.h"
using namespace std;
template <class T>
class ListDE
{
private:
int qElements;
Node<T>* start;
Node<T>* getNextNode(Node<T>* aNode);
public:
ListDE();
~ListDE();
Node<T> getFirstPosition();
int getQNodes();
void setQNnodes(int q);
Node<T>* getNode(int pos);
T get_data(int pos);
void change_value(int pos, T newValue);
void add_new_data(T data);
void concat(ListDE<T>* otherList);
void delete_last();
};
#endif /* LIST_H_ */
问题:当我尝试编译时,出现以下错误:
ListDE.h:24:5: error: ‘Node’ is not a template
ListDE.h:26:5: error: ‘Node’ is not a template
ListDE.h:26:34: error: ‘Node’ is not a template
ListDE.h:32:5: error: ‘Node’ is not a template
ListDE.h:35:5: error: ‘Node’ is not a template
谁能向我解释这些是什么意思?谢谢!