From 6d7f8b37937c442f1bf75cae5b967020e7127f5c Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Tue, 14 Jul 2020 15:36:06 +0200 Subject: [PATCH 1/2] README.md: Remove trailing whitespace --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 000ce1cfe8..2233b55427 100644 --- a/README.md +++ b/README.md @@ -483,7 +483,7 @@ MyIterator begin(MyContainer& tgt) { } MyIterator end(const MyContainer&) { - return {}; + return {}; } void foo() { @@ -761,7 +761,7 @@ j_document.merge_patch(j_patch); Supported types can be implicitly converted to JSON values. It is recommended to **NOT USE** implicit conversions **FROM** a JSON value. -You can find more details about this recommendation [here](https://www.github.com/nlohmann/json/issues/958). +You can find more details about this recommendation [here](https://www.github.com/nlohmann/json/issues/958). ```cpp // strings @@ -914,7 +914,7 @@ namespace ns { std::string street; int housenumber; int postcode; - + public: NLOHMANN_DEFINE_TYPE_INTRUSIVE(address, street, housenumber, postcode) }; @@ -1568,7 +1568,7 @@ This library does not support comments by default. It does so for three reasons: 1. Comments are not part of the [JSON specification](https://tools.ietf.org/html/rfc8259). You may argue that `//` or `/* */` are allowed in JavaScript, but JSON is not JavaScript. 2. This was not an oversight: Douglas Crockford [wrote on this](https://plus.google.com/118095276221607585885/posts/RK8qyGVaGSr) in May 2012: - > I removed comments from JSON because I saw people were using them to hold parsing directives, a practice which would have destroyed interoperability. I know that the lack of comments makes some people sad, but it shouldn't. + > I removed comments from JSON because I saw people were using them to hold parsing directives, a practice which would have destroyed interoperability. I know that the lack of comments makes some people sad, but it shouldn't. > Suppose you are using JSON to keep configuration files, which you would like to annotate. Go ahead and insert all the comments you like. Then pipe it through JSMin before handing it to your JSON parser. @@ -1584,9 +1584,9 @@ If you do want to preserve the insertion order, you can try the type [`nlohmann: ### Memory Release -We checked with Valgrind and the Address Sanitizer (ASAN) that there are no memory leaks. +We checked with Valgrind and the Address Sanitizer (ASAN) that there are no memory leaks. -If you find that a parsing program with this library does not release memory, please consider the following case and it maybe unrelated to this library. +If you find that a parsing program with this library does not release memory, please consider the following case and it maybe unrelated to this library. **Your program is compiled with glibc.** There is a tunable threshold that glibc uses to decide whether to actually return memory to the system or whether to cache it for later reuse. If in your program you make lots of small allocations and those small allocations are not a contiguous block and are presumably below the threshold, then they will not get returned to the OS. Here is a related issue [#1924](https://github.com/nlohmann/json/issues/1924). From 25a59b59f2074614da4c4188e184a87b366dd02d Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Tue, 14 Jul 2020 14:15:24 +0200 Subject: [PATCH 2/2] Github Actions: Add ClangCL on Windows MS Visual Studio 2019 has builtin support for other compiler toolsets [1]. This commit adds support for compiling using LLVM/Clang 10 using Visual Studio. ClangCL pretends to be MSVC so the usual MSVC flags apply, see also [2]. For detecting if ClangCL is used, newer cmake verisons (>= 3.15) have builtin support using CMAKE_CXX_COMPILER_FRONTEND_VARIANT [3], for older ones a workaround is available using CMAKE_CXX_SIMULATE_ID [4]. [1]: https://devblogs.microsoft.com/cppblog/clang-llvm-support-in-visual-studio/ [2]: https://clang.llvm.org/docs/UsersManual.html#clang-cl [3]: https://stackoverflow.com/a/10055571 [4]: https://github.com/microsoft/CMake/commit/4fe34b2d29ca67ea91b2545b223dad8abbcad282 --- .github/workflows/windows_clang_cl.yml | 30 ++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 31 insertions(+) create mode 100644 .github/workflows/windows_clang_cl.yml diff --git a/.github/workflows/windows_clang_cl.yml b/.github/workflows/windows_clang_cl.yml new file mode 100644 index 0000000000..4b5a5f5acf --- /dev/null +++ b/.github/workflows/windows_clang_cl.yml @@ -0,0 +1,30 @@ +name: Windows + +on: [push, pull_request] + +jobs: + clang-cl-10-x64: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v1 + - name: cmake + run: cmake -S . -B build -G "Visual Studio 16 2019" -A x64 -T ClangCL -DJSON_BuildTests=On + - name: build + run: cmake --build build --config Debug --parallel 10 + - name: test + run: cd build ; ctest -j 10 -C Debug --exclude-regex "test-unicode" --output-on-failure + + clang-cl-10-x86: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v1 + - name: cmake + run: cmake -S . -B build -G "Visual Studio 16 2019" -A Win32 -T ClangCL -DJSON_BuildTests=On + - name: build + run: cmake --build build --config Debug --parallel 10 + - name: test + run: cd build ; ctest -j 10 -C Debug --exclude-regex "test-unicode" --output-on-failure diff --git a/README.md b/README.md index 2233b55427..c1463349e9 100644 --- a/README.md +++ b/README.md @@ -1254,6 +1254,7 @@ The following compilers are currently used in continuous integration at [Travis] | MSVC 19.16.27035.0 (15.9.21+g9802d43bc3 for .NET Framework) | Windows-10.0.14393 | AppVeyor | | MSVC 19.25.28614.0 (Build Engine version 16.5.0+d4cbfca49 for .NET Framework) | Windows-10.0.17763 | AppVeyor | | MSVC 19.25.28614.0 (Build Engine version 16.5.0+d4cbfca49 for .NET Framework) | Windows-10.0.17763 | GitHub Actions | +| MSVC 19.25.28614.0 (Build Engine version 16.5.0+d4cbfca49 for .NET Framework) with ClangCL 10.0.0 | Windows-10.0.17763 | GitHub Actions | ## License