我需要将第一行更改为: template <class T> class Node{
class Node {
private:
double data;
Node* next;
public:
Node(double);
virtual ~Node(); //for later use of polymorphismi, review the topic again
friend class Stack; // allows dStack for private member access
};
Node::Node(double data) {
this->data = data;
next = 0;
}
Node::~Node() {
}
但我不确定我需要改变的所有内部工作。我只需要更改私有数据成员和公共节点功能吗?