diff --git a/src/blackmisc/dictionary.h b/src/blackmisc/dictionary.h index 7ad30eb75..aae64115b 100644 --- a/src/blackmisc/dictionary.h +++ b/src/blackmisc/dictionary.h @@ -9,6 +9,7 @@ #include "valueobject.h" #include "iterator.h" #include +#include namespace BlackMisc { @@ -242,6 +243,9 @@ namespace BlackMisc //! Copy constructor CDictionary(const CDictionary &) = default; + //! Move constructor + CDictionary(CDictionary &&other) : m_impl(std::move(other.m_impl)) {} + //! Virtual destructor virtual ~CDictionary() {} @@ -345,7 +349,7 @@ namespace BlackMisc CDictionary &operator =(const CDictionary &other) { m_impl = other.m_impl; return *this; } //! Move assignment - CDictionary &operator =(CDictionary && other) { m_impl = other.m_impl; return *this; } + CDictionary &operator =(CDictionary && other) { m_impl = std::move(other.m_impl); return *this; } /*! * \brief Access an element by its key.