[icinga-checkins] icinga.org: icinga2/master: Make VS 2013 happy

git at icinga.org git at icinga.org
Sat Aug 27 20:03:30 CEST 2016


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

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Sat Aug 27 20:03:12 2016 +0200

Make VS 2013 happy

refs #12555

---

 lib/base/string.hpp |   22 ++++++++++++++++++----
 lib/base/value.hpp  |   26 ++++++++++++++++----------
 2 files changed, 34 insertions(+), 14 deletions(-)

diff --git a/lib/base/string.hpp b/lib/base/string.hpp
index 159fbdc..695f420 100644
--- a/lib/base/string.hpp
+++ b/lib/base/string.hpp
@@ -77,8 +77,13 @@ public:
 		: m_Data(n, c)
 	{ }
 
-	String(const String& other) = default;
-	String(String&& other) = default;
+	String(const String& other)
+		: m_Data(other)
+	{ }
+
+	String(String&& other)
+		: m_Data(std::move(other.m_Data))
+	{ }
 
 	inline ~String(void)
 	{ }
@@ -88,8 +93,17 @@ public:
 		: m_Data(begin, end)
 	{ }
 
-	String& operator=(const String& rhs) = default;
-	String& operator=(String&& rhs) = default;
+	String& operator=(const String& rhs)
+	{
+		m_Data = rhs.m_Data;
+		return *this;
+	}
+
+	String& operator=(String&& rhs)
+	{
+		m_Data = std::move(rhs.m_Data);
+		return *this;
+	}
 
 	inline String& operator=(const std::string& rhs)
 	{
diff --git a/lib/base/value.hpp b/lib/base/value.hpp
index 60e213d..4fcfd65 100644
--- a/lib/base/value.hpp
+++ b/lib/base/value.hpp
@@ -99,16 +99,18 @@ public:
 		: m_Value(String(value))
 	{ }
 
-	Value(const Value& other) = default;
+	Value(const Value& other)
+		: m_Value(other.m_Value)
+	{ }
 
-#if BOOST_VERSION >= 105400
-	Value(Value&& other) = default;
-#else /* BOOST_VERSION */
 	Value(Value&& other)
 	{
+#if BOOST_VERSION >= 105400
+		m_Value = std::move(other.m_Value);
+#else /* BOOST_VERSION */
 		m_Value.swap(other.m_Value);
-	}
 #endif /* BOOST_VERSION */
+	}
 
 	inline Value(Object *value)
 	{
@@ -132,16 +134,20 @@ public:
 	operator double(void) const;
 	operator String(void) const;
 
-	Value& operator=(const Value& other) = default;
+	Value& operator=(const Value& other)
+	{
+		m_Value = other.m_Value;
+		return *this;
+	}
 
-#if BOOST_VERSION >= 105400
-	Value& operator=(Value&& other) = default;
-#else /* BOOST_VERSION */
 	Value& operator=(Value&& other)
 	{
+#if BOOST_VERSION >= 105400
+		m_Value = std::move(other.m_Value);
+#else /* BOOST_VERSION */
 		m_Value.swap(other.m_Value);
-	}
 #endif /* BOOST_VERSION */
+	}
 
 	bool operator==(bool rhs) const;
 	bool operator!=(bool rhs) const;



More information about the icinga-checkins mailing list