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