changeset 15329:6bde7fa50552 draft

(svn r19970) -Fix (r14742): SmallMap::Insert() did not compile. Construct new items like operator[].
author frosch <frosch@openttd.org>
date Sun, 13 Jun 2010 09:41:48 +0000
parents 6b310a08bd2b
children 839bc68a738c
files src/core/smallmap_type.hpp
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/smallmap_type.hpp
+++ b/src/core/smallmap_type.hpp
@@ -86,7 +86,9 @@
 	FORCEINLINE bool Insert(const T &key, const U &data)
 	{
 		if (this->Find(key) != this->End()) return false;
-		new (this->Append()) Pair(key, data);
+		Pair *n = this->Append();
+		n->first = key;
+		n->second = data;
 		return true;
 	}