Sync AMTL.

This commit is contained in:
Arkshine
2014-07-03 11:26:50 +02:00
parent 006e6e967a
commit de73007922
10 changed files with 403 additions and 71 deletions

View File

@@ -138,19 +138,24 @@ class HashMap : public AllocPolicy
// The map must not have been mutated in between findForAdd() and add().
// The Insert object is still valid after add() returns, however.
bool add(Insert &i, const K &key, const V &value) {
return table_.add(i, Entry(key, value));
Entry entry(key, value);
return table_.add(i, ke::Move(entry));
}
bool add(Insert &i, Moveable<K> key, const V &value) {
return table_.add(i, Entry(key, value));
Entry entry(key, value);
return table_.add(i, ke::Move(entry));
}
bool add(Insert &i, const K &key, Moveable<V> value) {
return table_.add(i, Entry(key, value));
Entry entry(key, value);
return table_.add(i, ke::Move(entry));
}
bool add(Insert &i, Moveable<K> key, Moveable<V> value) {
return table_.add(i, Entry(key, value));
Entry entry(key, value);
return table_.add(i, ke::Move(entry));
}
bool add(Insert &i, Moveable<K> key) {
return table_.add(i, Entry(key, V()));
Entry entry(key, V());
return table_.add(i, ke::Move(entry));
}
// This can be used to avoid compiler constructed temporaries, since AMTL