Skip to content

Commit

Permalink
Fix a MSVC C++latest warning regarding allocator traits
Browse files Browse the repository at this point in the history
  • Loading branch information
Naios committed Mar 12, 2018
1 parent 3b0d29a commit d30814c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/unit-test/single/test-continuable-traverse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,15 @@ struct my_allocator {
};

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) {
return std::allocator<T>{}.deallocate(p, n);
std::allocator<T> allocator;
return std::allocator_traits<std::allocator<T>>::deallocate(allocator, p,
n);
}
};

Expand Down

0 comments on commit d30814c

Please sign in to comment.