Merge branches 'develop' and 'mkdocs' of https://github.com/nlohmann/json into mkdocs
This commit is contained in:
		
						commit
						32bda1a7af
					
				
					 19 changed files with 409 additions and 276 deletions
				
			
		| 
						 | 
					@ -10,12 +10,9 @@ jobs:
 | 
				
			||||||
      - run:
 | 
					      - run:
 | 
				
			||||||
          name: Install required tools
 | 
					          name: Install required tools
 | 
				
			||||||
          command: 'apt-get update && apt-get install -y gcc g++ git cmake'
 | 
					          command: 'apt-get update && apt-get install -y gcc g++ git cmake'
 | 
				
			||||||
      - run:
 | 
					 | 
				
			||||||
          name: Show versions
 | 
					 | 
				
			||||||
          command: 'g++ --version ; uname -a; cmake --version'
 | 
					 | 
				
			||||||
      - run:
 | 
					      - run:
 | 
				
			||||||
          name: Run CMake
 | 
					          name: Run CMake
 | 
				
			||||||
          command: 'mkdir build ; cd build ; cmake ..'
 | 
					          command: 'mkdir build ; cd build ; cmake .. -DJSON_BuildTests=On'
 | 
				
			||||||
      - run:
 | 
					      - run:
 | 
				
			||||||
          name: Compile
 | 
					          name: Compile
 | 
				
			||||||
          command: 'cmake --build build'
 | 
					          command: 'cmake --build build'
 | 
				
			||||||
| 
						 | 
					@ -33,12 +30,9 @@ jobs:
 | 
				
			||||||
      - run:
 | 
					      - run:
 | 
				
			||||||
          name: Install required tools
 | 
					          name: Install required tools
 | 
				
			||||||
          command: 'pacman -Sy --noconfirm base base-devel gcc git cmake'
 | 
					          command: 'pacman -Sy --noconfirm base base-devel gcc git cmake'
 | 
				
			||||||
      - run:
 | 
					 | 
				
			||||||
          name: Show versions
 | 
					 | 
				
			||||||
          command: 'g++ --version ; uname -a; cmake --version'
 | 
					 | 
				
			||||||
      - run:
 | 
					      - run:
 | 
				
			||||||
          name: Run CMake
 | 
					          name: Run CMake
 | 
				
			||||||
          command: 'mkdir build ; cd build ; cmake ..'
 | 
					          command: 'mkdir build ; cd build ; cmake .. -DJSON_BuildTests=On'
 | 
				
			||||||
      - run:
 | 
					      - run:
 | 
				
			||||||
          name: Compile
 | 
					          name: Compile
 | 
				
			||||||
          command: 'cmake --build build'
 | 
					          command: 'cmake --build build'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										1
									
								
								.github/ISSUE_TEMPLATE/Feature_request.md
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.github/ISSUE_TEMPLATE/Feature_request.md
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -14,4 +14,3 @@ assignees: ''
 | 
				
			||||||
#### How would the feature be usable for other users?
 | 
					#### How would the feature be usable for other users?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<!-- Include sample usage where appropriate. -->
 | 
					<!-- Include sample usage where appropriate. -->
 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										6
									
								
								.github/ISSUE_TEMPLATE/question.md
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.github/ISSUE_TEMPLATE/question.md
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -7,6 +7,8 @@ assignees: ''
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<!-- Provide a concise summary of the issue in the title above. -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#### What do you want to achieve?
 | 
					#### What do you want to achieve?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<!-- Please describe the feature as detailed as possible. -->
 | 
					<!-- Please describe the feature as detailed as possible. -->
 | 
				
			||||||
| 
						 | 
					@ -17,6 +19,10 @@ assignees: ''
 | 
				
			||||||
<!-- There is a full documentation of the API: https://nlohmann.github.io/json/ -->
 | 
					<!-- There is a full documentation of the API: https://nlohmann.github.io/json/ -->
 | 
				
			||||||
<!-- There is a detailed README file: https://github.com/nlohmann/json/blob/develop/README.md -->
 | 
					<!-- There is a detailed README file: https://github.com/nlohmann/json/blob/develop/README.md -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### Can you provide a small code example?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<!-- Please understand that we cannot analyze and debug large code bases. -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#### Which compiler and operating system are you using?
 | 
					#### Which compiler and operating system are you using?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<!-- Include as many relevant details about the environment you experienced the bug in. -->
 | 
					<!-- Include as many relevant details about the environment you experienced the bug in. -->
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								.github/workflows/macos.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/macos.yml
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -10,7 +10,7 @@ jobs:
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
    - uses: actions/checkout@v1
 | 
					    - uses: actions/checkout@v1
 | 
				
			||||||
    - name: cmake
 | 
					    - name: cmake
 | 
				
			||||||
      run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug
 | 
					      run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
 | 
				
			||||||
    - name: build
 | 
					    - name: build
 | 
				
			||||||
      run: cmake --build build --parallel 10
 | 
					      run: cmake --build build --parallel 10
 | 
				
			||||||
    - name: test
 | 
					    - name: test
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								.github/workflows/ubuntu.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/ubuntu.yml
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -10,7 +10,7 @@ jobs:
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
    - uses: actions/checkout@v1
 | 
					    - uses: actions/checkout@v1
 | 
				
			||||||
    - name: cmake
 | 
					    - name: cmake
 | 
				
			||||||
      run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug
 | 
					      run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
 | 
				
			||||||
    - name: build
 | 
					    - name: build
 | 
				
			||||||
      run: cmake --build build --parallel 10
 | 
					      run: cmake --build build --parallel 10
 | 
				
			||||||
    - name: test
 | 
					    - name: test
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								.github/workflows/windows.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/windows.yml
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -10,7 +10,7 @@ jobs:
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
    - uses: actions/checkout@v1
 | 
					    - uses: actions/checkout@v1
 | 
				
			||||||
    - name: cmake
 | 
					    - name: cmake
 | 
				
			||||||
      run: cmake -S . -B build -G "Visual Studio 16 2019" -D CMAKE_BUILD_TYPE=Debug
 | 
					      run: cmake -S . -B build -G "Visual Studio 16 2019" -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
 | 
				
			||||||
    - name: build
 | 
					    - name: build
 | 
				
			||||||
      run: cmake --build build --parallel 10
 | 
					      run: cmake --build build --parallel 10
 | 
				
			||||||
    - name: test
 | 
					    - name: test
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -321,13 +321,9 @@ script:
 | 
				
			||||||
  # by default, use the single-header version
 | 
					  # by default, use the single-header version
 | 
				
			||||||
  - if [[ "${MULTIPLE_HEADERS}" == "" ]]; then export MULTIPLE_HEADERS=OFF; fi
 | 
					  - if [[ "${MULTIPLE_HEADERS}" == "" ]]; then export MULTIPLE_HEADERS=OFF; fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # show OS/compiler version
 | 
					 | 
				
			||||||
  - uname -a
 | 
					 | 
				
			||||||
  - $CXX --version
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  # compile and execute unit tests
 | 
					  # compile and execute unit tests
 | 
				
			||||||
  - mkdir -p build && cd build
 | 
					  - mkdir -p build && cd build
 | 
				
			||||||
  - cmake .. ${CMAKE_OPTIONS} -DJSON_MultipleHeaders=${MULTIPLE_HEADERS} -GNinja && cmake --build . --config Release
 | 
					  - cmake .. ${CMAKE_OPTIONS} -DJSON_MultipleHeaders=${MULTIPLE_HEADERS} -DJSON_BuildTests=On -GNinja && cmake --build . --config Release
 | 
				
			||||||
  - ctest -C Release --timeout 2700 -V -j
 | 
					  - ctest -C Release --timeout 2700 -V -j
 | 
				
			||||||
  - cd ..
 | 
					  - cd ..
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										482
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										482
									
								
								Makefile
									
										
									
									
									
								
							| 
						 | 
					@ -116,7 +116,7 @@ pedantic_clang:
 | 
				
			||||||
		-Wno-padded \
 | 
							-Wno-padded \
 | 
				
			||||||
		-Wno-range-loop-analysis \
 | 
							-Wno-range-loop-analysis \
 | 
				
			||||||
		-Wno-switch-enum -Wno-covered-switch-default \
 | 
							-Wno-switch-enum -Wno-covered-switch-default \
 | 
				
			||||||
		-Wno-weak-vtables" cmake -S . -B build_pedantic -GNinja -DCMAKE_BUILD_TYPE=Debug -DJSON_MultipleHeaders=ON
 | 
							-Wno-weak-vtables" cmake -S . -B build_pedantic -GNinja -DCMAKE_BUILD_TYPE=Debug -DJSON_MultipleHeaders=ON -DJSON_BuildTests=On
 | 
				
			||||||
	cmake --build build_pedantic
 | 
						cmake --build build_pedantic
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# calling GCC with most warnings
 | 
					# calling GCC with most warnings
 | 
				
			||||||
