Skip to content

Commit 5bb8c14

Browse files
committed
fix: apply astyle formatting to amalgamated headers
Regenerate single_include files and apply astyle --project=tools/astyle/.astylerc to match the format enforced by the CI amalgamation check.
1 parent 58de969 commit 5bb8c14

2 files changed

Lines changed: 83 additions & 72 deletions

File tree

single_include/nlohmann/json.hpp

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -3513,71 +3513,71 @@ NLOHMANN_JSON_NAMESPACE_END
35133513
// SPDX-License-Identifier: MIT
35143514

35153515
#ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_
3516-
#define INCLUDE_NLOHMANN_JSON_FWD_HPP_
3516+
#define INCLUDE_NLOHMANN_JSON_FWD_HPP_
35173517

3518-
#include <cstdint> // int64_t, uint64_t
3519-
#include <map> // map
3520-
#include <memory> // allocator
3521-
#include <string> // string
3522-
#include <vector> // vector
3523-
3524-
// #include <nlohmann/detail/abi_macros.hpp>
3518+
#include <cstdint> // int64_t, uint64_t
3519+
#include <map> // map
3520+
#include <memory> // allocator
3521+
#include <string> // string
3522+
#include <vector> // vector
35253523

3524+
// #include <nlohmann/detail/abi_macros.hpp>
35263525

3527-
/*!
3528-
@brief namespace for Niels Lohmann
3529-
@see https://github.com/nlohmann
3530-
@since version 1.0.0
3531-
*/
3532-
NLOHMANN_JSON_NAMESPACE_BEGIN
35333526

3534-
/*!
3535-
@brief default JSONSerializer template argument
3527+
/*!
3528+
@brief namespace for Niels Lohmann
3529+
@see https://github.com/nlohmann
3530+
@since version 1.0.0
3531+
*/
3532+
NLOHMANN_JSON_NAMESPACE_BEGIN
35363533

3537-
This serializer ignores the template arguments and uses ADL
3538-
([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl))
3539-
for serialization.
3540-
*/
3541-
template<typename T = void, typename SFINAE = void>
3542-
struct adl_serializer;
3543-
3544-
/// a class to store JSON values
3545-
/// @sa https://json.nlohmann.me/api/basic_json/
3546-
template<template<typename U, typename V, typename... Args> class ObjectType =
3547-
std::map,
3548-
template<typename U, typename... Args> class ArrayType = std::vector,
3549-
class StringType = std::string, class BooleanType = bool,
3550-
class NumberIntegerType = std::int64_t,
3551-
class NumberUnsignedType = std::uint64_t,
3552-
class NumberFloatType = double,
3553-
template<typename U> class AllocatorType = std::allocator,
3554-
template<typename T, typename SFINAE = void> class JSONSerializer =
3555-
adl_serializer,
3556-
class BinaryType = std::vector<std::uint8_t>, // cppcheck-suppress syntaxError
3557-
class CustomBaseClass = void>
3558-
class basic_json;
3534+
/*!
3535+
@brief default JSONSerializer template argument
35593536

3560-
/// @brief JSON Pointer defines a string syntax for identifying a specific value within a JSON document
3561-
/// @sa https://json.nlohmann.me/api/json_pointer/
3562-
template<typename RefStringType>
3563-
class json_pointer;
3537+
This serializer ignores the template arguments and uses ADL
3538+
([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl))
3539+
for serialization.
3540+
*/
3541+
template<typename T = void, typename SFINAE = void>
3542+
struct adl_serializer;
3543+
3544+
/// a class to store JSON values
3545+
/// @sa https://json.nlohmann.me/api/basic_json/
3546+
template<template<typename U, typename V, typename... Args> class ObjectType =
3547+
std::map,
3548+
template<typename U, typename... Args> class ArrayType = std::vector,
3549+
class StringType = std::string, class BooleanType = bool,
3550+
class NumberIntegerType = std::int64_t,
3551+
class NumberUnsignedType = std::uint64_t,
3552+
class NumberFloatType = double,
3553+
template<typename U> class AllocatorType = std::allocator,
3554+
template<typename T, typename SFINAE = void> class JSONSerializer =
3555+
adl_serializer,
3556+
class BinaryType = std::vector<std::uint8_t>, // cppcheck-suppress syntaxError
3557+
class CustomBaseClass = void>
3558+
class basic_json;
3559+
3560+
/// @brief JSON Pointer defines a string syntax for identifying a specific value within a JSON document
3561+
/// @sa https://json.nlohmann.me/api/json_pointer/
3562+
template<typename RefStringType>
3563+
class json_pointer;
35643564

3565-
/*!
3566-
@brief default specialization
3567-
@sa https://json.nlohmann.me/api/json/
3568-
*/
3569-
using json = basic_json<>;
3565+
/*!
3566+
@brief default specialization
3567+
@sa https://json.nlohmann.me/api/json/
3568+
*/
3569+
using json = basic_json<>;
35703570

3571-
/// @brief a minimal map-like container that preserves insertion order
3572-
/// @sa https://json.nlohmann.me/api/ordered_map/
3573-
template<class Key, class T, class IgnoredLess, class Allocator>
3574-
struct ordered_map;
3571+
/// @brief a minimal map-like container that preserves insertion order
3572+
/// @sa https://json.nlohmann.me/api/ordered_map/
3573+
template<class Key, class T, class IgnoredLess, class Allocator>
3574+
struct ordered_map;
35753575

