update nlohmann:json to v3.12.0

This commit is contained in:
Green Sky
2025-05-21 11:51:08 +02:00
parent 2ea7a1529a
commit 7e76d6116f
50 changed files with 4863 additions and 2641 deletions

View File

@ -1,9 +1,9 @@
// __ _____ _____ _____
// __| | __| | | | JSON for Modern C++
// | | |__ | | | | | | version 3.11.2
// | | |__ | | | | | | version 3.12.0
// |_____|_____|_____|_|___| https://github.com/nlohmann/json
//
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#pragma once
@ -25,28 +25,28 @@ inline std::size_t concat_length()
}
template<typename... Args>
inline std::size_t concat_length(const char* cstr, Args&& ... rest);
inline std::size_t concat_length(const char* cstr, const Args& ... rest);
template<typename StringType, typename... Args>
inline std::size_t concat_length(const StringType& str, Args&& ... rest);
inline std::size_t concat_length(const StringType& str, const Args& ... rest);
template<typename... Args>
inline std::size_t concat_length(const char /*c*/, Args&& ... rest)
inline std::size_t concat_length(const char /*c*/, const Args& ... rest)
{
return 1 + concat_length(std::forward<Args>(rest)...);
return 1 + concat_length(rest...);
}
template<typename... Args>
inline std::size_t concat_length(const char* cstr, Args&& ... rest)
inline std::size_t concat_length(const char* cstr, const Args& ... rest)
{
// cppcheck-suppress ignoredReturnValue
return ::strlen(cstr) + concat_length(std::forward<Args>(rest)...);
return ::strlen(cstr) + concat_length(rest...);
}
template<typename StringType, typename... Args>
inline std::size_t concat_length(const StringType& str, Args&& ... rest)
inline std::size_t concat_length(const StringType& str, const Args& ... rest)
{
return str.size() + concat_length(std::forward<Args>(rest)...);
return str.size() + concat_length(rest...);
}
template<typename OutStringType>
@ -137,7 +137,7 @@ template<typename OutStringType = std::string, typename... Args>
inline OutStringType concat(Args && ... args)
{
OutStringType str;
str.reserve(concat_length(std::forward<Args>(args)...));
str.reserve(concat_length(args...));
concat_into(str, std::forward<Args>(args)...);
return str;
}