fix compilation warnings with vs2017+, std=c++17

This commit is contained in:
greg
2019-05-12 11:36:49 -04:00
parent 523d56a74d
commit 8fc1bb41ef
+6 -5
View File
@@ -1417,11 +1417,12 @@ struct RebindAlloc {
using type = typename RebindFirstArg<T, U>::type;
};
template <typename T, typename U>
struct RebindAlloc<T, U, true> {
using type = typename T::template rebind<U>::other;
template <typename A, typename U>
struct RebindAlloc<A, U, true> {
using type = typename std::allocator_traits<A>::template rebind_alloc<U>;
};
} // namespace memory_internal
template <typename Ptr>
@@ -1632,7 +1633,7 @@ private:
static auto construct_impl(int, A& a, // NOLINT(runtime/references)
Args&&... args)
-> decltype(a.construct(std::forward<Args>(args)...)) {
a.construct(std::forward<Args>(args)...);
std::allocator_traits<A>::construct(a, std::forward<Args>(args)...);
}
template <typename T, typename... Args>
@@ -1643,7 +1644,7 @@ private:
template <typename A, typename T>
static auto destroy_impl(int, A& a, // NOLINT(runtime/references)
T* p) -> decltype(a.destroy(p)) {
a.destroy(p);
std::allocator_traits<A>::destroy(a, p);
}
template <typename T>
static void destroy_impl(char, Alloc&, T* p) {