Append


Append new item to bi-directional linked list. If after argument is not empty, the item is added as the next item. If after argument is empty, the head argument is used. If it points to existing list, the nullptr is returned and no item is added. Otherwise new list is created and set in head value. Function return created list item.

template<class Type> TList<Type> *Append(PList<Type> &head, TList<Type> *after, const Type &item);
Namespace: ntl
Include: NTL/Core/List.h