mirror of
https://github.com/Naios/continuable.git
synced 2025-12-06 16:56:44 +08:00
Fix a MSVC C++latest warning regarding allocator traits
This commit is contained in:
parent
3b0d29ae9d
commit
d30814c2ff
@ -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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user