diff options
Diffstat (limited to 'absl/container/inlined_vector.h')
-rw-r--r-- | absl/container/inlined_vector.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/absl/container/inlined_vector.h b/absl/container/inlined_vector.h index 03660f165353..75d980274a57 100644 --- a/absl/container/inlined_vector.h +++ b/absl/container/inlined_vector.h @@ -689,11 +689,14 @@ class InlinedVector { new (&rep_.allocation_storage.allocation) Allocation(allocation); } + // TODO(absl-team): investigate whether the reinterpret_cast is appropriate. value_type* inlined_space() { - return reinterpret_cast<value_type*>(&rep_.inlined_storage.inlined); + return reinterpret_cast<value_type*>( + std::addressof(rep_.inlined_storage.inlined[0])); } const value_type* inlined_space() const { - return reinterpret_cast<const value_type*>(&rep_.inlined_storage.inlined); + return reinterpret_cast<const value_type*>( + std::addressof(rep_.inlined_storage.inlined[0])); } value_type* allocated_space() { return allocation().buffer(); } |