26 lines
628 B
C++
26 lines
628 B
C++
#pragma once
|
|
#include <memory>
|
|
|
|
namespace Generic {
|
|
template <typename T, typename NodeType>
|
|
class UndirectedNode
|
|
{
|
|
public:
|
|
UndirectedNode(T value, std::shared_ptr<NodeType> left = nullptr, std::shared_ptr<NodeType> right = nullptr);
|
|
~UndirectedNode();
|
|
T value;
|
|
std::shared_ptr<NodeType> next;
|
|
private:
|
|
|
|
};
|
|
|
|
template <typename T, typename NodeType>
|
|
UndirectedNode<T, NodeType>::UndirectedNode(T value, std::shared_ptr<NodeType> left, std::shared_ptr<NodeType> right) {
|
|
this->value = value;
|
|
this->next = next;
|
|
}
|
|
|
|
template <typename T, typename NodeType>
|
|
UndirectedNode<T, NodeType>::~UndirectedNode() {}
|
|
}
|