1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-28 12:02:00 +03:00
* 👷 prepare GitHub actions for new Docker image

* 👷 use experimental docker image

* 👷 use Clang-Analyzer 14

* 🔇 suppress readability-identifier-length

* 🔇 suppress more Clang-Tidy warnings

* ♻️ simplify code

* 🔇 suppress more Clang-Tidy warnings

* 🔇 suppress more Clang-Tidy warnings

* 🚨 fix warning

* 🚨 fix warning

* 🚨 fix warning

* 👷 use new Docker image
This commit is contained in:
Niels Lohmann
2021-10-29 21:27:34 +02:00
committed by GitHub
parent c4a4e672fd
commit 7440786b81
12 changed files with 98 additions and 151 deletions

View File

@ -1073,64 +1073,34 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}
/// constructor for strings
json_value(const string_t& value)
{
string = create<string_t>(value);
}
json_value(const string_t& value) : string(create<string_t>(value)) {}
/// constructor for rvalue strings
json_value(string_t&& value)
{
string = create<string_t>(std::move(value));
}
json_value(string_t&& value) : string(create<string_t>(std::move(value))) {}
/// constructor for objects
json_value(const object_t& value)
{
object = create<object_t>(value);
}
json_value(const object_t& value) : object(create<object_t>(value)) {}
/// constructor for rvalue objects
json_value(object_t&& value)
{
object = create<object_t>(std::move(value));
}
json_value(object_t&& value) : object(create<object_t>(std::move(value))) {}
/// constructor for arrays
json_value(const array_t& value)
{
array = create<array_t>(value);
}
json_value(const array_t& value) : array(create<array_t>(value)) {}
/// constructor for rvalue arrays
json_value(array_t&& value)
{
array = create<array_t>(std::move(value));
}
json_value(array_t&& value) : array(create<array_t>(std::move(value))) {}
/// constructor for binary arrays
json_value(const typename binary_t::container_type& value)
{
binary = create<binary_t>(value);
}
json_value(const typename binary_t::container_type& value) : binary(create<binary_t>(value)) {}
/// constructor for rvalue binary arrays
json_value(typename binary_t::container_type&& value)
{
binary = create<binary_t>(std::move(value));
}
json_value(typename binary_t::container_type&& value) : binary(create<binary_t>(std::move(value))) {}
/// constructor for binary arrays (internal type)
json_value(const binary_t& value)
{
binary = create<binary_t>(value);
}
json_value(const binary_t& value) : binary(create<binary_t>(value)) {}
/// constructor for rvalue binary arrays (internal type)
json_value(binary_t&& value)
{
binary = create<binary_t>(std::move(value));
}
json_value(binary_t&& value) : binary(create<binary_t>(std::move(value))) {}
void destroy(value_t t)
{