Fix a MSVC C++latest warning regarding allocator traits

This commit is contained in:
Denis Blank 2018-03-12 11:20:35 +01:00
parent 3b0d29ae9d
commit d30814c2ff

View File

@ -179,11 +179,15 @@ struct my_allocator {
}; };
pointer allocate(size_type n, void const* hint = nullptr) { pointer allocate(size_type n, void const* hint = nullptr) {
return std::allocator<T>{}.allocate(n, hint); std::allocator<T> allocator;
return std::allocator_traits<std::allocator<T>>::allocate(allocator, n,
hint);
} }
void deallocate(pointer p, size_type n) { void deallocate(pointer p, size_type n) {
return std::allocator<T>{}.deallocate(p, n); std::allocator<T> allocator;
return std::allocator_traits<std::allocator<T>>::deallocate(allocator, p,
n);
} }
}; };