src/Containers.h

changeset 105
6dbac3305614
parent 94
8915ee6a277d
child 115
9be16e1c1e44
--- a/src/Containers.h	Sun Feb 09 15:13:02 2014 +0200
+++ b/src/Containers.h	Sun Feb 09 21:27:55 2014 +0200
@@ -144,10 +144,10 @@
 
 		// =====================================================================
 		//
-		void Merge (const SelfType& vals)
+		void Merge (const SelfType& other)
 		{
-			for (const T & val : vals)
-				Append (val);
+			m_data.resize (Size() + other.Size());
+			std::copy (other.begin(), other.end(), begin() + other.Size());
 		}
 
 		// =====================================================================
@@ -333,6 +333,15 @@
 			return Find (a) != -1;
 		}
 
+		// =====================================================================
+		//
+		SelfType operator+ (const SelfType& other) const
+		{
+			SelfType out (*this);
+			out.Merge (other);
+			return out;
+		}
+
 	private:
 		ListType m_data;
 };

mercurial