From 0ad7994f10624cd1538b1287e56cae5ac9c0cb40 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 23 Feb 2022 06:56:15 -0800 Subject: Export of internal Abseil changes -- 91d76b3ac9edff91f206d9eee60423c39eeeaf93 by Derek Mauro : Internal change PiperOrigin-RevId: 430442277 -- 9f8a87bcc5cc5b0fd8b7f0318f37d152fd8bea06 by Evan Brown : Small refactoring to work towards allowing for node_btree_* containers. - Change common_params::transfer to rely on slot_policy transfer instead of manually doing construct/destruct. Transfer is not construct/destruct for node containers. - Move maps' value_compare into btree.h from btree_map.h so it can be reused for node_btree_map.h. - Also add a test for maps' value_compare protected members. PiperOrigin-RevId: 430245542 -- 0126e0b6295342317d9c9f0a66e2d7009b858426 by Martijn Vels : Add CordRepSubString::Create function with hard checks on IsFlat() | IsExternal() This hardens internal invariants, IsFlat() || IsExternal() is a cheap, single predicted branch, and removes boilerplate code from cord.cc PiperOrigin-RevId: 429676041 -- ed98a92af49d9e238d9f1d1b69fb4eddcd1ccbc7 by Abseil Team : tweaks to status.h documentation to reflect general-purpose communication PiperOrigin-RevId: 429584104 GitOrigin-RevId: 91d76b3ac9edff91f206d9eee60423c39eeeaf93 Change-Id: I54d6d116a564f86a842b983ca76559bf9b388f72 --- absl/container/btree_map.h | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) (limited to 'absl/container/btree_map.h') diff --git a/absl/container/btree_map.h b/absl/container/btree_map.h index ad484ce0..286817f1 100644 --- a/absl/container/btree_map.h +++ b/absl/container/btree_map.h @@ -59,7 +59,7 @@ ABSL_NAMESPACE_BEGIN namespace container_internal { template + int TargetNodeSize, bool IsMulti> struct map_params; } // namespace container_internal @@ -85,7 +85,7 @@ class btree_map : public container_internal::btree_map_container< container_internal::btree>> { + /*IsMulti=*/false>>> { using Base = typename btree_map::btree_map_container; public: @@ -507,7 +507,7 @@ class btree_multimap : public container_internal::btree_multimap_container< container_internal::btree>> { + /*IsMulti=*/true>>> { using Base = typename btree_multimap::btree_multimap_container; public: @@ -817,9 +817,9 @@ namespace container_internal { // A parameters structure for holding the type parameters for a btree_map. // Compare and Alloc should be nothrow copy-constructible. template -struct map_params : common_params> { + int TargetNodeSize, bool IsMulti> +struct map_params : common_params> { using super_type = typename map_params::common_params; using mapped_type = Data; // This type allows us to move keys when it is safe to do so. It is safe @@ -829,25 +829,6 @@ struct map_params : common_params - friend class btree; - - protected: - explicit value_compare(original_key_compare c) : comp(std::move(c)) {} - - original_key_compare comp; // NOLINT - - public: - auto operator()(const value_type &lhs, const value_type &rhs) const - -> decltype(comp(lhs.first, rhs.first)) { - return comp(lhs.first, rhs.first); - } - }; - using is_map_container = std::true_type; - template static auto key(const V &value) -> decltype(value.first) { return value.first; -- cgit v1.2.3