Support building with C++20

std::allocator<T>::pointer and related are removed in C++20, so moving to
std::allocator_traits which is available since C++11.
Change-Id: Ie67b5c24b27e59edf5595a3575f2794748c3817f
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2894004
Reviewed-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
Kristofer Spinka 2021-05-13 09:22:45 -04:00 committed by Mike Frysinger
parent c484031f1f
commit 5c4b5d89e4

View File

@ -160,9 +160,12 @@ class PageAllocator {
// Wrapper to use with STL containers
template <typename T>
struct PageStdAllocator : public std::allocator<T> {
typedef typename std::allocator<T>::pointer pointer;
typedef typename std::allocator<T>::size_type size_type;
struct PageStdAllocator {
using AllocatorTraits = std::allocator_traits<std::allocator<T>>;
using value_type = typename AllocatorTraits::value_type;
using pointer = typename AllocatorTraits::pointer;
using difference_type = typename AllocatorTraits::difference_type;
using size_type = typename AllocatorTraits::size_type;
explicit PageStdAllocator(PageAllocator& allocator) : allocator_(allocator),
stackdata_(NULL),