diff --git a/libs/pbd/pbd/stl_delete.h b/libs/pbd/pbd/stl_delete.h index 41fdee34149..2b7ea21a2f9 100644 --- a/libs/pbd/pbd/stl_delete.h +++ b/libs/pbd/pbd/stl_delete.h @@ -57,9 +57,7 @@ template /*LIBPBD_API*/ void list_delete (std::list *l) #if defined(_CPP_SLIST) || defined(_GLIBCXX_SLIST) || defined(__SGI_STL_SLIST) template /*LIBPBD_API*/ void slist_delete (std::slist *l) { - typename std::slist::iterator i; - - for (i = l->begin(); i != l->end(); i++) { + for (T*& i : *l) { delete (*i); }