Fix the removed std::allocator::pointer member type removed in C++20

This commit is contained in:
Laurent Stacul 2020-02-07 09:37:34 +00:00 committed by Aliaksey Kandratsenka
parent 31024506c5
commit cf2df3b000

View File

@ -787,9 +787,9 @@ template<class Alloc>
static void DirectTestSTLAlloc(Alloc allocator, const char* name) {
HeapLeakChecker check((string("direct_stl-") + name).c_str());
static const int kSize = 1000;
typename Alloc::pointer ptrs[kSize];
typename Alloc::value_type* ptrs[kSize];
for (int i = 0; i < kSize; ++i) {
typename Alloc::pointer p = allocator.allocate(i*3+1);
typename Alloc::value_type* p = allocator.allocate(i*3+1);
HeapLeakChecker::IgnoreObject(p);
// This will crash if p is not known to heap profiler:
// (i.e. STL's "allocator" does not have a direct hook to heap profiler)