void sortedInsert(const T &value, bool unique = false);
/*!
- * Appends \a item to the end of the list.
+ * Appends \a item to the end of the list and returns a reference to the
+ * list.
*/
- void append(const T &item);
+ List<T> &append(const T &item);
/*!
- * Appends all of the values in \a l to the end of the list.
+ * Appends all of the values in \a l to the end of the list and returns a
+ * reference to the list.
*/
- void append(const List<T> &l);
+ List<T> &append(const List<T> &l);
/*!
* Clears the list. If auto deletion is enabled and this list contains a
}
template <class T>
-void List<T>::append(const T &item)
+List<T> &List<T>::append(const T &item)
{
detach();
d->list.push_back(item);
+ return *this;
}
template <class T>
-void List<T>::append(const List<T> &l)
+List<T> &List<T>::append(const List<T> &l)
{
detach();
d->list.insert(d->list.end(), l.begin(), l.end());
+ return *this;
}
template <class T>