Return a reference to the current list from append().

git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@336591 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Scott Wheeler 2004-08-06 21:07:46 +00:00
parent 4aaa73f613
commit 65bf71cd61
2 changed files with 10 additions and 6 deletions

View File

@ -109,14 +109,16 @@ namespace TagLib {
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

View File

@ -149,17 +149,19 @@ void List<T>::sortedInsert(const T &value, bool unique)
}
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>