| 
						 | 
					@ -124,226 +124,262 @@ pedantic_gcc:
 | 
				
			||||||
	rm -fr build_pedantic
 | 
						rm -fr build_pedantic
 | 
				
			||||||
	CXXFLAGS=" \
 | 
						CXXFLAGS=" \
 | 
				
			||||||
		-std=c++11 \
 | 
							-std=c++11 \
 | 
				
			||||||
		-Waddress \
 | 
							-pedantic \
 | 
				
			||||||
		-Waddress-of-packed-member \
 | 
					 | 
				
			||||||
		-Waggressive-loop-optimizations \
 | 
					 | 
				
			||||||
		-Waligned-new=all \
 | 
					 | 
				
			||||||
		-Wall \
 | 
					 | 
				
			||||||
		-Walloc-zero \
 | 
					 | 
				
			||||||
		-Walloca \
 | 
					 | 
				
			||||||
		-Warray-bounds \
 | 
					 | 
				
			||||||
		-Warray-bounds=2 \
 | 
					 | 
				
			||||||
		-Wattribute-alias=2 \
 | 
					 | 
				
			||||||
		-Wattribute-warning \
 | 
					 | 
				
			||||||
		-Wattributes \
 | 
					 | 
				
			||||||
		-Wbool-compare \
 | 
					 | 
				
			||||||
		-Wbool-operation \
 | 
					 | 
				
			||||||
		-Wbuiltin-declaration-mismatch \
 | 
					 | 
				
			||||||
		-Wbuiltin-macro-redefined \
 | 
					 | 
				
			||||||
		-Wcannot-profile \
 | 
					 | 
				
			||||||
		-Wcast-align \
 | 
					 | 
				
			||||||
		-Wcast-function-type \
 | 
					 | 
				
			||||||
		-Wcast-qual \
 | 
					 | 
				
			||||||
		-Wcatch-value=3 \
 | 
					 | 
				
			||||||
		-Wchar-subscripts \
 | 
					 | 
				
			||||||
		-Wclass-conversion \
 | 
					 | 
				
			||||||
		-Wclass-memaccess \
 | 
					 | 
				
			||||||
		-Wclobbered \
 | 
					 | 
				
			||||||
		-Wcomment \
 | 
					 | 
				
			||||||
		-Wcomments \
 | 
					 | 
				
			||||||
		-Wconditionally-supported \
 | 
					 | 
				
			||||||
		-Wconversion \
 | 
					 | 
				
			||||||
		-Wconversion-null \
 | 
					 | 
				
			||||||
		-Wcoverage-mismatch \
 | 
					 | 
				
			||||||
		-Wcpp \
 | 
					 | 
				
			||||||
		-Wctor-dtor-privacy \
 | 
					 | 
				
			||||||
		-Wdangling-else \
 | 
					 | 
				
			||||||
		-Wdate-time \
 | 
					 | 
				
			||||||
		-Wdelete-incomplete \
 | 
					 | 
				
			||||||
		-Wdelete-non-virtual-dtor \
 | 
					 | 
				
			||||||
		-Wdeprecated \
 | 
					 | 
				
			||||||
		-Wdeprecated-copy \
 | 
					 | 
				
			||||||
		-Wdeprecated-copy-dtor \
 | 
					 | 
				
			||||||
		-Wdeprecated-declarations \
 | 
					 | 
				
			||||||
		-Wdisabled-optimization \
 | 
					 | 
				
			||||||
		-Wdiv-by-zero \
 | 
					 | 
				
			||||||
		-Wdouble-promotion \
 | 
					 | 
				
			||||||
		-Wduplicated-branches \
 | 
					 | 
				
			||||||
		-Wduplicated-cond \
 | 
					 | 
				
			||||||
		-Weffc++ \
 | 
					 | 
				
			||||||
		-Wempty-body \
 | 
					 | 
				
			||||||
		-Wendif-labels \
 | 
					 | 
				
			||||||
		-Wenum-compare \
 | 
					 | 
				
			||||||
		-Wexpansion-to-defined \
 | 
					 | 
				
			||||||
		-Werror \
 | 
							-Werror \
 | 
				
			||||||
		-Wextra \
 | 
							--all-warnings                                    \
 | 
				
			||||||
		-Wextra-semi \
 | 
							--extra-warnings                                  \
 | 
				
			||||||
		-Wfloat-conversion \
 | 
							-W                                                \
 | 
				
			||||||
		-Wformat \
 | 
							-Wno-abi-tag                                         \
 | 
				
			||||||
		-Wformat-contains-nul \
 | 
							-Waddress                                         \
 | 
				
			||||||
		-Wformat-extra-args \
 | 
							-Waddress-of-packed-member                        \
 | 
				
			||||||
		-Wformat-nonliteral \
 | 
							-Wno-aggregate-return                                \
 | 
				
			||||||
		-Wformat-overflow=2 \
 | 
							-Waggressive-loop-optimizations                   \
 | 
				
			||||||
		-Wformat-security \
 | 
							-Waligned-new=all                                 \
 | 
				
			||||||
		-Wformat-signedness \
 | 
							-Wall                                             \
 | 
				
			||||||
		-Wformat-truncation=2 \
 | 
							-Walloc-zero                                      \
 | 
				
			||||||
		-Wformat-y2k \
 | 
							-Walloca                                          \
 | 
				
			||||||
		-Wformat-zero-length \
 | 
							-Wanalyzer-double-fclose                          \
 | 
				
			||||||
		-Wformat=2 \
 | 
							-Wanalyzer-double-free                            \
 | 
				
			||||||
		-Wframe-address \
 | 
							-Wanalyzer-exposure-through-output-file           \
 | 
				
			||||||
		-Wfree-nonheap-object \
 | 
							-Wanalyzer-file-leak                              \
 | 
				
			||||||
		-Whsa \
 | 
							-Wanalyzer-free-of-non-heap                       \
 | 
				
			||||||
		-Wif-not-aligned \
 | 
							-Wanalyzer-malloc-leak                            \
 | 
				
			||||||
		-Wignored-attributes \
 | 
							-Wanalyzer-null-argument                          \
 | 
				
			||||||
		-Wignored-qualifiers \
 | 
							-Wanalyzer-null-dereference                       \
 | 
				
			||||||
		-Wimplicit-fallthrough=5 \
 | 
							-Wanalyzer-possible-null-argument                 \
 | 
				
			||||||
		-Winherited-variadic-ctor \
 | 
							-Wanalyzer-possible-null-dereference              \
 | 
				
			||||||
		-Winit-list-lifetime \
 | 
							-Wanalyzer-stale-setjmp-buffer                    \
 | 
				
			||||||
		-Winit-self \
 | 
							-Wanalyzer-tainted-array-index                    \
 | 
				
			||||||
		-Winline \
 | 
							-Wanalyzer-too-complex                            \
 | 
				
			||||||
		-Wint-in-bool-context \
 | 
							-Wanalyzer-unsafe-call-within-signal-handler      \
 | 
				
			||||||
		-Wint-to-pointer-cast \
 | 
							-Wanalyzer-use-after-free                         \
 | 
				
			||||||
		-Winvalid-memory-model \
 | 
							-Wanalyzer-use-of-pointer-in-stale-stack-frame    \
 | 
				
			||||||
		-Winvalid-offsetof \
 | 
							-Warith-conversion                                \
 | 
				
			||||||
		-Winvalid-pch \
 | 
							-Warray-bounds                                    \
 | 
				
			||||||
		-Wliteral-suffix \
 | 
							-Warray-bounds=2                                  \
 | 
				
			||||||
		-Wlogical-not-parentheses \
 | 
							-Wattribute-alias=2                               \
 | 
				
			||||||
		-Wlogical-op \
 | 
							-Wattribute-warning                               \
 | 
				
			||||||
		-Wlto-type-mismatch \
 | 
							-Wattributes                                      \
 | 
				
			||||||
		-Wmain \
 | 
							-Wbool-compare                                    \
 | 
				
			||||||
		-Wmaybe-uninitialized \
 | 
							-Wbool-operation                                  \
 | 
				
			||||||
		-Wmemset-elt-size \
 | 
							-Wbuiltin-declaration-mismatch                    \
 | 
				
			||||||
		-Wmemset-transposed-args \
 | 
							-Wbuiltin-macro-redefined                         \
 | 
				
			||||||
		-Wmisleading-indentation \
 | 
							-Wc++0x-compat                                    \
 | 
				
			||||||
		-Wmissing-attributes \
 | 
							-Wc++11-compat                                    \
 | 
				
			||||||
		-Wmissing-braces \
 | 
							-Wc++14-compat                                    \
 | 
				
			||||||
		-Wmissing-declarations \
 | 
							-Wc++17-compat                                    \
 | 
				
			||||||
		-Wmissing-field-initializers \
 | 
							-Wc++1z-compat                                    \
 | 
				
			||||||
		-Wmissing-format-attribute \
 | 
							-Wc++20-compat                                    \
 | 
				
			||||||
		-Wmissing-include-dirs \
 | 
							-Wc++2a-compat                                    \
 | 
				
			||||||
		-Wmissing-noreturn \
 | 
							-Wcannot-profile                                  \
 | 
				
			||||||
		-Wmissing-profile \
 | 
							-Wcast-align                                      \
 | 
				
			||||||
		-Wmultichar \
 | 
							-Wcast-align=strict                               \
 | 
				
			||||||
		-Wmultiple-inheritance \
 | 
							-Wcast-function-type                              \
 | 
				
			||||||
		-Wmultistatement-macros \
 | 
							-Wcast-qual                                       \
 | 
				
			||||||
		-Wnarrowing \
 | 
							-Wcatch-value=3                                   \
 | 
				
			||||||
		-Wno-deprecated-declarations \
 | 
							-Wchar-subscripts                                 \
 | 
				
			||||||
		-Wno-float-equal \
 | 
							-Wclass-conversion                                \
 | 
				
			||||||
		-Wno-long-long \
 | 
							-Wclass-memaccess                                 \
 | 
				
			||||||
		-Wno-namespaces \
 | 
							-Wclobbered                                       \
 | 
				
			||||||
		-Wno-padded \
 | 
							-Wcomma-subscript                                 \
 | 
				
			||||||
		-Wno-switch-enum \
 | 
							-Wcomment                                         \
 | 
				
			||||||
		-Wno-system-headers \
 | 
							-Wcomments                                        \
 | 
				
			||||||
		-Wno-templates \
 | 
							-Wconditionally-supported                         \
 | 
				
			||||||
		-Wno-undef \
 | 
							-Wconversion                                      \
 | 
				
			||||||
		-Wno-noexcept \
 | 
							-Wconversion-null                                 \
 | 
				
			||||||
		-Wnoexcept-type \
 | 
							-Wcoverage-mismatch                               \
 | 
				
			||||||
		-Wnon-template-friend \
 | 
							-Wcpp                                             \
 | 
				
			||||||
		-Wnon-virtual-dtor \
 | 
							-Wctor-dtor-privacy                               \
 | 
				
			||||||
		-Wnonnull \
 | 
							-Wdangling-else                                   \
 | 
				
			||||||
		-Wnonnull-compare \
 | 
							-Wdate-time                                       \
 | 
				
			||||||
		-Wnonportable-cfstrings \
 | 
							-Wdelete-incomplete                               \
 | 
				
			||||||
		-Wnormalized \
 | 
							-Wdelete-non-virtual-dtor                         \
 | 
				
			||||||
		-Wnull-dereference \
 | 
							-Wdeprecated                                      \
 | 
				
			||||||
		-Wodr \
 | 
							-Wdeprecated-copy                                 \
 | 
				
			||||||
		-Wold-style-cast \
 | 
							-Wdeprecated-copy-dtor                            \
 | 
				
			||||||
		-Wopenmp-simd \
 | 
							-Wdeprecated-declarations                         \
 | 
				
			||||||
		-Woverflow \
 | 
							-Wdisabled-optimization                           \
 | 
				
			||||||
		-Woverlength-strings \
 | 
							-Wdiv-by-zero                                     \
 | 
				
			||||||
		-Woverloaded-virtual \
 | 
							-Wdouble-promotion                                \
 | 
				
			||||||
		-Wpacked \
 | 
							-Wduplicated-branches                             \
 | 
				
			||||||
		-Wpacked-bitfield-compat \
 | 
							-Wduplicated-cond                                 \
 | 
				
			||||||
		-Wpacked-not-aligned \
 | 
							-Weffc++                                          \
 | 
				
			||||||
		-Wparentheses \
 | 
							-Wempty-body                                      \
 | 
				
			||||||
		-Wpedantic \
 | 
							-Wendif-labels                                    \
 | 
				
			||||||
		-Wpessimizing-move \
 | 
							-Wenum-compare                                    \
 | 
				
			||||||
		-Wplacement-new=2 \
 | 
							-Wexpansion-to-defined                            \
 | 
				
			||||||
		-Wpmf-conversions \
 | 
							-Wextra                                           \
 | 
				
			||||||
		-Wpointer-arith \
 | 
							-Wextra-semi                                      \
 | 
				
			||||||
		-Wpointer-compare \
 | 
							-Wfloat-conversion                                \
 | 
				
			||||||
		-Wpragmas \
 | 
							-Wfloat-equal                                     \
 | 
				
			||||||
		-Wprio-ctor-dtor \
 | 
							-Wformat -Wformat-contains-nul                    \
 | 
				
			||||||
		-Wpsabi \
 | 
							-Wformat -Wformat-extra-args                      \
 | 
				
			||||||
		-Wredundant-decls \
 | 
							-Wformat -Wformat-nonliteral                      \
 | 
				
			||||||
		-Wredundant-move \
 | 
							-Wformat -Wformat-security                        \
 | 
				
			||||||
		-Wregister \
 | 
							-Wformat -Wformat-y2k                             \
 | 
				
			||||||
		-Wreorder \
 | 
							-Wformat -Wformat-zero-length                     \
 | 
				
			||||||
		-Wrestrict \
 | 
							-Wformat-diag                                     \
 | 
				
			||||||
		-Wreturn-local-addr \
 | 
							-Wformat-overflow=2                               \
 | 
				
			||||||
		-Wreturn-type \
 | 
							-Wformat-signedness                               \
 | 
				
			||||||
		-Wscalar-storage-order \
 | 
							-Wformat-truncation=2                             \
 | 
				
			||||||
		-Wsequence-point \
 | 
							-Wformat=2                                        \
 | 
				
			||||||
		-Wshadow \
 | 
							-Wframe-address                                   \
 | 
				
			||||||
		-Wshadow-compatible-local \
 | 
							-Wfree-nonheap-object                             \
 | 
				
			||||||
		-Wshadow-local \
 | 
							-Whsa                                             \
 | 
				
			||||||
		-Wshadow=compatible-local \
 | 
							-Wif-not-aligned                                  \
 | 
				
			||||||
		-Wshadow=global \
 | 
							-Wignored-attributes                              \
 | 
				
			||||||
		-Wshadow=local \
 | 
							-Wignored-qualifiers                              \
 | 
				
			||||||
		-Wshift-count-negative \
 | 
							-Wimplicit-fallthrough=5                          \
 | 
				
			||||||
		-Wshift-count-overflow \
 | 
							-Winaccessible-base                               \
 | 
				
			||||||
		-Wshift-negative-value \
 | 
							-Winherited-variadic-ctor                         \
 | 
				
			||||||
		-Wshift-overflow=2 \
 | 
							-Winit-list-lifetime                              \
 | 
				
			||||||
		-Wsign-compare \
 | 
							-Winit-self                                       \
 | 
				
			||||||
		-Wsign-conversion \
 | 
							-Winline                                          \
 | 
				
			||||||
		-Wsign-promo \
 | 
							-Wint-in-bool-context                             \
 | 
				
			||||||
		-Wsized-deallocation \
 | 
							-Wint-to-pointer-cast                             \
 | 
				
			||||||
		-Wsizeof-array-argument \
 | 
							-Winvalid-memory-model                            \
 | 
				
			||||||
		-Wsizeof-pointer-div \
 | 
							-Winvalid-offsetof                                \
 | 
				
			||||||
		-Wsizeof-pointer-memaccess \
 | 
							-Winvalid-pch                                     \
 | 
				
			||||||
		-Wstack-protector \
 | 
							-Wliteral-suffix                                  \
 | 
				
			||||||
		-Wstrict-aliasing=3 \
 | 
							-Wlogical-not-parentheses                         \
 | 
				
			||||||
		-Wstrict-null-sentinel \
 | 
							-Wlogical-op                                      \
 | 
				
			||||||
		-Wstrict-overflow=5 \
 | 
							-Wno-long-long                                       \
 | 
				
			||||||
		-Wstringop-overflow=4 \
 | 
							-Wlto-type-mismatch                               \
 | 
				
			||||||
		-Wstringop-truncation \
 | 
							-Wmain                                            \
 | 
				
			||||||
		-Wsubobject-linkage \
 | 
							-Wmaybe-uninitialized                             \
 | 
				
			||||||
		-Wsuggest-attribute=cold \
 | 
							-Wmemset-elt-size                                 \
 | 
				
			||||||
		-Wsuggest-attribute=const \
 | 
							-Wmemset-transposed-args                          \
 | 
				
			||||||
		-Wsuggest-attribute=format \
 | 
							-Wmisleading-indentation                          \
 | 
				
			||||||
		-Wsuggest-attribute=malloc \
 | 
							-Wmismatched-tags                                 \
 | 
				
			||||||
		-Wsuggest-attribute=noreturn \
 | 
							-Wmissing-attributes                              \
 | 
				
			||||||
		-Wsuggest-attribute=pure \
 | 
							-Wmissing-braces                                  \
 | 
				
			||||||
		-Wsuggest-final-methods \
 | 
							-Wmissing-declarations                            \
 | 
				
			||||||
		-Wsuggest-final-types \
 | 
							-Wmissing-field-initializers                      \
 | 
				
			||||||
		-Wsuggest-override \
 | 
							-Wmissing-include-dirs                            \
 | 
				
			||||||
		-Wswitch \
 | 
							-Wmissing-profile                                 \
 | 
				
			||||||
		-Wswitch-bool \
 | 
							-Wmultichar                                       \
 | 
				
			||||||
		-Wswitch-default \
 | 
							-Wmultiple-inheritance                            \
 | 
				
			||||||
		-Wswitch-unreachable \
 | 
							-Wmultistatement-macros                           \
 | 
				
			||||||
		-Wsync-nand \
 | 
							-Wno-namespaces                                      \
 | 
				
			||||||
		-Wsynth \
 | 
							-Wnarrowing                                       \
 | 
				
			||||||
		-Wtautological-compare \
 | 
							-Wno-noexcept                                        \
 | 
				
			||||||
		-Wterminate \
 | 
							-Wnoexcept-type                                   \
 | 
				
			||||||
		-Wtrampolines \
 | 
							-Wnon-template-friend                             \
 | 
				
			||||||
		-Wtrigraphs \
 | 
							-Wnon-virtual-dtor                                \
 | 
				
			||||||
		-Wtype-limits \
 | 
							-Wnonnull                                         \
 | 
				
			||||||
		-Wuninitialized \
 | 
							-Wnonnull-compare                                 \
 | 
				
			||||||
		-Wunknown-pragmas \
 | 
							-Wnonportable-cfstrings                           \
 | 
				
			||||||
		-Wunreachable-code \
 | 
							-Wnormalized=nfkc                                 \
 | 
				
			||||||
		-Wunsafe-loop-optimizations \
 | 
							-Wnull-dereference                                \
 | 
				
			||||||
		-Wunused \
 | 
							-Wodr                                             \
 | 
				
			||||||
		-Wunused-but-set-parameter \
 | 
							-Wold-style-cast                                  \
 | 
				
			||||||
		-Wunused-but-set-variable \
 | 
							-Wopenmp-simd                                     \
 | 
				
			||||||
		-Wunused-const-variable=2 \
 | 
							-Woverflow                                        \
 | 
				
			||||||
		-Wunused-function \
 | 
							-Woverlength-strings                              \
 | 
				
			||||||
		-Wunused-label \
 | 
							-Woverloaded-virtual                              \
 | 
				
			||||||
		-Wunused-local-typedefs \
 | 
							-Wpacked                                          \
 | 
				
			||||||
		-Wunused-macros \
 | 
							-Wpacked-bitfield-compat                          \
 | 
				
			||||||
		-Wunused-parameter \
 | 
							-Wpacked-not-aligned                              \
 | 
				
			||||||
		-Wunused-result \
 | 
							-Wno-padded                                          \
 | 
				
			||||||
		-Wunused-value \
 | 
							-Wparentheses                                     \
 | 
				
			||||||
		-Wunused-variable \
 | 
							-Wpedantic                                        \
 | 
				
			||||||
		-Wuseless-cast \
 | 
							-Wpessimizing-move                                \
 | 
				
			||||||
		-Wvarargs \
 | 
							-Wplacement-new=2                                 \
 | 
				
			||||||
		-Wvariadic-macros \
 | 
							-Wpmf-conversions                                 \
 | 
				
			||||||
		-Wvector-operation-performance \
 | 
							-Wpointer-arith                                   \
 | 
				
			||||||
		-Wvirtual-inheritance \
 | 
							-Wpointer-compare                                 \
 | 
				
			||||||
		-Wvirtual-move-assign \
 | 
							-Wpragmas                                         \
 | 
				
			||||||
		-Wvla \
 | 
							-Wprio-ctor-dtor                                  \
 | 
				
			||||||
		-Wvolatile-register-var \
 | 
							-Wpsabi                                           \
 | 
				
			||||||
		-Wwrite-strings \
 | 
							-Wredundant-decls                                 \
 | 
				
			||||||
		-Wzero-as-null-pointer-constant \
 | 
							-Wredundant-move                                  \
 | 
				
			||||||
		" cmake -S . -B build_pedantic -GNinja -DCMAKE_BUILD_TYPE=Debug -DJSON_MultipleHeaders=ON
 | 
							-Wredundant-tags                                  \
 | 
				
			||||||
 | 
							-Wregister                                        \
 | 
				
			||||||
 | 
							-Wreorder                                         \
 | 
				
			||||||
 | 
							-Wrestrict                                        \
 | 
				
			||||||
 | 
							-Wreturn-local-addr                               \
 | 
				
			||||||
 | 
							-Wreturn-type                                     \
 | 
				
			||||||
 | 
							-Wscalar-storage-order                            \
 | 
				
			||||||
 | 
							-Wsequence-point                                  \
 | 
				
			||||||
 | 
							-Wshadow=compatible-local                         \
 | 
				
			||||||
 | 
							-Wshadow=global                                   \
 | 
				
			||||||
 | 
							-Wshadow=local                                    \
 | 
				
			||||||
 | 
							-Wshift-count-negative                            \
 | 
				
			||||||
 | 
							-Wshift-count-overflow                            \
 | 
				
			||||||
 | 
							-Wshift-negative-value                            \
 | 
				
			||||||
 | 
							-Wshift-overflow=2                                \
 | 
				
			||||||
 | 
							-Wsign-compare                                    \
 | 
				
			||||||
 | 
							-Wsign-conversion                                 \
 | 
				
			||||||
 | 
							-Wsign-promo                                      \
 | 
				
			||||||
 | 
							-Wsized-deallocation                              \
 | 
				
			||||||
 | 
							-Wsizeof-array-argument                           \
 | 
				
			||||||
 | 
							-Wsizeof-pointer-div                              \
 | 
				
			||||||
 | 
							-Wsizeof-pointer-memaccess                        \
 | 
				
			||||||
 | 
							-Wstack-protector                                 \
 | 
				
			||||||
 | 
							-Wstrict-aliasing                                 \
 | 
				
			||||||
 | 
							-Wstrict-aliasing=3                               \
 | 
				
			||||||
 | 
							-Wstrict-null-sentinel                            \
 | 
				
			||||||
 | 
							-Wstrict-overflow                                 \
 | 
				
			||||||
 | 
							-Wstrict-overflow=5                               \
 | 
				
			||||||
 | 
							-Wstring-compare                                  \
 | 
				
			||||||
 | 
							-Wstringop-overflow                               \
 | 
				
			||||||
 | 
							-Wstringop-overflow=4                             \
 | 
				
			||||||
 | 
							-Wstringop-truncation                             \
 | 
				
			||||||
 | 
							-Wsubobject-linkage                               \
 | 
				
			||||||
 | 
							-Wsuggest-attribute=cold                          \
 | 
				
			||||||
 | 
							-Wsuggest-attribute=const                         \
 | 
				
			||||||
 | 
							-Wsuggest-attribute=format                        \
 | 
				
			||||||
 | 
							-Wsuggest-attribute=malloc                        \
 | 
				
			||||||
 | 
							-Wsuggest-attribute=noreturn                      \
 | 
				
			||||||
 | 
							-Wsuggest-attribute=pure                          \
 | 
				
			||||||
 | 
							-Wsuggest-final-methods                           \
 | 
				
			||||||
 | 
							-Wsuggest-final-types                             \
 | 
				
			||||||
 | 
							-Wsuggest-override                                \
 | 
				
			||||||
 | 
							-Wswitch                                          \
 | 
				
			||||||
 | 
							-Wswitch-bool                                     \
 | 
				
			||||||
 | 
							-Wswitch-default                                  \
 | 
				
			||||||
 | 
							-Wno-switch-enum                                     \
 | 
				
			||||||
 | 
							-Wswitch-outside-range                            \
 | 
				
			||||||
 | 
							-Wswitch-unreachable                              \
 | 
				
			||||||
 | 
							-Wsync-nand                                       \
 | 
				
			||||||
 | 
							-Wsynth                                           \
 | 
				
			||||||
 | 
							-Wno-system-headers                                  \
 | 
				
			||||||
 | 
							-Wtautological-compare                            \
 | 
				
			||||||
 | 
							-Wno-templates                                       \
 | 
				
			||||||
 | 
							-Wterminate                                       \
 | 
				
			||||||
 | 
							-Wtrampolines                                     \
 | 
				
			||||||
 | 
							-Wtrigraphs                                       \
 | 
				
			||||||
 | 
							-Wtype-limits                                     \
 | 
				
			||||||
 | 
							-Wundef                                           \
 | 
				
			||||||
 | 
							-Wuninitialized                                   \
 | 
				
			||||||
 | 
							-Wunknown-pragmas                                 \
 | 
				
			||||||
 | 
							-Wunreachable-code                                \
 | 
				
			||||||
 | 
							-Wunsafe-loop-optimizations                       \
 | 
				
			||||||
 | 
							-Wunused                                          \
 | 
				
			||||||
 | 
							-Wunused-but-set-parameter                        \
 | 
				
			||||||
 | 
							-Wunused-but-set-variable                         \
 | 
				
			||||||
 | 
							-Wunused-const-variable=2                         \
 | 
				
			||||||
 | 
							-Wunused-function                                 \
 | 
				
			||||||
 | 
							-Wunused-label                                    \
 | 
				
			||||||
 | 
							-Wunused-local-typedefs                           \
 | 
				
			||||||
 | 
							-Wunused-macros                                   \
 | 
				
			||||||
 | 
							-Wunused-parameter                                \
 | 
				
			||||||
 | 
							-Wunused-result                                   \
 | 
				
			||||||
 | 
							-Wunused-value                                    \
 | 
				
			||||||
 | 
							-Wunused-variable                                 \
 | 
				
			||||||
 | 
							-Wuseless-cast                                    \
 | 
				
			||||||
 | 
							-Wvarargs                                         \
 | 
				
			||||||
 | 
							-Wvariadic-macros                                 \
 | 
				
			||||||
 | 
							-Wvector-operation-performance                    \
 | 
				
			||||||
 | 
							-Wvirtual-inheritance                             \
 | 
				
			||||||
 | 
							-Wvirtual-move-assign                             \
 | 
				
			||||||
 | 
							-Wvla                                             \
 | 
				
			||||||
 | 
							-Wvolatile                                        \
 | 
				
			||||||
 | 
							-Wvolatile-register-var                           \
 | 
				
			||||||
 | 
							-Wwrite-strings                                   \
 | 
				
			||||||
 | 
							-Wzero-as-null-pointer-constant                   \
 | 
				
			||||||
 | 
							-Wzero-length-bounds                              \
 | 
				
			||||||
 | 
							" cmake -S . -B build_pedantic -GNinja -DCMAKE_BUILD_TYPE=Debug -DJSON_MultipleHeaders=ON -DJSON_BuildTests=On
 | 
				
			||||||
	cmake --build build_pedantic
 | 
						cmake --build build_pedantic
 | 
				
			||||||
 | 
					
 | 
				
			||||||