3576-
/// @brief specialization that maintains the insertion order of object keys
3577-
/// @sa https://json.nlohmann.me/api/ordered_json/
3578-
using ordered_json = basic_json<nlohmann::ordered_map>;
3576+
/// @brief specialization that maintains the insertion order of object keys
3577+
/// @sa https://json.nlohmann.me/api/ordered_json/
3578+
using ordered_json = basic_json<nlohmann::ordered_map>;
35793579

3580-
NLOHMANN_JSON_NAMESPACE_END
3580+
NLOHMANN_JSON_NAMESPACE_END
35813581

35823582
#endif // INCLUDE_NLOHMANN_JSON_FWD_HPP_
35833583

@@ -5441,7 +5441,7 @@ NLOHMANN_JSON_NAMESPACE_END
54415441

54425442

54435443
// #include <nlohmann/detail/macro_scope.hpp>
5444-
// JSON_HAS_CPP_17
5444+
// JSON_HAS_CPP_17
54455445
#ifdef JSON_HAS_CPP_17
54465446
#include <optional> // optional
54475447
#endif
@@ -20269,10 +20269,10 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
2026920269
const bool allow_exceptions = true,
2027020270
const bool ignore_comments = false,
2027120271
const bool ignore_trailing_commas = false
20272-
)
20272+
)
2027320273
{
2027420274
return ::nlohmann::detail::parser<basic_json, InputAdapterType>(std::move(adapter),
20275-
std::move(cb), allow_exceptions, ignore_comments, ignore_trailing_commas);
20275+
std::move(cb), allow_exceptions, ignore_comments, ignore_trailing_commas);
2027620276
}
2027720277

2027820278
private:
@@ -20970,8 +20970,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
2097020970
detail::enable_if_t <
2097120971
!detail::is_basic_json<U>::value && detail::is_compatible_type<basic_json_t, U>::value, int > = 0 >
2097220972
basic_json(CompatibleType && val) noexcept(noexcept( // NOLINT(bugprone-forwarding-reference-overload,bugprone-exception-escape)
20973-
JSONSerializer<U>::to_json(std::declval<basic_json_t&>(),
20974-
std::forward<CompatibleType>(val))))
20973+
JSONSerializer<U>::to_json(std::declval<basic_json_t&>(),
20974+
std::forward<CompatibleType>(val))))
2097520975
{
2097620976
JSONSerializer<U>::to_json(*this, std::forward<CompatibleType>(val));
2097720977
set_parents();
@@ -21774,7 +21774,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
2177421774
detail::has_from_json<basic_json_t, ValueType>::value,
2177521775
int > = 0 >
2177621776
ValueType get_impl(detail::priority_tag<0> /*unused*/) const noexcept(noexcept(
21777-
JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>(), std::declval<ValueType&>())))
21777+
JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>(), std::declval<ValueType&>())))
2177821778
{
2177921779
auto ret = ValueType();
2178021780
JSONSerializer<ValueType>::from_json(*this, ret);
@@ -21816,7 +21816,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
2181621816
detail::has_non_default_from_json<basic_json_t, ValueType>::value,
2181721817
int > = 0 >
2181821818
ValueType get_impl(detail::priority_tag<1> /*unused*/) const noexcept(noexcept(
21819-
JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>())))
21819+
JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>())))
2182021820
{
2182121821
return JSONSerializer<ValueType>::from_json(*this);
2182221822
}
@@ -21966,7 +21966,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
2196621966
detail::has_from_json<basic_json_t, ValueType>::value,
2196721967
int > = 0 >
2196821968
ValueType & get_to(ValueType& v) const noexcept(noexcept(
21969-
JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>(), v)))
21969+
JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>(), v)))
2197021970
{
2197121971
JSONSerializer<ValueType>::from_json(*this, v);
2197221972
return v;

single_include/nlohmann/json_fwd.hpp

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,31 @@
7070
#define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON
7171
#endif
7272

73+
#ifndef JSON_BRACE_INIT_COPY_SEMANTICS
74+
#define JSON_BRACE_INIT_COPY_SEMANTICS 0
75+
#endif
76+
77+
#if JSON_BRACE_INIT_COPY_SEMANTICS
78+
#define NLOHMANN_JSON_ABI_TAG_BRACE_INIT_COPY_SEMANTICS _bics
79+
#else
80+
#define NLOHMANN_JSON_ABI_TAG_BRACE_INIT_COPY_SEMANTICS
81+
#endif
82+
7383
#ifndef NLOHMANN_JSON_NAMESPACE_NO_VERSION
7484
#define NLOHMANN_JSON_NAMESPACE_NO_VERSION 0
7585
#endif
7686

7787
// Construct the namespace ABI tags component
78-
#define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b, c) json_abi ## a ## b ## c
79-
#define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b, c) \
80-
NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b, c)
81-
82-
#define NLOHMANN_JSON_ABI_TAGS \
83-
NLOHMANN_JSON_ABI_TAGS_CONCAT( \
84-
NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \
85-
NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON, \
86-
NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS)
88+
#define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b, c, d) json_abi ## a ## b ## c ## d
89+
#define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b, c, d) \
90+
NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b, c, d)
91+
92+
#define NLOHMANN_JSON_ABI_TAGS \
93+
NLOHMANN_JSON_ABI_TAGS_CONCAT( \
94+
NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \
95+
NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON, \
96+
NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS, \
97+
NLOHMANN_JSON_ABI_TAG_BRACE_INIT_COPY_SEMANTICS)
8798

8899
// Construct the namespace version component
89100
#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) \

0 commit comments

Comments
 (0)