#pragma once template class chainNode { public: T element; chainNode* next; //C11 can write like : std::unique_ptr> next; public: chainNode(); chainNode(const T& x, chainNode* next = nullptr); }; template chainNode::chainNode() { this->next = nullptr; } template chainNode::chainNode(const T& x, chainNode* next) : element(x), next(next) { }