aboutsummaryrefslogtreecommitdiff
path: root/absl/container/inlined_vector.h
diff options
context:
space:
mode:
Diffstat (limited to 'absl/container/inlined_vector.h')
-rw-r--r--absl/container/inlined_vector.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/absl/container/inlined_vector.h b/absl/container/inlined_vector.h
index bc1c4a77..42121228 100644
--- a/absl/container/inlined_vector.h
+++ b/absl/container/inlined_vector.h
@@ -275,8 +275,9 @@ class InlinedVector {
size_type max_size() const noexcept {
// One bit of the size storage is used to indicate whether the inlined
// vector contains allocated memory. As a result, the maximum size that the
- // inlined vector can express is half of the max for `size_type`.
- return (std::numeric_limits<size_type>::max)() / 2;
+ // inlined vector can express is half of the max for
+ // AllocatorTraits<A>::max_size();
+ return AllocatorTraits<A>::max_size(storage_.GetAllocator()) / 2;
}
// `InlinedVector::capacity()`