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
+8 -12
View File
@@ -1861,7 +1861,7 @@ namespace priv {
void swap(btree &x);
const key_compare &key_comp() const noexcept {
return root_.template get<0>();
return std::get<0>(root_);
}
template <typename K, typename LK>
bool compare_keys(const K &x, const LK &y) const {
@@ -1954,10 +1954,10 @@ namespace priv {
private:
// Internal accessor routines.
node_type *root() { return root_.template get<2>(); }
const node_type *root() const { return root_.template get<2>(); }
node_type *&mutable_root() noexcept { return root_.template get<2>(); }
key_compare *mutable_key_comp() noexcept { return &root_.template get<0>(); }
node_type *root() { return std::get<2>(root_); }
const node_type *root() const { return std::get<2>(root_); }
node_type *&mutable_root() noexcept { return std::get<2>(root_); }
key_compare *mutable_key_comp() noexcept { return &std::get<0>(root_); }
// The leftmost node is stored as the parent of the root node.
node_type *leftmost() { return root()->parent(); }
@@ -1965,10 +1965,10 @@ namespace priv {
// Allocator routines.
allocator_type *mutable_allocator() noexcept {
return &root_.template get<1>();
return &std::get<1>(root_);
}
const allocator_type &allocator() const noexcept {
return root_.template get<1>();
return std::get<1>(root_);
}
// Allocates a correctly aligned node of at least size bytes using the
@@ -2110,11 +2110,7 @@ namespace priv {
}
private:
// We use compressed tuple in order to save space because key_compare and
// allocator_type are usually empty.
phmap::priv::CompressedTuple<key_compare, allocator_type,
node_type *>
root_;
std::tuple<key_compare, allocator_type, node_type *> root_;
// A pointer to the rightmost node. Note that the leftmost node is stored as
// the root's parent.