From 57e1c7d55f7251a561ec200038260fcd327b5c98 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 24 Aug 2013 01:29:43 -0700 Subject: [PATCH] Fix build problems when using HashMap. --- public/amtl/am-hashmap.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/public/amtl/am-hashmap.h b/public/amtl/am-hashmap.h index 3ddd5278..632d9fae 100644 --- a/public/amtl/am-hashmap.h +++ b/public/amtl/am-hashmap.h @@ -57,6 +57,10 @@ class HashMap : public AllocPolicy K key; V value; + Entry() + { + } + Entry(const K &aKey, const V &aValue) : key(aKey), value(aValue) @@ -120,6 +124,13 @@ class HashMap : public AllocPolicy return table_.add(i, Entry(key, value)); } + // This can be used to avoid compiler constructed temporaries, since AMTL + // does not yet support move semantics. If you use this, the key and value + // must be set after. + bool add(Insert &i) { + return table_.add(i); + } + size_t estimateMemoryUse() const { return table_.estimateMemoryUse(); }