From a9a4ff61c6e8b24dc59a13f226cde17169f67098 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Wed, 13 Dec 2017 17:01:39 +0100 Subject: [PATCH] :rotating_light: remove C4996 warnings #872 These were the remaining direct calls to alloc. --- src/json.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index b0c85dc1..ba533ccc 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -8028,7 +8028,6 @@ class basic_json static T* create(Args&& ... args) { AllocatorType alloc; - using AllocatorTraits = std::allocator_traits>; auto deleter = [&](T * object) @@ -10719,8 +10718,8 @@ class basic_json if (is_string()) { AllocatorType alloc; - alloc.destroy(m_value.string); - alloc.deallocate(m_value.string, 1); + std::allocator_traits::destroy(alloc, m_value.string); + std::allocator_traits::deallocate(alloc, m_value.string, 1); m_value.string = nullptr; } @@ -10825,8 +10824,8 @@ class basic_json if (is_string()) { AllocatorType alloc; - alloc.destroy(m_value.string); - alloc.deallocate(m_value.string, 1); + std::allocator_traits::destroy(alloc, m_value.string); + std::allocator_traits::deallocate(alloc, m_value.string, 1); m_value.string = nullptr; }