diff options
author | Geir Storli <geirst@verizonmedia.com> | 2019-05-23 15:41:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-23 15:41:20 +0200 |
commit | 8c2e456fbd41b09b6bacc09562f58befe2d28c56 (patch) | |
tree | 2ec5035df57ca321ad54d667989f7108bec9ea51 /vespalib | |
parent | c8856d2a54e8b49f927d4a1e5955cf5ecdcc4754 (diff) | |
parent | 7cd0d37f36a731938ee1f95a1e34996cd2a7d5f8 (diff) |
Merge pull request #9512 from vespa-engine/toregge/refactor-handle-recorder
Refactor handle recorder.
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/vespa/vespalib/stllike/hash_map.h | 1 | ||||
-rw-r--r-- | vespalib/src/vespa/vespalib/stllike/hash_map.hpp | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/vespalib/src/vespa/vespalib/stllike/hash_map.h b/vespalib/src/vespa/vespalib/stllike/hash_map.h index 34b22ba7ca3..0de03cb97ee 100644 --- a/vespalib/src/vespa/vespalib/stllike/hash_map.h +++ b/vespalib/src/vespa/vespalib/stllike/hash_map.h @@ -27,6 +27,7 @@ public: hash_map & operator = (const hash_map &) = default; hash_map(size_t reserveSize=0); hash_map(size_t reserveSize, H hasher, EQ equality); + hash_map(std::initializer_list<value_type> input); ~hash_map(); iterator begin() { return _ht.begin(); } iterator end() { return _ht.end(); } diff --git a/vespalib/src/vespa/vespalib/stllike/hash_map.hpp b/vespalib/src/vespa/vespalib/stllike/hash_map.hpp index 74f1594965a..2ca6b97748f 100644 --- a/vespalib/src/vespa/vespalib/stllike/hash_map.hpp +++ b/vespalib/src/vespa/vespalib/stllike/hash_map.hpp @@ -17,6 +17,13 @@ hash_map<K, V, H, EQ, M>::hash_map(size_t reserveSize, H hasher, EQ equality) : { } template <typename K, typename V, typename H, typename EQ, typename M> +hash_map<K, V, H, EQ, M>::hash_map(std::initializer_list<value_type> input) + : _ht(0) +{ + insert(input.begin(), input.end()); +} + +template <typename K, typename V, typename H, typename EQ, typename M> hash_map<K, V, H, EQ, M>::~hash_map() = default; template <typename K, typename V, typename H, typename EQ, typename M> |