0001 template <typename T> void List<T>::init() { //列表初始化,在创建列表对象时统一调用 0002 head = new ListNode<T>; tail = new ListNode<T>; //创建头、尾哨兵节点 0003 head->succ = tail; head->pred = NULL; //向前链接 0004 tail->pred = head; tail->succ = NULL; //向后链接 0005 _size = 0; //记录规模 0006 }