From 8890b935fdc323ac84d02b875345d885fd8399de Mon Sep 17 00:00:00 2001 From: Mike Bogdanov Date: Wed, 6 Dec 2017 12:24:50 +0300 Subject: [PATCH] fixed merge conflicts --- src/json.hpp | 89 +++++++++++++++++----------------------------------- 1 file changed, 28 insertions(+), 61 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index 86c66f87..ab2b7d93 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -8115,37 +8115,37 @@ class basic_json void destroy(value_t t) { - switch (t) - { - case value_t::object: - { - AllocatorType alloc; - alloc.destroy(object); - alloc.deallocate(object, 1); - break; - } + switch (t) + { + case value_t::object: + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, object); + std::allocator_traits::deallocate(alloc, object, 1); + break; + } - case value_t::array: - { - AllocatorType alloc; - alloc.destroy(array); - alloc.deallocate(array, 1); - break; - } + case value_t::array: + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, array); + std::allocator_traits::deallocate(alloc, array, 1); + break; + } - case value_t::string: - { - AllocatorType alloc; - alloc.destroy(string); - alloc.deallocate(string, 1); - break; - } + case value_t::string: + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, string); + std::allocator_traits::deallocate(alloc, string, 1); + break; + } - default: - { - break; - } - } + default: + { + break; + } + } } }; @@ -8940,39 +8940,6 @@ class basic_json ~basic_json() { assert_invariant(); - - switch (m_type) - { - case value_t::object: - { - AllocatorType alloc; - std::allocator_traits::destroy(alloc, m_value.object); - std::allocator_traits::deallocate(alloc, m_value.object, 1); - break; - } - - case value_t::array: - { - AllocatorType alloc; - std::allocator_traits::destroy(alloc, m_value.array); - std::allocator_traits::deallocate(alloc, m_value.array, 1); - break; - } - - case value_t::string: - { - AllocatorType alloc; - std::allocator_traits::destroy(alloc, m_value.string); - std::allocator_traits::deallocate(alloc, m_value.string, 1); - break; - } - - default: - { - // all other types need no specific destructor - break; - } - } m_value.destroy(m_type); }