mirror of
https://github.com/nlohmann/json.git
synced 2026-10-24 14:58:54 +00:00
Make is_trivial_element a struct so astyle does not indent it
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
2 files changed
+14
-10
No files matched your search
@@ -362,14 +362,16 @@ std::array<T, sizeof...(Idx)> from_json_inplace_array_impl(const BasicJsonType&
|
||||
return { { j.at(Idx).template get<T>()... } };
|
||||
}
|
||||
|
||||
// std::is_trivial is deprecated in C++26 (see binary_writer::to_char_type)
|
||||
// std::is_trivial is deprecated in C++26 (see binary_writer::to_char_type);
|
||||
// a struct rather than an alias, as astyle indents an #ifdef block of aliases
|
||||
template<typename T>
|
||||
struct is_trivial_element
|
||||
#ifdef JSON_HAS_CPP_26
|
||||
template<typename T>
|
||||
using is_trivial_element = conjunction<std::is_trivially_copyable<T>, std::is_trivially_default_constructible<T>>;
|
||||
: conjunction<std::is_trivially_copyable<T>, std::is_trivially_default_constructible<T>>
|
||||
#else
|
||||
template<typename T>
|
||||
using is_trivial_element = std::is_trivial<T>;
|
||||
: std::is_trivial<T>
|
||||
#endif
|
||||
{};
|
||||
|
||||
// the element type may not be default constructible: construct every element
|
||||
// in place (a pack expansion that is unrolled N times)
|
||||
|
||||
Generated
+7
-5
@@ -6386,14 +6386,16 @@ std::array<T, sizeof...(Idx)> from_json_inplace_array_impl(const BasicJsonType&
|
||||
return { { j.at(Idx).template get<T>()... } };
|
||||
}
|
||||
|
||||
// std::is_trivial is deprecated in C++26 (see binary_writer::to_char_type)
|
||||
// std::is_trivial is deprecated in C++26 (see binary_writer::to_char_type);
|
||||
// a struct rather than an alias, as astyle indents an #ifdef block of aliases
|
||||
template<typename T>
|
||||
struct is_trivial_element
|
||||
#ifdef JSON_HAS_CPP_26
|
||||
template<typename T>
|
||||
using is_trivial_element = conjunction<std::is_trivially_copyable<T>, std::is_trivially_default_constructible<T>>;
|
||||
: conjunction<std::is_trivially_copyable<T>, std::is_trivially_default_constructible<T>>
|
||||
#else
|
||||
template<typename T>
|
||||
using is_trivial_element = std::is_trivial<T>;
|
||||
: std::is_trivial<T>
|
||||
#endif
|
||||
{};
|
||||
|
||||
// the element type may not be default constructible: construct every element
|
||||
// in place (a pack expansion that is unrolled N times)
|
||||
|
||||
Reference in new issue
Block a user