src/model.h

changeset 1074
a62f810ca26f
parent 1073
a0a0d581309b
child 1077
952d6b3e7d11
--- a/src/model.h	Sun Jan 29 15:05:14 2017 +0200
+++ b/src/model.h	Sun Jan 29 15:18:40 2017 +0200
@@ -57,6 +57,14 @@
 			return nullptr;
 	}
 
+	template<typename T, typename... Args>
+	T* emplaceReplacementAt(int position, Args&& ...args)
+	{
+		T* replacement = constructObject<T>(args...);
+		setObjectAt(position, replacement);
+		return replacement;
+	}
+
 protected:
 	template<typename T, typename... Args>
 	T* constructObject(Args&& ...args)

mercurial