27 lines
673 B
C++

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