mirror of
https://github.com/greg7mdp/parallel-hashmap.git
synced 2026-08-29 08:34:39 +08:00
Fix test warning related to update c++ 17 deprecation
This commit is contained in:
+2
-2
@@ -1269,7 +1269,7 @@ namespace {
|
||||
"key_compare_to_adapter should have adapted this comparator.");
|
||||
static_assert(
|
||||
std::is_same<phmap::weak_ordering,
|
||||
phmap::result_of_t<Adapted(const K &, const K &)>>::value,
|
||||
phmap::invoke_result_t<Adapted, const K &, const K &>>::value,
|
||||
"Adapted comparator should be a key-compare-to comparator.");
|
||||
}
|
||||
template <typename Compare, typename K>
|
||||
@@ -1280,7 +1280,7 @@ namespace {
|
||||
"key_compare_to_adapter shouldn't have adapted this comparator.");
|
||||
static_assert(
|
||||
std::is_same<bool,
|
||||
phmap::result_of_t<Unadapted(const K &, const K &)>>::value,
|
||||
phmap::invoke_result_t<Unadapted, const K &, const K &>>::value,
|
||||
"Un-adapted comparator should return bool.");
|
||||
}
|
||||
|
||||
|
||||
Vendored
+6
-5
@@ -440,8 +440,9 @@ namespace container_internal {
|
||||
class CountingAllocator : public std::allocator<T> {
|
||||
public:
|
||||
using Alloc = std::allocator<T>;
|
||||
using pointer = typename Alloc::pointer;
|
||||
using size_type = typename Alloc::size_type;
|
||||
using AllocTraits = typename std::allocator_traits<Alloc>;
|
||||
using pointer = typename AllocTraits::pointer;
|
||||
using size_type = typename AllocTraits::size_type;
|
||||
|
||||
CountingAllocator() : bytes_used_(nullptr) {}
|
||||
explicit CountingAllocator(int64_t* b) : bytes_used_(b) {}
|
||||
@@ -451,14 +452,14 @@ namespace container_internal {
|
||||
: Alloc(x), bytes_used_(x.bytes_used_) {}
|
||||
|
||||
pointer allocate(size_type n,
|
||||
std::allocator<void>::const_pointer hint = nullptr) {
|
||||
std::allocator_traits<std::allocator<void>>::const_pointer hint = nullptr) {
|
||||
assert(bytes_used_ != nullptr);
|
||||
*bytes_used_ += n * sizeof(T);
|
||||
return Alloc::allocate(n, hint);
|
||||
return AllocTraits::allocate(*this, n, hint);
|
||||
}
|
||||
|
||||
void deallocate(pointer p, size_type n) {
|
||||
Alloc::deallocate(p, n);
|
||||
AllocTraits::deallocate(*this, p, n);
|
||||
assert(bytes_used_ != nullptr);
|
||||
*bytes_used_ -= n * sizeof(T);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user