mirror of
https://github.com/nlohmann/json.git
synced 2026-10-24 23:08:56 +00:00
Shorten from_json_inplace_array so astyle aligns its parameters
The opening parenthesis of the previous name sat in column 41, beyond astyle's default --max-continuation-indent of 40, so the continuation lines fell back to a plain double indent. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
2 files changed
+10
-10
No files matched your search
Generated
+5
-5
@@ -6400,8 +6400,8 @@ struct is_trivial_element
|
||||
// the element type may not be default constructible: construct every element
|
||||
// in place (a pack expansion that is unrolled N times)
|
||||
template < typename BasicJsonType, typename T, std::size_t N >
|
||||
std::array<T, N> from_json_inplace_array(const BasicJsonType& j, identity_tag<std::array<T, N>> tag,
|
||||
std::false_type /*is_trivial_element*/)
|
||||
std::array<T, N> from_json_make_array(const BasicJsonType& j, identity_tag<std::array<T, N>> tag,
|
||||
std::false_type /*is_trivial_element*/)
|
||||
{
|
||||
return from_json_inplace_array_impl(j, tag, make_index_sequence<N> {});
|
||||
}
|
||||
@@ -6409,8 +6409,8 @@ std::array<T, N> from_json_inplace_array(const BasicJsonType& j, identity_tag<st
|
||||
// a trivial element type cannot tell default construction plus assignment from
|
||||
// construction in place, so use a loop instead of unrolling N conversions
|
||||
template < typename BasicJsonType, typename T, std::size_t N >
|
||||
std::array<T, N> from_json_inplace_array(const BasicJsonType& j, identity_tag<std::array<T, N>> /*unused*/,
|
||||
std::true_type /*is_trivial_element*/)
|
||||
std::array<T, N> from_json_make_array(const BasicJsonType& j, identity_tag<std::array<T, N>> /*unused*/,
|
||||
std::true_type /*is_trivial_element*/)
|
||||
{
|
||||
std::array<T, N> arr; // NOLINT(cppcoreguidelines-pro-type-member-init,hicpp-member-init): every element is assigned or an exception is thrown
|
||||
from_json_std_array(j, arr);
|
||||
@@ -6426,7 +6426,7 @@ auto from_json(const BasicJsonType& j, identity_tag<std::array<T, N>> tag)
|
||||
throw_type_must_be("array", j);
|
||||
}
|
||||
|
||||
return from_json_inplace_array(j, tag, is_trivial_element<T> {});
|
||||
return from_json_make_array(j, tag, is_trivial_element<T> {});
|
||||
}
|
||||
|
||||
template<typename BasicJsonType>
|
||||
|
||||
Reference in new issue
Block a user