Replace custom CompressedTuple with std::tuple.

This commit is contained in:
greg7mdp
2023-04-30 11:00:37 -04:00
parent 9f090342ec
commit 45edb98cd9
5 changed files with 17 additions and 400 deletions
+9 -10
View File
@@ -2281,7 +2281,7 @@ private:
growth_left() = CapacityToGrowth(capacity) - size_;
}
size_t& growth_left() { return settings_.template get<0>(); }
size_t& growth_left() { return std::get<0>(settings_); }
template <size_t N,
template <class, class, class, class> class RefSet,
@@ -2309,13 +2309,13 @@ private:
// small tables.
bool is_small() const { return capacity_ < Group::kWidth - 1; }
hasher& hash_ref() { return settings_.template get<1>(); }
const hasher& hash_ref() const { return settings_.template get<1>(); }
key_equal& eq_ref() { return settings_.template get<2>(); }
const key_equal& eq_ref() const { return settings_.template get<2>(); }
allocator_type& alloc_ref() { return settings_.template get<3>(); }
hasher& hash_ref() { return std::get<1>(settings_); }
const hasher& hash_ref() const { return std::get<1>(settings_); }
key_equal& eq_ref() { return std::get<2>(settings_); }
const key_equal& eq_ref() const { return std::get<2>(settings_); }
allocator_type& alloc_ref() { return std::get<3>(settings_); }
const allocator_type& alloc_ref() const {
return settings_.template get<3>();
return std::get<3>(settings_);
}
// TODO(alkis): Investigate removing some of these fields:
@@ -2326,9 +2326,8 @@ private:
size_t size_ = 0; // number of full slots
size_t capacity_ = 0; // total number of slots
HashtablezInfoHandle infoz_;
phmap::priv::CompressedTuple<size_t /* growth_left */, hasher,
key_equal, allocator_type>
settings_{0, hasher{}, key_equal{}, allocator_type{}};
std::tuple<size_t /* growth_left */, hasher, key_equal, allocator_type>
settings_{0, hasher{}, key_equal{}, allocator_type{}};
};