From 65bf71cd611f98d01acdb5dbd1c8d4e80d11ef9a Mon Sep 17 00:00:00 2001 From: Scott Wheeler Date: Fri, 6 Aug 2004 21:07:46 +0000 Subject: [PATCH] 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 --- toolkit/tlist.h | 10 ++++++---- toolkit/tlist.tcc | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/toolkit/tlist.h b/toolkit/tlist.h index 7ed5627d..3ea7a669 100644 --- a/toolkit/tlist.h +++ b/toolkit/tlist.h @@ -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 &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 &l); + List &append(const List &l); /*! * Clears the list. If auto deletion is enabled and this list contains a diff --git a/toolkit/tlist.tcc b/toolkit/tlist.tcc index 1064a1c5..e94b85a7 100644 --- a/toolkit/tlist.tcc +++ b/toolkit/tlist.tcc @@ -149,17 +149,19 @@ void List::sortedInsert(const T &value, bool unique) } template -void List::append(const T &item) +List &List::append(const T &item) { detach(); d->list.push_back(item); + return *this; } template -void List::append(const List &l) +List &List::append(const List &l) { detach(); d->list.insert(d->list.end(), l.begin(), l.end()); + return *this; } template