From 31863e9ca6814ec0735d173bb44911dbe27c2f13 Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Fri, 10 Apr 2015 21:49:16 +0200 Subject: [PATCH] refs #403 fix CCollection::useImplOf implementation --- src/blackmisc/collection.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blackmisc/collection.h b/src/blackmisc/collection.h index 109f8e696..a06e1aa2d 100644 --- a/src/blackmisc/collection.h +++ b/src/blackmisc/collection.h @@ -125,7 +125,7 @@ namespace BlackMisc * \brief Like changeImpl, but uses the implementation type of another collection. * \pre The other collection must be initialized. */ - void useImplOf(const CCollection &other) { PimplPtr p = other.pimpl()->cloneEmpty(); std::move(begin(), end(), std::inserter(*p, p->begin())); m_pimpl.reset(p.take()); } + void useImplOf(const CCollection &other) { CCollection c(other.pimpl()->cloneEmpty()); std::move(begin(), end(), std::inserter(c, c.begin())); *this = std::move(c); } /*! * \brief Returns iterator at the beginning of the collection.