diff --git a/README.md b/README.md index c38e7e12e..87c70fc96 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ The `json` class provides an API for manipulating a JSON value. To create a `jso ```cpp #include #include -using json = nlohmann::json; +using nlohmann::json; // ... @@ -164,7 +164,7 @@ If using modules (enabled with `NLOHMANN_JSON_BUILD_MODULES`), this example beco import std; import nlohmann.json; -using json = nlohmann::json; +using nlohmann::json; // ... @@ -842,7 +842,7 @@ assert(p == p2); To make this work with one of your types, you only need to provide two functions: ```cpp -using json = nlohmann::json; +using nlohmann::json; namespace ns { void to_json(json& j, const person& p) { @@ -1257,7 +1257,7 @@ See the page [quality assurance](https://json.nlohmann.me/community/quality_assu #include // for convenience -using json = nlohmann::json; +using nlohmann::json; ``` to the files you want to process JSON and set the necessary switches to enable C++11 (e.g., `-std=c++11` for GCC and Clang). diff --git a/docs/mkdocs/docs/api/basic_json/get_ptr.md b/docs/mkdocs/docs/api/basic_json/get_ptr.md index 7c000f1ac..1a8d87e9d 100644 --- a/docs/mkdocs/docs/api/basic_json/get_ptr.md +++ b/docs/mkdocs/docs/api/basic_json/get_ptr.md @@ -45,7 +45,7 @@ Constant. #include #include - using json = nlohmann::json; + using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/api/macros/json_assert.md b/docs/mkdocs/docs/api/macros/json_assert.md index 5cd52a091..a8f198a7a 100644 --- a/docs/mkdocs/docs/api/macros/json_assert.md +++ b/docs/mkdocs/docs/api/macros/json_assert.md @@ -38,7 +38,7 @@ Therefore, assertions can be switched off by defining `NDEBUG`. ```cpp #include - using json = nlohmann::json; + using nlohmann::json; int main() { @@ -64,7 +64,7 @@ Therefore, assertions can be switched off by defining `NDEBUG`. #include - using json = nlohmann::json; + using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/api/macros/json_brace_init_copy_semantics.md b/docs/mkdocs/docs/api/macros/json_brace_init_copy_semantics.md index a038f8435..adab0769a 100644 --- a/docs/mkdocs/docs/api/macros/json_brace_init_copy_semantics.md +++ b/docs/mkdocs/docs/api/macros/json_brace_init_copy_semantics.md @@ -79,7 +79,7 @@ The default value is `0` (disabled — existing behavior is preserved). ```cpp #include - using json = nlohmann::json; + using nlohmann::json; int main() { @@ -98,7 +98,7 @@ The default value is `0` (disabled — existing behavior is preserved). #define JSON_BRACE_INIT_COPY_SEMANTICS 1 #include - using json = nlohmann::json; + using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/api/macros/json_delete_deprecated_functions.md b/docs/mkdocs/docs/api/macros/json_delete_deprecated_functions.md index 20f0ead0c..bae89d52a 100644 --- a/docs/mkdocs/docs/api/macros/json_delete_deprecated_functions.md +++ b/docs/mkdocs/docs/api/macros/json_delete_deprecated_functions.md @@ -54,7 +54,7 @@ The default value is `0` (disabled, the deprecated functions can still be called ```cpp #include - using json = nlohmann::json; + using nlohmann::json; int main() { @@ -72,7 +72,7 @@ The default value is `0` (disabled, the deprecated functions can still be called #define JSON_DELETE_DEPRECATED_FUNCTIONS 1 #include - using json = nlohmann::json; + using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/api/macros/json_disable_enum_serialization.md b/docs/mkdocs/docs/api/macros/json_disable_enum_serialization.md index 83c48515b..a0024d81a 100644 --- a/docs/mkdocs/docs/api/macros/json_disable_enum_serialization.md +++ b/docs/mkdocs/docs/api/macros/json_disable_enum_serialization.md @@ -39,7 +39,7 @@ The default value is `0`. #define JSON_DISABLE_ENUM_SERIALIZATION 1 #include - using json = nlohmann::json; + using nlohmann::json; enum class Choice { @@ -66,7 +66,7 @@ The default value is `0`. #define JSON_DISABLE_ENUM_SERIALIZATION 1 #include - using json = nlohmann::json; + using nlohmann::json; enum class Choice { @@ -99,7 +99,7 @@ The default value is `0`. #define JSON_DISABLE_ENUM_SERIALIZATION 1 #include - using json = nlohmann::json; + using nlohmann::json; enum class Choice { diff --git a/docs/mkdocs/docs/api/macros/json_disable_stream_bulk_scan.md b/docs/mkdocs/docs/api/macros/json_disable_stream_bulk_scan.md index 3da1ac635..6b45a0056 100644 --- a/docs/mkdocs/docs/api/macros/json_disable_stream_bulk_scan.md +++ b/docs/mkdocs/docs/api/macros/json_disable_stream_bulk_scan.md @@ -92,7 +92,7 @@ The default value is `0`: streams are scanned in bulk. #include #include - using json = nlohmann::json; + using nlohmann::json; int main() { @@ -115,7 +115,7 @@ The default value is `0`: streams are scanned in bulk. #include #include - using json = nlohmann::json; + using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/api/macros/json_disable_tuple_reference_conversion.md b/docs/mkdocs/docs/api/macros/json_disable_tuple_reference_conversion.md index 0a2216b57..6d3aa003b 100644 --- a/docs/mkdocs/docs/api/macros/json_disable_tuple_reference_conversion.md +++ b/docs/mkdocs/docs/api/macros/json_disable_tuple_reference_conversion.md @@ -72,7 +72,7 @@ The default value is `0` (disabled — existing behavior is preserved). ```cpp #include - using json = nlohmann::json; + using nlohmann::json; int main() { @@ -89,7 +89,7 @@ The default value is `0` (disabled — existing behavior is preserved). #define JSON_DISABLE_TUPLE_REFERENCE_CONVERSION 1 #include - using json = nlohmann::json; + using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/api/macros/json_disable_unlocked_file_io.md b/docs/mkdocs/docs/api/macros/json_disable_unlocked_file_io.md index 6bb9d84a6..f0aa40b65 100644 --- a/docs/mkdocs/docs/api/macros/json_disable_unlocked_file_io.md +++ b/docs/mkdocs/docs/api/macros/json_disable_unlocked_file_io.md @@ -73,7 +73,7 @@ The default value is `0`: the file is locked once and read with the unlocked std #include #include - using json = nlohmann::json; + using nlohmann::json; int main() { @@ -92,7 +92,7 @@ The default value is `0`: the file is locked once and read with the unlocked std #include #include - using json = nlohmann::json; + using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/api/macros/json_no_simd.md b/docs/mkdocs/docs/api/macros/json_no_simd.md index 96926c48b..9c92fcc1d 100644 --- a/docs/mkdocs/docs/api/macros/json_no_simd.md +++ b/docs/mkdocs/docs/api/macros/json_no_simd.md @@ -61,7 +61,7 @@ By default, `#!cpp JSON_NO_SIMD` is not defined, and vector instructions are use #include #include - using json = nlohmann::json; + using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/api/macros/json_precise_stream_position.md b/docs/mkdocs/docs/api/macros/json_precise_stream_position.md index 0d0114da3..f641a737a 100644 --- a/docs/mkdocs/docs/api/macros/json_precise_stream_position.md +++ b/docs/mkdocs/docs/api/macros/json_precise_stream_position.md @@ -94,7 +94,7 @@ The default value is `0` (disabled — existing behavior is preserved). #include #include - using json = nlohmann::json; + using nlohmann::json; int main() { @@ -115,7 +115,7 @@ The default value is `0` (disabled — existing behavior is preserved). #include #include - using json = nlohmann::json; + using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/api/macros/json_strict_binary_utf8.md b/docs/mkdocs/docs/api/macros/json_strict_binary_utf8.md index 2369f5f4d..dadcb5fbe 100644 --- a/docs/mkdocs/docs/api/macros/json_strict_binary_utf8.md +++ b/docs/mkdocs/docs/api/macros/json_strict_binary_utf8.md @@ -64,7 +64,7 @@ The default value is `0` (disabled, the behavior of version 3.12.0 and earlier i ```cpp #include - using json = nlohmann::json; + using nlohmann::json; int main() { @@ -81,7 +81,7 @@ The default value is `0` (disabled, the behavior of version 3.12.0 and earlier i #define JSON_STRICT_BINARY_UTF8 1 #include - using json = nlohmann::json; + using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/api/macros/json_strict_nul_handling.md b/docs/mkdocs/docs/api/macros/json_strict_nul_handling.md index 69af3811d..806246053 100644 --- a/docs/mkdocs/docs/api/macros/json_strict_nul_handling.md +++ b/docs/mkdocs/docs/api/macros/json_strict_nul_handling.md @@ -92,7 +92,7 @@ The default value is `0` (disabled — existing behavior is preserved). ```cpp #include - using json = nlohmann::json; + using nlohmann::json; int main() { @@ -109,7 +109,7 @@ The default value is `0` (disabled — existing behavior is preserved). #define JSON_STRICT_NUL_HANDLING 1 #include - using json = nlohmann::json; + using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/api/macros/json_use_objects_for_enum_keyed_maps.md b/docs/mkdocs/docs/api/macros/json_use_objects_for_enum_keyed_maps.md index ca4139c48..8fdf47982 100644 --- a/docs/mkdocs/docs/api/macros/json_use_objects_for_enum_keyed_maps.md +++ b/docs/mkdocs/docs/api/macros/json_use_objects_for_enum_keyed_maps.md @@ -77,7 +77,7 @@ The default value is `0` (disabled — existing behavior is preserved). #include #include - using json = nlohmann::json; + using nlohmann::json; enum TaskState { TS_STOPPED, TS_RUNNING, TS_COMPLETED }; @@ -105,7 +105,7 @@ The default value is `0` (disabled — existing behavior is preserved). #include #include - using json = nlohmann::json; + using nlohmann::json; enum TaskState { TS_STOPPED, TS_RUNNING, TS_COMPLETED }; diff --git a/docs/mkdocs/docs/examples/README.cpp b/docs/mkdocs/docs/examples/README.cpp index 2d641e587..19d86a2b2 100644 --- a/docs/mkdocs/docs/examples/README.cpp +++ b/docs/mkdocs/docs/examples/README.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/accept__iterator_pair.cpp b/docs/mkdocs/docs/examples/accept__iterator_pair.cpp index dc7320de6..676ecb256 100644 --- a/docs/mkdocs/docs/examples/accept__iterator_pair.cpp +++ b/docs/mkdocs/docs/examples/accept__iterator_pair.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/accept__string.cpp b/docs/mkdocs/docs/examples/accept__string.cpp index 8eb3d9b75..5854bd3b0 100644 --- a/docs/mkdocs/docs/examples/accept__string.cpp +++ b/docs/mkdocs/docs/examples/accept__string.cpp @@ -2,19 +2,19 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { // a valid JSON text - auto valid_text = R"( + const auto *valid_text = R"( { "numbers": [1, 2, 3] } )"; // an invalid JSON text - auto invalid_text = R"( + const auto *invalid_text = R"( { "strings": ["extra", "comma", ] } diff --git a/docs/mkdocs/docs/examples/accept__wide_string.cpp b/docs/mkdocs/docs/examples/accept__wide_string.cpp index 63dce67db..af25ae873 100644 --- a/docs/mkdocs/docs/examples/accept__wide_string.cpp +++ b/docs/mkdocs/docs/examples/accept__wide_string.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/array.cpp b/docs/mkdocs/docs/examples/array.cpp index 139b5ef10..b0ee3f932 100644 --- a/docs/mkdocs/docs/examples/array.cpp +++ b/docs/mkdocs/docs/examples/array.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/array_t.cpp b/docs/mkdocs/docs/examples/array_t.cpp index 0964857b7..c1196620e 100644 --- a/docs/mkdocs/docs/examples/array_t.cpp +++ b/docs/mkdocs/docs/examples/array_t.cpp @@ -2,9 +2,9 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { - std::cout << std::boolalpha << std::is_same, json::array_t>::value << std::endl; + std::cout << std::boolalpha << std::is_same, json::array_t>::value << '\n'; } diff --git a/docs/mkdocs/docs/examples/at__json_pointer.cpp b/docs/mkdocs/docs/examples/at__json_pointer.cpp index 15e91433d..23bb917c3 100644 --- a/docs/mkdocs/docs/examples/at__json_pointer.cpp +++ b/docs/mkdocs/docs/examples/at__json_pointer.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() diff --git a/docs/mkdocs/docs/examples/at__json_pointer_const.cpp b/docs/mkdocs/docs/examples/at__json_pointer_const.cpp index ab026e078..6e121b75d 100644 --- a/docs/mkdocs/docs/examples/at__json_pointer_const.cpp +++ b/docs/mkdocs/docs/examples/at__json_pointer_const.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() diff --git a/docs/mkdocs/docs/examples/at__keytype.c++17.cpp b/docs/mkdocs/docs/examples/at__keytype.c++17.cpp index 032506acd..271158dd7 100644 --- a/docs/mkdocs/docs/examples/at__keytype.c++17.cpp +++ b/docs/mkdocs/docs/examples/at__keytype.c++17.cpp @@ -3,7 +3,7 @@ #include using namespace std::string_view_literals; -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/at__keytype_const.c++17.cpp b/docs/mkdocs/docs/examples/at__keytype_const.c++17.cpp index 712d456e6..948e46368 100644 --- a/docs/mkdocs/docs/examples/at__keytype_const.c++17.cpp +++ b/docs/mkdocs/docs/examples/at__keytype_const.c++17.cpp @@ -3,7 +3,7 @@ #include using namespace std::string_view_literals; -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/at__object_t_key_type.cpp b/docs/mkdocs/docs/examples/at__object_t_key_type.cpp index e1f33ceca..6aaf1b4d0 100644 --- a/docs/mkdocs/docs/examples/at__object_t_key_type.cpp +++ b/docs/mkdocs/docs/examples/at__object_t_key_type.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/at__object_t_key_type_const.cpp b/docs/mkdocs/docs/examples/at__object_t_key_type_const.cpp index b37bbd489..9cbf3c2c2 100644 --- a/docs/mkdocs/docs/examples/at__object_t_key_type_const.cpp +++ b/docs/mkdocs/docs/examples/at__object_t_key_type_const.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/at__size_type.cpp b/docs/mkdocs/docs/examples/at__size_type.cpp index 6527c6b16..ce6fdefeb 100644 --- a/docs/mkdocs/docs/examples/at__size_type.cpp +++ b/docs/mkdocs/docs/examples/at__size_type.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/at__size_type_const.cpp b/docs/mkdocs/docs/examples/at__size_type_const.cpp index 2080387a3..78d2d5f62 100644 --- a/docs/mkdocs/docs/examples/at__size_type_const.cpp +++ b/docs/mkdocs/docs/examples/at__size_type_const.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/back.cpp b/docs/mkdocs/docs/examples/back.cpp index 45342db13..6f1526cc4 100644 --- a/docs/mkdocs/docs/examples/back.cpp +++ b/docs/mkdocs/docs/examples/back.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json__BasicJsonType.cpp b/docs/mkdocs/docs/examples/basic_json__BasicJsonType.cpp index 562d45b9f..9586832db 100644 --- a/docs/mkdocs/docs/examples/basic_json__BasicJsonType.cpp +++ b/docs/mkdocs/docs/examples/basic_json__BasicJsonType.cpp @@ -1,8 +1,8 @@ #include #include -using json = nlohmann::json; -using ordered_json = nlohmann::ordered_json; +using nlohmann::json; +using nlohmann::ordered_json; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json__CompatibleType.cpp b/docs/mkdocs/docs/examples/basic_json__CompatibleType.cpp index 130ef6aec..f1301b8d9 100644 --- a/docs/mkdocs/docs/examples/basic_json__CompatibleType.cpp +++ b/docs/mkdocs/docs/examples/basic_json__CompatibleType.cpp @@ -8,7 +8,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json__InputIt_InputIt.cpp b/docs/mkdocs/docs/examples/basic_json__InputIt_InputIt.cpp index dec693c80..ece5a7fe4 100644 --- a/docs/mkdocs/docs/examples/basic_json__InputIt_InputIt.cpp +++ b/docs/mkdocs/docs/examples/basic_json__InputIt_InputIt.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json__basic_json.cpp b/docs/mkdocs/docs/examples/basic_json__basic_json.cpp index 17136f437..481d43458 100644 --- a/docs/mkdocs/docs/examples/basic_json__basic_json.cpp +++ b/docs/mkdocs/docs/examples/basic_json__basic_json.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json__copyassignment.cpp b/docs/mkdocs/docs/examples/basic_json__copyassignment.cpp index 2d8657400..e2b684e13 100644 --- a/docs/mkdocs/docs/examples/basic_json__copyassignment.cpp +++ b/docs/mkdocs/docs/examples/basic_json__copyassignment.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json__list_init_t.cpp b/docs/mkdocs/docs/examples/basic_json__list_init_t.cpp index 78611e1a3..c678318dc 100644 --- a/docs/mkdocs/docs/examples/basic_json__list_init_t.cpp +++ b/docs/mkdocs/docs/examples/basic_json__list_init_t.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json__moveconstructor.cpp b/docs/mkdocs/docs/examples/basic_json__moveconstructor.cpp index 48b68f61e..f8a84d091 100644 --- a/docs/mkdocs/docs/examples/basic_json__moveconstructor.cpp +++ b/docs/mkdocs/docs/examples/basic_json__moveconstructor.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json__nullptr_t.cpp b/docs/mkdocs/docs/examples/basic_json__nullptr_t.cpp index 7a4366650..ed69b5707 100644 --- a/docs/mkdocs/docs/examples/basic_json__nullptr_t.cpp +++ b/docs/mkdocs/docs/examples/basic_json__nullptr_t.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json__size_type_basic_json.cpp b/docs/mkdocs/docs/examples/basic_json__size_type_basic_json.cpp index 9ec767727..526ed5457 100644 --- a/docs/mkdocs/docs/examples/basic_json__size_type_basic_json.cpp +++ b/docs/mkdocs/docs/examples/basic_json__size_type_basic_json.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json__value_t.cpp b/docs/mkdocs/docs/examples/basic_json__value_t.cpp index c306731ac..b52b3a442 100644 --- a/docs/mkdocs/docs/examples/basic_json__value_t.cpp +++ b/docs/mkdocs/docs/examples/basic_json__value_t.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_document__accept.cpp b/docs/mkdocs/docs/examples/basic_json_document__accept.cpp index 675fa823f..e7273bab6 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__accept.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__accept.cpp @@ -2,7 +2,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_document__basic_json_document.cpp b/docs/mkdocs/docs/examples/basic_json_document__basic_json_document.cpp index 0c185f7b8..3d6741155 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__basic_json_document.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__basic_json_document.cpp @@ -2,7 +2,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_document__erase.cpp b/docs/mkdocs/docs/examples/basic_json_document__erase.cpp index 4b3197698..116eba8a9 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__erase.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__erase.cpp @@ -1,9 +1,9 @@ #include #include -using json = nlohmann::json; -using json_editable_document = nlohmann::json_editable_document; -using json_editable_view = nlohmann::json_editable_view; +using nlohmann::json; +using nlohmann::json_editable_document; +using nlohmann::json_editable_view; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_document__insert.cpp b/docs/mkdocs/docs/examples/basic_json_document__insert.cpp index 1c04bd6cc..714c4b98e 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__insert.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__insert.cpp @@ -1,9 +1,9 @@ #include #include -using json = nlohmann::json; -using json_editable_document = nlohmann::json_editable_document; -using json_editable_view = nlohmann::json_editable_view; +using nlohmann::json; +using nlohmann::json_editable_document; +using nlohmann::json_editable_view; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_document__is_discarded.cpp b/docs/mkdocs/docs/examples/basic_json_document__is_discarded.cpp index d64d37d23..62ce5b29a 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__is_discarded.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__is_discarded.cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_document__load.cpp b/docs/mkdocs/docs/examples/basic_json_document__load.cpp index 52a085a10..03861deb6 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__load.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__load.cpp @@ -4,8 +4,8 @@ #include #include -using json = nlohmann::json; -using json_document = nlohmann::json_document; +using nlohmann::json; +using nlohmann::json_document; using image_check = json_document::image_check; int main() diff --git a/docs/mkdocs/docs/examples/basic_json_document__memory_usage.cpp b/docs/mkdocs/docs/examples/basic_json_document__memory_usage.cpp index efa235310..7e9e9136f 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__memory_usage.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__memory_usage.cpp @@ -2,7 +2,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_document__node_count.cpp b/docs/mkdocs/docs/examples/basic_json_document__node_count.cpp index d6ae5f89b..bb685bb51 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__node_count.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__node_count.cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_document__owns_source.cpp b/docs/mkdocs/docs/examples/basic_json_document__owns_source.cpp index 8f442ea13..05bca7856 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__owns_source.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__owns_source.cpp @@ -2,7 +2,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_document__parse.cpp b/docs/mkdocs/docs/examples/basic_json_document__parse.cpp index 4eba7350d..b103bac85 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__parse.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__parse.cpp @@ -3,7 +3,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_document__parse_copy.cpp b/docs/mkdocs/docs/examples/basic_json_document__parse_copy.cpp index 16d3ce939..4770a4bfb 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__parse_copy.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__parse_copy.cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; json_document parse_from_temporary_buffer() { diff --git a/docs/mkdocs/docs/examples/basic_json_document__parse_iterator_pair.cpp b/docs/mkdocs/docs/examples/basic_json_document__parse_iterator_pair.cpp index 6d446bd67..ea0376254 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__parse_iterator_pair.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__parse_iterator_pair.cpp @@ -2,7 +2,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_document__push_back.cpp b/docs/mkdocs/docs/examples/basic_json_document__push_back.cpp index 16385ea99..e7a33a3e0 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__push_back.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__push_back.cpp @@ -1,8 +1,8 @@ #include #include -using json = nlohmann::json; -using json_editable_document = nlohmann::json_editable_document; +using nlohmann::json; +using nlohmann::json_editable_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_document__read.cpp b/docs/mkdocs/docs/examples/basic_json_document__read.cpp index 4858a7db7..7b9208da9 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__read.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__read.cpp @@ -3,7 +3,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_document__root.cpp b/docs/mkdocs/docs/examples/basic_json_document__root.cpp index 9789f2566..5b06ec6da 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__root.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__root.cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_document__save.cpp b/docs/mkdocs/docs/examples/basic_json_document__save.cpp index 6a3cc978b..76eac5efe 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__save.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__save.cpp @@ -4,7 +4,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_document__set.cpp b/docs/mkdocs/docs/examples/basic_json_document__set.cpp index 7631a7b1b..ece572ee2 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__set.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__set.cpp @@ -1,9 +1,9 @@ #include #include -using json = nlohmann::json; -using json_editable_document = nlohmann::json_editable_document; -using json_editable_view = nlohmann::json_editable_view; +using nlohmann::json; +using nlohmann::json_editable_document; +using nlohmann::json_editable_view; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_document__shrink_to_fit.cpp b/docs/mkdocs/docs/examples/basic_json_document__shrink_to_fit.cpp index f2560078a..6ab9b6503 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__shrink_to_fit.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__shrink_to_fit.cpp @@ -3,7 +3,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_document__source.cpp b/docs/mkdocs/docs/examples/basic_json_document__source.cpp index 722cdffaf..12d40ee72 100644 --- a/docs/mkdocs/docs/examples/basic_json_document__source.cpp +++ b/docs/mkdocs/docs/examples/basic_json_document__source.cpp @@ -2,7 +2,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__at.cpp b/docs/mkdocs/docs/examples/basic_json_view__at.cpp index 1e984c55f..2cd390e36 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__at.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__at.cpp @@ -1,8 +1,8 @@ #include #include -using json_document = nlohmann::json_document; -using json_view = nlohmann::json_view; +using nlohmann::json_document; +using nlohmann::json_view; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__at_json_pointer.cpp b/docs/mkdocs/docs/examples/basic_json_view__at_json_pointer.cpp index 47ed9419c..8f6088d84 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__at_json_pointer.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__at_json_pointer.cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; using json_pointer = nlohmann::json::json_pointer; int main() diff --git a/docs/mkdocs/docs/examples/basic_json_view__back.cpp b/docs/mkdocs/docs/examples/basic_json_view__back.cpp index 606cb8966..6fa64cbc0 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__back.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__back.cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__begin.cpp b/docs/mkdocs/docs/examples/basic_json_view__begin.cpp index 5989ae404..71a119602 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__begin.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__begin.cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__cbegin.cpp b/docs/mkdocs/docs/examples/basic_json_view__cbegin.cpp index 4e67a8041..70b532077 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__cbegin.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__cbegin.cpp @@ -2,8 +2,8 @@ #include #include -using json_document = nlohmann::json_document; -using json_view = nlohmann::json_view; +using nlohmann::json_document; +using nlohmann::json_view; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__cend.cpp b/docs/mkdocs/docs/examples/basic_json_view__cend.cpp index c72990673..d396f43bf 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__cend.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__cend.cpp @@ -2,8 +2,8 @@ #include #include -using json_document = nlohmann::json_document; -using json_view = nlohmann::json_view; +using nlohmann::json_document; +using nlohmann::json_view; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__contains.cpp b/docs/mkdocs/docs/examples/basic_json_view__contains.cpp index e339ee79a..603bef166 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__contains.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__contains.cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__contains_json_pointer.cpp b/docs/mkdocs/docs/examples/basic_json_view__contains_json_pointer.cpp index 260bac5eb..cb86f14bd 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__contains_json_pointer.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__contains_json_pointer.cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; using json_pointer = nlohmann::json::json_pointer; int main() diff --git a/docs/mkdocs/docs/examples/basic_json_view__count.cpp b/docs/mkdocs/docs/examples/basic_json_view__count.cpp index 75d82579f..414ff816f 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__count.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__count.cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__dump.cpp b/docs/mkdocs/docs/examples/basic_json_view__dump.cpp index c9bd8198f..617e4307b 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__dump.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__dump.cpp @@ -1,8 +1,8 @@ #include #include -using json_document = nlohmann::json_document; -using json_view = nlohmann::json_view; +using nlohmann::json_document; +using nlohmann::json_view; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__end.cpp b/docs/mkdocs/docs/examples/basic_json_view__end.cpp index 6808a6c95..cf5f6f421 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__end.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__end.cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__find.cpp b/docs/mkdocs/docs/examples/basic_json_view__find.cpp index 06141b65a..47512fb27 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__find.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__find.cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__front.cpp b/docs/mkdocs/docs/examples/basic_json_view__front.cpp index ed743f77e..079813c48 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__front.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__front.cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__get.cpp b/docs/mkdocs/docs/examples/basic_json_view__get.cpp index 43e262035..e5ede47b9 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__get.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__get.cpp @@ -3,8 +3,8 @@ #include #include -using json_document = nlohmann::json_document; -using json_view = nlohmann::json_view; +using nlohmann::json_document; +using nlohmann::json_view; // address has no direct conversion in get(), so get
() falls back // to materialize().get
() -- a real nlohmann::json value is built diff --git a/docs/mkdocs/docs/examples/basic_json_view__get_string.cpp b/docs/mkdocs/docs/examples/basic_json_view__get_string.cpp index 66ae1bbb3..1c459286b 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__get_string.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__get_string.cpp @@ -2,8 +2,8 @@ #include #include -using json_document = nlohmann::json_document; -using json_view = nlohmann::json_view; +using nlohmann::json_document; +using nlohmann::json_view; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__get_to.cpp b/docs/mkdocs/docs/examples/basic_json_view__get_to.cpp index 748270759..ccab7e309 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__get_to.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__get_to.cpp @@ -2,8 +2,8 @@ #include #include -using json_document = nlohmann::json_document; -using json_view = nlohmann::json_view; +using nlohmann::json_document; +using nlohmann::json_view; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__items.cpp b/docs/mkdocs/docs/examples/basic_json_view__items.cpp index 3f7779c19..aaaaafba5 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__items.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__items.cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__materialize.cpp b/docs/mkdocs/docs/examples/basic_json_view__materialize.cpp index 38160b461..9d11cee95 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__materialize.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__materialize.cpp @@ -2,7 +2,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__number_format.cpp b/docs/mkdocs/docs/examples/basic_json_view__number_format.cpp index f67ea4e84..5ba989d40 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__number_format.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__number_format.cpp @@ -1,8 +1,8 @@ #include #include -using json_document = nlohmann::json_document; -using json_view = nlohmann::json_view; +using nlohmann::json_document; +using nlohmann::json_view; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__number_token.cpp b/docs/mkdocs/docs/examples/basic_json_view__number_token.cpp index dec63371c..4ccd8d089 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__number_token.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__number_token.cpp @@ -1,8 +1,8 @@ #include #include -using json_document = nlohmann::json_document; -using json_view = nlohmann::json_view; +using nlohmann::json_document; +using nlohmann::json_view; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__operator[].cpp b/docs/mkdocs/docs/examples/basic_json_view__operator[].cpp index 1919e06be..a454bf7c5 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__operator[].cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__operator[].cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__operator[]_json_pointer.cpp b/docs/mkdocs/docs/examples/basic_json_view__operator[]_json_pointer.cpp index 2ea8130a6..3010cb2b5 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__operator[]_json_pointer.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__operator[]_json_pointer.cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; using json_pointer = nlohmann::json::json_pointer; int main() diff --git a/docs/mkdocs/docs/examples/basic_json_view__operator_eq.cpp b/docs/mkdocs/docs/examples/basic_json_view__operator_eq.cpp index 846d40fc0..abea9086d 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__operator_eq.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__operator_eq.cpp @@ -1,8 +1,8 @@ #include #include -using json_document = nlohmann::json_document; -using json = nlohmann::json; +using nlohmann::json_document; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__operator_ltlt.cpp b/docs/mkdocs/docs/examples/basic_json_view__operator_ltlt.cpp index 97100d536..09afb9f6f 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__operator_ltlt.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__operator_ltlt.cpp @@ -2,8 +2,8 @@ #include #include -using json_document = nlohmann::json_document; -using json_view = nlohmann::json_view; +using nlohmann::json_document; +using nlohmann::json_view; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__operator_ne.cpp b/docs/mkdocs/docs/examples/basic_json_view__operator_ne.cpp index faa1d61cf..24fe8927c 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__operator_ne.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__operator_ne.cpp @@ -1,9 +1,9 @@ #include #include -using json_document = nlohmann::json_document; -using ordered_json_document = nlohmann::ordered_json_document; -using json = nlohmann::json; +using nlohmann::json_document; +using nlohmann::ordered_json_document; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__size_empty.cpp b/docs/mkdocs/docs/examples/basic_json_view__size_empty.cpp index 36700ef9d..64a16c589 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__size_empty.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__size_empty.cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__source_offset.cpp b/docs/mkdocs/docs/examples/basic_json_view__source_offset.cpp index 651964f0f..9ec340f1f 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__source_offset.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__source_offset.cpp @@ -2,7 +2,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__type_name.cpp b/docs/mkdocs/docs/examples/basic_json_view__type_name.cpp index 30661c0fd..7e7740877 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__type_name.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__type_name.cpp @@ -1,8 +1,8 @@ #include #include -using json_document = nlohmann::json_document; -using json_view = nlohmann::json_view; +using nlohmann::json_document; +using nlohmann::json_view; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__type_predicates.cpp b/docs/mkdocs/docs/examples/basic_json_view__type_predicates.cpp index edc37ff52..210dbe230 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__type_predicates.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__type_predicates.cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__value.cpp b/docs/mkdocs/docs/examples/basic_json_view__value.cpp index 1829730ef..252c80c57 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__value.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__value.cpp @@ -2,8 +2,8 @@ #include #include -using json_document = nlohmann::json_document; -using json_view = nlohmann::json_view; +using nlohmann::json_document; +using nlohmann::json_view; int main() { diff --git a/docs/mkdocs/docs/examples/basic_json_view__value_json_pointer.cpp b/docs/mkdocs/docs/examples/basic_json_view__value_json_pointer.cpp index 605f389a7..e5b4448fa 100644 --- a/docs/mkdocs/docs/examples/basic_json_view__value_json_pointer.cpp +++ b/docs/mkdocs/docs/examples/basic_json_view__value_json_pointer.cpp @@ -1,8 +1,8 @@ #include #include -using json_document = nlohmann::json_document; -using json_view = nlohmann::json_view; +using nlohmann::json_document; +using nlohmann::json_view; using json_pointer = nlohmann::json::json_pointer; int main() diff --git a/docs/mkdocs/docs/examples/begin.cpp b/docs/mkdocs/docs/examples/begin.cpp index 654835b02..6be31d569 100644 --- a/docs/mkdocs/docs/examples/begin.cpp +++ b/docs/mkdocs/docs/examples/begin.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/binary.cpp b/docs/mkdocs/docs/examples/binary.cpp index 617ce6096..6fff997bb 100644 --- a/docs/mkdocs/docs/examples/binary.cpp +++ b/docs/mkdocs/docs/examples/binary.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -12,5 +12,5 @@ int main() json j = json::binary(vec, 42); // output type and subtype - std::cout << "type: " << j.type_name() << ", subtype: " << j.get_binary().subtype() << std::endl; + std::cout << "type: " << j.type_name() << ", subtype: " << j.get_binary().subtype() << '\n'; } diff --git a/docs/mkdocs/docs/examples/binary_t.cpp b/docs/mkdocs/docs/examples/binary_t.cpp index bfaee5ca8..ed6196634 100644 --- a/docs/mkdocs/docs/examples/binary_t.cpp +++ b/docs/mkdocs/docs/examples/binary_t.cpp @@ -2,9 +2,9 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { - std::cout << std::boolalpha << std::is_same>, json::binary_t>::value << std::endl; + std::cout << std::boolalpha << std::is_same>, json::binary_t>::value << '\n'; } diff --git a/docs/mkdocs/docs/examples/boolean_t.cpp b/docs/mkdocs/docs/examples/boolean_t.cpp index 75b8c99f9..45d6aa385 100644 --- a/docs/mkdocs/docs/examples/boolean_t.cpp +++ b/docs/mkdocs/docs/examples/boolean_t.cpp @@ -2,9 +2,9 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { - std::cout << std::boolalpha << std::is_same::value << std::endl; + std::cout << std::boolalpha << std::is_same::value << '\n'; } diff --git a/docs/mkdocs/docs/examples/byte_container_with_subtype__byte_container_with_subtype.cpp b/docs/mkdocs/docs/examples/byte_container_with_subtype__byte_container_with_subtype.cpp index 1c10be5c2..bcb8d664a 100644 --- a/docs/mkdocs/docs/examples/byte_container_with_subtype__byte_container_with_subtype.cpp +++ b/docs/mkdocs/docs/examples/byte_container_with_subtype__byte_container_with_subtype.cpp @@ -4,7 +4,7 @@ // define a byte container based on std::vector using byte_container_with_subtype = nlohmann::byte_container_with_subtype>; -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -19,5 +19,5 @@ int main() // (3) create container with subtype auto c3 = byte_container_with_subtype(bytes, 42); - std::cout << json(c1) << "\n" << json(c2) << "\n" << json(c3) << std::endl; + std::cout << json(c1) << "\n" << json(c2) << "\n" << json(c3) << '\n'; } diff --git a/docs/mkdocs/docs/examples/byte_container_with_subtype__clear_subtype.cpp b/docs/mkdocs/docs/examples/byte_container_with_subtype__clear_subtype.cpp index f9ce6842b..68a6767f7 100644 --- a/docs/mkdocs/docs/examples/byte_container_with_subtype__clear_subtype.cpp +++ b/docs/mkdocs/docs/examples/byte_container_with_subtype__clear_subtype.cpp @@ -4,7 +4,7 @@ // define a byte container based on std::vector using byte_container_with_subtype = nlohmann::byte_container_with_subtype>; -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/byte_container_with_subtype__has_subtype.cpp b/docs/mkdocs/docs/examples/byte_container_with_subtype__has_subtype.cpp index 61c21eaae..b393be891 100644 --- a/docs/mkdocs/docs/examples/byte_container_with_subtype__has_subtype.cpp +++ b/docs/mkdocs/docs/examples/byte_container_with_subtype__has_subtype.cpp @@ -15,5 +15,5 @@ int main() auto c2 = byte_container_with_subtype(bytes, 42); std::cout << std::boolalpha << "c1.has_subtype() = " << c1.has_subtype() - << "\nc2.has_subtype() = " << c2.has_subtype() << std::endl; + << "\nc2.has_subtype() = " << c2.has_subtype() << '\n'; } diff --git a/docs/mkdocs/docs/examples/byte_container_with_subtype__operator__equal.cpp b/docs/mkdocs/docs/examples/byte_container_with_subtype__operator__equal.cpp index ef2a9cdcb..6b7f079a8 100644 --- a/docs/mkdocs/docs/examples/byte_container_with_subtype__operator__equal.cpp +++ b/docs/mkdocs/docs/examples/byte_container_with_subtype__operator__equal.cpp @@ -19,5 +19,5 @@ int main() << "c1 == c2: " << (c1 == c2) << '\n' << "c1 == c3: " << (c1 == c3) << '\n' << "c3 == c4: " << (c3 == c4) << '\n' - << "c3 == c5: " << (c3 == c5) << std::endl; + << "c3 == c5: " << (c3 == c5) << '\n'; } diff --git a/docs/mkdocs/docs/examples/byte_container_with_subtype__operator__notequal.cpp b/docs/mkdocs/docs/examples/byte_container_with_subtype__operator__notequal.cpp index c7c104342..a3f6f9578 100644 --- a/docs/mkdocs/docs/examples/byte_container_with_subtype__operator__notequal.cpp +++ b/docs/mkdocs/docs/examples/byte_container_with_subtype__operator__notequal.cpp @@ -19,5 +19,5 @@ int main() << "c1 != c2: " << (c1 != c2) << '\n' << "c1 != c3: " << (c1 != c3) << '\n' << "c3 != c4: " << (c3 != c4) << '\n' - << "c3 != c5: " << (c3 != c5) << std::endl; + << "c3 != c5: " << (c3 != c5) << '\n'; } diff --git a/docs/mkdocs/docs/examples/byte_container_with_subtype__set_subtype.cpp b/docs/mkdocs/docs/examples/byte_container_with_subtype__set_subtype.cpp index b2694c54d..3b8123aec 100644 --- a/docs/mkdocs/docs/examples/byte_container_with_subtype__set_subtype.cpp +++ b/docs/mkdocs/docs/examples/byte_container_with_subtype__set_subtype.cpp @@ -4,7 +4,7 @@ // define a byte container based on std::vector using byte_container_with_subtype = nlohmann::byte_container_with_subtype>; -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/byte_container_with_subtype__subtype.cpp b/docs/mkdocs/docs/examples/byte_container_with_subtype__subtype.cpp index cd230ade1..b60e93e8b 100644 --- a/docs/mkdocs/docs/examples/byte_container_with_subtype__subtype.cpp +++ b/docs/mkdocs/docs/examples/byte_container_with_subtype__subtype.cpp @@ -15,7 +15,7 @@ int main() auto c2 = byte_container_with_subtype(bytes, 42); std::cout << "c1.subtype() = " << c1.subtype() - << "\nc2.subtype() = " << c2.subtype() << std::endl; + << "\nc2.subtype() = " << c2.subtype() << '\n'; // in case no subtype is set, return special value assert(c1.subtype() == static_cast(-1)); diff --git a/docs/mkdocs/docs/examples/cbegin.cpp b/docs/mkdocs/docs/examples/cbegin.cpp index bed2b3725..c0c66a36d 100644 --- a/docs/mkdocs/docs/examples/cbegin.cpp +++ b/docs/mkdocs/docs/examples/cbegin.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/cbor_tag_handler_t.cpp b/docs/mkdocs/docs/examples/cbor_tag_handler_t.cpp index 38d168ca8..78c03c282 100644 --- a/docs/mkdocs/docs/examples/cbor_tag_handler_t.cpp +++ b/docs/mkdocs/docs/examples/cbor_tag_handler_t.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -15,14 +15,14 @@ int main() } catch (const json::parse_error& e) { - std::cout << e.what() << std::endl; + std::cout << e.what() << '\n'; } // cbor_tag_handler_t::ignore ignores the tag auto b_ignore_tag = json::from_cbor(vec, true, true, json::cbor_tag_handler_t::ignore); - std::cout << b_ignore_tag << std::endl; + std::cout << b_ignore_tag << '\n'; // cbor_tag_handler_t::store stores the tag as binary subtype auto b_store_tag = json::from_cbor(vec, true, true, json::cbor_tag_handler_t::store); - std::cout << b_store_tag << std::endl; + std::cout << b_store_tag << '\n'; } diff --git a/docs/mkdocs/docs/examples/cend.cpp b/docs/mkdocs/docs/examples/cend.cpp index 3050f5001..374bb3d17 100644 --- a/docs/mkdocs/docs/examples/cend.cpp +++ b/docs/mkdocs/docs/examples/cend.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/clear.cpp b/docs/mkdocs/docs/examples/clear.cpp index f081e7eda..b4a73dbcb 100644 --- a/docs/mkdocs/docs/examples/clear.cpp +++ b/docs/mkdocs/docs/examples/clear.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/comments.cpp b/docs/mkdocs/docs/examples/comments.cpp index fc8a0ac34..1e02a071d 100644 --- a/docs/mkdocs/docs/examples/comments.cpp +++ b/docs/mkdocs/docs/examples/comments.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -20,7 +20,7 @@ int main() } catch (json::exception& e) { - std::cout << e.what() << std::endl; + std::cout << e.what() << '\n'; } json j = json::parse(s, diff --git a/docs/mkdocs/docs/examples/contains__json_pointer.cpp b/docs/mkdocs/docs/examples/contains__json_pointer.cpp index 985ad9ec5..1ace92a93 100644 --- a/docs/mkdocs/docs/examples/contains__json_pointer.cpp +++ b/docs/mkdocs/docs/examples/contains__json_pointer.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() @@ -23,5 +23,5 @@ int main() // an array index with a leading '0' is not found << j.contains("/array/01"_json_pointer) << '\n' // an array index that is not a number is not found - << j.contains("/array/one"_json_pointer) << std::endl; + << j.contains("/array/one"_json_pointer) << '\n'; } diff --git a/docs/mkdocs/docs/examples/contains__keytype.c++17.cpp b/docs/mkdocs/docs/examples/contains__keytype.c++17.cpp index 43b62fab1..6b98b99b6 100644 --- a/docs/mkdocs/docs/examples/contains__keytype.c++17.cpp +++ b/docs/mkdocs/docs/examples/contains__keytype.c++17.cpp @@ -3,7 +3,7 @@ #include using namespace std::string_view_literals; -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() @@ -16,5 +16,5 @@ int main() std::cout << std::boolalpha << "j_object contains 'key': " << j_object.contains("key"sv) << '\n' << "j_object contains 'another': " << j_object.contains("another"sv) << '\n' << - "j_array contains 'key': " << j_array.contains("key"sv) << std::endl; + "j_array contains 'key': " << j_array.contains("key"sv) << '\n'; } diff --git a/docs/mkdocs/docs/examples/contains__object_t_key_type.cpp b/docs/mkdocs/docs/examples/contains__object_t_key_type.cpp index a8bc8143d..f72d81b6a 100644 --- a/docs/mkdocs/docs/examples/contains__object_t_key_type.cpp +++ b/docs/mkdocs/docs/examples/contains__object_t_key_type.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() @@ -14,5 +14,5 @@ int main() std::cout << std::boolalpha << "j_object contains 'key': " << j_object.contains("key") << '\n' << "j_object contains 'another': " << j_object.contains("another") << '\n' << - "j_array contains 'key': " << j_array.contains("key") << std::endl; + "j_array contains 'key': " << j_array.contains("key") << '\n'; } diff --git a/docs/mkdocs/docs/examples/count__keytype.c++17.cpp b/docs/mkdocs/docs/examples/count__keytype.c++17.cpp index ec6de0607..0310e17e1 100644 --- a/docs/mkdocs/docs/examples/count__keytype.c++17.cpp +++ b/docs/mkdocs/docs/examples/count__keytype.c++17.cpp @@ -3,7 +3,7 @@ #include using namespace std::string_view_literals; -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/count__object_t_key_type.cpp b/docs/mkdocs/docs/examples/count__object_t_key_type.cpp index a8d54b9d1..9680f94c3 100644 --- a/docs/mkdocs/docs/examples/count__object_t_key_type.cpp +++ b/docs/mkdocs/docs/examples/count__object_t_key_type.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/crbegin.cpp b/docs/mkdocs/docs/examples/crbegin.cpp index dc3209cf8..2ff1b41f8 100644 --- a/docs/mkdocs/docs/examples/crbegin.cpp +++ b/docs/mkdocs/docs/examples/crbegin.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/crend.cpp b/docs/mkdocs/docs/examples/crend.cpp index dff260931..298a69cb8 100644 --- a/docs/mkdocs/docs/examples/crend.cpp +++ b/docs/mkdocs/docs/examples/crend.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/custom_array_type.cpp b/docs/mkdocs/docs/examples/custom_array_type.cpp index 9765c51e8..fe60d575c 100644 --- a/docs/mkdocs/docs/examples/custom_array_type.cpp +++ b/docs/mkdocs/docs/examples/custom_array_type.cpp @@ -13,6 +13,6 @@ int main() j.push_back(2); j.push_back(3); - std::cout << j.dump() << std::endl; - std::cout << std::boolalpha << (custom_json::parse(j.dump()) == j) << std::endl; + std::cout << j.dump() << '\n'; + std::cout << std::boolalpha << (custom_json::parse(j.dump()) == j) << '\n'; } diff --git a/docs/mkdocs/docs/examples/custom_binary_type.cpp b/docs/mkdocs/docs/examples/custom_binary_type.cpp index 0a835d475..38356af6d 100644 --- a/docs/mkdocs/docs/examples/custom_binary_type.cpp +++ b/docs/mkdocs/docs/examples/custom_binary_type.cpp @@ -10,6 +10,6 @@ int main() { const auto j = custom_json::binary({0x01, 0x02, 0x03}); - std::cout << j.dump() << std::endl; - std::cout << std::boolalpha << (custom_json::from_cbor(custom_json::to_cbor(j)) == j) << std::endl; + std::cout << j.dump() << '\n'; + std::cout << std::boolalpha << (custom_json::from_cbor(custom_json::to_cbor(j)) == j) << '\n'; } diff --git a/docs/mkdocs/docs/examples/custom_object_type.cpp b/docs/mkdocs/docs/examples/custom_object_type.cpp index 9d4b43daf..d37363fc5 100644 --- a/docs/mkdocs/docs/examples/custom_object_type.cpp +++ b/docs/mkdocs/docs/examples/custom_object_type.cpp @@ -14,12 +14,12 @@ int main() j["happy"] = true; j["list"] = {1, 2, 3}; - std::cout << j.dump(2) << std::endl; - std::cout << std::boolalpha << (custom_json::parse(j.dump()) == j) << std::endl; + std::cout << j.dump(2) << '\n'; + std::cout << std::boolalpha << (custom_json::parse(j.dump()) == j) << '\n'; // custom_object_type has no key_compare member, so object_comparator_t // falls back to its default std::cout << std::boolalpha << std::is_same::value - << std::endl; + << '\n'; } diff --git a/docs/mkdocs/docs/examples/custom_string_type.cpp b/docs/mkdocs/docs/examples/custom_string_type.cpp index 2e71c9378..691848aca 100644 --- a/docs/mkdocs/docs/examples/custom_string_type.cpp +++ b/docs/mkdocs/docs/examples/custom_string_type.cpp @@ -13,6 +13,6 @@ int main() j["happy"] = true; j["list"] = {1, 2, 3}; - std::cout << j.dump(2) << std::endl; - std::cout << std::boolalpha << (custom_json::parse(j.dump()) == j) << std::endl; + std::cout << j.dump(2) << '\n'; + std::cout << std::boolalpha << (custom_json::parse(j.dump()) == j) << '\n'; } diff --git a/docs/mkdocs/docs/examples/default_object_comparator_t.cpp b/docs/mkdocs/docs/examples/default_object_comparator_t.cpp index 9f200fe6b..6cb4d4c22 100644 --- a/docs/mkdocs/docs/examples/default_object_comparator_t.cpp +++ b/docs/mkdocs/docs/examples/default_object_comparator_t.cpp @@ -1,11 +1,11 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { std::cout << std::boolalpha << "one < two : " << json::default_object_comparator_t{}("one", "two") << "\n" - << "three < four : " << json::default_object_comparator_t{}("three", "four") << std::endl; + << "three < four : " << json::default_object_comparator_t{}("three", "four") << '\n'; } diff --git a/docs/mkdocs/docs/examples/diagnostic_positions.cpp b/docs/mkdocs/docs/examples/diagnostic_positions.cpp index 259344cd0..5675a1297 100644 --- a/docs/mkdocs/docs/examples/diagnostic_positions.cpp +++ b/docs/mkdocs/docs/examples/diagnostic_positions.cpp @@ -3,7 +3,7 @@ #define JSON_DIAGNOSTIC_POSITIONS 1 #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/diagnostic_positions_exception.cpp b/docs/mkdocs/docs/examples/diagnostic_positions_exception.cpp index 085a25c19..599176364 100644 --- a/docs/mkdocs/docs/examples/diagnostic_positions_exception.cpp +++ b/docs/mkdocs/docs/examples/diagnostic_positions_exception.cpp @@ -3,7 +3,7 @@ #define JSON_DIAGNOSTIC_POSITIONS 1 #include -using json = nlohmann::json; +using nlohmann::json; /* Demonstration of type error exception with diagnostic positions support enabled */ int main() diff --git a/docs/mkdocs/docs/examples/diagnostics_extended.cpp b/docs/mkdocs/docs/examples/diagnostics_extended.cpp index 3b9f484b7..bac1a5363 100644 --- a/docs/mkdocs/docs/examples/diagnostics_extended.cpp +++ b/docs/mkdocs/docs/examples/diagnostics_extended.cpp @@ -3,7 +3,7 @@ # define JSON_DIAGNOSTICS 1 #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/diagnostics_extended_positions.cpp b/docs/mkdocs/docs/examples/diagnostics_extended_positions.cpp index 9a31ac356..22c8685a7 100644 --- a/docs/mkdocs/docs/examples/diagnostics_extended_positions.cpp +++ b/docs/mkdocs/docs/examples/diagnostics_extended_positions.cpp @@ -4,7 +4,7 @@ #define JSON_DIAGNOSTIC_POSITIONS 1 #include -using json = nlohmann::json; +using nlohmann::json; /* Demonstration of type error exception with diagnostic positions support enabled */ int main() diff --git a/docs/mkdocs/docs/examples/diagnostics_standard.cpp b/docs/mkdocs/docs/examples/diagnostics_standard.cpp index eae61a4a7..2c3537d2e 100644 --- a/docs/mkdocs/docs/examples/diagnostics_standard.cpp +++ b/docs/mkdocs/docs/examples/diagnostics_standard.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/diff.cpp b/docs/mkdocs/docs/examples/diff.cpp index ef01332a1..3b089e9a8 100644 --- a/docs/mkdocs/docs/examples/diff.cpp +++ b/docs/mkdocs/docs/examples/diff.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() @@ -33,5 +33,5 @@ int main() // output patch and roundtrip result std::cout << std::setw(4) << patch << "\n\n" - << std::setw(4) << patched_source << std::endl; + << std::setw(4) << patched_source << '\n'; } diff --git a/docs/mkdocs/docs/examples/dump.cpp b/docs/mkdocs/docs/examples/dump.cpp index 009c95fd7..c95381f9e 100644 --- a/docs/mkdocs/docs/examples/dump.cpp +++ b/docs/mkdocs/docs/examples/dump.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -33,11 +33,11 @@ int main() json j_invalid = "ä\xA9ü"; try { - std::cout << j_invalid.dump() << std::endl; + std::cout << j_invalid.dump() << '\n'; } catch (const json::type_error& e) { - std::cout << e.what() << std::endl; + std::cout << e.what() << '\n'; } std::cout << "string with replaced invalid characters: " diff --git a/docs/mkdocs/docs/examples/emplace.cpp b/docs/mkdocs/docs/examples/emplace.cpp index a5314910f..93f665f39 100644 --- a/docs/mkdocs/docs/examples/emplace.cpp +++ b/docs/mkdocs/docs/examples/emplace.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/emplace_back.cpp b/docs/mkdocs/docs/examples/emplace_back.cpp index e979a945c..a9b055434 100644 --- a/docs/mkdocs/docs/examples/emplace_back.cpp +++ b/docs/mkdocs/docs/examples/emplace_back.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/empty.cpp b/docs/mkdocs/docs/examples/empty.cpp index 6ef6e40ed..7d92ebfed 100644 --- a/docs/mkdocs/docs/examples/empty.cpp +++ b/docs/mkdocs/docs/examples/empty.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/end.cpp b/docs/mkdocs/docs/examples/end.cpp index 47beedb77..01d4700bf 100644 --- a/docs/mkdocs/docs/examples/end.cpp +++ b/docs/mkdocs/docs/examples/end.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/erase__IteratorType.cpp b/docs/mkdocs/docs/examples/erase__IteratorType.cpp index f0d4ec6fb..1b1578ba9 100644 --- a/docs/mkdocs/docs/examples/erase__IteratorType.cpp +++ b/docs/mkdocs/docs/examples/erase__IteratorType.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/erase__IteratorType_IteratorType.cpp b/docs/mkdocs/docs/examples/erase__IteratorType_IteratorType.cpp index 392511ffe..f2b06d690 100644 --- a/docs/mkdocs/docs/examples/erase__IteratorType_IteratorType.cpp +++ b/docs/mkdocs/docs/examples/erase__IteratorType_IteratorType.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/erase__keytype.c++17.cpp b/docs/mkdocs/docs/examples/erase__keytype.c++17.cpp index c5e4bed5d..f1339941e 100644 --- a/docs/mkdocs/docs/examples/erase__keytype.c++17.cpp +++ b/docs/mkdocs/docs/examples/erase__keytype.c++17.cpp @@ -3,7 +3,7 @@ #include using namespace std::string_view_literals; -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/erase__object_t_key_type.cpp b/docs/mkdocs/docs/examples/erase__object_t_key_type.cpp index 2fd84c86e..140e77ef6 100644 --- a/docs/mkdocs/docs/examples/erase__object_t_key_type.cpp +++ b/docs/mkdocs/docs/examples/erase__object_t_key_type.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/erase__size_type.cpp b/docs/mkdocs/docs/examples/erase__size_type.cpp index 810062387..b92fed88a 100644 --- a/docs/mkdocs/docs/examples/erase__size_type.cpp +++ b/docs/mkdocs/docs/examples/erase__size_type.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/error_handler_t.cpp b/docs/mkdocs/docs/examples/error_handler_t.cpp index bf035cea3..1b6945b47 100644 --- a/docs/mkdocs/docs/examples/error_handler_t.cpp +++ b/docs/mkdocs/docs/examples/error_handler_t.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -9,11 +9,11 @@ int main() json j_invalid = "ä\xA9ü"; try { - std::cout << j_invalid.dump() << std::endl; + std::cout << j_invalid.dump() << '\n'; } catch (const json::type_error& e) { - std::cout << e.what() << std::endl; + std::cout << e.what() << '\n'; } std::cout << "string with replaced invalid characters: " diff --git a/docs/mkdocs/docs/examples/exception.cpp b/docs/mkdocs/docs/examples/exception.cpp index 3e5a23b3c..17ed0584b 100644 --- a/docs/mkdocs/docs/examples/exception.cpp +++ b/docs/mkdocs/docs/examples/exception.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -15,6 +15,6 @@ int main() { // output exception information std::cout << "message: " << e.what() << '\n' - << "exception id: " << e.id << std::endl; + << "exception id: " << e.id << '\n'; } } diff --git a/docs/mkdocs/docs/examples/find__keytype.c++17.cpp b/docs/mkdocs/docs/examples/find__keytype.c++17.cpp index da94cf0ad..f7efb5d6f 100644 --- a/docs/mkdocs/docs/examples/find__keytype.c++17.cpp +++ b/docs/mkdocs/docs/examples/find__keytype.c++17.cpp @@ -3,7 +3,7 @@ #include using namespace std::string_view_literals; -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/find__object_t_key_type.cpp b/docs/mkdocs/docs/examples/find__object_t_key_type.cpp index 685ba7763..e1e226cb4 100644 --- a/docs/mkdocs/docs/examples/find__object_t_key_type.cpp +++ b/docs/mkdocs/docs/examples/find__object_t_key_type.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/flatten.cpp b/docs/mkdocs/docs/examples/flatten.cpp index 83f3ff6c3..a0ae57ec6 100644 --- a/docs/mkdocs/docs/examples/flatten.cpp +++ b/docs/mkdocs/docs/examples/flatten.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/flatten__empty.cpp b/docs/mkdocs/docs/examples/flatten__empty.cpp index 1dd52d551..b802c060d 100644 --- a/docs/mkdocs/docs/examples/flatten__empty.cpp +++ b/docs/mkdocs/docs/examples/flatten__empty.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/format_as.cpp b/docs/mkdocs/docs/examples/format_as.cpp index 0ea3a5ede..e392a6251 100644 --- a/docs/mkdocs/docs/examples/format_as.cpp +++ b/docs/mkdocs/docs/examples/format_as.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -12,5 +12,5 @@ int main() // fmt::format/fmt::print would find it auto j_str = format_as(j); - std::cout << j_str << std::endl; + std::cout << j_str << '\n'; } diff --git a/docs/mkdocs/docs/examples/from_bjdata.cpp b/docs/mkdocs/docs/examples/from_bjdata.cpp index 961164c29..3de031c27 100644 --- a/docs/mkdocs/docs/examples/from_bjdata.cpp +++ b/docs/mkdocs/docs/examples/from_bjdata.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -16,5 +16,5 @@ int main() json j = json::from_bjdata(v); // print the deserialized JSON value - std::cout << std::setw(2) << j << std::endl; + std::cout << std::setw(2) << j << '\n'; } diff --git a/docs/mkdocs/docs/examples/from_bon8.cpp b/docs/mkdocs/docs/examples/from_bon8.cpp index 83ab82060..320f5b3a0 100644 --- a/docs/mkdocs/docs/examples/from_bon8.cpp +++ b/docs/mkdocs/docs/examples/from_bon8.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -17,5 +17,5 @@ int main() json j = json::from_bon8(v); // print the deserialized JSON value - std::cout << std::setw(2) << j << std::endl; + std::cout << std::setw(2) << j << '\n'; } diff --git a/docs/mkdocs/docs/examples/from_bson.cpp b/docs/mkdocs/docs/examples/from_bson.cpp index c9d9fdfa6..8d7d2f951 100644 --- a/docs/mkdocs/docs/examples/from_bson.cpp +++ b/docs/mkdocs/docs/examples/from_bson.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -17,5 +17,5 @@ int main() json j = json::from_bson(v); // print the deserialized JSON value - std::cout << std::setw(2) << j << std::endl; + std::cout << std::setw(2) << j << '\n'; } diff --git a/docs/mkdocs/docs/examples/from_cbor.cpp b/docs/mkdocs/docs/examples/from_cbor.cpp index e685329ef..4ef881acb 100644 --- a/docs/mkdocs/docs/examples/from_cbor.cpp +++ b/docs/mkdocs/docs/examples/from_cbor.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -16,5 +16,5 @@ int main() json j = json::from_cbor(v); // print the deserialized JSON value - std::cout << std::setw(2) << j << std::endl; + std::cout << std::setw(2) << j << '\n'; } diff --git a/docs/mkdocs/docs/examples/from_json__default_constructible.cpp b/docs/mkdocs/docs/examples/from_json__default_constructible.cpp index 17c0551c8..33c75f95a 100644 --- a/docs/mkdocs/docs/examples/from_json__default_constructible.cpp +++ b/docs/mkdocs/docs/examples/from_json__default_constructible.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; namespace ns { @@ -33,5 +33,5 @@ int main() auto p = j.get(); - std::cout << p.name << " (" << p.age << ") lives in " << p.address << std::endl; + std::cout << p.name << " (" << p.age << ") lives in " << p.address << '\n'; } diff --git a/docs/mkdocs/docs/examples/from_json__non_default_constructible.cpp b/docs/mkdocs/docs/examples/from_json__non_default_constructible.cpp index 6cb86153c..73eba7584 100644 --- a/docs/mkdocs/docs/examples/from_json__non_default_constructible.cpp +++ b/docs/mkdocs/docs/examples/from_json__non_default_constructible.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; namespace ns { @@ -49,5 +49,5 @@ int main() auto p = j.get(); - std::cout << p.name << " (" << p.age << ") lives in " << p.address << std::endl; + std::cout << p.name << " (" << p.age << ") lives in " << p.address << '\n'; } diff --git a/docs/mkdocs/docs/examples/from_msgpack.cpp b/docs/mkdocs/docs/examples/from_msgpack.cpp index 5c2183f1e..f2a1db51e 100644 --- a/docs/mkdocs/docs/examples/from_msgpack.cpp +++ b/docs/mkdocs/docs/examples/from_msgpack.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -16,5 +16,5 @@ int main() json j = json::from_msgpack(v); // print the deserialized JSON value - std::cout << std::setw(2) << j << std::endl; + std::cout << std::setw(2) << j << '\n'; } diff --git a/docs/mkdocs/docs/examples/from_ubjson.cpp b/docs/mkdocs/docs/examples/from_ubjson.cpp index 1e85e4e36..9046ac406 100644 --- a/docs/mkdocs/docs/examples/from_ubjson.cpp +++ b/docs/mkdocs/docs/examples/from_ubjson.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -16,5 +16,5 @@ int main() json j = json::from_ubjson(v); // print the deserialized JSON value - std::cout << std::setw(2) << j << std::endl; + std::cout << std::setw(2) << j << '\n'; } diff --git a/docs/mkdocs/docs/examples/front.cpp b/docs/mkdocs/docs/examples/front.cpp index a0f630689..4f53be276 100644 --- a/docs/mkdocs/docs/examples/front.cpp +++ b/docs/mkdocs/docs/examples/front.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/get__BasicJsonType.cpp b/docs/mkdocs/docs/examples/get__BasicJsonType.cpp index d63458c0b..fb70d402e 100644 --- a/docs/mkdocs/docs/examples/get__BasicJsonType.cpp +++ b/docs/mkdocs/docs/examples/get__BasicJsonType.cpp @@ -1,8 +1,8 @@ #include #include -using json = nlohmann::json; -using ordered_json = nlohmann::ordered_json; +using nlohmann::json; +using nlohmann::ordered_json; int main() { diff --git a/docs/mkdocs/docs/examples/get__PointerType.cpp b/docs/mkdocs/docs/examples/get__PointerType.cpp index 2f32ed7af..8e44c67bf 100644 --- a/docs/mkdocs/docs/examples/get__PointerType.cpp +++ b/docs/mkdocs/docs/examples/get__PointerType.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -9,11 +9,11 @@ int main() json value = 17; // explicitly getting pointers - auto p1 = value.get(); - auto p2 = value.get(); - auto p3 = value.get(); - auto p4 = value.get(); - auto p5 = value.get(); + const auto *p1 = value.get(); + auto *p2 = value.get(); + auto *p3 = value.get(); + const auto *p4 = value.get(); + auto *p5 = value.get(); // print the pointees std::cout << *p1 << ' ' << *p2 << ' ' << *p3 << ' ' << *p4 << '\n'; diff --git a/docs/mkdocs/docs/examples/get__ValueType_const.cpp b/docs/mkdocs/docs/examples/get__ValueType_const.cpp index 7b0ca47bb..19d9b8d9f 100644 --- a/docs/mkdocs/docs/examples/get__ValueType_const.cpp +++ b/docs/mkdocs/docs/examples/get__ValueType_const.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -43,7 +43,7 @@ int main() } std::cout << "\n\n"; - for (auto i : v8) + for (const auto& i : v8) { std::cout << i.first << ": " << i.second << '\n'; } diff --git a/docs/mkdocs/docs/examples/get_allocator.cpp b/docs/mkdocs/docs/examples/get_allocator.cpp index 35079a10c..186b102a8 100644 --- a/docs/mkdocs/docs/examples/get_allocator.cpp +++ b/docs/mkdocs/docs/examples/get_allocator.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -11,7 +11,7 @@ int main() json* j = traits_t::allocate(alloc, 1); traits_t::construct(alloc, j, "Hello, world!"); - std::cout << *j << std::endl; + std::cout << *j << '\n'; traits_t::destroy(alloc, j); traits_t::deallocate(alloc, j, 1); diff --git a/docs/mkdocs/docs/examples/get_binary.cpp b/docs/mkdocs/docs/examples/get_binary.cpp index 617ce6096..6fff997bb 100644 --- a/docs/mkdocs/docs/examples/get_binary.cpp +++ b/docs/mkdocs/docs/examples/get_binary.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -12,5 +12,5 @@ int main() json j = json::binary(vec, 42); // output type and subtype - std::cout << "type: " << j.type_name() << ", subtype: " << j.get_binary().subtype() << std::endl; + std::cout << "type: " << j.type_name() << ", subtype: " << j.get_binary().subtype() << '\n'; } diff --git a/docs/mkdocs/docs/examples/get_ptr.cpp b/docs/mkdocs/docs/examples/get_ptr.cpp index 564ce0f4e..13c4a412a 100644 --- a/docs/mkdocs/docs/examples/get_ptr.cpp +++ b/docs/mkdocs/docs/examples/get_ptr.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -9,11 +9,11 @@ int main() json value = 17; // explicitly getting pointers - auto p1 = value.get_ptr(); - auto p2 = value.get_ptr(); - auto p3 = value.get_ptr(); - auto p4 = value.get_ptr(); - auto p5 = value.get_ptr(); + const auto *p1 = value.get_ptr(); + auto *p2 = value.get_ptr(); + auto *p3 = value.get_ptr(); + const auto *p4 = value.get_ptr(); + auto *p5 = value.get_ptr(); // print the pointees std::cout << *p1 << ' ' << *p2 << ' ' << *p3 << ' ' << *p4 << '\n'; diff --git a/docs/mkdocs/docs/examples/get_ref.cpp b/docs/mkdocs/docs/examples/get_ref.cpp index 0183a6537..706b45708 100644 --- a/docs/mkdocs/docs/examples/get_ref.cpp +++ b/docs/mkdocs/docs/examples/get_ref.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/get_to.cpp b/docs/mkdocs/docs/examples/get_to.cpp index cdbe347c0..553c80c06 100644 --- a/docs/mkdocs/docs/examples/get_to.cpp +++ b/docs/mkdocs/docs/examples/get_to.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -52,7 +52,7 @@ int main() } std::cout << "\n\n"; - for (auto i : v8) + for (const auto& i : v8) { std::cout << i.first << ": " << i.second << '\n'; } diff --git a/docs/mkdocs/docs/examples/insert.cpp b/docs/mkdocs/docs/examples/insert.cpp index 4ee609876..de6b03d61 100644 --- a/docs/mkdocs/docs/examples/insert.cpp +++ b/docs/mkdocs/docs/examples/insert.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/insert__count.cpp b/docs/mkdocs/docs/examples/insert__count.cpp index ce33b93e4..43e1e3164 100644 --- a/docs/mkdocs/docs/examples/insert__count.cpp +++ b/docs/mkdocs/docs/examples/insert__count.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/insert__ilist.cpp b/docs/mkdocs/docs/examples/insert__ilist.cpp index a20766a14..9415b6887 100644 --- a/docs/mkdocs/docs/examples/insert__ilist.cpp +++ b/docs/mkdocs/docs/examples/insert__ilist.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/insert__range.cpp b/docs/mkdocs/docs/examples/insert__range.cpp index 92fe63b0d..69bf25069 100644 --- a/docs/mkdocs/docs/examples/insert__range.cpp +++ b/docs/mkdocs/docs/examples/insert__range.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/insert__range_object.cpp b/docs/mkdocs/docs/examples/insert__range_object.cpp index 97373d3b4..f2cc9627c 100644 --- a/docs/mkdocs/docs/examples/insert__range_object.cpp +++ b/docs/mkdocs/docs/examples/insert__range_object.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/invalid_iterator.cpp b/docs/mkdocs/docs/examples/invalid_iterator.cpp index ecde12e62..138fdbc7e 100644 --- a/docs/mkdocs/docs/examples/invalid_iterator.cpp +++ b/docs/mkdocs/docs/examples/invalid_iterator.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -16,6 +16,6 @@ int main() { // output exception information std::cout << "message: " << e.what() << '\n' - << "exception id: " << e.id << std::endl; + << "exception id: " << e.id << '\n'; } } diff --git a/docs/mkdocs/docs/examples/is_array.cpp b/docs/mkdocs/docs/examples/is_array.cpp index 8ecc45035..c1ef39b8e 100644 --- a/docs/mkdocs/docs/examples/is_array.cpp +++ b/docs/mkdocs/docs/examples/is_array.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/is_binary.cpp b/docs/mkdocs/docs/examples/is_binary.cpp index d7f049ec4..6fe4d5006 100644 --- a/docs/mkdocs/docs/examples/is_binary.cpp +++ b/docs/mkdocs/docs/examples/is_binary.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/is_boolean.cpp b/docs/mkdocs/docs/examples/is_boolean.cpp index 0b7981955..e48d1ef5c 100644 --- a/docs/mkdocs/docs/examples/is_boolean.cpp +++ b/docs/mkdocs/docs/examples/is_boolean.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/is_discarded.cpp b/docs/mkdocs/docs/examples/is_discarded.cpp index 09016655e..9bfcba039 100644 --- a/docs/mkdocs/docs/examples/is_discarded.cpp +++ b/docs/mkdocs/docs/examples/is_discarded.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/is_discarded__parse.cpp b/docs/mkdocs/docs/examples/is_discarded__parse.cpp index feaca2363..2286c15e6 100644 --- a/docs/mkdocs/docs/examples/is_discarded__parse.cpp +++ b/docs/mkdocs/docs/examples/is_discarded__parse.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/is_null.cpp b/docs/mkdocs/docs/examples/is_null.cpp index 8a8433260..891acb1be 100644 --- a/docs/mkdocs/docs/examples/is_null.cpp +++ b/docs/mkdocs/docs/examples/is_null.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/is_number.cpp b/docs/mkdocs/docs/examples/is_number.cpp index f107a048a..0384891c1 100644 --- a/docs/mkdocs/docs/examples/is_number.cpp +++ b/docs/mkdocs/docs/examples/is_number.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/is_number_float.cpp b/docs/mkdocs/docs/examples/is_number_float.cpp index bba2b446f..f3804cf9d 100644 --- a/docs/mkdocs/docs/examples/is_number_float.cpp +++ b/docs/mkdocs/docs/examples/is_number_float.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/is_number_integer.cpp b/docs/mkdocs/docs/examples/is_number_integer.cpp index 8d6a5ae16..141190b47 100644 --- a/docs/mkdocs/docs/examples/is_number_integer.cpp +++ b/docs/mkdocs/docs/examples/is_number_integer.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/is_number_unsigned.cpp b/docs/mkdocs/docs/examples/is_number_unsigned.cpp index b52ac6b31..332aff2f0 100644 --- a/docs/mkdocs/docs/examples/is_number_unsigned.cpp +++ b/docs/mkdocs/docs/examples/is_number_unsigned.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/is_object.cpp b/docs/mkdocs/docs/examples/is_object.cpp index a0216fd21..fa0b16a32 100644 --- a/docs/mkdocs/docs/examples/is_object.cpp +++ b/docs/mkdocs/docs/examples/is_object.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/is_primitive.cpp b/docs/mkdocs/docs/examples/is_primitive.cpp index af3968e83..1aaa871d1 100644 --- a/docs/mkdocs/docs/examples/is_primitive.cpp +++ b/docs/mkdocs/docs/examples/is_primitive.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/is_string.cpp b/docs/mkdocs/docs/examples/is_string.cpp index c89f550b0..6aaae09dd 100644 --- a/docs/mkdocs/docs/examples/is_string.cpp +++ b/docs/mkdocs/docs/examples/is_string.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/is_structured.cpp b/docs/mkdocs/docs/examples/is_structured.cpp index 41947b1be..2b8939d2b 100644 --- a/docs/mkdocs/docs/examples/is_structured.cpp +++ b/docs/mkdocs/docs/examples/is_structured.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/items.cpp b/docs/mkdocs/docs/examples/items.cpp index 9cd2b51b1..5d3786c5f 100644 --- a/docs/mkdocs/docs/examples/items.cpp +++ b/docs/mkdocs/docs/examples/items.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -10,13 +10,13 @@ int main() json j_array = {1, 2, 4, 8, 16}; // example for an object - for (auto& x : j_object.items()) + for (const auto& x : j_object.items()) { std::cout << "key: " << x.key() << ", value: " << x.value() << '\n'; } // example for an array - for (auto& x : j_array.items()) + for (const auto& x : j_array.items()) { std::cout << "key: " << x.key() << ", value: " << x.value() << '\n'; } diff --git a/docs/mkdocs/docs/examples/json_base_class_t.cpp b/docs/mkdocs/docs/examples/json_base_class_t.cpp index 1dafd417f..678e22dd4 100644 --- a/docs/mkdocs/docs/examples/json_base_class_t.cpp +++ b/docs/mkdocs/docs/examples/json_base_class_t.cpp @@ -24,7 +24,7 @@ void visitor_adaptor_with_metadata::visit(const Fnc& fnc) const template void visitor_adaptor_with_metadata::do_visit(const Ptr& ptr, const Fnc& fnc) const { - using value_t = nlohmann::detail::value_t; + using nlohmann::detail::value_t; const json& j = *static_cast(this); switch (j.type()) { diff --git a/docs/mkdocs/docs/examples/json_document.cpp b/docs/mkdocs/docs/examples/json_document.cpp index 01f2847e2..1613526ac 100644 --- a/docs/mkdocs/docs/examples/json_document.cpp +++ b/docs/mkdocs/docs/examples/json_document.cpp @@ -1,7 +1,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/json_editable_document.cpp b/docs/mkdocs/docs/examples/json_editable_document.cpp index bf08c0d9b..1ae760183 100644 --- a/docs/mkdocs/docs/examples/json_editable_document.cpp +++ b/docs/mkdocs/docs/examples/json_editable_document.cpp @@ -1,9 +1,9 @@ #include #include -using json = nlohmann::json; -using json_editable_document = nlohmann::json_editable_document; -using json_editable_view = nlohmann::json_editable_view; +using nlohmann::json; +using nlohmann::json_editable_document; +using nlohmann::json_editable_view; int main() { diff --git a/docs/mkdocs/docs/examples/json_lines.cpp b/docs/mkdocs/docs/examples/json_lines.cpp index 233c81a4a..a8da39d80 100644 --- a/docs/mkdocs/docs/examples/json_lines.cpp +++ b/docs/mkdocs/docs/examples/json_lines.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -17,6 +17,6 @@ int main() std::string line; while (std::getline(input, line)) { - std::cout << json::parse(line) << std::endl; + std::cout << json::parse(line) << '\n'; } } diff --git a/docs/mkdocs/docs/examples/json_pointer.cpp b/docs/mkdocs/docs/examples/json_pointer.cpp index 8705cf498..d8a43601b 100644 --- a/docs/mkdocs/docs/examples/json_pointer.cpp +++ b/docs/mkdocs/docs/examples/json_pointer.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/json_pointer__back.cpp b/docs/mkdocs/docs/examples/json_pointer__back.cpp index dd3b210bf..04f663818 100644 --- a/docs/mkdocs/docs/examples/json_pointer__back.cpp +++ b/docs/mkdocs/docs/examples/json_pointer__back.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -11,5 +11,5 @@ int main() // call empty() std::cout << "last reference token of \"" << ptr1 << "\" is \"" << ptr1.back() << "\"\n" - << "last reference token of \"" << ptr2 << "\" is \"" << ptr2.back() << "\"" << std::endl; + << "last reference token of \"" << ptr2 << "\" is \"" << ptr2.back() << "\"" << '\n'; } diff --git a/docs/mkdocs/docs/examples/json_pointer__empty.cpp b/docs/mkdocs/docs/examples/json_pointer__empty.cpp index 57257e8b1..f59955533 100644 --- a/docs/mkdocs/docs/examples/json_pointer__empty.cpp +++ b/docs/mkdocs/docs/examples/json_pointer__empty.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -16,5 +16,5 @@ int main() << "\"" << ptr0 << "\": " << ptr0.empty() << '\n' << "\"" << ptr1 << "\": " << ptr1.empty() << '\n' << "\"" << ptr2 << "\": " << ptr2.empty() << '\n' - << "\"" << ptr3 << "\": " << ptr3.empty() << std::endl; + << "\"" << ptr3 << "\": " << ptr3.empty() << '\n'; } diff --git a/docs/mkdocs/docs/examples/json_pointer__front.cpp b/docs/mkdocs/docs/examples/json_pointer__front.cpp index 42c76ffec..6d0fd400d 100644 --- a/docs/mkdocs/docs/examples/json_pointer__front.cpp +++ b/docs/mkdocs/docs/examples/json_pointer__front.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -11,5 +11,5 @@ int main() // call empty() std::cout << "first reference token of \"" << ptr1 << "\" is \"" << ptr1.front() << "\"\n" - << "first reference token of \"" << ptr2 << "\" is \"" << ptr2.front() << "\"" << std::endl; + << "first reference token of \"" << ptr2 << "\" is \"" << ptr2.front() << "\"" << '\n'; } diff --git a/docs/mkdocs/docs/examples/json_pointer__operator__equal.cpp b/docs/mkdocs/docs/examples/json_pointer__operator__equal.cpp index dce6df03c..e59bc453c 100644 --- a/docs/mkdocs/docs/examples/json_pointer__operator__equal.cpp +++ b/docs/mkdocs/docs/examples/json_pointer__operator__equal.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -15,5 +15,5 @@ int main() << "\"" << ptr0 << "\" == \"" << ptr0 << "\": " << (ptr0 == ptr0) << '\n' << "\"" << ptr0 << "\" == \"" << ptr1 << "\": " << (ptr0 == ptr1) << '\n' << "\"" << ptr1 << "\" == \"" << ptr2 << "\": " << (ptr1 == ptr2) << '\n' - << "\"" << ptr2 << "\" == \"" << ptr2 << "\": " << (ptr2 == ptr2) << std::endl; + << "\"" << ptr2 << "\" == \"" << ptr2 << "\": " << (ptr2 == ptr2) << '\n'; } diff --git a/docs/mkdocs/docs/examples/json_pointer__operator__equal_stringtype.cpp b/docs/mkdocs/docs/examples/json_pointer__operator__equal_stringtype.cpp index af8ec5a29..28197c3db 100644 --- a/docs/mkdocs/docs/examples/json_pointer__operator__equal_stringtype.cpp +++ b/docs/mkdocs/docs/examples/json_pointer__operator__equal_stringtype.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -20,14 +20,14 @@ int main() std::cout << std::boolalpha << "\"" << ptr0 << "\" == \"" << str0 << "\": " << (ptr0 == str0) << '\n' << "\"" << str0 << "\" == \"" << ptr1 << "\": " << (str0 == ptr1) << '\n' - << "\"" << ptr2 << "\" == \"" << str1 << "\": " << (ptr2 == str1) << std::endl; + << "\"" << ptr2 << "\" == \"" << str1 << "\": " << (ptr2 == str1) << '\n'; try { - std::cout << "\"" << str2 << "\" == \"" << ptr2 << "\": " << (str2 == ptr2) << std::endl; + std::cout << "\"" << str2 << "\" == \"" << ptr2 << "\": " << (str2 == ptr2) << '\n'; } catch (const json::parse_error& ex) { - std::cout << ex.what() << std::endl; + std::cout << ex.what() << '\n'; } } diff --git a/docs/mkdocs/docs/examples/json_pointer__operator__notequal.cpp b/docs/mkdocs/docs/examples/json_pointer__operator__notequal.cpp index 9bbdd5310..624b4e053 100644 --- a/docs/mkdocs/docs/examples/json_pointer__operator__notequal.cpp +++ b/docs/mkdocs/docs/examples/json_pointer__operator__notequal.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -15,5 +15,5 @@ int main() << "\"" << ptr0 << "\" != \"" << ptr0 << "\": " << (ptr0 != ptr0) << '\n' << "\"" << ptr0 << "\" != \"" << ptr1 << "\": " << (ptr0 != ptr1) << '\n' << "\"" << ptr1 << "\" != \"" << ptr2 << "\": " << (ptr1 != ptr2) << '\n' - << "\"" << ptr2 << "\" != \"" << ptr2 << "\": " << (ptr2 != ptr2) << std::endl; + << "\"" << ptr2 << "\" != \"" << ptr2 << "\": " << (ptr2 != ptr2) << '\n'; } diff --git a/docs/mkdocs/docs/examples/json_pointer__operator__notequal_stringtype.cpp b/docs/mkdocs/docs/examples/json_pointer__operator__notequal_stringtype.cpp index b9b898728..abf92adc3 100644 --- a/docs/mkdocs/docs/examples/json_pointer__operator__notequal_stringtype.cpp +++ b/docs/mkdocs/docs/examples/json_pointer__operator__notequal_stringtype.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -19,14 +19,14 @@ int main() std::cout << std::boolalpha << "\"" << ptr0 << "\" != \"" << str0 << "\": " << (ptr0 != str0) << '\n' << "\"" << str0 << "\" != \"" << ptr1 << "\": " << (str0 != ptr1) << '\n' - << "\"" << ptr2 << "\" != \"" << str1 << "\": " << (ptr2 != str1) << std::endl; + << "\"" << ptr2 << "\" != \"" << str1 << "\": " << (ptr2 != str1) << '\n'; try { - std::cout << "\"" << str2 << "\" != \"" << ptr2 << "\": " << (str2 != ptr2) << std::endl; + std::cout << "\"" << str2 << "\" != \"" << ptr2 << "\": " << (str2 != ptr2) << '\n'; } catch (const json::parse_error& ex) { - std::cout << ex.what() << std::endl; + std::cout << ex.what() << '\n'; } } diff --git a/docs/mkdocs/docs/examples/json_pointer__operator_add.cpp b/docs/mkdocs/docs/examples/json_pointer__operator_add.cpp index 14bd74561..9526cc690 100644 --- a/docs/mkdocs/docs/examples/json_pointer__operator_add.cpp +++ b/docs/mkdocs/docs/examples/json_pointer__operator_add.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -19,5 +19,5 @@ int main() // append an array index ptr /= 42; - std::cout << "\"" << ptr << "\"" << std::endl; + std::cout << "\"" << ptr << "\"" << '\n'; } diff --git a/docs/mkdocs/docs/examples/json_pointer__operator_add_binary.cpp b/docs/mkdocs/docs/examples/json_pointer__operator_add_binary.cpp index d26a0d171..55941da25 100644 --- a/docs/mkdocs/docs/examples/json_pointer__operator_add_binary.cpp +++ b/docs/mkdocs/docs/examples/json_pointer__operator_add_binary.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -15,5 +15,5 @@ int main() std::cout << "\"" << ptr / "fob" << "\"\n"; // append an array index - std::cout << "\"" << ptr / 42 << "\"" << std::endl; + std::cout << "\"" << ptr / 42 << "\"" << '\n'; } diff --git a/docs/mkdocs/docs/examples/json_pointer__operator_spaceship.c++20.cpp b/docs/mkdocs/docs/examples/json_pointer__operator_spaceship.c++20.cpp index a2354da73..374c07dd6 100644 --- a/docs/mkdocs/docs/examples/json_pointer__operator_spaceship.c++20.cpp +++ b/docs/mkdocs/docs/examples/json_pointer__operator_spaceship.c++20.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; const char* to_string(const std::strong_ordering& so) { diff --git a/docs/mkdocs/docs/examples/json_pointer__operator_string_t.cpp b/docs/mkdocs/docs/examples/json_pointer__operator_string_t.cpp index 56f213020..964797230 100644 --- a/docs/mkdocs/docs/examples/json_pointer__operator_string_t.cpp +++ b/docs/mkdocs/docs/examples/json_pointer__operator_string_t.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -15,5 +15,5 @@ int main() s += "\n"; s += ptr2; - std::cout << s << std::endl; + std::cout << s << '\n'; } diff --git a/docs/mkdocs/docs/examples/json_pointer__parent_pointer.cpp b/docs/mkdocs/docs/examples/json_pointer__parent_pointer.cpp index ef9df4534..f321050dd 100644 --- a/docs/mkdocs/docs/examples/json_pointer__parent_pointer.cpp +++ b/docs/mkdocs/docs/examples/json_pointer__parent_pointer.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -14,5 +14,5 @@ int main() std::cout << std::boolalpha << "parent of \"" << ptr1 << "\" is \"" << ptr1.parent_pointer() << "\"\n" << "parent of \"" << ptr2 << "\" is \"" << ptr2.parent_pointer() << "\"\n" - << "parent of \"" << ptr3 << "\" is \"" << ptr3.parent_pointer() << "\"" << std::endl; + << "parent of \"" << ptr3 << "\" is \"" << ptr3.parent_pointer() << "\"" << '\n'; } diff --git a/docs/mkdocs/docs/examples/json_pointer__pop_back.cpp b/docs/mkdocs/docs/examples/json_pointer__pop_back.cpp index fd077b7e9..ebd43b23d 100644 --- a/docs/mkdocs/docs/examples/json_pointer__pop_back.cpp +++ b/docs/mkdocs/docs/examples/json_pointer__pop_back.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/json_pointer__pop_front.cpp b/docs/mkdocs/docs/examples/json_pointer__pop_front.cpp index 59403668c..dfadd63c6 100644 --- a/docs/mkdocs/docs/examples/json_pointer__pop_front.cpp +++ b/docs/mkdocs/docs/examples/json_pointer__pop_front.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/json_pointer__push_back.cpp b/docs/mkdocs/docs/examples/json_pointer__push_back.cpp index e6b59a125..76b27ebc4 100644 --- a/docs/mkdocs/docs/examples/json_pointer__push_back.cpp +++ b/docs/mkdocs/docs/examples/json_pointer__push_back.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/json_pointer__push_front.cpp b/docs/mkdocs/docs/examples/json_pointer__push_front.cpp index 7bcdccb45..723edb7c8 100644 --- a/docs/mkdocs/docs/examples/json_pointer__push_front.cpp +++ b/docs/mkdocs/docs/examples/json_pointer__push_front.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/json_pointer__string_t.cpp b/docs/mkdocs/docs/examples/json_pointer__string_t.cpp index fbe0f179e..48e9d22aa 100644 --- a/docs/mkdocs/docs/examples/json_pointer__string_t.cpp +++ b/docs/mkdocs/docs/examples/json_pointer__string_t.cpp @@ -1,13 +1,13 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { json::json_pointer::string_t s = "This is a string."; - std::cout << s << std::endl; + std::cout << s << '\n'; - std::cout << std::boolalpha << std::is_same::value << std::endl; + std::cout << std::boolalpha << std::is_same::value << '\n'; } diff --git a/docs/mkdocs/docs/examples/json_pointer__to_string.cpp b/docs/mkdocs/docs/examples/json_pointer__to_string.cpp index 31d35a724..af52355a5 100644 --- a/docs/mkdocs/docs/examples/json_pointer__to_string.cpp +++ b/docs/mkdocs/docs/examples/json_pointer__to_string.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -30,5 +30,5 @@ int main() << "\"" << ptr9.to_string() << "\"\n" << "\"" << ptr10.to_string() << "\"\n" << "\"" << ptr11.to_string() << "\"\n" - << "\"" << ptr12.to_string() << "\"" << std::endl; + << "\"" << ptr12.to_string() << "\"" << '\n'; } diff --git a/docs/mkdocs/docs/examples/json_view_ownership.cpp b/docs/mkdocs/docs/examples/json_view_ownership.cpp index fa0e8262a..7fa2afdf3 100644 --- a/docs/mkdocs/docs/examples/json_view_ownership.cpp +++ b/docs/mkdocs/docs/examples/json_view_ownership.cpp @@ -3,7 +3,7 @@ #include #include -using json_document = nlohmann::json_document; +using nlohmann::json_document; int main() { diff --git a/docs/mkdocs/docs/examples/max_size.cpp b/docs/mkdocs/docs/examples/max_size.cpp index c2ffc5468..7477acab7 100644 --- a/docs/mkdocs/docs/examples/max_size.cpp +++ b/docs/mkdocs/docs/examples/max_size.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/merge_diff.cpp b/docs/mkdocs/docs/examples/merge_diff.cpp index 22ae9b087..906b5786f 100644 --- a/docs/mkdocs/docs/examples/merge_diff.cpp +++ b/docs/mkdocs/docs/examples/merge_diff.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() @@ -47,5 +47,5 @@ int main() // output patch and roundtrip result std::cout << std::setw(4) << patch << "\n\n" - << std::setw(4) << patched_source << std::endl; + << std::setw(4) << patched_source << '\n'; } diff --git a/docs/mkdocs/docs/examples/merge_patch.cpp b/docs/mkdocs/docs/examples/merge_patch.cpp index f3fee1ed1..aaed7d923 100644 --- a/docs/mkdocs/docs/examples/merge_patch.cpp +++ b/docs/mkdocs/docs/examples/merge_patch.cpp @@ -2,7 +2,7 @@ #include #include // for std::setw -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() @@ -37,5 +37,5 @@ int main() document.merge_patch(patch); // output original and patched document - std::cout << std::setw(4) << document << std::endl; + std::cout << std::setw(4) << document << '\n'; } diff --git a/docs/mkdocs/docs/examples/meta.cpp b/docs/mkdocs/docs/examples/meta.cpp index a051575ba..f0de003b4 100644 --- a/docs/mkdocs/docs/examples/meta.cpp +++ b/docs/mkdocs/docs/examples/meta.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/nlohmann_define_derived_type_intrusive_macro.cpp b/docs/mkdocs/docs/examples/nlohmann_define_derived_type_intrusive_macro.cpp index 0dca78162..30f792b86 100644 --- a/docs/mkdocs/docs/examples/nlohmann_define_derived_type_intrusive_macro.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_define_derived_type_intrusive_macro.cpp @@ -33,5 +33,5 @@ int main() B example(23, 42, 3.142, 1.777); json example_json = example; - std::cout << std::setw(4) << example_json << std::endl; + std::cout << std::setw(4) << example_json << '\n'; } \ No newline at end of file diff --git a/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_explicit.cpp b/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_explicit.cpp index ce13ff114..832f2cbdd 100644 --- a/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_explicit.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_explicit.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; namespace ns @@ -43,7 +43,7 @@ int main() // serialization: person -> json json j = p; - std::cout << "serialization: " << j << std::endl; + std::cout << "serialization: " << j << '\n'; // deserialization: json -> person json j2 = R"({"address": "742 Evergreen Terrace", "age": 40, "name": "Homer Simpson"})"_json; @@ -57,6 +57,6 @@ int main() } catch (const json::exception& e) { - std::cout << "deserialization failed: " << e.what() << std::endl; + std::cout << "deserialization failed: " << e.what() << '\n'; } } diff --git a/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_macro.cpp b/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_macro.cpp index ab8657801..3a0392717 100644 --- a/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_macro.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_macro.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; namespace ns @@ -29,7 +29,7 @@ int main() // serialization: person -> json json j = p; - std::cout << "serialization: " << j << std::endl; + std::cout << "serialization: " << j << '\n'; // deserialization: json -> person json j2 = R"({"address": "742 Evergreen Terrace", "age": 40, "name": "Homer Simpson"})"_json; @@ -43,6 +43,6 @@ int main() } catch (const json::exception& e) { - std::cout << "deserialization failed: " << e.what() << std::endl; + std::cout << "deserialization failed: " << e.what() << '\n'; } } diff --git a/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_only_serialize_explicit.cpp b/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_only_serialize_explicit.cpp index dd6a9a679..a61d57e93 100644 --- a/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_only_serialize_explicit.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_only_serialize_explicit.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; namespace ns @@ -35,5 +35,5 @@ int main() // serialization: person -> json json j = p; - std::cout << "serialization: " << j << std::endl; + std::cout << "serialization: " << j << '\n'; } diff --git a/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_only_serialize_macro.cpp b/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_only_serialize_macro.cpp index 8213f9063..ca2dcaa22 100644 --- a/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_only_serialize_macro.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_only_serialize_macro.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; namespace ns @@ -29,5 +29,5 @@ int main() // serialization: person -> json json j = p; - std::cout << "serialization: " << j << std::endl; + std::cout << "serialization: " << j << '\n'; } diff --git a/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_with_default_explicit.cpp b/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_with_default_explicit.cpp index 2713444b6..a06cdff0c 100644 --- a/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_with_default_explicit.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_with_default_explicit.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; namespace ns @@ -44,7 +44,7 @@ int main() // serialization: person -> json json j = p; - std::cout << "serialization: " << j << std::endl; + std::cout << "serialization: " << j << '\n'; // deserialization: json -> person json j2 = R"({"address": "742 Evergreen Terrace", "age": 40, "name": "Homer Simpson"})"_json; @@ -53,5 +53,5 @@ int main() // incomplete deserialization: json j3 = R"({"address": "742 Evergreen Terrace", "name": "Maggie Simpson"})"_json; auto p3 = j3.get(); - std::cout << "roundtrip: " << json(p3) << std::endl; + std::cout << "roundtrip: " << json(p3) << '\n'; } diff --git a/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_with_default_macro.cpp b/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_with_default_macro.cpp index 851a3582f..764c8dd81 100644 --- a/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_with_default_macro.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_define_type_intrusive_with_default_macro.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; namespace ns @@ -29,7 +29,7 @@ int main() // serialization: person -> json json j = p; - std::cout << "serialization: " << j << std::endl; + std::cout << "serialization: " << j << '\n'; // deserialization: json -> person json j2 = R"({"address": "742 Evergreen Terrace", "age": 40, "name": "Homer Simpson"})"_json; @@ -38,5 +38,5 @@ int main() // incomplete deserialization: json j3 = R"({"address": "742 Evergreen Terrace", "name": "Maggie Simpson"})"_json; auto p3 = j3.get(); - std::cout << "roundtrip: " << json(p3) << std::endl; + std::cout << "roundtrip: " << json(p3) << '\n'; } diff --git a/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_explicit.cpp b/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_explicit.cpp index dfbdde4ac..d6089f165 100644 --- a/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_explicit.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_explicit.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; namespace ns @@ -36,7 +36,7 @@ int main() // serialization: person -> json json j = p; - std::cout << "serialization: " << j << std::endl; + std::cout << "serialization: " << j << '\n'; // deserialization: json -> person json j2 = R"({"address": "742 Evergreen Terrace", "age": 40, "name": "Homer Simpson"})"_json; @@ -50,6 +50,6 @@ int main() } catch (const json::exception& e) { - std::cout << "deserialization failed: " << e.what() << std::endl; + std::cout << "deserialization failed: " << e.what() << '\n'; } } diff --git a/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_macro.cpp b/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_macro.cpp index cdf90dc2c..fea57ea24 100644 --- a/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_macro.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_macro.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; namespace ns @@ -22,7 +22,7 @@ int main() // serialization: person -> json json j = p; - std::cout << "serialization: " << j << std::endl; + std::cout << "serialization: " << j << '\n'; // deserialization: json -> person json j2 = R"({"address": "742 Evergreen Terrace", "age": 40, "name": "Homer Simpson"})"_json; @@ -36,6 +36,6 @@ int main() } catch (const json::exception& e) { - std::cout << "deserialization failed: " << e.what() << std::endl; + std::cout << "deserialization failed: " << e.what() << '\n'; } } diff --git a/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_only_serialize_explicit.cpp b/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_only_serialize_explicit.cpp index ead75b74e..6f20b1067 100644 --- a/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_only_serialize_explicit.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_only_serialize_explicit.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; namespace ns @@ -28,5 +28,5 @@ int main() // serialization: person -> json json j = p; - std::cout << "serialization: " << j << std::endl; + std::cout << "serialization: " << j << '\n'; } diff --git a/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_only_serialize_macro.cpp b/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_only_serialize_macro.cpp index 7aef23af6..978d14bde 100644 --- a/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_only_serialize_macro.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_only_serialize_macro.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; namespace ns @@ -22,5 +22,5 @@ int main() // serialization: person -> json json j = p; - std::cout << "serialization: " << j << std::endl; + std::cout << "serialization: " << j << '\n'; } diff --git a/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_with_default_explicit.cpp b/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_with_default_explicit.cpp index 23384b70c..a6bcc624a 100644 --- a/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_with_default_explicit.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_with_default_explicit.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; namespace ns @@ -42,7 +42,7 @@ int main() // serialization: person -> json json j = p; - std::cout << "serialization: " << j << std::endl; + std::cout << "serialization: " << j << '\n'; // deserialization: json -> person json j2 = R"({"address": "742 Evergreen Terrace", "age": 40, "name": "Homer Simpson"})"_json; @@ -51,5 +51,5 @@ int main() // incomplete deserialization: json j3 = R"({"address": "742 Evergreen Terrace", "name": "Maggie Simpson"})"_json; auto p3 = j3.get(); - std::cout << "roundtrip: " << json(p3) << std::endl; + std::cout << "roundtrip: " << json(p3) << '\n'; } diff --git a/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_with_default_macro.cpp b/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_with_default_macro.cpp index aa9bc53b4..d33d5355d 100644 --- a/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_with_default_macro.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_with_default_macro.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; namespace ns @@ -27,7 +27,7 @@ int main() // serialization: person -> json json j = p; - std::cout << "serialization: " << j << std::endl; + std::cout << "serialization: " << j << '\n'; // deserialization: json -> person json j2 = R"({"address": "742 Evergreen Terrace", "age": 40, "name": "Homer Simpson"})"_json; @@ -36,5 +36,5 @@ int main() // incomplete deserialization: json j3 = R"({"address": "742 Evergreen Terrace", "name": "Maggie Simpson"})"_json; auto p3 = j3.get(); - std::cout << "roundtrip: " << json(p3) << std::endl; + std::cout << "roundtrip: " << json(p3) << '\n'; } diff --git a/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_with_names_explicit.cpp b/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_with_names_explicit.cpp index d92f13c42..f022cffd8 100644 --- a/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_with_names_explicit.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_with_names_explicit.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; namespace ns @@ -36,7 +36,7 @@ int main() // serialization: person -> json json j = p; - std::cout << "serialization: " << j << std::endl; + std::cout << "serialization: " << j << '\n'; // deserialization: json -> person json j2 = R"({"json_address": "742 Evergreen Terrace", "json_age": 40, "json_name": "Homer Simpson"})"_json; @@ -50,6 +50,6 @@ int main() } catch (const json::exception& e) { - std::cout << "deserialization failed: " << e.what() << std::endl; + std::cout << "deserialization failed: " << e.what() << '\n'; } } diff --git a/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_with_names_macro.cpp b/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_with_names_macro.cpp index 36114e724..bb3712486 100644 --- a/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_with_names_macro.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_define_type_non_intrusive_with_names_macro.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; namespace ns @@ -22,7 +22,7 @@ int main() // serialization: person -> json json j = p; - std::cout << "serialization: " << j << std::endl; + std::cout << "serialization: " << j << '\n'; // deserialization: json -> person json j2 = R"({"json_address": "742 Evergreen Terrace", "json_age": 40, "json_name": "Homer Simpson"})"_json; @@ -36,6 +36,6 @@ int main() } catch (const json::exception& e) { - std::cout << "deserialization failed: " << e.what() << std::endl; + std::cout << "deserialization failed: " << e.what() << '\n'; } } diff --git a/docs/mkdocs/docs/examples/nlohmann_json_namespace.cpp b/docs/mkdocs/docs/examples/nlohmann_json_namespace.cpp index 4bad91f4b..6cb07f584 100644 --- a/docs/mkdocs/docs/examples/nlohmann_json_namespace.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_json_namespace.cpp @@ -2,7 +2,7 @@ #include // possible use case: use NLOHMANN_JSON_NAMESPACE instead of nlohmann -using json = NLOHMANN_JSON_NAMESPACE::json; +using NLOHMANN_JSON_NAMESPACE::json; // macro needed to output the NLOHMANN_JSON_NAMESPACE as string literal #define Q(x) #x @@ -10,5 +10,5 @@ using json = NLOHMANN_JSON_NAMESPACE::json; int main() { - std::cout << QUOTE(NLOHMANN_JSON_NAMESPACE) << std::endl; + std::cout << QUOTE(NLOHMANN_JSON_NAMESPACE) << '\n'; } diff --git a/docs/mkdocs/docs/examples/nlohmann_json_namespace_begin.c++17.cpp b/docs/mkdocs/docs/examples/nlohmann_json_namespace_begin.c++17.cpp index 9385d593d..924bcb239 100644 --- a/docs/mkdocs/docs/examples/nlohmann_json_namespace_begin.c++17.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_json_namespace_begin.c++17.cpp @@ -29,5 +29,5 @@ int main() NLOHMANN_JSON_NAMESPACE::json j; j.push_back(o1); j.push_back(o2); - std::cout << j << std::endl; + std::cout << j << '\n'; } diff --git a/docs/mkdocs/docs/examples/nlohmann_json_namespace_no_version.cpp b/docs/mkdocs/docs/examples/nlohmann_json_namespace_no_version.cpp index 97948dd7e..9f1bd9ad6 100644 --- a/docs/mkdocs/docs/examples/nlohmann_json_namespace_no_version.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_json_namespace_no_version.cpp @@ -9,5 +9,5 @@ int main() { - std::cout << QUOTE(NLOHMANN_JSON_NAMESPACE) << std::endl; + std::cout << QUOTE(NLOHMANN_JSON_NAMESPACE) << '\n'; } diff --git a/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum.cpp b/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum.cpp index f9e472c64..5a59e826a 100644 --- a/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; namespace ns { @@ -39,7 +39,7 @@ int main() json j_stopped = ns::TS_STOPPED; json j_red = ns::Color::red; std::cout << "ns::TS_STOPPED -> " << j_stopped - << ", ns::Color::red -> " << j_red << std::endl; + << ", ns::Color::red -> " << j_red << '\n'; // deserialization json j_running = "running"; @@ -47,7 +47,7 @@ int main() auto running = j_running.get(); auto blue = j_blue.get(); std::cout << j_running << " -> " << running - << ", " << j_blue << " -> " << static_cast(blue) << std::endl; + << ", " << j_blue << " -> " << static_cast(blue) << '\n'; // deserializing undefined JSON value to enum // (where the first map entry above is the default) @@ -55,5 +55,5 @@ int main() auto invalid = j_pi.get(); auto unknown = j_pi.get(); std::cout << j_pi << " -> " << invalid << ", " - << j_pi << " -> " << static_cast(unknown) << std::endl; + << j_pi << " -> " << static_cast(unknown) << '\n'; } diff --git a/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum_2.cpp b/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum_2.cpp index fd27226ca..e7b0fa966 100644 --- a/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum_2.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum_2.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; namespace ns { @@ -22,12 +22,12 @@ int main() { // serialization json j_red = ns::Color::red; - std::cout << static_cast(ns::Color::red) << " -> " << j_red << std::endl; + std::cout << static_cast(ns::Color::red) << " -> " << j_red << '\n'; // deserialization json j_rot = "rot"; auto rot = j_rot.get(); auto red = j_red.get(); - std::cout << j_rot << " -> " << static_cast(rot) << std::endl; - std::cout << j_red << " -> " << static_cast(red) << std::endl; + std::cout << j_rot << " -> " << static_cast(rot) << '\n'; + std::cout << j_red << " -> " << static_cast(red) << '\n'; } diff --git a/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum_strict.cpp b/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum_strict.cpp index fa2572dec..1017a729f 100644 --- a/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum_strict.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum_strict.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; namespace ns { @@ -39,7 +39,7 @@ int main() json j_stopped = ns::TS_STOPPED; json j_red = ns::Color::red; std::cout << "ns::TS_STOPPED -> " << j_stopped - << ", ns::Color::red -> " << j_red << std::endl; + << ", ns::Color::red -> " << j_red << '\n'; // deserialization json j_running = "running"; @@ -47,6 +47,6 @@ int main() auto running = j_running.get(); auto blue = j_blue.get(); std::cout << j_running << " -> " << running - << ", " << j_blue << " -> " << static_cast(blue) << std::endl; + << ", " << j_blue << " -> " << static_cast(blue) << '\n'; } diff --git a/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum_strict_2.cpp b/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum_strict_2.cpp index 7f766b7a9..263fe30a6 100644 --- a/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum_strict_2.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum_strict_2.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; namespace ns { @@ -22,12 +22,12 @@ int main() { // serialization json j_red = ns::Color::red; - std::cout << static_cast(ns::Color::red) << " -> " << j_red << std::endl; + std::cout << static_cast(ns::Color::red) << " -> " << j_red << '\n'; // deserialization json j_rot = "rot"; auto rot = j_rot.get(); auto red = j_red.get(); - std::cout << j_rot << " -> " << static_cast(rot) << std::endl; - std::cout << j_red << " -> " << static_cast(red) << std::endl; + std::cout << j_rot << " -> " << static_cast(rot) << '\n'; + std::cout << j_red << " -> " << static_cast(red) << '\n'; } diff --git a/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum_strict_err.cpp b/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum_strict_err.cpp index aeb901122..4589edc8a 100644 --- a/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum_strict_err.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_json_serialize_enum_strict_err.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; namespace ns { @@ -34,7 +34,7 @@ int main() } catch (const json::exception e) { - std::cout << "deserialization failed: " << e.what() << std::endl; + std::cout << "deserialization failed: " << e.what() << '\n'; } // invalid deserialization @@ -46,7 +46,7 @@ int main() } catch (const json::exception e) { - std::cout << "deserialization failed: " << e.what() << std::endl; + std::cout << "deserialization failed: " << e.what() << '\n'; } return 0; diff --git a/docs/mkdocs/docs/examples/nlohmann_json_version.cpp b/docs/mkdocs/docs/examples/nlohmann_json_version.cpp index ca5f53728..e83eb9227 100644 --- a/docs/mkdocs/docs/examples/nlohmann_json_version.cpp +++ b/docs/mkdocs/docs/examples/nlohmann_json_version.cpp @@ -1,12 +1,12 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { std::cout << "JSON for Modern C++ version " << NLOHMANN_JSON_VERSION_MAJOR << "." << NLOHMANN_JSON_VERSION_MINOR << "." - << NLOHMANN_JSON_VERSION_PATCH << std::endl; + << NLOHMANN_JSON_VERSION_PATCH << '\n'; } diff --git a/docs/mkdocs/docs/examples/number_float_t.cpp b/docs/mkdocs/docs/examples/number_float_t.cpp index 21211dc51..4eb91369e 100644 --- a/docs/mkdocs/docs/examples/number_float_t.cpp +++ b/docs/mkdocs/docs/examples/number_float_t.cpp @@ -2,9 +2,9 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { - std::cout << std::boolalpha << std::is_same::value << std::endl; + std::cout << std::boolalpha << std::is_same::value << '\n'; } diff --git a/docs/mkdocs/docs/examples/number_integer_t.cpp b/docs/mkdocs/docs/examples/number_integer_t.cpp index 75ee57b63..db6954847 100644 --- a/docs/mkdocs/docs/examples/number_integer_t.cpp +++ b/docs/mkdocs/docs/examples/number_integer_t.cpp @@ -2,9 +2,9 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { - std::cout << std::boolalpha << std::is_same::value << std::endl; + std::cout << std::boolalpha << std::is_same::value << '\n'; } diff --git a/docs/mkdocs/docs/examples/number_unsigned_t.cpp b/docs/mkdocs/docs/examples/number_unsigned_t.cpp index ff3b86df8..b1a3d12b1 100644 --- a/docs/mkdocs/docs/examples/number_unsigned_t.cpp +++ b/docs/mkdocs/docs/examples/number_unsigned_t.cpp @@ -2,9 +2,9 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { - std::cout << std::boolalpha << std::is_same::value << std::endl; + std::cout << std::boolalpha << std::is_same::value << '\n'; } diff --git a/docs/mkdocs/docs/examples/object.cpp b/docs/mkdocs/docs/examples/object.cpp index ad167d4af..bed0d7124 100644 --- a/docs/mkdocs/docs/examples/object.cpp +++ b/docs/mkdocs/docs/examples/object.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/object_comparator_t.cpp b/docs/mkdocs/docs/examples/object_comparator_t.cpp index 6b82c7ca6..6526a09c1 100644 --- a/docs/mkdocs/docs/examples/object_comparator_t.cpp +++ b/docs/mkdocs/docs/examples/object_comparator_t.cpp @@ -1,11 +1,11 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { std::cout << std::boolalpha << "json::object_comparator_t(\"one\", \"two\") = " << json::object_comparator_t{}("one", "two") << "\n" - << "json::object_comparator_t(\"three\", \"four\") = " << json::object_comparator_t{}("three", "four") << std::endl; + << "json::object_comparator_t(\"three\", \"four\") = " << json::object_comparator_t{}("three", "four") << '\n'; } diff --git a/docs/mkdocs/docs/examples/object_t.cpp b/docs/mkdocs/docs/examples/object_t.cpp index 85cfa3e33..275898b76 100644 --- a/docs/mkdocs/docs/examples/object_t.cpp +++ b/docs/mkdocs/docs/examples/object_t.cpp @@ -2,9 +2,9 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { - std::cout << std::boolalpha << std::is_same, json::object_t>::value << std::endl; + std::cout << std::boolalpha << std::is_same, json::object_t>::value << '\n'; } diff --git a/docs/mkdocs/docs/examples/operator__ValueType.cpp b/docs/mkdocs/docs/examples/operator__ValueType.cpp index 7ab29ec71..0363c79cc 100644 --- a/docs/mkdocs/docs/examples/operator__ValueType.cpp +++ b/docs/mkdocs/docs/examples/operator__ValueType.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -43,7 +43,7 @@ int main() } std::cout << "\n\n"; - for (auto i : v8) + for (const auto& i : v8) { std::cout << i.first << ": " << i.second << '\n'; } diff --git a/docs/mkdocs/docs/examples/operator__equal.cpp b/docs/mkdocs/docs/examples/operator__equal.cpp index 1426f489a..2a9a89e54 100644 --- a/docs/mkdocs/docs/examples/operator__equal.cpp +++ b/docs/mkdocs/docs/examples/operator__equal.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/operator__equal__nullptr_t.cpp b/docs/mkdocs/docs/examples/operator__equal__nullptr_t.cpp index dbb210372..7b1810a4a 100644 --- a/docs/mkdocs/docs/examples/operator__equal__nullptr_t.cpp +++ b/docs/mkdocs/docs/examples/operator__equal__nullptr_t.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/operator__equal__specializations.cpp b/docs/mkdocs/docs/examples/operator__equal__specializations.cpp index 97d5ecead..a053af6df 100644 --- a/docs/mkdocs/docs/examples/operator__equal__specializations.cpp +++ b/docs/mkdocs/docs/examples/operator__equal__specializations.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -12,5 +12,5 @@ int main() nlohmann::ordered_json oj1 = {{"version", 1}, {"type", "integer"}}; nlohmann::ordered_json oj2 = {{"type", "integer"}, {"version", 1}}; - std::cout << std::boolalpha << (uj1 == uj2) << '\n' << (oj1 == oj2) << std::endl; + std::cout << std::boolalpha << (uj1 == uj2) << '\n' << (oj1 == oj2) << '\n'; } diff --git a/docs/mkdocs/docs/examples/operator__greater.cpp b/docs/mkdocs/docs/examples/operator__greater.cpp index 65bb9c049..878eba66f 100644 --- a/docs/mkdocs/docs/examples/operator__greater.cpp +++ b/docs/mkdocs/docs/examples/operator__greater.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/operator__greaterequal.cpp b/docs/mkdocs/docs/examples/operator__greaterequal.cpp index f8659ee07..2d36c1d4e 100644 --- a/docs/mkdocs/docs/examples/operator__greaterequal.cpp +++ b/docs/mkdocs/docs/examples/operator__greaterequal.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/operator__less.cpp b/docs/mkdocs/docs/examples/operator__less.cpp index 64209a22a..949982102 100644 --- a/docs/mkdocs/docs/examples/operator__less.cpp +++ b/docs/mkdocs/docs/examples/operator__less.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/operator__lessequal.cpp b/docs/mkdocs/docs/examples/operator__lessequal.cpp index 543b9543f..e044e5544 100644 --- a/docs/mkdocs/docs/examples/operator__lessequal.cpp +++ b/docs/mkdocs/docs/examples/operator__lessequal.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/operator__notequal.cpp b/docs/mkdocs/docs/examples/operator__notequal.cpp index 43e89509c..0f9f85869 100644 --- a/docs/mkdocs/docs/examples/operator__notequal.cpp +++ b/docs/mkdocs/docs/examples/operator__notequal.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/operator__notequal__nullptr_t.cpp b/docs/mkdocs/docs/examples/operator__notequal__nullptr_t.cpp index dc7e6ac4c..30ef0d1bd 100644 --- a/docs/mkdocs/docs/examples/operator__notequal__nullptr_t.cpp +++ b/docs/mkdocs/docs/examples/operator__notequal__nullptr_t.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/operator__value_t.cpp b/docs/mkdocs/docs/examples/operator__value_t.cpp index d9aac7978..c2340c68a 100644 --- a/docs/mkdocs/docs/examples/operator__value_t.cpp +++ b/docs/mkdocs/docs/examples/operator__value_t.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/operator_array__json_pointer.cpp b/docs/mkdocs/docs/examples/operator_array__json_pointer.cpp index 0fa207f02..388011f45 100644 --- a/docs/mkdocs/docs/examples/operator_array__json_pointer.cpp +++ b/docs/mkdocs/docs/examples/operator_array__json_pointer.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() diff --git a/docs/mkdocs/docs/examples/operator_array__json_pointer_const.cpp b/docs/mkdocs/docs/examples/operator_array__json_pointer_const.cpp index f40e2494a..1a327cea8 100644 --- a/docs/mkdocs/docs/examples/operator_array__json_pointer_const.cpp +++ b/docs/mkdocs/docs/examples/operator_array__json_pointer_const.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() diff --git a/docs/mkdocs/docs/examples/operator_array__keytype.c++17.cpp b/docs/mkdocs/docs/examples/operator_array__keytype.c++17.cpp index 7f2b41dd8..69e5b340e 100644 --- a/docs/mkdocs/docs/examples/operator_array__keytype.c++17.cpp +++ b/docs/mkdocs/docs/examples/operator_array__keytype.c++17.cpp @@ -4,7 +4,7 @@ #include using namespace std::string_view_literals; -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/operator_array__keytype_const.c++17.cpp b/docs/mkdocs/docs/examples/operator_array__keytype_const.c++17.cpp index 2cf94f40f..99343575a 100644 --- a/docs/mkdocs/docs/examples/operator_array__keytype_const.c++17.cpp +++ b/docs/mkdocs/docs/examples/operator_array__keytype_const.c++17.cpp @@ -3,7 +3,7 @@ #include using namespace std::string_view_literals; -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/operator_array__object_t_key_type.cpp b/docs/mkdocs/docs/examples/operator_array__object_t_key_type.cpp index f9b7f7318..209b08d61 100644 --- a/docs/mkdocs/docs/examples/operator_array__object_t_key_type.cpp +++ b/docs/mkdocs/docs/examples/operator_array__object_t_key_type.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/operator_array__object_t_key_type_const.cpp b/docs/mkdocs/docs/examples/operator_array__object_t_key_type_const.cpp index 1bdb34024..1f774cc6f 100644 --- a/docs/mkdocs/docs/examples/operator_array__object_t_key_type_const.cpp +++ b/docs/mkdocs/docs/examples/operator_array__object_t_key_type_const.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/operator_array__size_type.cpp b/docs/mkdocs/docs/examples/operator_array__size_type.cpp index d6f3e153c..5a7f735d7 100644 --- a/docs/mkdocs/docs/examples/operator_array__size_type.cpp +++ b/docs/mkdocs/docs/examples/operator_array__size_type.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/operator_array__size_type_const.cpp b/docs/mkdocs/docs/examples/operator_array__size_type_const.cpp index d56fa0a43..4a41c4529 100644 --- a/docs/mkdocs/docs/examples/operator_array__size_type_const.cpp +++ b/docs/mkdocs/docs/examples/operator_array__size_type_const.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/operator_deserialize.cpp b/docs/mkdocs/docs/examples/operator_deserialize.cpp index 8e3d8bd83..b42f40428 100644 --- a/docs/mkdocs/docs/examples/operator_deserialize.cpp +++ b/docs/mkdocs/docs/examples/operator_deserialize.cpp @@ -3,7 +3,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/operator_literal_json.cpp b/docs/mkdocs/docs/examples/operator_literal_json.cpp index 84ca6297d..6b8a7e18c 100644 --- a/docs/mkdocs/docs/examples/operator_literal_json.cpp +++ b/docs/mkdocs/docs/examples/operator_literal_json.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() diff --git a/docs/mkdocs/docs/examples/operator_literal_json_pointer.cpp b/docs/mkdocs/docs/examples/operator_literal_json_pointer.cpp index aba93e88e..c7e5460b1 100644 --- a/docs/mkdocs/docs/examples/operator_literal_json_pointer.cpp +++ b/docs/mkdocs/docs/examples/operator_literal_json_pointer.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() diff --git a/docs/mkdocs/docs/examples/operator_ltlt__basic_json.cpp b/docs/mkdocs/docs/examples/operator_ltlt__basic_json.cpp index 3bd4ad577..148d60276 100644 --- a/docs/mkdocs/docs/examples/operator_ltlt__basic_json.cpp +++ b/docs/mkdocs/docs/examples/operator_ltlt__basic_json.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/operator_ltlt__json_pointer.cpp b/docs/mkdocs/docs/examples/operator_ltlt__json_pointer.cpp index 044318fa5..156a07794 100644 --- a/docs/mkdocs/docs/examples/operator_ltlt__json_pointer.cpp +++ b/docs/mkdocs/docs/examples/operator_ltlt__json_pointer.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -9,5 +9,5 @@ int main() json::json_pointer ptr("/foo/bar/baz"); // write string representation to stream - std::cout << ptr << std::endl; + std::cout << ptr << '\n'; } diff --git a/docs/mkdocs/docs/examples/operator_spaceship__const_reference.c++20.cpp b/docs/mkdocs/docs/examples/operator_spaceship__const_reference.c++20.cpp index 9e7c9e9be..2c260adc8 100644 --- a/docs/mkdocs/docs/examples/operator_spaceship__const_reference.c++20.cpp +++ b/docs/mkdocs/docs/examples/operator_spaceship__const_reference.c++20.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; const char* to_string(const std::partial_ordering& po) { diff --git a/docs/mkdocs/docs/examples/operator_spaceship__scalartype.c++20.cpp b/docs/mkdocs/docs/examples/operator_spaceship__scalartype.c++20.cpp index ebb5b4349..8628dfb0b 100644 --- a/docs/mkdocs/docs/examples/operator_spaceship__scalartype.c++20.cpp +++ b/docs/mkdocs/docs/examples/operator_spaceship__scalartype.c++20.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; const char* to_string(const std::partial_ordering& po) { diff --git a/docs/mkdocs/docs/examples/ordered_json.cpp b/docs/mkdocs/docs/examples/ordered_json.cpp index effad530c..a427e635e 100644 --- a/docs/mkdocs/docs/examples/ordered_json.cpp +++ b/docs/mkdocs/docs/examples/ordered_json.cpp @@ -1,7 +1,7 @@ #include #include -using ordered_json = nlohmann::ordered_json; +using nlohmann::ordered_json; int main() { diff --git a/docs/mkdocs/docs/examples/ordered_json_document.cpp b/docs/mkdocs/docs/examples/ordered_json_document.cpp index 2cae413bf..389055115 100644 --- a/docs/mkdocs/docs/examples/ordered_json_document.cpp +++ b/docs/mkdocs/docs/examples/ordered_json_document.cpp @@ -1,7 +1,7 @@ #include #include -using ordered_json_document = nlohmann::ordered_json_document; +using nlohmann::ordered_json_document; int main() { diff --git a/docs/mkdocs/docs/examples/ordered_json_editable_document.cpp b/docs/mkdocs/docs/examples/ordered_json_editable_document.cpp index c6e7fa08e..9d7821066 100644 --- a/docs/mkdocs/docs/examples/ordered_json_editable_document.cpp +++ b/docs/mkdocs/docs/examples/ordered_json_editable_document.cpp @@ -1,7 +1,7 @@ #include #include -using ordered_json_editable_document = nlohmann::ordered_json_editable_document; +using nlohmann::ordered_json_editable_document; int main() { diff --git a/docs/mkdocs/docs/examples/ordered_map.cpp b/docs/mkdocs/docs/examples/ordered_map.cpp index dcc60cb52..7c507a564 100644 --- a/docs/mkdocs/docs/examples/ordered_map.cpp +++ b/docs/mkdocs/docs/examples/ordered_map.cpp @@ -10,7 +10,7 @@ void output(const char* prefix, const Map& m) { std::cout << element.first << ":" << element.second << ' '; } - std::cout << "}" << std::endl; + std::cout << "}" << '\n'; } int main() diff --git a/docs/mkdocs/docs/examples/other_error.cpp b/docs/mkdocs/docs/examples/other_error.cpp index 56aa8ae6b..2fa152b8b 100644 --- a/docs/mkdocs/docs/examples/other_error.cpp +++ b/docs/mkdocs/docs/examples/other_error.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() @@ -25,6 +25,6 @@ int main() { // output exception information std::cout << "message: " << e.what() << '\n' - << "exception id: " << e.id << std::endl; + << "exception id: " << e.id << '\n'; } } diff --git a/docs/mkdocs/docs/examples/out_of_range.cpp b/docs/mkdocs/docs/examples/out_of_range.cpp index 03282082d..cb87d1a33 100644 --- a/docs/mkdocs/docs/examples/out_of_range.cpp +++ b/docs/mkdocs/docs/examples/out_of_range.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -15,6 +15,6 @@ int main() { // output exception information std::cout << "message: " << e.what() << '\n' - << "exception id: " << e.id << std::endl; + << "exception id: " << e.id << '\n'; } } diff --git a/docs/mkdocs/docs/examples/parse__allow_exceptions.cpp b/docs/mkdocs/docs/examples/parse__allow_exceptions.cpp index f396c347e..6e9385a86 100644 --- a/docs/mkdocs/docs/examples/parse__allow_exceptions.cpp +++ b/docs/mkdocs/docs/examples/parse__allow_exceptions.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -19,7 +19,7 @@ int main() } catch (const json::parse_error& e) { - std::cout << e.what() << std::endl; + std::cout << e.what() << '\n'; } // parse without exceptions @@ -27,10 +27,10 @@ int main() if (j.is_discarded()) { - std::cout << "the input is invalid JSON" << std::endl; + std::cout << "the input is invalid JSON" << '\n'; } else { - std::cout << "the input is valid JSON: " << j << std::endl; + std::cout << "the input is valid JSON: " << j << '\n'; } } diff --git a/docs/mkdocs/docs/examples/parse__array__parser_callback_t.cpp b/docs/mkdocs/docs/examples/parse__array__parser_callback_t.cpp index 63f0a0e4d..747df8599 100644 --- a/docs/mkdocs/docs/examples/parse__array__parser_callback_t.cpp +++ b/docs/mkdocs/docs/examples/parse__array__parser_callback_t.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/parse__contiguouscontainer__parser_callback_t.cpp b/docs/mkdocs/docs/examples/parse__contiguouscontainer__parser_callback_t.cpp index 6eb409bba..50eeee437 100644 --- a/docs/mkdocs/docs/examples/parse__contiguouscontainer__parser_callback_t.cpp +++ b/docs/mkdocs/docs/examples/parse__contiguouscontainer__parser_callback_t.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/parse__istream__parser_callback_t.cpp b/docs/mkdocs/docs/examples/parse__istream__parser_callback_t.cpp index 2ef14dab2..4440c81c4 100644 --- a/docs/mkdocs/docs/examples/parse__istream__parser_callback_t.cpp +++ b/docs/mkdocs/docs/examples/parse__istream__parser_callback_t.cpp @@ -3,12 +3,12 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { // a JSON text - auto text = R"( + const auto *text = R"( { "Image": { "Width": 800, diff --git a/docs/mkdocs/docs/examples/parse__iterator_pair.cpp b/docs/mkdocs/docs/examples/parse__iterator_pair.cpp index d0c30c1a5..751f29d17 100644 --- a/docs/mkdocs/docs/examples/parse__iterator_pair.cpp +++ b/docs/mkdocs/docs/examples/parse__iterator_pair.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/parse__pointers.cpp b/docs/mkdocs/docs/examples/parse__pointers.cpp index a5a16eea9..9152588c8 100644 --- a/docs/mkdocs/docs/examples/parse__pointers.cpp +++ b/docs/mkdocs/docs/examples/parse__pointers.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/parse__string__parser_callback_t.cpp b/docs/mkdocs/docs/examples/parse__string__parser_callback_t.cpp index 19c6c448a..8959aec47 100644 --- a/docs/mkdocs/docs/examples/parse__string__parser_callback_t.cpp +++ b/docs/mkdocs/docs/examples/parse__string__parser_callback_t.cpp @@ -2,12 +2,12 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { // a JSON text - auto text = R"( + const auto *text = R"( { "Image": { "Width": 800, diff --git a/docs/mkdocs/docs/examples/parse__wide_string.cpp b/docs/mkdocs/docs/examples/parse__wide_string.cpp index 93a599947..33b251d8b 100644 --- a/docs/mkdocs/docs/examples/parse__wide_string.cpp +++ b/docs/mkdocs/docs/examples/parse__wide_string.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/parse_error.cpp b/docs/mkdocs/docs/examples/parse_error.cpp index 2f73ac65f..73367dada 100644 --- a/docs/mkdocs/docs/examples/parse_error.cpp +++ b/docs/mkdocs/docs/examples/parse_error.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -15,6 +15,6 @@ int main() // output exception information std::cout << "message: " << e.what() << '\n' << "exception id: " << e.id << '\n' - << "byte position of error: " << e.byte << std::endl; + << "byte position of error: " << e.byte << '\n'; } } diff --git a/docs/mkdocs/docs/examples/parse_event_t.cpp b/docs/mkdocs/docs/examples/parse_event_t.cpp index 3a56b22a9..89c7260aa 100644 --- a/docs/mkdocs/docs/examples/parse_event_t.cpp +++ b/docs/mkdocs/docs/examples/parse_event_t.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; // translate a parse_event_t to a human-readable name std::string event_name(json::parse_event_t event) @@ -29,7 +29,7 @@ std::string event_name(json::parse_event_t event) int main() { // a small JSON text - auto text = R"({"pi": 3.141, "numbers": [1, 2]})"; + const auto *text = R"({"pi": 3.141, "numbers": [1, 2]})"; // parse the text and report every event together with its depth; // returning true keeps every value unchanged diff --git a/docs/mkdocs/docs/examples/parser_callback_t.cpp b/docs/mkdocs/docs/examples/parser_callback_t.cpp index 99c4298e8..0b892309f 100644 --- a/docs/mkdocs/docs/examples/parser_callback_t.cpp +++ b/docs/mkdocs/docs/examples/parser_callback_t.cpp @@ -1,12 +1,12 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { // a JSON text with an array and a number inside an object - auto text = R"({"IDs": [116, 943], "Width": 800})"; + const auto *text = R"({"IDs": [116, 943], "Width": 800})"; // discard the array when the parser reads its opening bracket json j_array_start = json::parse(text, [](int /*depth*/, json::parse_event_t event, json& /*parsed*/) diff --git a/docs/mkdocs/docs/examples/patch.cpp b/docs/mkdocs/docs/examples/patch.cpp index b7ecb8eee..53688a364 100644 --- a/docs/mkdocs/docs/examples/patch.cpp +++ b/docs/mkdocs/docs/examples/patch.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() @@ -29,5 +29,5 @@ int main() // output original and patched document std::cout << std::setw(4) << doc << "\n\n" - << std::setw(4) << patched_doc << std::endl; + << std::setw(4) << patched_doc << '\n'; } diff --git a/docs/mkdocs/docs/examples/patch__exception.cpp b/docs/mkdocs/docs/examples/patch__exception.cpp index 9e0a27cab..98b8bebc7 100644 --- a/docs/mkdocs/docs/examples/patch__exception.cpp +++ b/docs/mkdocs/docs/examples/patch__exception.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() @@ -32,5 +32,5 @@ int main() } // the original document is unchanged - std::cout << std::setw(4) << doc << std::endl; + std::cout << std::setw(4) << doc << '\n'; } diff --git a/docs/mkdocs/docs/examples/patch_inplace.cpp b/docs/mkdocs/docs/examples/patch_inplace.cpp index 061708a2d..82e837549 100644 --- a/docs/mkdocs/docs/examples/patch_inplace.cpp +++ b/docs/mkdocs/docs/examples/patch_inplace.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() @@ -25,11 +25,11 @@ int main() )"_json; // output original document - std::cout << "Before\n" << std::setw(4) << doc << std::endl; + std::cout << "Before\n" << std::setw(4) << doc << '\n'; // apply the patch doc.patch_inplace(patch); // output patched document - std::cout << "\nAfter\n" << std::setw(4) << doc << std::endl; + std::cout << "\nAfter\n" << std::setw(4) << doc << '\n'; } diff --git a/docs/mkdocs/docs/examples/patch_inplace__exception.cpp b/docs/mkdocs/docs/examples/patch_inplace__exception.cpp index 02ebe133a..bb89e08e6 100644 --- a/docs/mkdocs/docs/examples/patch_inplace__exception.cpp +++ b/docs/mkdocs/docs/examples/patch_inplace__exception.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() @@ -34,5 +34,5 @@ int main() } // the first operation has already been applied to doc - std::cout << std::setw(4) << doc << std::endl; + std::cout << std::setw(4) << doc << '\n'; } diff --git a/docs/mkdocs/docs/examples/push_back.cpp b/docs/mkdocs/docs/examples/push_back.cpp index bbddf4f51..3120d452b 100644 --- a/docs/mkdocs/docs/examples/push_back.cpp +++ b/docs/mkdocs/docs/examples/push_back.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/push_back__initializer_list.cpp b/docs/mkdocs/docs/examples/push_back__initializer_list.cpp index e96645f16..e0cf4e6de 100644 --- a/docs/mkdocs/docs/examples/push_back__initializer_list.cpp +++ b/docs/mkdocs/docs/examples/push_back__initializer_list.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/push_back__object_t__value.cpp b/docs/mkdocs/docs/examples/push_back__object_t__value.cpp index 5d694e938..b63e8f7e1 100644 --- a/docs/mkdocs/docs/examples/push_back__object_t__value.cpp +++ b/docs/mkdocs/docs/examples/push_back__object_t__value.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/rbegin.cpp b/docs/mkdocs/docs/examples/rbegin.cpp index 239f7a689..867a9c952 100644 --- a/docs/mkdocs/docs/examples/rbegin.cpp +++ b/docs/mkdocs/docs/examples/rbegin.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/reject_duplicate_keys.cpp b/docs/mkdocs/docs/examples/reject_duplicate_keys.cpp index 0e5e78925..3e8259763 100644 --- a/docs/mkdocs/docs/examples/reject_duplicate_keys.cpp +++ b/docs/mkdocs/docs/examples/reject_duplicate_keys.cpp @@ -5,7 +5,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; json parse_strict(const std::string& input) { diff --git a/docs/mkdocs/docs/examples/rend.cpp b/docs/mkdocs/docs/examples/rend.cpp index adadbbdc2..86d70c7f9 100644 --- a/docs/mkdocs/docs/examples/rend.cpp +++ b/docs/mkdocs/docs/examples/rend.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/sax_no_exception.cpp b/docs/mkdocs/docs/examples/sax_no_exception.cpp index 1eeff466e..580c0cb9d 100644 --- a/docs/mkdocs/docs/examples/sax_no_exception.cpp +++ b/docs/mkdocs/docs/examples/sax_no_exception.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; // a DOM parser that reports parse errors instead of throwing class sax_no_exception : public nlohmann::detail::json_sax_dom_parser @@ -18,7 +18,7 @@ class sax_no_exception : public nlohmann::detail::json_sax_dom_parser #include -using json = nlohmann::json; +using nlohmann::json; // a simple event consumer that collects string representations of the passed // values; note inheriting from json::json_sax_t is not required, but can @@ -95,7 +95,7 @@ class sax_event_consumer : public json::json_sax_t int main() { // a JSON text - auto text = R"( + const auto *text = R"( { "Image": { "Width": 800, @@ -127,5 +127,5 @@ int main() } // output the result of sax_parse - std::cout << "\nresult: " << std::boolalpha << result << std::endl; + std::cout << "\nresult: " << std::boolalpha << result << '\n'; } diff --git a/docs/mkdocs/docs/examples/sax_parse__binary.cpp b/docs/mkdocs/docs/examples/sax_parse__binary.cpp index 08bc85df6..300bbda66 100644 --- a/docs/mkdocs/docs/examples/sax_parse__binary.cpp +++ b/docs/mkdocs/docs/examples/sax_parse__binary.cpp @@ -3,7 +3,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; // a simple event consumer that collects string representations of the passed // values; note inheriting from json::json_sax_t is not required, but can @@ -110,5 +110,5 @@ int main() } // output the result of sax_parse - std::cout << "\nresult: " << std::boolalpha << result << std::endl; + std::cout << "\nresult: " << std::boolalpha << result << '\n'; } diff --git a/docs/mkdocs/docs/examples/size.cpp b/docs/mkdocs/docs/examples/size.cpp index 237548377..00ed8cd15 100644 --- a/docs/mkdocs/docs/examples/size.cpp +++ b/docs/mkdocs/docs/examples/size.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/std_formatter.c++20.cpp b/docs/mkdocs/docs/examples/std_formatter.c++20.cpp index d249415d7..3401ad5e6 100644 --- a/docs/mkdocs/docs/examples/std_formatter.c++20.cpp +++ b/docs/mkdocs/docs/examples/std_formatter.c++20.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/std_hash.cpp b/docs/mkdocs/docs/examples/std_hash.cpp index 184ddbbb3..0fcabdcf1 100644 --- a/docs/mkdocs/docs/examples/std_hash.cpp +++ b/docs/mkdocs/docs/examples/std_hash.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() @@ -16,5 +16,5 @@ int main() << "hash({}) = " << std::hash {}(json::object()) << '\n' << "hash([]) = " << std::hash {}(json::array()) << '\n' << "hash({\"hello\": \"world\"}) = " << std::hash {}("{\"hello\": \"world\"}"_json) - << std::endl; + << '\n'; } diff --git a/docs/mkdocs/docs/examples/std_swap.cpp b/docs/mkdocs/docs/examples/std_swap.cpp index 36ab3ce6b..f829c9a5d 100644 --- a/docs/mkdocs/docs/examples/std_swap.cpp +++ b/docs/mkdocs/docs/examples/std_swap.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -15,5 +15,5 @@ int main() // swap values std::swap(j1, j2); - std::cout << "j1 = " << j1 << " | j2 = " << j2 << std::endl; + std::cout << "j1 = " << j1 << " | j2 = " << j2 << '\n'; } diff --git a/docs/mkdocs/docs/examples/string_t.cpp b/docs/mkdocs/docs/examples/string_t.cpp index 77a9ea480..118c42d26 100644 --- a/docs/mkdocs/docs/examples/string_t.cpp +++ b/docs/mkdocs/docs/examples/string_t.cpp @@ -2,9 +2,9 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { - std::cout << std::boolalpha << std::is_same::value << std::endl; + std::cout << std::boolalpha << std::is_same::value << '\n'; } diff --git a/docs/mkdocs/docs/examples/swap__array_t.cpp b/docs/mkdocs/docs/examples/swap__array_t.cpp index 2119dd552..e551f1fcc 100644 --- a/docs/mkdocs/docs/examples/swap__array_t.cpp +++ b/docs/mkdocs/docs/examples/swap__array_t.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/swap__binary_t.cpp b/docs/mkdocs/docs/examples/swap__binary_t.cpp index 4b8fc3db7..a9c7b9d03 100644 --- a/docs/mkdocs/docs/examples/swap__binary_t.cpp +++ b/docs/mkdocs/docs/examples/swap__binary_t.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/swap__object_t.cpp b/docs/mkdocs/docs/examples/swap__object_t.cpp index 301b558d3..9aff7667e 100644 --- a/docs/mkdocs/docs/examples/swap__object_t.cpp +++ b/docs/mkdocs/docs/examples/swap__object_t.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/swap__reference.cpp b/docs/mkdocs/docs/examples/swap__reference.cpp index 34182ad24..d2ffbedf2 100644 --- a/docs/mkdocs/docs/examples/swap__reference.cpp +++ b/docs/mkdocs/docs/examples/swap__reference.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/swap__string_t.cpp b/docs/mkdocs/docs/examples/swap__string_t.cpp index b5d58316f..14d7552ef 100644 --- a/docs/mkdocs/docs/examples/swap__string_t.cpp +++ b/docs/mkdocs/docs/examples/swap__string_t.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/to_bjdata.cpp b/docs/mkdocs/docs/examples/to_bjdata.cpp index 9b7abac4e..ddebccb2f 100644 --- a/docs/mkdocs/docs/examples/to_bjdata.cpp +++ b/docs/mkdocs/docs/examples/to_bjdata.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; // function to print BJData's diagnostic format @@ -10,11 +10,11 @@ void print_byte(uint8_t byte) { if (32 < byte and byte < 128) { - std::cout << (char)byte; + std::cout << static_cast(byte); } else { - std::cout << (int)byte; + std::cout << static_cast(byte); } } @@ -31,7 +31,7 @@ int main() { print_byte(byte); } - std::cout << std::endl; + std::cout << '\n'; // create an array of numbers json array = {1, 2, 3, 4, 5, 6, 7, 8}; @@ -48,17 +48,17 @@ int main() { print_byte(byte); } - std::cout << std::endl; + std::cout << '\n'; for (auto& byte : v_array_size) { print_byte(byte); } - std::cout << std::endl; + std::cout << '\n'; for (auto& byte : v_array_size_and_type) { print_byte(byte); } - std::cout << std::endl; + std::cout << '\n'; } diff --git a/docs/mkdocs/docs/examples/to_bjdata__exception.cpp b/docs/mkdocs/docs/examples/to_bjdata__exception.cpp index 560f3343b..8e3dda347 100644 --- a/docs/mkdocs/docs/examples/to_bjdata__exception.cpp +++ b/docs/mkdocs/docs/examples/to_bjdata__exception.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/to_bon8.cpp b/docs/mkdocs/docs/examples/to_bon8.cpp index a40130903..2dc36fc6a 100644 --- a/docs/mkdocs/docs/examples/to_bon8.cpp +++ b/docs/mkdocs/docs/examples/to_bon8.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() @@ -16,7 +16,7 @@ int main() // print the vector content for (auto& byte : v) { - std::cout << "0x" << std::hex << std::setw(2) << std::setfill('0') << (int)byte << " "; + std::cout << "0x" << std::hex << std::setw(2) << std::setfill('0') << static_cast(byte) << " "; } - std::cout << std::endl; + std::cout << '\n'; } diff --git a/docs/mkdocs/docs/examples/to_bon8__exception.cpp b/docs/mkdocs/docs/examples/to_bon8__exception.cpp index 48992413b..cefea2809 100644 --- a/docs/mkdocs/docs/examples/to_bon8__exception.cpp +++ b/docs/mkdocs/docs/examples/to_bon8__exception.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/to_bson.cpp b/docs/mkdocs/docs/examples/to_bson.cpp index 3484b0b76..bfbb3677b 100644 --- a/docs/mkdocs/docs/examples/to_bson.cpp +++ b/docs/mkdocs/docs/examples/to_bson.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() @@ -16,7 +16,7 @@ int main() // print the vector content for (auto& byte : v) { - std::cout << "0x" << std::hex << std::setw(2) << std::setfill('0') << (int)byte << " "; + std::cout << "0x" << std::hex << std::setw(2) << std::setfill('0') << static_cast(byte) << " "; } - std::cout << std::endl; + std::cout << '\n'; } diff --git a/docs/mkdocs/docs/examples/to_bson__exception.cpp b/docs/mkdocs/docs/examples/to_bson__exception.cpp index fe12c202f..387bba3e8 100644 --- a/docs/mkdocs/docs/examples/to_bson__exception.cpp +++ b/docs/mkdocs/docs/examples/to_bson__exception.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/to_cbor.cpp b/docs/mkdocs/docs/examples/to_cbor.cpp index 3d5e04150..46a2cd042 100644 --- a/docs/mkdocs/docs/examples/to_cbor.cpp +++ b/docs/mkdocs/docs/examples/to_cbor.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() @@ -16,7 +16,7 @@ int main() // print the vector content for (auto& byte : v) { - std::cout << "0x" << std::hex << std::setw(2) << std::setfill('0') << (int)byte << " "; + std::cout << "0x" << std::hex << std::setw(2) << std::setfill('0') << static_cast(byte) << " "; } - std::cout << std::endl; + std::cout << '\n'; } diff --git a/docs/mkdocs/docs/examples/to_json.cpp b/docs/mkdocs/docs/examples/to_json.cpp index 1f82a4de4..9ac74116a 100644 --- a/docs/mkdocs/docs/examples/to_json.cpp +++ b/docs/mkdocs/docs/examples/to_json.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; namespace ns { @@ -28,5 +28,5 @@ int main() json j = p; - std::cout << j << std::endl; + std::cout << j << '\n'; } diff --git a/docs/mkdocs/docs/examples/to_msgpack.cpp b/docs/mkdocs/docs/examples/to_msgpack.cpp index b29ae8c7c..958a13767 100644 --- a/docs/mkdocs/docs/examples/to_msgpack.cpp +++ b/docs/mkdocs/docs/examples/to_msgpack.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() @@ -16,7 +16,7 @@ int main() // print the vector content for (auto& byte : v) { - std::cout << "0x" << std::hex << std::setw(2) << std::setfill('0') << (int)byte << " "; + std::cout << "0x" << std::hex << std::setw(2) << std::setfill('0') << static_cast(byte) << " "; } - std::cout << std::endl; + std::cout << '\n'; } diff --git a/docs/mkdocs/docs/examples/to_msgpack__exception.cpp b/docs/mkdocs/docs/examples/to_msgpack__exception.cpp index fb20d0ad8..d932ffac4 100644 --- a/docs/mkdocs/docs/examples/to_msgpack__exception.cpp +++ b/docs/mkdocs/docs/examples/to_msgpack__exception.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/to_string.cpp b/docs/mkdocs/docs/examples/to_string.cpp index ee44283f3..2e9ec0d3b 100644 --- a/docs/mkdocs/docs/examples/to_string.cpp +++ b/docs/mkdocs/docs/examples/to_string.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using std::to_string; int main() @@ -16,5 +16,5 @@ int main() // serialize without indentation std::cout << j_str << "\n\n" - << i_str << std::endl; + << i_str << '\n'; } diff --git a/docs/mkdocs/docs/examples/to_ubjson.cpp b/docs/mkdocs/docs/examples/to_ubjson.cpp index fd267a85a..e951378e2 100644 --- a/docs/mkdocs/docs/examples/to_ubjson.cpp +++ b/docs/mkdocs/docs/examples/to_ubjson.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; // function to print UBJSON's diagnostic format @@ -10,11 +10,11 @@ void print_byte(uint8_t byte) { if (32 < byte and byte < 128) { - std::cout << (char)byte; + std::cout << static_cast(byte); } else { - std::cout << (int)byte; + std::cout << static_cast(byte); } } @@ -31,7 +31,7 @@ int main() { print_byte(byte); } - std::cout << std::endl; + std::cout << '\n'; // create an array of numbers json array = {1, 2, 3, 4, 5, 6, 7, 8}; @@ -48,17 +48,17 @@ int main() { print_byte(byte); } - std::cout << std::endl; + std::cout << '\n'; for (auto& byte : v_array_size) { print_byte(byte); } - std::cout << std::endl; + std::cout << '\n'; for (auto& byte : v_array_size_and_type) { print_byte(byte); } - std::cout << std::endl; + std::cout << '\n'; } diff --git a/docs/mkdocs/docs/examples/to_ubjson__exception.cpp b/docs/mkdocs/docs/examples/to_ubjson__exception.cpp index 8fe481d84..bfed7abfe 100644 --- a/docs/mkdocs/docs/examples/to_ubjson__exception.cpp +++ b/docs/mkdocs/docs/examples/to_ubjson__exception.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/trailing_commas.cpp b/docs/mkdocs/docs/examples/trailing_commas.cpp index 32bf6874e..4a2285e6b 100644 --- a/docs/mkdocs/docs/examples/trailing_commas.cpp +++ b/docs/mkdocs/docs/examples/trailing_commas.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -25,7 +25,7 @@ int main() } catch (json::exception& e) { - std::cout << e.what() << std::endl; + std::cout << e.what() << '\n'; } json j = json::parse(s, diff --git a/docs/mkdocs/docs/examples/type.cpp b/docs/mkdocs/docs/examples/type.cpp index 68fba3a91..3b51b143f 100644 --- a/docs/mkdocs/docs/examples/type.cpp +++ b/docs/mkdocs/docs/examples/type.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/type_error.cpp b/docs/mkdocs/docs/examples/type_error.cpp index f520f4013..44c3e0279 100644 --- a/docs/mkdocs/docs/examples/type_error.cpp +++ b/docs/mkdocs/docs/examples/type_error.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -15,6 +15,6 @@ int main() { // output exception information std::cout << "message: " << e.what() << '\n' - << "exception id: " << e.id << std::endl; + << "exception id: " << e.id << '\n'; } } diff --git a/docs/mkdocs/docs/examples/type_name.cpp b/docs/mkdocs/docs/examples/type_name.cpp index 32d3590cc..b3a46712f 100644 --- a/docs/mkdocs/docs/examples/type_name.cpp +++ b/docs/mkdocs/docs/examples/type_name.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/unflatten.cpp b/docs/mkdocs/docs/examples/unflatten.cpp index 75fb02d03..ac665e2da 100644 --- a/docs/mkdocs/docs/examples/unflatten.cpp +++ b/docs/mkdocs/docs/examples/unflatten.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/update.cpp b/docs/mkdocs/docs/examples/update.cpp index ff94b67fa..413b12779 100644 --- a/docs/mkdocs/docs/examples/update.cpp +++ b/docs/mkdocs/docs/examples/update.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() diff --git a/docs/mkdocs/docs/examples/update__range.cpp b/docs/mkdocs/docs/examples/update__range.cpp index 5b4385046..e38b5c19d 100644 --- a/docs/mkdocs/docs/examples/update__range.cpp +++ b/docs/mkdocs/docs/examples/update__range.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() diff --git a/docs/mkdocs/docs/examples/value__exception.cpp b/docs/mkdocs/docs/examples/value__exception.cpp index 1d611d4c9..79cbc53b2 100644 --- a/docs/mkdocs/docs/examples/value__exception.cpp +++ b/docs/mkdocs/docs/examples/value__exception.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/value__json_ptr.cpp b/docs/mkdocs/docs/examples/value__json_ptr.cpp index d866ef076..8f8bb37e3 100644 --- a/docs/mkdocs/docs/examples/value__json_ptr.cpp +++ b/docs/mkdocs/docs/examples/value__json_ptr.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; using namespace nlohmann::literals; int main() diff --git a/docs/mkdocs/docs/examples/value__keytype.c++17.cpp b/docs/mkdocs/docs/examples/value__keytype.c++17.cpp index 1f6ff5c30..b1a034a55 100644 --- a/docs/mkdocs/docs/examples/value__keytype.c++17.cpp +++ b/docs/mkdocs/docs/examples/value__keytype.c++17.cpp @@ -3,7 +3,7 @@ #include using namespace std::string_view_literals; -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/value__object_t_key_type.cpp b/docs/mkdocs/docs/examples/value__object_t_key_type.cpp index 9488d30ef..df2e48f52 100644 --- a/docs/mkdocs/docs/examples/value__object_t_key_type.cpp +++ b/docs/mkdocs/docs/examples/value__object_t_key_type.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/examples/value__return_type.cpp b/docs/mkdocs/docs/examples/value__return_type.cpp index 7947e1d93..2818e2271 100644 --- a/docs/mkdocs/docs/examples/value__return_type.cpp +++ b/docs/mkdocs/docs/examples/value__return_type.cpp @@ -1,7 +1,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { @@ -9,6 +9,6 @@ int main() std::cout << "operator[]: " << j["uint64"] << '\n' << "default value (int): " << j.value("uint64", 0) << '\n' - << "default value (uint64_t): " << j.value("uint64", std::uint64_t(0)) << '\n' + << "default value (uint64_t): " << j.value("uint64", static_cast(0)) << '\n' << "explicit return value type: " << j.value("uint64", 0) << '\n'; } diff --git a/docs/mkdocs/docs/examples/with_t.cpp b/docs/mkdocs/docs/examples/with_t.cpp index 665efde3e..2be58f944 100644 --- a/docs/mkdocs/docs/examples/with_t.cpp +++ b/docs/mkdocs/docs/examples/with_t.cpp @@ -14,5 +14,5 @@ int main() j["b"] = 3; // keys are sorted, because std::map is used to store the object - std::cout << j.dump() << std::endl; + std::cout << j.dump() << '\n'; } diff --git a/docs/mkdocs/docs/features/arbitrary_types.md b/docs/mkdocs/docs/features/arbitrary_types.md index 0ca165902..245d3e090 100644 --- a/docs/mkdocs/docs/features/arbitrary_types.md +++ b/docs/mkdocs/docs/features/arbitrary_types.md @@ -54,7 +54,7 @@ assert(p == p2); To make this work with one of your types, you only need to provide two functions: ```cpp -using json = nlohmann::json; +using nlohmann::json; namespace ns { void to_json(json& j, const person& p) { diff --git a/docs/mkdocs/docs/features/assertions.md b/docs/mkdocs/docs/features/assertions.md index dadb0bd87..3eba87e6e 100644 --- a/docs/mkdocs/docs/features/assertions.md +++ b/docs/mkdocs/docs/features/assertions.md @@ -35,7 +35,7 @@ See also the documentation on [element access](element_access/index.md). ```cpp #include - using json = nlohmann::json; + using nlohmann::json; int main() { @@ -57,7 +57,7 @@ See also the documentation on [element access](element_access/index.md). ```cpp #include - using json = nlohmann::json; + using nlohmann::json; using namespace nlohmann::literals; int main() @@ -85,7 +85,7 @@ uninitialized iterator is undefined behavior and yields a runtime assertion. ```cpp #include - using json = nlohmann::json; + using nlohmann::json; int main() { @@ -112,7 +112,7 @@ behavior and yields a runtime assertion. ```cpp #include - using json = nlohmann::json; + using nlohmann::json; int main() { @@ -144,7 +144,7 @@ result in undefined behavior. Since version 3.12.0, this library checks for `nul #include #include - using json = nlohmann::json; + using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/features/modules.md b/docs/mkdocs/docs/features/modules.md index 28b538a2e..b87cb8950 100644 --- a/docs/mkdocs/docs/features/modules.md +++ b/docs/mkdocs/docs/features/modules.md @@ -15,7 +15,7 @@ When using modules rather than headers, the previous example for creating a `jso import std; import nlohmann.json; -using json = nlohmann::json; +using nlohmann::json; // ... diff --git a/docs/mkdocs/docs/features/object_order.md b/docs/mkdocs/docs/features/object_order.md index b90637711..b9997238e 100644 --- a/docs/mkdocs/docs/features/object_order.md +++ b/docs/mkdocs/docs/features/object_order.md @@ -12,7 +12,7 @@ The default type `nlohmann::json` uses a `std::map` to store JSON objects, and t #include #include - using json = nlohmann::json; + using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/index.md b/docs/mkdocs/docs/index.md index 07e60067d..4aa5a1940 100644 --- a/docs/mkdocs/docs/index.md +++ b/docs/mkdocs/docs/index.md @@ -20,7 +20,7 @@ Add the single header to your project and use the library like this: #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/integration/bazel/example.cpp b/docs/mkdocs/docs/integration/bazel/example.cpp index 1a7ac4de2..c51a502aa 100644 --- a/docs/mkdocs/docs/integration/bazel/example.cpp +++ b/docs/mkdocs/docs/integration/bazel/example.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/integration/build2/example.cpp b/docs/mkdocs/docs/integration/build2/example.cpp index 1a7ac4de2..c51a502aa 100644 --- a/docs/mkdocs/docs/integration/build2/example.cpp +++ b/docs/mkdocs/docs/integration/build2/example.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/integration/cget/example.cpp b/docs/mkdocs/docs/integration/cget/example.cpp index 1a7ac4de2..c51a502aa 100644 --- a/docs/mkdocs/docs/integration/cget/example.cpp +++ b/docs/mkdocs/docs/integration/cget/example.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/integration/conan/example.cpp b/docs/mkdocs/docs/integration/conan/example.cpp index 1a7ac4de2..c51a502aa 100644 --- a/docs/mkdocs/docs/integration/conan/example.cpp +++ b/docs/mkdocs/docs/integration/conan/example.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/integration/conda/example.cpp b/docs/mkdocs/docs/integration/conda/example.cpp index 1a7ac4de2..c51a502aa 100644 --- a/docs/mkdocs/docs/integration/conda/example.cpp +++ b/docs/mkdocs/docs/integration/conda/example.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/integration/cpm/example.cpp b/docs/mkdocs/docs/integration/cpm/example.cpp index 1a7ac4de2..c51a502aa 100644 --- a/docs/mkdocs/docs/integration/cpm/example.cpp +++ b/docs/mkdocs/docs/integration/cpm/example.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/integration/example.cpp b/docs/mkdocs/docs/integration/example.cpp index 1a7ac4de2..c51a502aa 100644 --- a/docs/mkdocs/docs/integration/example.cpp +++ b/docs/mkdocs/docs/integration/example.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/integration/homebrew/example.cpp b/docs/mkdocs/docs/integration/homebrew/example.cpp index 1a7ac4de2..c51a502aa 100644 --- a/docs/mkdocs/docs/integration/homebrew/example.cpp +++ b/docs/mkdocs/docs/integration/homebrew/example.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/integration/hunter/example.cpp b/docs/mkdocs/docs/integration/hunter/example.cpp index 1a7ac4de2..c51a502aa 100644 --- a/docs/mkdocs/docs/integration/hunter/example.cpp +++ b/docs/mkdocs/docs/integration/hunter/example.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/integration/index.md b/docs/mkdocs/docs/integration/index.md index f6f303142..2f55b4a2b 100644 --- a/docs/mkdocs/docs/integration/index.md +++ b/docs/mkdocs/docs/integration/index.md @@ -37,7 +37,7 @@ file in `single_include/nlohmann` or [released here](https://github.com/nlohmann #include // for convenience -using json = nlohmann::json; +using nlohmann::json; ``` to the files you want to process JSON and set the necessary switches to enable C++11 (e.g., `-std=c++11` for GCC and diff --git a/docs/mkdocs/docs/integration/macports/example.cpp b/docs/mkdocs/docs/integration/macports/example.cpp index 1a7ac4de2..c51a502aa 100644 --- a/docs/mkdocs/docs/integration/macports/example.cpp +++ b/docs/mkdocs/docs/integration/macports/example.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/integration/meson/example.cpp b/docs/mkdocs/docs/integration/meson/example.cpp index 1a7ac4de2..c51a502aa 100644 --- a/docs/mkdocs/docs/integration/meson/example.cpp +++ b/docs/mkdocs/docs/integration/meson/example.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/integration/msys2/example.cpp b/docs/mkdocs/docs/integration/msys2/example.cpp index 1a7ac4de2..c51a502aa 100644 --- a/docs/mkdocs/docs/integration/msys2/example.cpp +++ b/docs/mkdocs/docs/integration/msys2/example.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/integration/spack/example.cpp b/docs/mkdocs/docs/integration/spack/example.cpp index 1a7ac4de2..c51a502aa 100644 --- a/docs/mkdocs/docs/integration/spack/example.cpp +++ b/docs/mkdocs/docs/integration/spack/example.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/integration/swift/example.cpp b/docs/mkdocs/docs/integration/swift/example.cpp index ad0a06827..33ccbfef0 100644 --- a/docs/mkdocs/docs/integration/swift/example.cpp +++ b/docs/mkdocs/docs/integration/swift/example.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/integration/vcpkg/example.cpp b/docs/mkdocs/docs/integration/vcpkg/example.cpp index 1a7ac4de2..c51a502aa 100644 --- a/docs/mkdocs/docs/integration/vcpkg/example.cpp +++ b/docs/mkdocs/docs/integration/vcpkg/example.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/docs/mkdocs/docs/integration/xmake/example.cpp b/docs/mkdocs/docs/integration/xmake/example.cpp index 1a7ac4de2..c51a502aa 100644 --- a/docs/mkdocs/docs/integration/xmake/example.cpp +++ b/docs/mkdocs/docs/integration/xmake/example.cpp @@ -2,7 +2,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; int main() { diff --git a/tests/benchmarks/src/benchmarks.cpp b/tests/benchmarks/src/benchmarks.cpp index 6e51d4778..0d9e06d21 100644 --- a/tests/benchmarks/src/benchmarks.cpp +++ b/tests/benchmarks/src/benchmarks.cpp @@ -21,7 +21,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; ////////////////////////////////////////////////////////////////////////////// // parse JSON from file diff --git a/tests/benchmarks/src/benchmarks_view.cpp b/tests/benchmarks/src/benchmarks_view.cpp index 475ed54a4..02920ffab 100644 --- a/tests/benchmarks/src/benchmarks_view.cpp +++ b/tests/benchmarks/src/benchmarks_view.cpp @@ -17,8 +17,8 @@ #include #include -using json = nlohmann::json; -using json_document = nlohmann::json_document; +using nlohmann::json; +using nlohmann::json_document; static std::string read_file(const char* filename) { diff --git a/tests/src/fuzzer-json_view_image.cpp b/tests/src/fuzzer-json_view_image.cpp index 8495468a4..d990600af 100644 --- a/tests/src/fuzzer-json_view_image.cpp +++ b/tests/src/fuzzer-json_view_image.cpp @@ -33,8 +33,8 @@ drivers. #error "the fuzzer drivers must be built without NDEBUG" #endif -using json = nlohmann::json; -using json_document = nlohmann::json_document; +using nlohmann::json; +using nlohmann::json_document; using image_check = json_document::image_check; // see http://llvm.org/docs/LibFuzzer.html diff --git a/tests/src/fuzzer-parse_json_view.cpp b/tests/src/fuzzer-parse_json_view.cpp index 9b9f5a02a..5e41d6c79 100644 --- a/tests/src/fuzzer-parse_json_view.cpp +++ b/tests/src/fuzzer-parse_json_view.cpp @@ -42,8 +42,8 @@ drivers. #error "the fuzzer drivers must be built without NDEBUG" #endif -using json = nlohmann::json; -using json_document = nlohmann::json_document; +using nlohmann::json; +using nlohmann::json_document; namespace { diff --git a/tests/src/unit-bjdata.cpp b/tests/src/unit-bjdata.cpp index 2f91462da..67e9e0a05 100644 --- a/tests/src/unit-bjdata.cpp +++ b/tests/src/unit-bjdata.cpp @@ -19,7 +19,7 @@ #include using nlohmann::json; -using ordered_json = nlohmann::ordered_json; +using nlohmann::ordered_json; #include #include diff --git a/tests/src/unit-diagnostic-positions.cpp b/tests/src/unit-diagnostic-positions.cpp index f5c6bc648..9e0625115 100644 --- a/tests/src/unit-diagnostic-positions.cpp +++ b/tests/src/unit-diagnostic-positions.cpp @@ -14,7 +14,7 @@ #define JSON_DIAGNOSTIC_POSITIONS 1 #include -using json = nlohmann::json; +using nlohmann::json; TEST_CASE("Better diagnostics with positions") { diff --git a/tests/src/unit-disabled_exceptions.cpp b/tests/src/unit-disabled_exceptions.cpp index 40a37c339..0e36d622e 100644 --- a/tests/src/unit-disabled_exceptions.cpp +++ b/tests/src/unit-disabled_exceptions.cpp @@ -13,7 +13,7 @@ DOCTEST_GCC_SUPPRESS_WARNING_PUSH DOCTEST_GCC_SUPPRESS_WARNING("-Wnoexcept") #include -using json = nlohmann::json; +using nlohmann::json; #ifdef JSON_TEST_NO_GLOBAL_UDLS using namespace nlohmann::literals; // NOLINT(google-build-using-namespace) #endif diff --git a/tests/src/unit-element_access2.cpp b/tests/src/unit-element_access2.cpp index 7765c0601..9f4d67fe8 100644 --- a/tests/src/unit-element_access2.cpp +++ b/tests/src/unit-element_access2.cpp @@ -1948,7 +1948,7 @@ TEST_CASE_TEMPLATE("element access 2 (additional value() tests)", Json, nlohmann #ifdef JSON_HAS_CPP_17 TEST_CASE("operator[] with user-defined std::string_view-convertible types") { - using json = nlohmann::json; + using nlohmann::json; class TestClass { @@ -2031,7 +2031,7 @@ TEST_CASE("keys convertible to std::string_view work with all lookup functions ( SECTION("nlohmann::json") { - using json = nlohmann::json; + using nlohmann::json; SECTION("ViewKey") { @@ -2072,7 +2072,7 @@ TEST_CASE("keys convertible to std::string_view work with all lookup functions ( SECTION("nlohmann::ordered_json") { - using ordered_json = nlohmann::ordered_json; + using nlohmann::ordered_json; SECTION("ViewKey") { diff --git a/tests/src/unit-explicit_instantiation.cpp b/tests/src/unit-explicit_instantiation.cpp index 71132a59f..ddb5e40f9 100644 --- a/tests/src/unit-explicit_instantiation.cpp +++ b/tests/src/unit-explicit_instantiation.cpp @@ -15,7 +15,7 @@ #include "doctest_compatibility.h" #include -using json = nlohmann::json; +using nlohmann::json; ///////////////////////////////////////////////////////////////////// // for #4825 - explicitly instantiating basic_json must compile; this diff --git a/tests/src/unit-format-as.cpp b/tests/src/unit-format-as.cpp index b275f505c..61821f9ac 100644 --- a/tests/src/unit-format-as.cpp +++ b/tests/src/unit-format-as.cpp @@ -9,8 +9,8 @@ #include "doctest_compatibility.h" #include -using json = nlohmann::json; -using ordered_json = nlohmann::ordered_json; +using nlohmann::json; +using nlohmann::ordered_json; namespace { diff --git a/tests/src/unit-hash.cpp b/tests/src/unit-hash.cpp index 117bc0151..e544cff9b 100644 --- a/tests/src/unit-hash.cpp +++ b/tests/src/unit-hash.cpp @@ -9,8 +9,8 @@ #include "doctest_compatibility.h" #include -using json = nlohmann::json; -using ordered_json = nlohmann::ordered_json; +using nlohmann::json; +using nlohmann::ordered_json; #include #include diff --git a/tests/src/unit-no_automatic_udls.cpp b/tests/src/unit-no_automatic_udls.cpp index 1a708da50..02f900077 100644 --- a/tests/src/unit-no_automatic_udls.cpp +++ b/tests/src/unit-no_automatic_udls.cpp @@ -19,7 +19,7 @@ #include #include -using json = nlohmann::json; +using nlohmann::json; // An argument type whose associated namespace is the library namespace, so // argument-dependent lookup of a literal operator called by its function name diff --git a/tests/src/unit-no_io_and_user_exceptions.cpp b/tests/src/unit-no_io_and_user_exceptions.cpp index 667d114e7..5a2b7da44 100644 --- a/tests/src/unit-no_io_and_user_exceptions.cpp +++ b/tests/src/unit-no_io_and_user_exceptions.cpp @@ -38,7 +38,7 @@ static int json_throw_user_call_count = 0; // NOLINT(cppcoreguidelines-avoid-non #include "doctest_compatibility.h" #include -using json = nlohmann::json; +using nlohmann::json; TEST_CASE("JSON_NO_IO") { diff --git a/tests/src/unit-regression2.cpp b/tests/src/unit-regression2.cpp index b532e75ae..c7566c799 100644 --- a/tests/src/unit-regression2.cpp +++ b/tests/src/unit-regression2.cpp @@ -33,8 +33,8 @@ #define JSON_TESTS_PRIVATE #include -using json = nlohmann::json; -using ordered_json = nlohmann::ordered_json; +using nlohmann::json; +using nlohmann::ordered_json; #ifdef JSON_TEST_NO_GLOBAL_UDLS using namespace nlohmann::literals; // NOLINT(google-build-using-namespace) #endif diff --git a/tests/src/unit-regression3.cpp b/tests/src/unit-regression3.cpp index b31cfd054..148ce2658 100644 --- a/tests/src/unit-regression3.cpp +++ b/tests/src/unit-regression3.cpp @@ -36,8 +36,8 @@ #define JSON_TESTS_PRIVATE #include -using json = nlohmann::json; -using ordered_json = nlohmann::ordered_json; +using nlohmann::json; +using nlohmann::ordered_json; #ifdef JSON_TEST_NO_GLOBAL_UDLS using namespace nlohmann::literals; // NOLINT(google-build-using-namespace) #endif diff --git a/tests/src/unit-std-format.cpp b/tests/src/unit-std-format.cpp index f2be8d5ec..9f32868e4 100644 --- a/tests/src/unit-std-format.cpp +++ b/tests/src/unit-std-format.cpp @@ -16,8 +16,8 @@ #include "doctest_compatibility.h" #include -using json = nlohmann::json; -using ordered_json = nlohmann::ordered_json; +using nlohmann::json; +using nlohmann::ordered_json; // JSON_HAS_CPP_20 (do not remove; see note at top of file) #if JSON_HAS_STD_FORMAT