##########################################################################
 | 
					##########################################################################
 | 
				
			||||||
| 
						 | 
					@ -353,7 +389,7 @@ pedantic_gcc:
 | 
				
			||||||
run_benchmarks:
 | 
					run_benchmarks:
 | 
				
			||||||
	rm -fr build_benchmarks
 | 
						rm -fr build_benchmarks
 | 
				
			||||||
	mkdir build_benchmarks
 | 
						mkdir build_benchmarks
 | 
				
			||||||
	cd build_benchmarks ; cmake ../benchmarks -GNinja -DCMAKE_BUILD_TYPE=Release
 | 
						cd build_benchmarks ; cmake ../benchmarks -GNinja -DCMAKE_BUILD_TYPE=Release -DJSON_BuildTests=On
 | 
				
			||||||
	cd build_benchmarks ; ninja
 | 
						cd build_benchmarks ; ninja
 | 
				
			||||||
	cd build_benchmarks ; ./json_benchmarks
 | 
						cd build_benchmarks ; ./json_benchmarks
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -430,7 +466,7 @@ cppcheck:
 | 
				
			||||||
clang_analyze:
 | 
					clang_analyze:
 | 
				
			||||||
	rm -fr clang_analyze_build
 | 
						rm -fr clang_analyze_build
 | 
				
			||||||
	mkdir clang_analyze_build
 | 
						mkdir clang_analyze_build
 | 
				
			||||||
	cd clang_analyze_build ; CCC_CXX=$(COMPILER_DIR)/clang++ CXX=$(COMPILER_DIR)/clang++ $(COMPILER_DIR)/scan-build cmake .. -GNinja
 | 
						cd clang_analyze_build ; CCC_CXX=$(COMPILER_DIR)/clang++ CXX=$(COMPILER_DIR)/clang++ $(COMPILER_DIR)/scan-build cmake .. -GNinja -DJSON_BuildTests=On
 | 
				
			||||||
	cd clang_analyze_build ; \
 | 
						cd clang_analyze_build ; \
 | 
				
			||||||
		$(COMPILER_DIR)/scan-build \
 | 
							$(COMPILER_DIR)/scan-build \
 | 
				
			||||||
			-enable-checker alpha.core.BoolAssignment,alpha.core.CallAndMessageUnInitRefArg,alpha.core.CastSize,alpha.core.CastToStruct,alpha.core.Conversion,alpha.core.DynamicTypeChecker,alpha.core.FixedAddr,alpha.core.PointerArithm,alpha.core.PointerSub,alpha.core.SizeofPtr,alpha.core.StackAddressAsyncEscape,alpha.core.TestAfterDivZero,alpha.deadcode.UnreachableCode,core.builtin.BuiltinFunctions,core.builtin.NoReturnFunctions,core.CallAndMessage,core.DivideZero,core.DynamicTypePropagation,core.NonnilStringConstants,core.NonNullParamChecker,core.NullDereference,core.StackAddressEscape,core.UndefinedBinaryOperatorResult,core.uninitialized.ArraySubscript,core.uninitialized.Assign,core.uninitialized.Branch,core.uninitialized.CapturedBlockVariable,core.uninitialized.UndefReturn,core.VLASize,cplusplus.InnerPointer,cplusplus.Move,cplusplus.NewDelete,cplusplus.NewDeleteLeaks,cplusplus.SelfAssignment,deadcode.DeadStores,nullability.NullableDereferenced,nullability.NullablePassedToNonnull,nullability.NullableReturnedFromNonnull,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull \
 | 
								-enable-checker alpha.core.BoolAssignment,alpha.core.CallAndMessageUnInitRefArg,alpha.core.CastSize,alpha.core.CastToStruct,alpha.core.Conversion,alpha.core.DynamicTypeChecker,alpha.core.FixedAddr,alpha.core.PointerArithm,alpha.core.PointerSub,alpha.core.SizeofPtr,alpha.core.StackAddressAsyncEscape,alpha.core.TestAfterDivZero,alpha.deadcode.UnreachableCode,core.builtin.BuiltinFunctions,core.builtin.NoReturnFunctions,core.CallAndMessage,core.DivideZero,core.DynamicTypePropagation,core.NonnilStringConstants,core.NonNullParamChecker,core.NullDereference,core.StackAddressEscape,core.UndefinedBinaryOperatorResult,core.uninitialized.ArraySubscript,core.uninitialized.Assign,core.uninitialized.Branch,core.uninitialized.CapturedBlockVariable,core.uninitialized.UndefReturn,core.VLASize,cplusplus.InnerPointer,cplusplus.Move,cplusplus.NewDelete,cplusplus.NewDeleteLeaks,cplusplus.SelfAssignment,deadcode.DeadStores,nullability.NullableDereferenced,nullability.NullablePassedToNonnull,nullability.NullableReturnedFromNonnull,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull \
 | 
				
			||||||
| 
						 | 
					@ -472,7 +508,7 @@ oclint:
 | 
				
			||||||
clang_sanitize:
 | 
					clang_sanitize:
 | 
				
			||||||
	rm -fr clang_sanitize_build
 | 
						rm -fr clang_sanitize_build
 | 
				
			||||||
	mkdir clang_sanitize_build
 | 
						mkdir clang_sanitize_build
 | 
				
			||||||
	cd clang_sanitize_build ; CXX=$(COMPILER_DIR)/clang++ cmake .. -DJSON_Sanitizer=On -DJSON_MultipleHeaders=ON -GNinja
 | 
						cd clang_sanitize_build ; CXX=$(COMPILER_DIR)/clang++ cmake .. -DJSON_Sanitizer=On -DJSON_MultipleHeaders=ON -DJSON_BuildTests=On -GNinja
 | 
				
			||||||
	cd clang_sanitize_build ; ninja
 | 
						cd clang_sanitize_build ; ninja
 | 
				
			||||||
	cd clang_sanitize_build ; ctest -j10
 | 
						cd clang_sanitize_build ; ctest -j10
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										80
									
								
								README.md
									
										
									
									
									
								
							
							
						
						
									
										80
									
								
								README.md
									
										
									
									
									
								
							| 
						 | 
					@ -12,13 +12,13 @@
 | 
				
			||||||
