24 lines
541 B
C++

#pragma once
#include <memory>
namespace Generic {
template <typename T, typename NodeType>
class UndirectedNode
{
public:
UndirectedNode(T value, std::shared_ptr<NodeType> next = nullptr);
~UndirectedNode();
T value;
std::shared_ptr<NodeType> next;
};
template <typename T, typename NodeType>
UndirectedNode<T, NodeType>::UndirectedNode(T value, std::shared_ptr<NodeType> next) {
this->value = value;
this->next = next;
}
template <typename T, typename NodeType>
UndirectedNode<T, NodeType>::~UndirectedNode() {}
}