summaryrefslogtreecommitdiff
path: root/libs/ultrahdr/jpegencoderhelper.cpp
diff options
context:
space:
mode:
author Ryan Prichard <rprichard@google.com> 2023-07-20 20:04:42 -0700
committer Ryan Prichard <rprichard@google.com> 2023-07-24 19:24:12 -0700
commit239f45348de7368078b525efbf6fac1085a433ab (patch)
treeb9f47a5c4be83bf1191e2c6e0ed5938225302cf1 /libs/ultrahdr/jpegencoderhelper.cpp
parent39a9427c02c1bb30434e532f0053d436aedf85b2 (diff)
Add InlineStdAllocator::rebind struct member
Newer versions of libc++ (as well as libstdc++) require this of allocators. This member is needed for std::allocator_traits<InlineStdAllocator<T, SIZE>>::rebind_alloc<U>, which contains a typedef for InlineStdAllocator<U>. I believe this requirement was always present, but libc++ is checking for it now. AFAICT, the STL wouldn't be able to construct an InlineStdAllocator<U>, because there is no default constructor, and the copy constructor wouldn't accept a reference to InlineStdAllocator<T>. Perhaps that's OK because this allocator is only used with std::vector, not (say) std::list or std::map, which actually need to allocate internal node types. std::allocator_traits::rebind_alloc can automatically handle custom allocators with type parameters, but not with non-type parameters (i.e. It can't handle "size_t SIZE = 4"). See https://stackoverflow.com/a/34863387. Bug: b/175635923 Test: treehugger Change-Id: I0cceb47ab780414202cef1ed54fa7deb3773d01a
Diffstat (limited to 'libs/ultrahdr/jpegencoderhelper.cpp')
0 files changed, 0 insertions, 0 deletions