mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
Update for C++17 and fix MSVC warnings (#1694)
* Update MSVC arguments * Fix json allocator * Fix simulation diamond * Bump gtest * Remove empty varargs in unit tests * Replace test case with test suite * Remove deprecation warning in optional * Remove need for NOMIXMAX to be defined in wpilib headers
This commit is contained in:
committed by
Peter Johnson
parent
fb1239a2ad
commit
221011494d
@@ -142,24 +142,24 @@ void json::json_value::destroy(value_t t) noexcept
|
||||
case value_t::object:
|
||||
{
|
||||
std::allocator<object_t> alloc;
|
||||
alloc.destroy(object);
|
||||
alloc.deallocate(object, 1);
|
||||
std::allocator_traits<decltype(alloc)>::destroy(alloc, object);
|
||||
std::allocator_traits<decltype(alloc)>::deallocate(alloc, object, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
case value_t::array:
|
||||
{
|
||||
std::allocator<array_t> alloc;
|
||||
alloc.destroy(array);
|
||||
alloc.deallocate(array, 1);
|
||||
std::allocator_traits<decltype(alloc)>::destroy(alloc, array);
|
||||
std::allocator_traits<decltype(alloc)>::deallocate(alloc, array, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
case value_t::string:
|
||||
{
|
||||
std::allocator<std::string> alloc;
|
||||
alloc.destroy(string);
|
||||
alloc.deallocate(string, 1);
|
||||
std::allocator_traits<decltype(alloc)>::destroy(alloc, string);
|
||||
std::allocator_traits<decltype(alloc)>::deallocate(alloc, string, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -621,8 +621,8 @@ json::size_type json::max_size() const noexcept
|
||||
|
||||
case value_t::object:
|
||||
{
|
||||
// delegate call to std::allocator<json>::max_size()
|
||||
return std::allocator<json>().max_size();
|
||||
// delegate call to std::allocator<object_t>::max_size()
|
||||
return std::allocator_traits<object_t>::max_size(*m_value.object);
|
||||
}
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user