about summary refs log tree commit diff
path: root/absl/container
diff options
context:
space:
mode:
Diffstat (limited to 'absl/container')
-rw-r--r--absl/container/CMakeLists.txt17
-rw-r--r--absl/container/fixed_array.h2
-rw-r--r--absl/container/flat_hash_set.h2
-rw-r--r--absl/container/inlined_vector.h2
-rw-r--r--absl/container/inlined_vector_test.cc12
-rw-r--r--absl/container/internal/hash_policy_testing.h2
-rw-r--r--absl/container/internal/raw_hash_set.h4
7 files changed, 22 insertions, 19 deletions
diff --git a/absl/container/CMakeLists.txt b/absl/container/CMakeLists.txt
index 9e406902b058..72113e195127 100644
--- a/absl/container/CMakeLists.txt
+++ b/absl/container/CMakeLists.txt
@@ -52,12 +52,11 @@ absl_library(
   TARGET
     absl_container
   SOURCES
-    "internal/raw_hash_set.cc"
+   "internal/raw_hash_set.cc"
   EXPORT_NAME
     container
 )
 
-
 #
 ## TESTS
 #
@@ -82,7 +81,7 @@ absl_library(
 
 # test fixed_array_test
 set(FIXED_ARRAY_TEST_SRC "fixed_array_test.cc")
-set(FIXED_ARRAY_TEST_PUBLIC_LIBRARIES absl::base absl_throw_delegate test_instance_tracker_lib)
+set(FIXED_ARRAY_TEST_PUBLIC_LIBRARIES absl::base absl_internal_throw_delegate test_instance_tracker_lib)
 
 absl_test(
   TARGET
@@ -111,7 +110,7 @@ absl_test(
 set(FIXED_ARRAY_EXCEPTION_SAFETY_TEST_SRC "fixed_array_exception_safety_test.cc")
 set(FIXED_ARRAY_EXCEPTION_SAFETY_TEST_PUBLIC_LIBRARIES
   absl::container
-  absl_base_internal_exception_safety_testing
+  absl_internal_exception_safety_testing
 )
 
 absl_test(
@@ -128,7 +127,7 @@ absl_test(
 
 # test inlined_vector_test
 set(INLINED_VECTOR_TEST_SRC "inlined_vector_test.cc")
-set(INLINED_VECTOR_TEST_PUBLIC_LIBRARIES absl::base absl_throw_delegate test_instance_tracker_lib)
+set(INLINED_VECTOR_TEST_PUBLIC_LIBRARIES absl::base absl_internal_throw_delegate test_instance_tracker_lib)
 
 absl_test(
   TARGET
@@ -153,7 +152,7 @@ absl_test(
 
 # test test_instance_tracker_test
 set(TEST_INSTANCE_TRACKER_TEST_SRC "internal/test_instance_tracker_test.cc")
-set(TEST_INSTANCE_TRACKER_TEST_PUBLIC_LIBRARIES absl::base absl_throw_delegate test_instance_tracker_lib)
+set(TEST_INSTANCE_TRACKER_TEST_PUBLIC_LIBRARIES absl::base absl_internal_throw_delegate test_instance_tracker_lib)
 
 
 absl_test(
@@ -165,12 +164,14 @@ absl_test(
     ${TEST_INSTANCE_TRACKER_TEST_PUBLIC_LIBRARIES}
 )
 
-
 absl_test(
   TARGET
     raw_hash_set_test
   SOURCES
     "internal/raw_hash_set_test.cc"
   PUBLIC_LIBRARIES
-    absl::base absl::hash absl_throw_delegate test_instance_tracker_lib
+    absl::base
+    absl::hash
+    absl_internal_throw_delegate
+    test_instance_tracker_lib
 )
diff --git a/absl/container/fixed_array.h b/absl/container/fixed_array.h
index fe67dceef669..6da84411aed2 100644
--- a/absl/container/fixed_array.h
+++ b/absl/container/fixed_array.h
@@ -188,7 +188,7 @@ class FixedArray {
   // `FixedArray<T>`. This is equivalent to the most possible addressable bytes
   // over the number of bytes taken by T.
   constexpr size_type max_size() const {
-    return std::numeric_limits<difference_type>::max() / sizeof(value_type);
+    return (std::numeric_limits<difference_type>::max)() / sizeof(value_type);
   }
 
   // FixedArray::empty()
diff --git a/absl/container/flat_hash_set.h b/absl/container/flat_hash_set.h
index 98aead1a8ae2..04fa73f15511 100644
--- a/absl/container/flat_hash_set.h
+++ b/absl/container/flat_hash_set.h
@@ -84,7 +84,7 @@ struct FlatHashSetPolicy;
 //     {"huey", "dewey", "louie"};
 //
 //  // Insert a new element into the flat hash set
-//  ducks.insert("donald"};
+//  ducks.insert("donald");
 //
 //  // Force a rehash of the flat hash set
 //  ducks.rehash(0);
diff --git a/absl/container/inlined_vector.h b/absl/container/inlined_vector.h
index 12756bb820cf..0d773e5a0864 100644
--- a/absl/container/inlined_vector.h
+++ b/absl/container/inlined_vector.h
@@ -264,7 +264,7 @@ class InlinedVector {
     // One bit of the size storage is used to indicate whether the inlined
     // vector is allocated; as a result, the maximum size of the container that
     // we can express is half of the max for our size type.
-    return std::numeric_limits<size_type>::max() / 2;
+    return (std::numeric_limits<size_type>::max)() / 2;
   }
 
   // InlinedVector::data()
diff --git a/absl/container/inlined_vector_test.cc b/absl/container/inlined_vector_test.cc
index 08dcd3ef66fb..5485f454a7cb 100644
--- a/absl/container/inlined_vector_test.cc
+++ b/absl/container/inlined_vector_test.cc
@@ -906,6 +906,8 @@ TYPED_TEST_P(InstanceTest, Swap) {
       InstanceTracker tracker;
       InstanceVec a, b;
       const size_t inlined_capacity = a.capacity();
+      auto min_len = std::min(l1, l2);
+      auto max_len = std::max(l1, l2);
       for (int i = 0; i < l1; i++) a.push_back(Instance(i));
       for (int i = 0; i < l2; i++) b.push_back(Instance(100+i));
       EXPECT_EQ(tracker.instances(), l1 + l2);
@@ -919,15 +921,15 @@ TYPED_TEST_P(InstanceTest, Swap) {
         EXPECT_EQ(tracker.swaps(), 0);  // Allocations are swapped.
         EXPECT_EQ(tracker.moves(), 0);
       } else if (a.size() <= inlined_capacity && b.size() <= inlined_capacity) {
-        EXPECT_EQ(tracker.swaps(), std::min(l1, l2));
-        // TODO(bsamwel): This should use moves when the type is movable.
-        EXPECT_EQ(tracker.copies(), std::max(l1, l2) - std::min(l1, l2));
+        EXPECT_EQ(tracker.swaps(), min_len);
+        EXPECT_EQ((tracker.moves() ? tracker.moves() : tracker.copies()),
+                  max_len - min_len);
       } else {
         // One is allocated and the other isn't. The allocation is transferred
         // without copying elements, and the inlined instances are copied/moved.
         EXPECT_EQ(tracker.swaps(), 0);
-        // TODO(bsamwel): This should use moves when the type is movable.
-        EXPECT_EQ(tracker.copies(), std::min(l1, l2));
+        EXPECT_EQ((tracker.moves() ? tracker.moves() : tracker.copies()),
+                  min_len);
       }
 
       EXPECT_EQ(l1, b.size());
diff --git a/absl/container/internal/hash_policy_testing.h b/absl/container/internal/hash_policy_testing.h
index ffc76ead7a68..38bbec77a2ed 100644
--- a/absl/container/internal/hash_policy_testing.h
+++ b/absl/container/internal/hash_policy_testing.h
@@ -139,7 +139,7 @@ struct Alloc : std::allocator<T> {
   friend bool operator!=(const Alloc& a, const Alloc& b) { return !(a == b); }
 
  private:
-  size_t id_ = std::numeric_limits<size_t>::max();
+  size_t id_ = (std::numeric_limits<size_t>::max)();
 };
 
 template <class Map>
diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h
index 40bdb71b5203..aa423b25df5b 100644
--- a/absl/container/internal/raw_hash_set.h
+++ b/absl/container/internal/raw_hash_set.h
@@ -477,7 +477,7 @@ inline size_t NormalizeCapacity(size_t n) {
   constexpr size_t kMinCapacity = Group::kWidth - 1;
   return n <= kMinCapacity
              ? kMinCapacity
-             : std::numeric_limits<size_t>::max() >> LeadingZeros(n);
+             : (std::numeric_limits<size_t>::max)() >> LeadingZeros(n);
 }
 
 // The node_handle concept from C++17.
@@ -1022,7 +1022,7 @@ class raw_hash_set {
   bool empty() const { return !size(); }
   size_t size() const { return size_; }
   size_t capacity() const { return capacity_; }
-  size_t max_size() const { return std::numeric_limits<size_t>::max(); }
+  size_t max_size() const { return (std::numeric_limits<size_t>::max)(); }
 
   void clear() {
     // Iterating over this container is O(bucket_count()). When bucket_count()