summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-06-13 09:41:48 +0000
committerfrosch <frosch@openttd.org>2010-06-13 09:41:48 +0000
commit67bec51f27d47949010ae4eaf777a622619893c8 (patch)
tree795c4e6d460109d878b453196619fdc68a285030
parent55a684efc1a40735fa004ac087f990b4425af636 (diff)
downloadopenttd-67bec51f27d47949010ae4eaf777a622619893c8.tar.xz
(svn r19970) -Fix (r14742): SmallMap::Insert() did not compile. Construct new items like operator[].
-rw-r--r--src/core/smallmap_type.hpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/smallmap_type.hpp b/src/core/smallmap_type.hpp
index 269950544..28000145e 100644
--- a/src/core/smallmap_type.hpp
+++ b/src/core/smallmap_type.hpp
@@ -86,7 +86,9 @@ struct SmallMap : SmallVector<SmallPair<T, U>, S> {
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;
}