Fix build problems when using HashMap.

This commit is contained in:
David Anderson 2013-08-24 01:29:43 -07:00
parent e489b4a570
commit 57e1c7d55f

View File

@ -57,6 +57,10 @@ class HashMap : public AllocPolicy
K key; K key;
V value; V value;
Entry()
{
}
Entry(const K &aKey, const V &aValue) Entry(const K &aKey, const V &aValue)
: key(aKey), : key(aKey),
value(aValue) value(aValue)
@ -120,6 +124,13 @@ class HashMap : public AllocPolicy
return table_.add(i, Entry(key, value)); 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 { size_t estimateMemoryUse() const {
return table_.estimateMemoryUse(); return table_.estimateMemoryUse();
} }