From 230e12df61e4e741000695a857ebb3e5dc405797 Mon Sep 17 00:00:00 2001 From: Natale Patriciello Date: Sun, 25 Feb 2018 11:36:01 +0100 Subject: [PATCH] core: Added move operator for Time type --- src/core/model/nstime.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/core/model/nstime.h b/src/core/model/nstime.h index d4976d5bc..6afe1facd 100644 --- a/src/core/model/nstime.h +++ b/src/core/model/nstime.h @@ -124,7 +124,7 @@ public: * Assignment operator * \param [in] o Time to assign. * \return The Time. - */ + */ inline Time & operator = (const Time & o) { m_data = o.m_data; @@ -136,20 +136,34 @@ public: { if (g_markingTimes) { - Mark (this); + Mark (this); } } /** * Copy constructor * * \param [in] o Time to copy - */ + */ inline Time(const Time & o) : m_data (o.m_data) { if (g_markingTimes) { - Mark (this); + Mark (this); + } + } + + /** + * \brief Move constructor + * + * \param [in] o Time from which take the data + */ + Time (Time &&o) + : m_data (o.m_data) + { + if (g_markingTimes) + { + Mark (this); } } /**