include/am-hashmap.h
changeset 8 73549b7f37f5
parent 2 5fe3546d3336
child 9 4cd655ff4c2c
     1.1 --- a/include/am-hashmap.h	Fri Aug 23 22:37:59 2013 -0700
     1.2 +++ b/include/am-hashmap.h	Sat Aug 24 01:31:41 2013 -0700
     1.3 @@ -57,6 +57,10 @@
     1.4      K key;
     1.5      V value;
     1.6  
     1.7 +    Entry()
     1.8 +    {
     1.9 +    }
    1.10 +
    1.11      Entry(const K &aKey, const V &aValue)
    1.12       : key(aKey),
    1.13         value(aValue)
    1.14 @@ -120,6 +124,13 @@
    1.15      return table_.add(i, Entry(key, value));
    1.16    }
    1.17  
    1.18 +  // This can be used to avoid compiler constructed temporaries, since AMTL
    1.19 +  // does not yet support move semantics. If you use this, the key and value
    1.20 +  // must be set after.
    1.21 +  bool add(Insert &i) {
    1.22 +    return table_.add(i);
    1.23 +  }
    1.24 +
    1.25    size_t estimateMemoryUse() const {
    1.26      return table_.estimateMemoryUse();
    1.27    }