From 6f73c80c6409d6f91cdf66ec1a002177274da2e7 Mon Sep 17 00:00:00 2001 From: Attractive Chaos Date: Fri, 27 Dec 2019 18:55:54 -0500 Subject: [PATCH] for compatibility with older g++ --- cpp/khashl.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cpp/khashl.hpp b/cpp/khashl.hpp index 274c91c..b35d349 100644 --- a/cpp/khashl.hpp +++ b/cpp/khashl.hpp @@ -175,17 +175,17 @@ class KHashMap : public KHashSet, typedef KHashSet, KHashMapEq, khint_t> hashset_t; public: khint_t get(const KType &key) const { - bucket_t t = { .key = key }; + bucket_t t = { key, VType() }; return hashset_t::get(t); } khint_t put(const KType &key, int *absent) { - bucket_t t = { .key = key }; + bucket_t t = { key, VType() }; return hashset_t::put(t, absent); } inline KType &key(khint_t i) { return hashset_t::key(i).key; } inline VType &value(khint_t i) { return hashset_t::key(i).val; } inline VType &operator[] (const KType &key) { - bucket_t t = { .key = key }; + bucket_t t = { key, VType() }; return value(hashset_t::put(t)); } }; @@ -212,11 +212,11 @@ class KHashSetCached : public KHashSet, typedef KHashSet, KHashCachedEq, khint_t> hashset_t; public: khint_t get(const KType &key) const { - bucket_t t = { .key = key, .hash = Hash()(key) }; + bucket_t t = { key, Hash()(key) }; return hashset_t::get(t); } khint_t put(const KType &key, int *absent) { - bucket_t t = { .key = key, .hash = Hash()(key) }; + bucket_t t = { key, Hash()(key) }; return hashset_t::put(t, absent); } inline KType &key(khint_t i) { return hashset_t::key(i).key; } @@ -238,17 +238,17 @@ class KHashMapCached : public KHashSet, KHashCachedEq, khint_t> hashset_t; public: khint_t get(const KType &key) const { - bucket_t t = { .key = key, .hash = Hash()(key) }; + bucket_t t = { key, VType(), Hash()(key) }; return hashset_t::get(t); } khint_t put(const KType &key, int *absent) { - bucket_t t = { .key = key, .hash = Hash()(key) }; + bucket_t t = { key, VType(), Hash()(key) }; return hashset_t::put(t, absent); } inline KType &key(khint_t i) { return hashset_t::key(i).key; } inline VType &value(khint_t i) { return hashset_t::key(i).val; } inline VType &operator[] (const KType &key) { - bucket_t t = { .key = key, .hash = Hash()(key) }; + bucket_t t = { key, VType(), Hash()(key) }; return value(hashset_t::put(t)); } }; -- 2.47.3