Keep astyle from padding the create_object_with_comparator templates

Spell the negated condition as detail::negation<...> instead of a leading
'!', which made astyle spread the template header out.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-09-30 18:17:33 +02:00
parent 6be8c2e986
commit 4eb8618d16
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -1134,15 +1134,15 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// types, such as nlohmann::ordered_map, fall back to the plain range
/// constructor and default-construct their comparator, just as they
/// always have (@ref detail::is_comparator_constructible_object_type).
template < typename Iterator, detail::enable_if_t <
detail::is_comparator_constructible_object_type<object_t, Iterator>::value, int > = 0 >
template<typename Iterator, detail::enable_if_t<
detail::is_comparator_constructible_object_type<object_t, Iterator>::value, int> = 0>
static object_t* create_object_with_comparator(const object_t& src_object, Iterator first, Iterator last)
{
return create<object_t>(first, last, src_object.key_comp());
}
template < typename Iterator, detail::enable_if_t <
!detail::is_comparator_constructible_object_type<object_t, Iterator>::value, int > = 0 >
template<typename Iterator, detail::enable_if_t<
detail::negation<detail::is_comparator_constructible_object_type<object_t, Iterator>>::value, int> = 0>
static object_t* create_object_with_comparator(const object_t& /*src_object*/, Iterator first, Iterator last)
{
return create<object_t>(first, last);
+4 -4
View File
@@ -27246,15 +27246,15 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// types, such as nlohmann::ordered_map, fall back to the plain range
/// constructor and default-construct their comparator, just as they
/// always have (@ref detail::is_comparator_constructible_object_type).
template < typename Iterator, detail::enable_if_t <
detail::is_comparator_constructible_object_type<object_t, Iterator>::value, int > = 0 >
template<typename Iterator, detail::enable_if_t<
detail::is_comparator_constructible_object_type<object_t, Iterator>::value, int> = 0>
static object_t* create_object_with_comparator(const object_t& src_object, Iterator first, Iterator last)
{
return create<object_t>(first, last, src_object.key_comp());
}
template < typename Iterator, detail::enable_if_t <
!detail::is_comparator_constructible_object_type<object_t, Iterator>::value, int > = 0 >
template<typename Iterator, detail::enable_if_t<
detail::negation<detail::is_comparator_constructible_object_type<object_t, Iterator>>::value, int> = 0>
static object_t* create_object_with_comparator(const object_t& /*src_object*/, Iterator first, Iterator last)
{
return create<object_t>(first, last);