From 4960ba517018309ff5b2d7e4daa4ade0c06becc7 Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Sun, 21 Dec 2014 16:59:06 +0000 Subject: [PATCH] Fixed error in CSequence::useImplOf. --- src/blackmisc/sequence.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blackmisc/sequence.h b/src/blackmisc/sequence.h index efe021994..ebebe4f76 100644 --- a/src/blackmisc/sequence.h +++ b/src/blackmisc/sequence.h @@ -96,7 +96,7 @@ namespace BlackMisc * \brief Like changeImpl, but uses the implementation type of another sequence. * \pre The other sequence must be initialized. */ - void useImplOf(const CSequence &other) { PimplPtr p = other.pimpl()->cloneEmpty(); std::move(begin(), end(), std::inserter(*p, p->begin())); m_pimpl.reset(p.take()); } + void useImplOf(const CSequence &other) { CSequence 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 sequence.