[icinga-checkins] icinga.org: icinga2/master: Implement an rvalue constructor for the String and Value classes

git at icinga.org git at icinga.org
Fri Aug 26 09:13:06 CEST 2016


Module: icinga2
Branch: master
Commit: 4f46e59af30fe622ad1e945e3cb94e7e7cc44195
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=4f46e59af30fe622ad1e945e3cb94e7e7cc44195

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Fri Aug 26 08:58:49 2016 +0200

Implement an rvalue constructor for the String and Value classes

fixes #12555

---

 lib/base/string.hpp |    4 ++++
 lib/base/value.hpp  |    4 ++++
 2 files changed, 8 insertions(+)

diff --git a/lib/base/string.hpp b/lib/base/string.hpp
index 2ed06b8..f86b292 100644
--- a/lib/base/string.hpp
+++ b/lib/base/string.hpp
@@ -77,6 +77,10 @@ public:
 		: m_Data(other.m_Data)
 	{ }
 
+	inline String(String&& other)
+		: m_Data(other)
+	{ }
+
 	inline ~String(void)
 	{ }
 
diff --git a/lib/base/value.hpp b/lib/base/value.hpp
index 3d12a26..52a03b1 100644
--- a/lib/base/value.hpp
+++ b/lib/base/value.hpp
@@ -99,6 +99,10 @@ public:
 		: m_Value(other.m_Value)
 	{ }
 
+	inline Value(Value&& other)
+		: m_Value(other.m_Value)
+	{ }
+
 	inline Value(Object *value)
 	{
 		if (!value)



More information about the icinga-checkins mailing list