Fix build problems when using HashMap.
authorDavid Anderson <dvander@alliedmods.net>
Sat Aug 24 01:29:43 2013 -0700 (2013-08-24)
changeset 4049b52cc94632fd
parent 4048 ebff56b332b2
child 4050 f04f6114dc9e
Fix build problems when using HashMap.
public/amtl/am-hashmap.h
     1.1 --- a/public/amtl/am-hashmap.h	Sat Aug 24 01:29:26 2013 -0700
     1.2 +++ b/public/amtl/am-hashmap.h	Sat Aug 24 01:29:43 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    }