run amalgamate

This commit is contained in:
barcode 2022-08-08 23:47:35 +02:00
parent 962fca21c5
commit 7cd3033e83
2 changed files with 49 additions and 8 deletions

View File

@ -2590,12 +2590,13 @@ JSON_HEDLEY_DIAGNOSTIC_POP
class NumberUnsignedType, class NumberFloatType, \ class NumberUnsignedType, class NumberFloatType, \
template<typename> class AllocatorType, \ template<typename> class AllocatorType, \
template<typename, typename = void> class JSONSerializer, \ template<typename, typename = void> class JSONSerializer, \
class BinaryType> class BinaryType, \
class CustomBaseClass>
#define NLOHMANN_BASIC_JSON_TPL \ #define NLOHMANN_BASIC_JSON_TPL \
basic_json<ObjectType, ArrayType, StringType, BooleanType, \ basic_json<ObjectType, ArrayType, StringType, BooleanType, \
NumberIntegerType, NumberUnsignedType, NumberFloatType, \ NumberIntegerType, NumberUnsignedType, NumberFloatType, \
AllocatorType, JSONSerializer, BinaryType> AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>
// Macros to simplify conversion from/to types // Macros to simplify conversion from/to types
@ -3389,7 +3390,8 @@ NLOHMANN_JSON_NAMESPACE_END
template<typename U> class AllocatorType = std::allocator, template<typename U> class AllocatorType = std::allocator,
template<typename T, typename SFINAE = void> class JSONSerializer = template<typename T, typename SFINAE = void> class JSONSerializer =
adl_serializer, adl_serializer,
class BinaryType = std::vector<std::uint8_t>> class BinaryType = std::vector<std::uint8_t>, // cppcheck-suppress syntaxError
class CustomBaseClass = void>
class basic_json; class basic_json;
/// @brief JSON Pointer defines a string syntax for identifying a specific value within a JSON document /// @brief JSON Pointer defines a string syntax for identifying a specific value within a JSON document
@ -13673,6 +13675,38 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/iterators/primitive_iterator.hpp> // #include <nlohmann/detail/iterators/primitive_iterator.hpp>
// #include <nlohmann/detail/json_custom_base_class.hpp>
#include <type_traits> // conditional, is_same
namespace nlohmann
{
namespace detail
{
/*!
@brief Default base class of the @ref basic_json class.
So that the correct implementation of the copy / move ctors / assign operators
of @ref basic_json does not require complex case distinctions
(no base class / custom base class used as customization point),
@ref basic_json always has a base class.
By default, this class is used because it is empty and thus has no effect
on the behavior of @ref basic_json.
*/
struct json_default_base {};
template<class T>
using json_base_class = typename std::conditional <
std::is_same<T, void>::value,
json_default_base,
T
>::type;
} // namespace detail
} // namespace nlohmann
// #include <nlohmann/detail/json_pointer.hpp> // #include <nlohmann/detail/json_pointer.hpp>
// __ _____ _____ _____ // __ _____ _____ _____
// __| | __| | | | JSON for Modern C++ // __| | __| | | | JSON for Modern C++
@ -19271,6 +19305,7 @@ The invariants are checked by member function assert_invariant().
*/ */
NLOHMANN_BASIC_JSON_TPL_DECLARATION NLOHMANN_BASIC_JSON_TPL_DECLARATION
class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions) class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions)
: public ::nlohmann::detail::json_base_class<CustomBaseClass>
{ {
private: private:
template<detail::value_t> friend struct detail::external_constructor; template<detail::value_t> friend struct detail::external_constructor;
@ -19297,6 +19332,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// workaround type for MSVC /// workaround type for MSVC
using basic_json_t = NLOHMANN_BASIC_JSON_TPL; using basic_json_t = NLOHMANN_BASIC_JSON_TPL;
using json_base_class_t = ::nlohmann::detail::json_base_class<CustomBaseClass>;
JSON_PRIVATE_UNLESS_TESTED: JSON_PRIVATE_UNLESS_TESTED:
// convenience aliases for types residing in namespace detail; // convenience aliases for types residing in namespace detail;
@ -20310,7 +20346,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief copy constructor /// @brief copy constructor
/// @sa https://json.nlohmann.me/api/basic_json/basic_json/ /// @sa https://json.nlohmann.me/api/basic_json/basic_json/
basic_json(const basic_json& other) basic_json(const basic_json& other)
: m_type(other.m_type) : json_base_class_t(other),
m_type(other.m_type)
{ {
// check of passed value is valid // check of passed value is valid
other.assert_invariant(); other.assert_invariant();
@ -20378,11 +20415,12 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief move constructor /// @brief move constructor
/// @sa https://json.nlohmann.me/api/basic_json/basic_json/ /// @sa https://json.nlohmann.me/api/basic_json/basic_json/
basic_json(basic_json&& other) noexcept basic_json(basic_json&& other) noexcept
: m_type(std::move(other.m_type)), : json_base_class_t(std::move(other)),
m_type(std::move(other.m_type)),
m_value(std::move(other.m_value)) m_value(std::move(other.m_value))
{ {
// check that passed value is valid // check that passed value is valid
other.assert_invariant(false); other.assert_invariant(false); // NOLINT(bugprone-use-after-move,hicpp-invalid-access-moved)
// invalidate payload // invalidate payload
other.m_type = value_t::null; other.m_type = value_t::null;
@ -20398,7 +20436,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
std::is_nothrow_move_constructible<value_t>::value&& std::is_nothrow_move_constructible<value_t>::value&&
std::is_nothrow_move_assignable<value_t>::value&& std::is_nothrow_move_assignable<value_t>::value&&
std::is_nothrow_move_constructible<json_value>::value&& std::is_nothrow_move_constructible<json_value>::value&&
std::is_nothrow_move_assignable<json_value>::value std::is_nothrow_move_assignable<json_value>::value&&
std::is_nothrow_move_assignable<json_base_class_t>::value
) )
{ {
// check that passed value is valid // check that passed value is valid
@ -20407,6 +20446,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
using std::swap; using std::swap;
swap(m_type, other.m_type); swap(m_type, other.m_type);
swap(m_value, other.m_value); swap(m_value, other.m_value);
json_base_class_t::operator=(std::move(other));
set_parents(); set_parents();
assert_invariant(); assert_invariant();

View File

@ -147,7 +147,8 @@ template<template<typename U, typename V, typename... Args> class ObjectType =
template<typename U> class AllocatorType = std::allocator, template<typename U> class AllocatorType = std::allocator,
template<typename T, typename SFINAE = void> class JSONSerializer = template<typename T, typename SFINAE = void> class JSONSerializer =
adl_serializer, adl_serializer,
class BinaryType = std::vector<std::uint8_t>> class BinaryType = std::vector<std::uint8_t>, // cppcheck-suppress syntaxError
class CustomBaseClass = void>
class basic_json; class basic_json;
/// @brief JSON Pointer defines a string syntax for identifying a specific value within a JSON document /// @brief JSON Pointer defines a string syntax for identifying a specific value within a JSON document