Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Node: public NodeBase {
- T data;
- NodeBase *parent;
- public:
- Node(T);
- void setData(T);
- T * getData(void);
- void setParent(NodeBase * const);
- NodeBase * getParent(void);
- };
- class NodeBase {
- };
- Node<char> n1 = Node('A');
- Node<int> n2 = Node(63);
- n1.setParent(&n2);
- NodeBase *pNode = n1.getParent();
- pNode->getData(); // Error: BaseNode has no member 'getData()'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement