23 lines
356 B
C++
23 lines
356 B
C++
/**
|
|
* C++ 版本单链表结点
|
|
*
|
|
* Author: Liam Huang (Liam0205)
|
|
*/
|
|
|
|
#ifndef STACK_LINKED_LIST_H_
|
|
#define STACK_LINKED_LIST_H_
|
|
|
|
#include <memory>
|
|
|
|
template <typename T>
|
|
struct Node {
|
|
using ptr_t = std::shared_ptr<Node<T>>;
|
|
T data;
|
|
ptr_t next;
|
|
|
|
Node(T data_) : data(data_), next(nullptr) {}
|
|
Node() : next(nullptr) {}
|
|
};
|
|
|
|
#endif
|