Merge pull request #873 from nlohmann/feature/issue872
🚨 remove C4996 warnings #872
This commit is contained in:
commit
f80827d068
1 changed files with 4 additions and 5 deletions
|
@ -8028,7 +8028,6 @@ class basic_json
|
||||||
static T* create(Args&& ... args)
|
static T* create(Args&& ... args)
|
||||||
{
|
{
|
||||||
AllocatorType<T> alloc;
|
AllocatorType<T> alloc;
|
||||||
|
|
||||||
using AllocatorTraits = std::allocator_traits<AllocatorType<T>>;
|
using AllocatorTraits = std::allocator_traits<AllocatorType<T>>;
|
||||||
|
|
||||||
auto deleter = [&](T * object)
|
auto deleter = [&](T * object)
|
||||||
|
@ -10719,8 +10718,8 @@ class basic_json
|
||||||
if (is_string())
|
if (is_string())
|
||||||
{
|
{
|
||||||
AllocatorType<string_t> alloc;
|
AllocatorType<string_t> alloc;
|
||||||
alloc.destroy(m_value.string);
|
std::allocator_traits<decltype(alloc)>::destroy(alloc, m_value.string);
|
||||||
alloc.deallocate(m_value.string, 1);
|
std::allocator_traits<decltype(alloc)>::deallocate(alloc, m_value.string, 1);
|
||||||
m_value.string = nullptr;
|
m_value.string = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10825,8 +10824,8 @@ class basic_json
|
||||||
if (is_string())
|
if (is_string())
|
||||||
{
|
{
|
||||||
AllocatorType<string_t> alloc;
|
AllocatorType<string_t> alloc;
|
||||||
alloc.destroy(m_value.string);
|
std::allocator_traits<decltype(alloc)>::destroy(alloc, m_value.string);
|
||||||
alloc.deallocate(m_value.string, 1);
|
std::allocator_traits<decltype(alloc)>::deallocate(alloc, m_value.string, 1);
|
||||||
m_value.string = nullptr;
|
m_value.string = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue