Inserts new item in bi-directional linked list before the specified one. If before is empty, it means the new list should be created and head should point to nullptr. The second function can be used to insert a list of items. The first function returns inserted item. The second function returns boolean value indicating whether insert was successfully done.
template<class Type> TList<Type> *Insert(PList<Type> &head, TList<Type> *before, const Type &item);
template<class Type> bool Insert(PList<Type> &head, TList<Type> *before, TList<Type> &first, TList<Type> &last);
Namespace: | ntl |
Include: | NTL/Core/List.h |