mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 04:25:42 +08:00
refs #311 CDictionary: added move constructor and fixed move assignment
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
#include "valueobject.h"
|
#include "valueobject.h"
|
||||||
#include "iterator.h"
|
#include "iterator.h"
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
@@ -242,6 +243,9 @@ namespace BlackMisc
|
|||||||
//! Copy constructor
|
//! Copy constructor
|
||||||
CDictionary(const CDictionary &) = default;
|
CDictionary(const CDictionary &) = default;
|
||||||
|
|
||||||
|
//! Move constructor
|
||||||
|
CDictionary(CDictionary &&other) : m_impl(std::move(other.m_impl)) {}
|
||||||
|
|
||||||
//! Virtual destructor
|
//! Virtual destructor
|
||||||
virtual ~CDictionary() {}
|
virtual ~CDictionary() {}
|
||||||
|
|
||||||
@@ -345,7 +349,7 @@ namespace BlackMisc
|
|||||||
CDictionary &operator =(const CDictionary &other) { m_impl = other.m_impl; return *this; }
|
CDictionary &operator =(const CDictionary &other) { m_impl = other.m_impl; return *this; }
|
||||||
|
|
||||||
//! Move assignment
|
//! 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.
|
* \brief Access an element by its key.
|
||||||
|
|||||||
Reference in New Issue
Block a user