diff options
| author | 2023-07-26 04:25:38 +0000 | |
|---|---|---|
| committer | 2023-07-26 04:25:38 +0000 | |
| commit | 651ed13c79142f26648426a1f57032bce344f7a9 (patch) | |
| tree | c9eee20812600384cc5b1df32a6f58164669f504 | |
| parent | 83ded97394a9f0ae9ccf9e570c4db4c8d1970502 (diff) | |
| parent | ccff001d5872792ff728d1e61b31b3cefa0a0377 (diff) | |
Merge "Add InlineStdAllocator::rebind struct member" into main am: e66246347c am: 770c1df5cb am: 5b528cf043 am: 8548e36faa am: ccff001d58
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2673907
Change-Id: I3bfee0e052f0dd2e30ab021db4b978714e0b4c26
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | libs/ui/include/ui/FatVector.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/ui/include/ui/FatVector.h b/libs/ui/include/ui/FatVector.h index cb61e6a320..494272b1a8 100644 --- a/libs/ui/include/ui/FatVector.h +++ b/libs/ui/include/ui/FatVector.h @@ -65,6 +65,17 @@ public: free(p); } } + + // The STL checks that this member type is present so that + // std::allocator_traits<InlineStdAllocator<T, SIZE>>::rebind_alloc<Other> + // works. std::vector won't be able to construct an + // InlineStdAllocator<Other, SIZE>, because InlineStdAllocator has no + // default constructor, but vector presumably doesn't rebind the allocator + // because it doesn't allocate internal node types. + template <class Other> + struct rebind { + typedef InlineStdAllocator<Other, SIZE> other; + }; Allocation& mAllocation; }; |