[](https://lgtm.com/projects/g/nlohmann/json/context:cpp)
 | 
					[](https://lgtm.com/projects/g/nlohmann/json/context:cpp)
 | 
				
			||||||
[](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:json)
 | 
					[](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:json)
 | 
				
			||||||
[](https://wandbox.org/permlink/3lCHrFUZANONKv7a)
 | 
					[](https://wandbox.org/permlink/3lCHrFUZANONKv7a)
 | 
				
			||||||
[](http://nlohmann.github.io/json)
 | 
					[](https://nlohmann.github.io/json/doxygen/index.html)
 | 
				
			||||||
[](https://raw.githubusercontent.com/nlohmann/json/master/LICENSE.MIT)
 | 
					[](https://raw.githubusercontent.com/nlohmann/json/master/LICENSE.MIT)
 | 
				
			||||||
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fnlohmann%2Fjson?ref=badge_shield)
 | 
					[](https://app.fossa.com/projects/git%2Bgithub.com%2Fnlohmann%2Fjson?ref=badge_shield)
 | 
				
			||||||
[](https://github.com/nlohmann/json/releases)
 | 
					[](https://github.com/nlohmann/json/releases)
 | 
				
			||||||
[](https://github.com/nlohmann/json/releases)
 | 
					[](https://github.com/nlohmann/json/releases)
 | 
				
			||||||
[](http://github.com/nlohmann/json/issues)
 | 
					[](https://github.com/nlohmann/json/issues)
 | 
				
			||||||
[](http://isitmaintained.com/project/nlohmann/json "Average time to resolve an issue")
 | 
					[](https://isitmaintained.com/project/nlohmann/json "Average time to resolve an issue")
 | 
				
			||||||
[](https://bestpractices.coreinfrastructure.org/projects/289)
 | 
					[](https://bestpractices.coreinfrastructure.org/projects/289)
 | 
				
			||||||
[](https://github.com/sponsors/nlohmann)
 | 
					[](https://github.com/sponsors/nlohmann)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -55,7 +55,7 @@ There are myriads of [JSON](https://json.org) libraries out there, and each may
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- **Trivial integration**. Our whole code consists of a single header file [`json.hpp`](https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp). That's it. No library, no subproject, no dependencies, no complex build system. The class is written in vanilla C++11. All in all, everything should require no adjustment of your compiler flags or project settings.
 | 
					- **Trivial integration**. Our whole code consists of a single header file [`json.hpp`](https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp). That's it. No library, no subproject, no dependencies, no complex build system. The class is written in vanilla C++11. All in all, everything should require no adjustment of your compiler flags or project settings.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- **Serious testing**. Our class is heavily [unit-tested](https://github.com/nlohmann/json/tree/develop/test/src) and covers [100%](https://coveralls.io/r/nlohmann/json) of the code, including all exceptional behavior. Furthermore, we checked with [Valgrind](http://valgrind.org) and the [Clang Sanitizers](https://clang.llvm.org/docs/index.html) that there are no memory leaks. [Google OSS-Fuzz](https://github.com/google/oss-fuzz/tree/master/projects/json) additionally runs fuzz tests against all parsers 24/7, effectively executing billions of tests so far. To maintain high quality, the project is following the [Core Infrastructure Initiative (CII) best practices](https://bestpractices.coreinfrastructure.org/projects/289).
 | 
					- **Serious testing**. Our class is heavily [unit-tested](https://github.com/nlohmann/json/tree/develop/test/src) and covers [100%](https://coveralls.io/r/nlohmann/json) of the code, including all exceptional behavior. Furthermore, we checked with [Valgrind](https://valgrind.org) and the [Clang Sanitizers](https://clang.llvm.org/docs/index.html) that there are no memory leaks. [Google OSS-Fuzz](https://github.com/google/oss-fuzz/tree/master/projects/json) additionally runs fuzz tests against all parsers 24/7, effectively executing billions of tests so far. To maintain high quality, the project is following the [Core Infrastructure Initiative (CII) best practices](https://bestpractices.coreinfrastructure.org/projects/289).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Other aspects were not so important to us:
 | 
					Other aspects were not so important to us:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -148,7 +148,7 @@ Example:
 | 
				
			||||||
include(FetchContent)
 | 
					include(FetchContent)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FetchContent_Declare(json
 | 
					FetchContent_Declare(json
 | 
				
			||||||
  GIT_REPOSITORY https://github.com/nlohmann/json
 | 
					  GIT_REPOSITORY https://github.com/nlohmann/json.git
 | 
				
			||||||
  GIT_TAG v3.7.3)
 | 
					  GIT_TAG v3.7.3)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FetchContent_GetProperties(json)
 | 
					FetchContent_GetProperties(json)
 | 
				
			||||||
| 
						 | 
					@ -199,9 +199,9 @@ endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Package Managers
 | 
					### Package Managers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
:beer: If you are using OS X and [Homebrew](http://brew.sh), just type `brew tap nlohmann/json` and `brew install nlohmann-json` and you're set. If you want the bleeding edge rather than the latest release, use `brew install nlohmann-json --HEAD`.
 | 
					:beer: If you are using OS X and [Homebrew](https://brew.sh), just type `brew tap nlohmann/json` and `brew install nlohmann-json` and you're set. If you want the bleeding edge rather than the latest release, use `brew install nlohmann-json --HEAD`.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If you are using the [Meson Build System](http://mesonbuild.com), add this source tree as a [meson subproject](https://mesonbuild.com/Subprojects.html#using-a-subproject). You may also use the `include.zip` published in this project's [Releases](https://github.com/nlohmann/json/releases) to reduce the size of the vendored source tree. Alternatively, you can get a wrap file by downloading it from [Meson WrapDB](https://wrapdb.mesonbuild.com/nlohmann_json), or simply use `meson wrap install nlohmann_json`. Please see the meson project for any issues regarding the packaging.
 | 
					If you are using the [Meson Build System](https://mesonbuild.com), add this source tree as a [meson subproject](https://mesonbuild.com/Subprojects.html#using-a-subproject). You may also use the `include.zip` published in this project's [Releases](https://github.com/nlohmann/json/releases) to reduce the size of the vendored source tree. Alternatively, you can get a wrap file by downloading it from [Meson WrapDB](https://wrapdb.mesonbuild.com/nlohmann_json), or simply use `meson wrap install nlohmann_json`. Please see the meson project for any issues regarding the packaging.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The provided meson.build can also be used as an alternative to cmake for installing `nlohmann_json` system-wide in which case a pkg-config file is installed. To use it, simply have your build system require the `nlohmann_json` pkg-config dependency. In Meson, it is preferred to use the [`dependency()`](https://mesonbuild.com/Reference-manual.html#dependency) object with a subproject fallback, rather than using the subproject directly.
 | 
					The provided meson.build can also be used as an alternative to cmake for installing `nlohmann_json` system-wide in which case a pkg-config file is installed. To use it, simply have your build system require the `nlohmann_json` pkg-config dependency. In Meson, it is preferred to use the [`dependency()`](https://mesonbuild.com/Reference-manual.html#dependency) object with a subproject fallback, rather than using the subproject directly.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -215,7 +215,7 @@ If you are using [Buckaroo](https://buckaroo.pm), you can install this library's
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If you are using [vcpkg](https://github.com/Microsoft/vcpkg/) on your project for external dependencies, then you can use the [nlohmann-json package](https://github.com/Microsoft/vcpkg/tree/master/ports/nlohmann-json). Please see the vcpkg project for any issues regarding the packaging.
 | 
					If you are using [vcpkg](https://github.com/Microsoft/vcpkg/) on your project for external dependencies, then you can use the [nlohmann-json package](https://github.com/Microsoft/vcpkg/tree/master/ports/nlohmann-json). Please see the vcpkg project for any issues regarding the packaging.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If you are using [cget](http://cget.readthedocs.io/en/latest/), you can install the latest development version with `cget install nlohmann/json`. A specific version can be installed with `cget install nlohmann/json@v3.1.0`. Also, the multiple header version can be installed by adding the `-DJSON_MultipleHeaders=ON` flag (i.e., `cget install nlohmann/json -DJSON_MultipleHeaders=ON`).
 | 
					If you are using [cget](https://cget.readthedocs.io/en/latest/), you can install the latest development version with `cget install nlohmann/json`. A specific version can be installed with `cget install nlohmann/json@v3.1.0`. Also, the multiple header version can be installed by adding the `-DJSON_MultipleHeaders=ON` flag (i.e., `cget install nlohmann/json -DJSON_MultipleHeaders=ON`).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If you are using [CocoaPods](https://cocoapods.org), you can use the library by adding pod `"nlohmann_json", '~>3.1.2'` to your podfile (see [an example](https://bitbucket.org/benman/nlohmann_json-cocoapod/src/master/)). Please file issues [here](https://bitbucket.org/benman/nlohmann_json-cocoapod/issues?status=new&status=open).
 | 
					If you are using [CocoaPods](https://cocoapods.org), you can use the library by adding pod `"nlohmann_json", '~>3.1.2'` to your podfile (see [an example](https://bitbucket.org/benman/nlohmann_json-cocoapod/src/master/)). Please file issues [here](https://bitbucket.org/benman/nlohmann_json-cocoapod/issues?status=new&status=open).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -223,12 +223,12 @@ If you are using [NuGet](https://www.nuget.org), you can use the package [nlohma
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If you are using [conda](https://conda.io/), you can use the package [nlohmann_json](https://github.com/conda-forge/nlohmann_json-feedstock) from [conda-forge](https://conda-forge.org) executing `conda install -c conda-forge nlohmann_json`. Please file issues [here](https://github.com/conda-forge/nlohmann_json-feedstock/issues).
 | 
					If you are using [conda](https://conda.io/), you can use the package [nlohmann_json](https://github.com/conda-forge/nlohmann_json-feedstock) from [conda-forge](https://conda-forge.org) executing `conda install -c conda-forge nlohmann_json`. Please file issues [here](https://github.com/conda-forge/nlohmann_json-feedstock/issues).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If you are using [MSYS2](http://www.msys2.org/), your can use the [mingw-w64-nlohmann-json](https://packages.msys2.org/base/mingw-w64-nlohmann-json) package, just type `pacman -S mingw-w64-i686-nlohmann-json` or `pacman -S mingw-w64-x86_64-nlohmann-json` for installation. Please file issues [here](https://github.com/msys2/MINGW-packages/issues/new?title=%5Bnlohmann-json%5D) if you experience problems with the packages.
 | 
					If you are using [MSYS2](https://www.msys2.org/), your can use the [mingw-w64-nlohmann-json](https://packages.msys2.org/base/mingw-w64-nlohmann-json) package, just type `pacman -S mingw-w64-i686-nlohmann-json` or `pacman -S mingw-w64-x86_64-nlohmann-json` for installation. Please file issues [here](https://github.com/msys2/MINGW-packages/issues/new?title=%5Bnlohmann-json%5D) if you experience problems with the packages.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If you are using [`build2`](https://build2.org), you can use the [`nlohmann-json`](https://cppget.org/nlohmann-json) package from the public repository http://cppget.org or directly from the [package's sources repository](https://github.com/build2-packaging/nlohmann-json). In your project's `manifest` file, just add `depends: nlohmann-json` (probably with some [version constraints](https://build2.org/build2-toolchain/doc/build2-toolchain-intro.xhtml#guide-add-remove-deps)). If you are not familiar with using dependencies in `build2`, [please read this introduction](https://build2.org/build2-toolchain/doc/build2-toolchain-intro.xhtml).
 | 
					If you are using [`build2`](https://build2.org), you can use the [`nlohmann-json`](https://cppget.org/nlohmann-json) package from the public repository https://cppget.org or directly from the [package's sources repository](https://github.com/build2-packaging/nlohmann-json). In your project's `manifest` file, just add `depends: nlohmann-json` (probably with some [version constraints](https://build2.org/build2-toolchain/doc/build2-toolchain-intro.xhtml#guide-add-remove-deps)). If you are not familiar with using dependencies in `build2`, [please read this introduction](https://build2.org/build2-toolchain/doc/build2-toolchain-intro.xhtml).
 | 
				
			||||||
Please file issues [here](https://github.com/build2-packaging/nlohmann-json) if you experience problems with the packages.
 | 
					Please file issues [here](https://github.com/build2-packaging/nlohmann-json) if you experience problems with the packages.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If you are using [`wsjcpp`](http://wsjcpp.org), you can use the command `wsjcpp install "https://github.com/nlohmann/json:develop"` to get the latest version. Note you can change the branch ":develop" to an existing tag or another branch.
 | 
					If you are using [`wsjcpp`](https://wsjcpp.org), you can use the command `wsjcpp install "https://github.com/nlohmann/json:develop"` to get the latest version. Note you can change the branch ":develop" to an existing tag or another branch.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Examples
 | 
					## Examples
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1016,7 +1016,7 @@ Other Important points:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Binary formats (BSON, CBOR, MessagePack, and UBJSON)
 | 
					### Binary formats (BSON, CBOR, MessagePack, and UBJSON)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Though JSON is a ubiquitous data format, it is not a very compact format suitable for data exchange, for instance over a network. Hence, the library supports [BSON](http://bsonspec.org) (Binary JSON), [CBOR](http://cbor.io) (Concise Binary Object Representation), [MessagePack](http://msgpack.org), and [UBJSON](http://ubjson.org) (Universal Binary JSON Specification) to efficiently encode JSON values to byte vectors and to decode such vectors.
 | 
					Though JSON is a ubiquitous data format, it is not a very compact format suitable for data exchange, for instance over a network. Hence, the library supports [BSON](http://bsonspec.org) (Binary JSON), [CBOR](https://cbor.io) (Concise Binary Object Representation), [MessagePack](https://msgpack.org), and [UBJSON](http://ubjson.org) (Universal Binary JSON Specification) to efficiently encode JSON values to byte vectors and to decode such vectors.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```cpp
 | 
					```cpp
 | 
				
			||||||
// create a JSON value
 | 
					// create a JSON value
 | 
				
			||||||
| 
						 | 
					@ -1112,7 +1112,7 @@ Please note:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The code compiles successfully with [Android NDK](https://developer.android.com/ndk/index.html?hl=ml), Revision 9 - 11 (and possibly later) and [CrystaX's Android NDK](https://www.crystax.net/en/android/ndk) version 10.
 | 
					    The code compiles successfully with [Android NDK](https://developer.android.com/ndk/index.html?hl=ml), Revision 9 - 11 (and possibly later) and [CrystaX's Android NDK](https://www.crystax.net/en/android/ndk) version 10.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- For GCC running on MinGW or Android SDK, the error `'to_string' is not a member of 'std'` (or similarly, for `strtod` or `strtof`) may occur. Note this is not an issue with the code,  but rather with the compiler itself. On Android, see above to build with a newer environment.  For MinGW, please refer to [this site](http://tehsausage.com/mingw-to-string) and [this discussion](https://github.com/nlohmann/json/issues/136) for information on how to fix this bug. For Android NDK using `APP_STL := gnustl_static`, please refer to [this discussion](https://github.com/nlohmann/json/issues/219).
 | 
					- For GCC running on MinGW or Android SDK, the error `'to_string' is not a member of 'std'` (or similarly, for `strtod` or `strtof`) may occur. Note this is not an issue with the code,  but rather with the compiler itself. On Android, see above to build with a newer environment.  For MinGW, please refer to [this site](https://tehsausage.com/mingw-to-string) and [this discussion](https://github.com/nlohmann/json/issues/136) for information on how to fix this bug. For Android NDK using `APP_STL := gnustl_static`, please refer to [this discussion](https://github.com/nlohmann/json/issues/219).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- Unsupported versions of GCC and Clang are rejected by `#error` directives. This can be switched off by defining `JSON_SKIP_UNSUPPORTED_COMPILER_CHECK`. Note that you can expect no support in this case.
 | 
					- Unsupported versions of GCC and Clang are rejected by `#error` directives. This can be switched off by defining `JSON_SKIP_UNSUPPORTED_COMPILER_CHECK`. Note that you can expect no support in this case.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1169,11 +1169,11 @@ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR I
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* * *
 | 
					* * *
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The class contains the UTF-8 Decoder from Bjoern Hoehrmann which is licensed under the [MIT License](http://opensource.org/licenses/MIT) (see above). Copyright © 2008-2009 [Björn Hoehrmann](http://bjoern.hoehrmann.de/) <bjoern@hoehrmann.de>
 | 
					The class contains the UTF-8 Decoder from Bjoern Hoehrmann which is licensed under the [MIT License](http://opensource.org/licenses/MIT) (see above). Copyright © 2008-2009 [Björn Hoehrmann](https://bjoern.hoehrmann.de/) <bjoern@hoehrmann.de>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The class contains a slightly modified version of the Grisu2 algorithm from Florian Loitsch which is licensed under the [MIT License](http://opensource.org/licenses/MIT) (see above). Copyright © 2009 [Florian Loitsch](http://florian.loitsch.com/)
 | 
					The class contains a slightly modified version of the Grisu2 algorithm from Florian Loitsch which is licensed under the [MIT License](http://opensource.org/licenses/MIT) (see above). Copyright © 2009 [Florian Loitsch](https://florian.loitsch.com/)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The class contains a copy of [Hedley](https://nemequ.github.io/hedley/) from Evan Nemerson which is licensed as [CC0-1.0](http://creativecommons.org/publicdomain/zero/1.0/).
 | 
					The class contains a copy of [Hedley](https://nemequ.github.io/hedley/) from Evan Nemerson which is licensed as [CC0-1.0](https://creativecommons.org/publicdomain/zero/1.0/).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Contact
 | 
					## Contact
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1230,7 +1230,7 @@ I deeply appreciate the help of the following people.
 | 
				
			||||||
- [Mário Feroldi](https://github.com/thelostt) fixed a small typo.
 | 
					- [Mário Feroldi](https://github.com/thelostt) fixed a small typo.
 | 
				
			||||||
- [duncanwerner](https://github.com/duncanwerner) found a really embarrassing performance regression in the 2.0.0 release.
 | 
					- [duncanwerner](https://github.com/duncanwerner) found a really embarrassing performance regression in the 2.0.0 release.
 | 
				
			||||||
- [Damien](https://github.com/dtoma) fixed one of the last conversion warnings.
 | 
					- [Damien](https://github.com/dtoma) fixed one of the last conversion warnings.
 | 
				
			||||||
- [Thomas Braun](https://github.com/t-b) fixed a warning in a test case.
 | 
					- [Thomas Braun](https://github.com/t-b) fixed a warning in a test case and adjusted MSVC calls in the CI.
 | 
				
			||||||
- [Théo DELRIEU](https://github.com/theodelrieu) patiently and constructively oversaw the long way toward [iterator-range parsing](https://github.com/nlohmann/json/issues/290). He also implemented the magic behind the serialization/deserialization of user-defined types and split the single header file into smaller chunks.
 | 
					- [Théo DELRIEU](https://github.com/theodelrieu) patiently and constructively oversaw the long way toward [iterator-range parsing](https://github.com/nlohmann/json/issues/290). He also implemented the magic behind the serialization/deserialization of user-defined types and split the single header file into smaller chunks.
 | 
				
			||||||
- [Stefan](https://github.com/5tefan) fixed a minor issue in the documentation.
 | 
					- [Stefan](https://github.com/5tefan) fixed a minor issue in the documentation.
 | 
				
			||||||
- [Vasil Dimov](https://github.com/vasild) fixed the documentation regarding conversions from `std::multiset`.
 | 
					- [Vasil Dimov](https://github.com/vasild) fixed the documentation regarding conversions from `std::multiset`.
 | 
				
			||||||
| 
						 | 
					@ -1374,6 +1374,36 @@ I deeply appreciate the help of the following people.
 | 
				
			||||||
- [Florian Pigorsch](https://github.com/flopp) fixed a lot of typos.
 | 
					- [Florian Pigorsch](https://github.com/flopp) fixed a lot of typos.
 | 
				
			||||||
- [Camille Bégué](https://github.com/cbegue) fixed an issue in the conversion from  `std::pair` and `std::tuple` to `json`.
 | 
					- [Camille Bégué](https://github.com/cbegue) fixed an issue in the conversion from  `std::pair` and `std::tuple` to `json`.
 | 
				
			||||||
- [Anthony VH](https://github.com/AnthonyVH) fixed a compile error in an enum deserialization.
 | 
					- [Anthony VH](https://github.com/AnthonyVH) fixed a compile error in an enum deserialization.
 | 
				
			||||||
 | 
					- [Yuriy Vountesmery](https://github.com/ua-code-dragon) noted a subtle bug in a preprocessor check.
 | 
				
			||||||
 | 
					- [Chen](https://github.com/dota17) fixed numerous issues in the library.
 | 
				
			||||||
 | 
					- [Antony Kellermann](https://github.com/aokellermann) added a CI step for GCC 10.1.
 | 
				
			||||||
 | 
					- [Alex](https://github.com/gistrec) fixed an MSVC warning.
 | 
				
			||||||
 | 
					- [Rainer](https://github.com/rvjr) proposed an improvement in the floating-point serialization in CBOR.
 | 
				
			||||||
 | 
					- [Francois Chabot](https://github.com/FrancoisChabot) made performance improvements in the input adapters.
 | 
				
			||||||
 | 
					- [Arthur Sonzogni](https://github.com/ArthurSonzogni) documented how the library can be included via `FetchContent`.
 | 
				
			||||||
 | 
					- [Rimas Misevičius](https://github.com/rmisev) fixed an error message.
 | 
				
			||||||
 | 
					- [Alexander Myasnikov](https://github.com/alexandermyasnikov) fixed some examples and a link in the README.
 | 
				
			||||||
 | 
					- [Hubert Chathi](https://github.com/uhoreg) made CMake's version config file architecture-independent.
 | 
				
			||||||
 | 
					- [OmnipotentEntity](https://github.com/OmnipotentEntity) implemented the binary values for CBOR, MessagePack, BSON, and UBJSON.
 | 
				
			||||||
 | 
					- [ArtemSarmini](https://github.com/ArtemSarmini) fixed a compilation issue with GCC 10 and fixed a leak.
 | 
				
			||||||
 | 
					- [Evgenii Sopov](https://github.com/sea-kg) integrated the library to the wsjcpp package manager.
 | 
				
			||||||
 | 
					- [Sergey Linev](https://github.com/linev) fixed a compiler warning.
 | 
				
			||||||
 | 
					- [Miguel Magalhães](https://github.com/magamig) fixed the year in the copyright.
 | 
				
			||||||
 | 
					- [Gareth Sylvester-Bradley](https://github.com/garethsb-sony) fixed a compilation issue with MSVC.
 | 
				
			||||||
 | 
					- [Alexander “weej” Jones](https://github.com/alex-weej) fixed an example in the README.
 | 
				
			||||||
 | 
					- [Antoine Cœur](https://github.com/Coeur) fixed some typos in the documentation.
 | 
				
			||||||
 | 
					- [jothepro](https://github.com/jothepro) updated links to the Hunter package.
 | 
				
			||||||
 | 
					- [Dave Lee](https://github.com/kastiglione) fixed link in the README.
 | 
				
			||||||
 | 
					- [Joël Lamotte](https://github.com/Klaim) added instruction for using Build2's package manager.
 | 
				
			||||||
 | 
					- [Paul Jurczak](https://github.com/pauljurczak) fixed an example in the README.
 | 
				
			||||||
 | 
					- [Sonu Lohani](https://github.com/sonulohani) fixed a warning.
 | 
				
			||||||
 | 
					- [Carlos Gomes Martinho](https://github.com/gocarlos) updated the Conan package source.
 | 
				
			||||||
 | 
					- [Konstantin Podsvirov](https://github.com/podsvirov) fixed the MSYS2 package documentation.
 | 
				
			||||||
 | 
					- [Tridacnid](https://github.com/Tridacnid) improved the CMake tests.
 | 
				
			||||||
 | 
					- [Michael](https://github.com/MBalszun) fixed MSVC warnings.
 | 
				
			||||||
 | 
					- [Quentin Barbarat](https://github.com/quentin-dev) fixed an example in the documentation.
 | 
				
			||||||
 | 
					- [XyFreak](https://github.com/XyFreak) fixed a compiler warning.
 | 
				
			||||||
 | 
					- [TotalCaesar659](https://github.com/TotalCaesar659) fixed links in the README.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Thanks a lot for helping out! Please [let me know](mailto:mail@nlohmann.me) if I forgot someone.
 | 
					Thanks a lot for helping out! Please [let me know](mailto:mail@nlohmann.me) if I forgot someone.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1383,10 +1413,10 @@ Thanks a lot for helping out! Please [let me know](mailto:mail@nlohmann.me) if I
 | 
				
			||||||
The library itself consists of a single header file licensed under the MIT license. However, it is built, tested, documented, and whatnot using a lot of third-party tools and services. Thanks a lot!
 | 
					The library itself consists of a single header file licensed under the MIT license. However, it is built, tested, documented, and whatnot using a lot of third-party tools and services. Thanks a lot!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- [**amalgamate.py - Amalgamate C source and header files**](https://github.com/edlund/amalgamate) to create a single header file
 | 
					- [**amalgamate.py - Amalgamate C source and header files**](https://github.com/edlund/amalgamate) to create a single header file
 | 
				
			||||||
- [**American fuzzy lop**](http://lcamtuf.coredump.cx/afl/) for fuzz testing
 | 
					- [**American fuzzy lop**](https://lcamtuf.coredump.cx/afl/) for fuzz testing
 | 
				
			||||||
- [**AppVeyor**](https://www.appveyor.com) for [continuous integration](https://ci.appveyor.com/project/nlohmann/json) on Windows
 | 
					- [**AppVeyor**](https://www.appveyor.com) for [continuous integration](https://ci.appveyor.com/project/nlohmann/json) on Windows
 | 
				
			||||||
- [**Artistic Style**](http://astyle.sourceforge.net) for automatic source code indentation
 | 
					- [**Artistic Style**](http://astyle.sourceforge.net) for automatic source code indentation
 | 
				
			||||||
- [**CircleCI**](http://circleci.com) for [continuous integration](https://circleci.com/gh/nlohmann/json).
 | 
					- [**CircleCI**](https://circleci.com) for [continuous integration](https://circleci.com/gh/nlohmann/json).
 | 
				
			||||||
- [**Clang**](https://clang.llvm.org) for compilation with code sanitizers
 | 
					- [**Clang**](https://clang.llvm.org) for compilation with code sanitizers
 | 
				
			||||||
- [**CMake**](https://cmake.org) for build automation
 | 
					- [**CMake**](https://cmake.org) for build automation
 | 
				
			||||||
- [**Codacity**](https://www.codacy.com) for further [code analysis](https://www.codacy.com/app/nlohmann/json)
 | 
					- [**Codacity**](https://www.codacy.com) for further [code analysis](https://www.codacy.com/app/nlohmann/json)
 | 
				
			||||||
| 
						 | 
					@ -1394,19 +1424,19 @@ The library itself consists of a single header file licensed under the MIT licen
 | 
				
			||||||
- [**Coverity Scan**](https://scan.coverity.com) for [static analysis](https://scan.coverity.com/projects/nlohmann-json)
 | 
					- [**Coverity Scan**](https://scan.coverity.com) for [static analysis](https://scan.coverity.com/projects/nlohmann-json)
 | 
				
			||||||
- [**cppcheck**](http://cppcheck.sourceforge.net) for static analysis
 | 
					- [**cppcheck**](http://cppcheck.sourceforge.net) for static analysis
 | 
				
			||||||
- [**doctest**](https://github.com/onqtam/doctest) for the unit tests
 | 
					- [**doctest**](https://github.com/onqtam/doctest) for the unit tests
 | 
				
			||||||
- [**Doxygen**](http://www.stack.nl/~dimitri/doxygen/) to generate [documentation](https://nlohmann.github.io/json/)
 | 
					- [**Doxygen**](https://www.doxygen.nl/index.html) to generate [documentation](https://nlohmann.github.io/json/doxygen/index.html)
 | 
				
			||||||
- [**git-update-ghpages**](https://github.com/rstacruz/git-update-ghpages) to upload the documentation to gh-pages
 | 
					- [**git-update-ghpages**](https://github.com/rstacruz/git-update-ghpages) to upload the documentation to gh-pages
 | 
				
			||||||
- [**GitHub Changelog Generator**](https://github.com/skywinder/github-changelog-generator) to generate the [ChangeLog](https://github.com/nlohmann/json/blob/develop/ChangeLog.md)
 | 
					- [**GitHub Changelog Generator**](https://github.com/skywinder/github-changelog-generator) to generate the [ChangeLog](https://github.com/nlohmann/json/blob/develop/ChangeLog.md)
 | 
				
			||||||
- [**Google Benchmark**](https://github.com/google/benchmark) to implement the benchmarks
 | 
					- [**Google Benchmark**](https://github.com/google/benchmark) to implement the benchmarks
 | 
				
			||||||
- [**Hedley**](https://nemequ.github.io/hedley/) to avoid re-inventing several compiler-agnostic feature macros
 | 
					- [**Hedley**](https://nemequ.github.io/hedley/) to avoid re-inventing several compiler-agnostic feature macros
 | 
				
			||||||
- [**lcov**](http://ltp.sourceforge.net/coverage/lcov.php) to process coverage information and create a HTML view
 | 
					- [**lcov**](http://ltp.sourceforge.net/coverage/lcov.php) to process coverage information and create a HTML view
 | 
				
			||||||
- [**libFuzzer**](http://llvm.org/docs/LibFuzzer.html) to implement fuzz testing for OSS-Fuzz
 | 
					- [**libFuzzer**](https://llvm.org/docs/LibFuzzer.html) to implement fuzz testing for OSS-Fuzz
 | 
				
			||||||
- [**OSS-Fuzz**](https://github.com/google/oss-fuzz) for continuous fuzz testing of the library ([project repository](https://github.com/google/oss-fuzz/tree/master/projects/json))
 | 
					- [**OSS-Fuzz**](https://github.com/google/oss-fuzz) for continuous fuzz testing of the library ([project repository](https://github.com/google/oss-fuzz/tree/master/projects/json))
 | 
				
			||||||
- [**Probot**](https://probot.github.io) for automating maintainer tasks such as closing stale issues, requesting missing information, or detecting toxic comments.
 | 
					- [**Probot**](https://probot.github.io) for automating maintainer tasks such as closing stale issues, requesting missing information, or detecting toxic comments.
 | 
				
			||||||
- [**send_to_wandbox**](https://github.com/nlohmann/json/blob/develop/doc/scripts/send_to_wandbox.py) to send code examples to [Wandbox](http://melpon.org/wandbox)
 | 
					- [**send_to_wandbox**](https://github.com/nlohmann/json/blob/develop/doc/scripts/send_to_wandbox.py) to send code examples to [Wandbox](http://melpon.org/wandbox)
 | 
				
			||||||
- [**Travis**](https://travis-ci.org) for [continuous integration](https://travis-ci.org/nlohmann/json) on Linux and macOS
 | 
					- [**Travis**](https://travis-ci.org) for [continuous integration](https://travis-ci.org/nlohmann/json) on Linux and macOS
 | 
				
			||||||
- [**Valgrind**](http://valgrind.org) to check for correct memory management
 | 
					- [**Valgrind**](https://valgrind.org) to check for correct memory management
 | 
				
			||||||
- [**Wandbox**](http://melpon.org/wandbox) for [online examples](https://wandbox.org/permlink/3lCHrFUZANONKv7a)
 | 
					- [**Wandbox**](https://wandbox.org) for [online examples](https://wandbox.org/permlink/3lCHrFUZANONKv7a)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Projects using JSON for Modern C++
 | 
					## Projects using JSON for Modern C++
 | 
				
			||||||
| 
						 | 
					@ -1423,7 +1453,7 @@ The library supports **Unicode input** as follows:
 | 
				
			||||||
- Only **UTF-8** encoded input is supported which is the default encoding for JSON according to [RFC 8259](https://tools.ietf.org/html/rfc8259.html#section-8.1).
 | 
					- Only **UTF-8** encoded input is supported which is the default encoding for JSON according to [RFC 8259](https://tools.ietf.org/html/rfc8259.html#section-8.1).
 | 
				
			||||||
- `std::u16string` and `std::u32string` can be parsed, assuming UTF-16 and UTF-32 encoding, respectively. These encodings are not supported when reading from files or other input containers.
 | 
					- `std::u16string` and `std::u32string` can be parsed, assuming UTF-16 and UTF-32 encoding, respectively. These encodings are not supported when reading from files or other input containers.
 | 
				
			||||||
- Other encodings such as Latin-1 or ISO 8859-1 are **not** supported and will yield parse or serialization errors.
 | 
					- Other encodings such as Latin-1 or ISO 8859-1 are **not** supported and will yield parse or serialization errors.
 | 
				
			||||||
- [Unicode noncharacters](http://www.unicode.org/faq/private_use.html#nonchar1) will not be replaced by the library.
 | 
					- [Unicode noncharacters](https://www.unicode.org/faq/private_use.html#nonchar1) will not be replaced by the library.
 | 
				
			||||||
- Invalid surrogates (e.g., incomplete pairs such as `\uDEAD`) will yield parse errors.
 | 
					- Invalid surrogates (e.g., incomplete pairs such as `\uDEAD`) will yield parse errors.
 | 
				
			||||||
- The strings stored in the library are UTF-8 encoded. When using the default string type (`std::string`), note that its length/size functions return the number of stored bytes rather than the number of characters or glyphs.
 | 
					- The strings stored in the library are UTF-8 encoded. When using the default string type (`std::string`), note that its length/size functions return the number of stored bytes rather than the number of characters or glyphs.
 | 
				
			||||||
- When you store strings with different encodings in the library, calling [`dump()`](https://nlohmann.github.io/json/classnlohmann_1_1basic__json_a50ec80b02d0f3f51130d4abb5d1cfdc5.html#a50ec80b02d0f3f51130d4abb5d1cfdc5) may throw an exception unless `json::error_handler_t::replace` or `json::error_handler_t::ignore` are used as error handlers.
 | 
					- When you store strings with different encodings in the library, calling [`dump()`](https://nlohmann.github.io/json/classnlohmann_1_1basic__json_a50ec80b02d0f3f51130d4abb5d1cfdc5.html#a50ec80b02d0f3f51130d4abb5d1cfdc5) may throw an exception unless `json::error_handler_t::replace` or `json::error_handler_t::ignore` are used as error handlers.
 | 
				
			||||||
| 
						 | 
					@ -1474,7 +1504,7 @@ To compile and run the tests, you need to execute
 | 
				
			||||||
```sh
 | 
					```sh
 | 
				
			||||||
$ mkdir build
 | 
					$ mkdir build
 | 
				
			||||||
$ cd build
 | 
					$ cd build
 | 
				
			||||||
$ cmake ..
 | 
					$ cmake .. -DJSON_BuildTests=On
 | 
				
			||||||
$ cmake --build .
 | 
					$ cmake --build .
 | 
				
			||||||
$ ctest --output-on-failure
 | 
					$ ctest --output-on-failure
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -112,7 +112,7 @@ before_build:
 | 
				
			||||||
  # for with_win_header build, inject the inclusion of Windows.h to the single-header library
 | 
					  # for with_win_header build, inject the inclusion of Windows.h to the single-header library
 | 
				
			||||||
  - ps: if ($env:name -Eq "with_win_header") { $header_path = "single_include\nlohmann\json.hpp" }
 | 
					  - ps: if ($env:name -Eq "with_win_header") { $header_path = "single_include\nlohmann\json.hpp" }
 | 
				
			||||||
  - ps: if ($env:name -Eq "with_win_header") { "#include <Windows.h>`n" + (Get-Content $header_path | Out-String) | Set-Content $header_path }
 | 
					  - ps: if ($env:name -Eq "with_win_header") { "#include <Windows.h>`n" + (Get-Content $header_path | Out-String) | Set-Content $header_path }
 | 
				
			||||||
  - if "%GENERATOR%"=="Ninja" (cmake . -G "%GENERATOR%" -DCMAKE_BUILD_TYPE="%configuration%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin") else (cmake . -G "%GENERATOR%" -A "%GENERATOR_PLATFORM%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin")
 | 
					  - if "%GENERATOR%"=="Ninja" (cmake . -G "%GENERATOR%" -DCMAKE_BUILD_TYPE="%configuration%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin" -DJSON_BuildTests=On) else (cmake . -G "%GENERATOR%" -A "%GENERATOR_PLATFORM%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin" -DJSON_BuildTests=On)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
build_script:
 | 
					build_script:
 | 
				
			||||||
  - cmake --build . --config "%configuration%"
 | 
					  - cmake --build . --config "%configuration%"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								doc/avatars.png
									
										
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								doc/avatars.png
									
										
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 1 MiB After Width: | Height: | Size: 1.1 MiB  | 
| 
						 | 
					@ -331,13 +331,14 @@ inline input_stream_adapter input_adapter(std::istream&& stream)
 | 
				
			||||||
    return input_stream_adapter(stream);
 | 
					    return input_stream_adapter(stream);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
template<typename CharT,
 | 
					template<typename CharT, typename SizeT,
 | 
				
			||||||
         typename std::enable_if<
 | 
					         typename std::enable_if<
 | 
				
			||||||
             std::is_pointer<CharT>::value and
 | 
					             std::is_pointer<CharT>::value and
 | 
				
			||||||
             std::is_integral<typename std::remove_pointer<CharT>::type>::value and
 | 
					             std::is_integral<typename std::remove_pointer<CharT>::type>::value and
 | 
				
			||||||
 | 
					             not std::is_same<SizeT, bool>::value and
 | 
				
			||||||
             sizeof(typename std::remove_pointer<CharT>::type) == 1,
 | 
					             sizeof(typename std::remove_pointer<CharT>::type) == 1,
 | 
				
			||||||
             int>::type = 0>
 | 
					             int>::type = 0>
 | 
				
			||||||
input_buffer_adapter input_adapter(CharT b, std::size_t l)
 | 
					input_buffer_adapter input_adapter(CharT b, SizeT l)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    return input_buffer_adapter(reinterpret_cast<const char*>(b), l);
 | 
					    return input_buffer_adapter(reinterpret_cast<const char*>(b), l);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -452,7 +452,7 @@ class json_sax_dom_callback_parser
 | 
				
			||||||
        ref_stack.pop_back();
 | 
					        ref_stack.pop_back();
 | 
				
			||||||
        keep_stack.pop_back();
 | 
					        keep_stack.pop_back();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (not ref_stack.empty() and ref_stack.back() and ref_stack.back()->is_object())
 | 
					        if (not ref_stack.empty() and ref_stack.back() and ref_stack.back()->is_structured())
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            // remove discarded value
 | 
					            // remove discarded value
 | 
				
			||||||
            for (auto it = ref_stack.back()->begin(); it != ref_stack.back()->end(); ++it)
 | 
					            for (auto it = ref_stack.back()->begin(); it != ref_stack.back()->end(); ++it)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1367,7 +1367,7 @@ scan_number_done:
 | 
				
			||||||
        std::string result;
 | 
					        std::string result;
 | 
				
			||||||
        for (const auto c : token_string)
 | 
					        for (const auto c : token_string)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if ('\x00' <= c and c <= '\x1F')
 | 
					            if (static_cast<unsigned char>(c) <= '\x1F')
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                // escape control characters
 | 
					                // escape control characters
 | 
				
			||||||
                std::array<char, 9> cs{{}};
 | 
					                std::array<char, 9> cs{{}};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3207,7 +3207,7 @@ class basic_json
 | 
				
			||||||
                   not std::is_same<ValueType, typename string_t::value_type>::value and
 | 
					                   not std::is_same<ValueType, typename string_t::value_type>::value and
 | 
				
			||||||
                   not detail::is_basic_json<ValueType>::value
 | 
					                   not detail::is_basic_json<ValueType>::value
 | 
				
			||||||
                   and not std::is_same<ValueType, std::initializer_list<typename string_t::value_type>>::value
 | 
					                   and not std::is_same<ValueType, std::initializer_list<typename string_t::value_type>>::value
 | 
				
			||||||
#if defined(JSON_HAS_CPP_17) && (defined(__GNUC__) || (defined(_MSC_VER) and _MSC_VER <= 1914))
 | 
					#if defined(JSON_HAS_CPP_17) && (defined(__GNUC__) || (defined(_MSC_VER) and _MSC_VER >= 1910 and _MSC_VER <= 1914))
 | 
				
			||||||
                   and not std::is_same<ValueType, typename std::string_view>::value
 | 
					                   and not std::is_same<ValueType, typename std::string_view>::value
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
                   and detail::is_detected<detail::get_template_function, const basic_json_t&, ValueType>::value
 | 
					                   and detail::is_detected<detail::get_template_function, const basic_json_t&, ValueType>::value
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4753,13 +4753,14 @@ inline input_stream_adapter input_adapter(std::istream&& stream)
 | 
				
			||||||
    return input_stream_adapter(stream);
 | 
					    return input_stream_adapter(stream);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
template<typename CharT,
 | 
					template<typename CharT, typename SizeT,
 | 
				
			||||||
         typename std::enable_if<
 | 
					         typename std::enable_if<
 | 
				
			||||||
             std::is_pointer<CharT>::value and
 | 
					             std::is_pointer<CharT>::value and
 | 
				
			||||||
             std::is_integral<typename std::remove_pointer<CharT>::type>::value and
 | 
					             std::is_integral<typename std::remove_pointer<CharT>::type>::value and
 | 
				
			||||||
 | 
					             not std::is_same<SizeT, bool>::value and
 | 
				
			||||||
             sizeof(typename std::remove_pointer<CharT>::type) == 1,
 | 
					             sizeof(typename std::remove_pointer<CharT>::type) == 1,
 | 
				
			||||||
             int>::type = 0>
 | 
					             int>::type = 0>
 | 
				
			||||||
input_buffer_adapter input_adapter(CharT b, std::size_t l)
 | 
					input_buffer_adapter input_adapter(CharT b, SizeT l)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    return input_buffer_adapter(reinterpret_cast<const char*>(b), l);
 | 
					    return input_buffer_adapter(reinterpret_cast<const char*>(b), l);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -5357,7 +5358,7 @@ class json_sax_dom_callback_parser
 | 
				
			||||||
        ref_stack.pop_back();
 | 
					        ref_stack.pop_back();
 | 
				
			||||||
        keep_stack.pop_back();
 | 
					        keep_stack.pop_back();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (not ref_stack.empty() and ref_stack.back() and ref_stack.back()->is_object())
 | 
					        if (not ref_stack.empty() and ref_stack.back() and ref_stack.back()->is_structured())
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            // remove discarded value
 | 
					            // remove discarded value
 | 
				
			||||||
            for (auto it = ref_stack.back()->begin(); it != ref_stack.back()->end(); ++it)
 | 
					            for (auto it = ref_stack.back()->begin(); it != ref_stack.back()->end(); ++it)
 | 
				
			||||||
| 
						 | 
					@ -9456,7 +9457,7 @@ scan_number_done:
 | 
				
			||||||
        std::string result;
 | 
					        std::string result;
 | 
				
			||||||
        for (const auto c : token_string)
 | 
					        for (const auto c : token_string)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if ('\x00' <= c and c <= '\x1F')
 | 
					            if (static_cast<unsigned char>(c) <= '\x1F')
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                // escape control characters
 | 
					                // escape control characters
 | 
				
			||||||
                std::array<char, 9> cs{{}};
 | 
					                std::array<char, 9> cs{{}};
 | 
				
			||||||
| 
						 | 
					@ -18999,7 +19000,7 @@ class basic_json
 | 
				
			||||||
                   not std::is_same<ValueType, typename string_t::value_type>::value and
 | 
					                   not std::is_same<ValueType, typename string_t::value_type>::value and
 | 
				
			||||||
                   not detail::is_basic_json<ValueType>::value
 | 
					                   not detail::is_basic_json<ValueType>::value
 | 
				
			||||||
                   and not std::is_same<ValueType, std::initializer_list<typename string_t::value_type>>::value
 | 
					                   and not std::is_same<ValueType, std::initializer_list<typename string_t::value_type>>::value
 | 
				
			||||||
#if defined(JSON_HAS_CPP_17) && (defined(__GNUC__) || (defined(_MSC_VER) and _MSC_VER <= 1914))
 | 
					#if defined(JSON_HAS_CPP_17) && (defined(__GNUC__) || (defined(_MSC_VER) and _MSC_VER >= 1910 and _MSC_VER <= 1914))
 | 
				
			||||||
                   and not std::is_same<ValueType, typename std::string_view>::value
 | 
					                   and not std::is_same<ValueType, typename std::string_view>::value
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
                   and detail::is_detected<detail::get_template_function, const basic_json_t&, ValueType>::value
 | 
					                   and detail::is_detected<detail::get_template_function, const basic_json_t&, ValueType>::value
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -183,6 +183,7 @@ add_dependencies(json_unit download_test_data)
 | 
				
			||||||
#############################################################################
 | 
					#############################################################################
 | 
				
			||||||
# Test the generated build configs
 | 
					# Test the generated build configs
 | 
				
			||||||
#############################################################################
 | 
					#############################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
add_subdirectory(cmake_import)
 | 
					add_subdirectory(cmake_import)
 | 
				
			||||||
add_subdirectory(cmake_import_minver)
 | 
					add_subdirectory(cmake_import_minver)
 | 
				
			||||||
add_subdirectory(cmake_add_subdirectory)
 | 
					add_subdirectory(cmake_add_subdirectory)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1489,6 +1489,18 @@ TEST_CASE("parser class")
 | 
				
			||||||
            [1,2,[3,4,5],4,5]
 | 
					            [1,2,[3,4,5],4,5]
 | 
				
			||||||
        )";
 | 
					        )";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        auto structured_array = R"(
 | 
				
			||||||
 | 
					            [
 | 
				
			||||||
 | 
					                1,
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                     "foo": "bar"
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                     "qux": "baz"
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            ]
 | 
				
			||||||
 | 
					        )";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        SECTION("filter nothing")
 | 
					        SECTION("filter nothing")
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            json j_object = json::parse(s_object, [](int, json::parse_event_t, const json&)
 | 
					            json j_object = json::parse(s_object, [](int, json::parse_event_t, const json&)
 | 
				
			||||||
| 
						 | 
					@ -1557,6 +1569,41 @@ TEST_CASE("parser class")
 | 
				
			||||||
            CHECK (j_array == json({1, {3, 4, 5}, 4, 5}));
 | 
					            CHECK (j_array == json({1, {3, 4, 5}, 4, 5}));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        SECTION("filter object in array")
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            json j_filtered1 = json::parse(structured_array, [](int, json::parse_event_t e, const json & parsed)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (e == json::parse_event_t::object_end and parsed.contains("foo"))
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return false;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return true;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // the specified object will be discarded, and removed.
 | 
				
			||||||
 | 
					            CHECK (j_filtered1.size() == 2);
 | 
				
			||||||
 | 
					            CHECK (j_filtered1 == json({1, {{"qux", "baz"}}}));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            json j_filtered2 = json::parse(structured_array, [](int, json::parse_event_t e, const json & parsed)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (e == json::parse_event_t::object_end)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return false;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return true;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // removed all objects in array.
 | 
				
			||||||
 | 
					            CHECK (j_filtered2.size() == 1);
 | 
				
			||||||
 | 
					            CHECK (j_filtered2 == json({1}));
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        SECTION("filter specific events")
 | 
					        SECTION("filter specific events")
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            SECTION("first closing event")
 | 
					            SECTION("first closing event")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1890,6 +1890,28 @@ TEST_CASE("regression tests")
 | 
				
			||||||
        json j = val;
 | 
					        json j = val;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    SECTION("issue #1715 - json::from_cbor does not respect allow_exceptions = false when input is string literal")
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        SECTION("string literal")
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            json cbor = json::from_cbor("B", true, false);
 | 
				
			||||||
 | 
					            CHECK(cbor.is_discarded());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        SECTION("string array")
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            const char input[] = { 'B', 0x00 };
 | 
				
			||||||
 | 
					            json cbor = json::from_cbor(input, true, false);
 | 
				
			||||||
 | 
					            CHECK(cbor.is_discarded());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        SECTION("std::string")
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            json cbor = json::from_cbor(std::string("B"), true, false);
 | 
				
			||||||
 | 
					            CHECK(cbor.is_discarded());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    SECTION("issue #1805 - A pair<T1, T2> is json constructible only if T1 and T2 are json constructible")
 | 
					    SECTION("issue #1805 - A pair<T1, T2> is json constructible only if T1 and T2 are json constructible")
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        static_assert(!std::is_constructible<json, std::pair<std::string, NotSerializableData>>::value, "");
 | 
					        static_assert(!std::is_constructible<json, std::pair<std::string, NotSerializableData>>::value, "");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue