From fdb603c88fbdb4e3b2665c65ff447feb1c5bb5b0 Mon Sep 17 00:00:00 2001 From: Scott Wheeler Date: Sat, 16 Sep 2006 12:09:48 +0000 Subject: [PATCH] It makes more sense to return iterators here. (The return types weren't there in the last release, so this isn't API breakage.) git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@585152 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- toolkit/tlist.h | 4 ++-- toolkit/tlist.tcc | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/toolkit/tlist.h b/toolkit/tlist.h index 1c29533a..6c34d19b 100644 --- a/toolkit/tlist.h +++ b/toolkit/tlist.h @@ -99,7 +99,7 @@ namespace TagLib { /*! * Inserts a copy of \a value before \a it. */ - List &insert(Iterator it, const T &value); + Iterator insert(Iterator it, const T &value); /*! * Inserts the \a value into the list. This assumes that the list is @@ -164,7 +164,7 @@ namespace TagLib { /*! * Erase the item at \a it from the list. */ - List &erase(Iterator it); + Iterator erase(Iterator it); /*! * Returns a reference to the first item in the list. diff --git a/toolkit/tlist.tcc b/toolkit/tlist.tcc index d17faca1..de3cd75e 100644 --- a/toolkit/tlist.tcc +++ b/toolkit/tlist.tcc @@ -128,11 +128,10 @@ typename List::ConstIterator List::end() const } template -List &List::insert(Iterator it, const T &item) +typename List::Iterator List::insert(Iterator it, const T &item) { detach(); - d->list.insert(it, item); - return *this; + return d->list.insert(it, item); } template @@ -219,10 +218,9 @@ bool List::contains(const T &value) const } template -List &List::erase(Iterator it) +typename List::Iterator List::erase(Iterator it) { - d->list.erase(it); - return *this; + return d->list.erase(it); } template