Instrument Neutral Distributed Interface INDI  2.0.2
json.h
Go to the documentation of this file.
1 /*
2  __ _____ _____ _____
3  __| | __| | | | JSON for Modern C++
4 | | |__ | | | | | | version 3.10.5
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
6 
7 Licensed under the MIT License <http://opensource.org/licenses/MIT>.
8 SPDX-License-Identifier: MIT
9 Copyright (c) 2013-2022 Niels Lohmann <http://nlohmann.me>.
10 
11 Permission is hereby granted, free of charge, to any person obtaining a copy
12 of this software and associated documentation files (the "Software"), to deal
13 in the Software without restriction, including without limitation the rights
14 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 copies of the Software, and to permit persons to whom the Software is
16 furnished to do so, subject to the following conditions:
17 
18 The above copyright notice and this permission notice shall be included in all
19 copies or substantial portions of the Software.
20 
21 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 SOFTWARE.
28 */
29 
30 /****************************************************************************\
31  * Note on documentation: The source files contain links to the online *
32  * documentation of the public API at https://json.nlohmann.me. This URL *
33  * contains the most recent documentation and should also be applicable to *
34  * previous versions; documentation for deprecated functions is not *
35  * removed, but marked deprecated. See "Generate documentation" section in *
36  * file docs/README.md. *
37 \****************************************************************************/
38 
39 #ifndef INCLUDE_NLOHMANN_JSON_HPP_
40 #define INCLUDE_NLOHMANN_JSON_HPP_
41 
42 #ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
43  #if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH)
44  #if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 10 || NLOHMANN_JSON_VERSION_PATCH != 5
45  #warning "Already included a different version of the library!"
46  #endif
47  #endif
48 #endif
49 
50 #define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum)
51 #define NLOHMANN_JSON_VERSION_MINOR 10 // NOLINT(modernize-macro-to-enum)
52 #define NLOHMANN_JSON_VERSION_PATCH 5 // NOLINT(modernize-macro-to-enum)
53 
54 #include <algorithm> // all_of, find, for_each
55 #include <cstddef> // nullptr_t, ptrdiff_t, size_t
56 #include <functional> // hash, less
57 #include <initializer_list> // initializer_list
58 #ifndef JSON_NO_IO
59  #include <iosfwd> // istream, ostream
60 #endif // JSON_NO_IO
61 #include <iterator> // random_access_iterator_tag
62 #include <memory> // unique_ptr
63 #include <numeric> // accumulate
64 #include <string> // string, stoi, to_string
65 #include <utility> // declval, forward, move, pair, swap
66 #include <vector> // vector
67 
68 // #include <nlohmann/adl_serializer.hpp>
69 
70 
71 #include <type_traits>
72 #include <utility>
73 
74 // #include <nlohmann/detail/conversions/from_json.hpp>
75 
76 
77 #include <algorithm> // transform
78 #include <array> // array
79 #include <forward_list> // forward_list
80 #include <iterator> // inserter, front_inserter, end
81 #include <map> // map
82 #include <string> // string
83 #include <tuple> // tuple, make_tuple
84 #include <type_traits> // is_arithmetic, is_same, is_enum, underlying_type, is_convertible
85 #include <unordered_map> // unordered_map
86 #include <utility> // pair, declval
87 #include <valarray> // valarray
88 
89 // #include <nlohmann/detail/exceptions.hpp>
90 
91 
92 #include <cstddef> // nullptr_t
93 #include <exception> // exception
94 #include <stdexcept> // runtime_error
95 #include <string> // to_string
96 #include <vector> // vector
97 
98 // #include <nlohmann/detail/value_t.hpp>
99 
100 
101 #include <array> // array
102 #include <cstddef> // size_t
103 #include <cstdint> // uint8_t
104 #include <string> // string
105 
106 // #include <nlohmann/detail/macro_scope.hpp>
107 
108 
109 #include <utility> // declval, pair
110 // #include <nlohmann/thirdparty/hedley/hedley.hpp>
111 
112 
113 /* Hedley - https://nemequ.github.io/hedley
114  * Created by Evan Nemerson <evan@nemerson.com>
115  *
116  * To the extent possible under law, the author(s) have dedicated all
117  * copyright and related and neighboring rights to this software to
118  * the public domain worldwide. This software is distributed without
119  * any warranty.
120  *
121  * For details, see <http://creativecommons.org/publicdomain/zero/1.0/>.
122  * SPDX-License-Identifier: CC0-1.0
123  */
124 
125 #if !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < 15)
126 #if defined(JSON_HEDLEY_VERSION)
127  #undef JSON_HEDLEY_VERSION
128 #endif
129 #define JSON_HEDLEY_VERSION 15
130 
131 #if defined(JSON_HEDLEY_STRINGIFY_EX)
132  #undef JSON_HEDLEY_STRINGIFY_EX
133 #endif
134 #define JSON_HEDLEY_STRINGIFY_EX(x) #x
135 
136 #if defined(JSON_HEDLEY_STRINGIFY)
137  #undef JSON_HEDLEY_STRINGIFY
138 #endif
139 #define JSON_HEDLEY_STRINGIFY(x) JSON_HEDLEY_STRINGIFY_EX(x)
140 
141 #if defined(JSON_HEDLEY_CONCAT_EX)
142  #undef JSON_HEDLEY_CONCAT_EX
143 #endif
144 #define JSON_HEDLEY_CONCAT_EX(a,b) a##b
145 
146 #if defined(JSON_HEDLEY_CONCAT)
147  #undef JSON_HEDLEY_CONCAT
148 #endif
149 #define JSON_HEDLEY_CONCAT(a,b) JSON_HEDLEY_CONCAT_EX(a,b)
150 
151 #if defined(JSON_HEDLEY_CONCAT3_EX)
152  #undef JSON_HEDLEY_CONCAT3_EX
153 #endif
154 #define JSON_HEDLEY_CONCAT3_EX(a,b,c) a##b##c
155 
156 #if defined(JSON_HEDLEY_CONCAT3)
157  #undef JSON_HEDLEY_CONCAT3
158 #endif
159 #define JSON_HEDLEY_CONCAT3(a,b,c) JSON_HEDLEY_CONCAT3_EX(a,b,c)
160 
161 #if defined(JSON_HEDLEY_VERSION_ENCODE)
162  #undef JSON_HEDLEY_VERSION_ENCODE
163 #endif
164 #define JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision))
165 
166 #if defined(JSON_HEDLEY_VERSION_DECODE_MAJOR)
167  #undef JSON_HEDLEY_VERSION_DECODE_MAJOR
168 #endif
169 #define JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000)
170 
171 #if defined(JSON_HEDLEY_VERSION_DECODE_MINOR)
172  #undef JSON_HEDLEY_VERSION_DECODE_MINOR
173 #endif
174 #define JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000)
175 
176 #if defined(JSON_HEDLEY_VERSION_DECODE_REVISION)
177  #undef JSON_HEDLEY_VERSION_DECODE_REVISION
178 #endif
179 #define JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000)
180 
181 #if defined(JSON_HEDLEY_GNUC_VERSION)
182  #undef JSON_HEDLEY_GNUC_VERSION
183 #endif
184 #if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__)
185  #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
186 #elif defined(__GNUC__)
187  #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0)
188 #endif
189 
190 #if defined(JSON_HEDLEY_GNUC_VERSION_CHECK)
191  #undef JSON_HEDLEY_GNUC_VERSION_CHECK
192 #endif
193 #if defined(JSON_HEDLEY_GNUC_VERSION)
194  #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GNUC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
195 #else
196  #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0)
197 #endif
198 
199 #if defined(JSON_HEDLEY_MSVC_VERSION)
200  #undef JSON_HEDLEY_MSVC_VERSION
201 #endif
202 #if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) && !defined(__ICL)
203  #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100)
204 #elif defined(_MSC_FULL_VER) && !defined(__ICL)
205  #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10)
206 #elif defined(_MSC_VER) && !defined(__ICL)
207  #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0)
208 #endif
209 
210 #if defined(JSON_HEDLEY_MSVC_VERSION_CHECK)
211  #undef JSON_HEDLEY_MSVC_VERSION_CHECK
212 #endif
213 #if !defined(JSON_HEDLEY_MSVC_VERSION)
214  #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0)
215 #elif defined(_MSC_VER) && (_MSC_VER >= 1400)
216  #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch)))
217 #elif defined(_MSC_VER) && (_MSC_VER >= 1200)
218  #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch)))
219 #else
220  #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor)))
221 #endif
222 
223 #if defined(JSON_HEDLEY_INTEL_VERSION)
224  #undef JSON_HEDLEY_INTEL_VERSION
225 #endif
226 #if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && !defined(__ICL)
227  #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE)
228 #elif defined(__INTEL_COMPILER) && !defined(__ICL)
229  #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0)
230 #endif
231 
232 #if defined(JSON_HEDLEY_INTEL_VERSION_CHECK)
233  #undef JSON_HEDLEY_INTEL_VERSION_CHECK
234 #endif
235 #if defined(JSON_HEDLEY_INTEL_VERSION)
236  #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
237 #else
238  #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0)
239 #endif
240 
241 #if defined(JSON_HEDLEY_INTEL_CL_VERSION)
242  #undef JSON_HEDLEY_INTEL_CL_VERSION
243 #endif
244 #if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && defined(__ICL)
245  #define JSON_HEDLEY_INTEL_CL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER, __INTEL_COMPILER_UPDATE, 0)
246 #endif
247 
248 #if defined(JSON_HEDLEY_INTEL_CL_VERSION_CHECK)
249  #undef JSON_HEDLEY_INTEL_CL_VERSION_CHECK
250 #endif
251 #if defined(JSON_HEDLEY_INTEL_CL_VERSION)
252  #define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_CL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
253 #else
254  #define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (0)
255 #endif
256 
257 #if defined(JSON_HEDLEY_PGI_VERSION)
258  #undef JSON_HEDLEY_PGI_VERSION
259 #endif
260 #if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__)
261  #define JSON_HEDLEY_PGI_VERSION JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__)
262 #endif
263 
264 #if defined(JSON_HEDLEY_PGI_VERSION_CHECK)
265  #undef JSON_HEDLEY_PGI_VERSION_CHECK
266 #endif
267 #if defined(JSON_HEDLEY_PGI_VERSION)
268  #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PGI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
269 #else
270  #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0)
271 #endif
272 
273 #if defined(JSON_HEDLEY_SUNPRO_VERSION)
274  #undef JSON_HEDLEY_SUNPRO_VERSION
275 #endif
276 #if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000)
277  #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10)
278 #elif defined(__SUNPRO_C)
279  #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf)
280 #elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000)
281  #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10)
282 #elif defined(__SUNPRO_CC)
283  #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf)
284 #endif
285 
286 #if defined(JSON_HEDLEY_SUNPRO_VERSION_CHECK)
287  #undef JSON_HEDLEY_SUNPRO_VERSION_CHECK
288 #endif
289 #if defined(JSON_HEDLEY_SUNPRO_VERSION)
290  #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_SUNPRO_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
291 #else
292  #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0)
293 #endif
294 
295 #if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION)
296  #undef JSON_HEDLEY_EMSCRIPTEN_VERSION
297 #endif
298 #if defined(__EMSCRIPTEN__)
299  #define JSON_HEDLEY_EMSCRIPTEN_VERSION JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__)
300 #endif
301 
302 #if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK)
303  #undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK
304 #endif
305 #if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION)
306  #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_EMSCRIPTEN_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
307 #else
308  #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0)
309 #endif
310 
311 #if defined(JSON_HEDLEY_ARM_VERSION)
312  #undef JSON_HEDLEY_ARM_VERSION
313 #endif
314 #if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION)
315  #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100)
316 #elif defined(__CC_ARM) && defined(__ARMCC_VERSION)
317  #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100)
318 #endif
319 
320 #if defined(JSON_HEDLEY_ARM_VERSION_CHECK)
321  #undef JSON_HEDLEY_ARM_VERSION_CHECK
322 #endif
323 #if defined(JSON_HEDLEY_ARM_VERSION)
324  #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_ARM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
325 #else
326  #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0)
327 #endif
328 
329 #if defined(JSON_HEDLEY_IBM_VERSION)
330  #undef JSON_HEDLEY_IBM_VERSION
331 #endif
332 #if defined(__ibmxl__)
333  #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__)
334 #elif defined(__xlC__) && defined(__xlC_ver__)
335  #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff)
336 #elif defined(__xlC__)
337  #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0)
338 #endif
339 
340 #if defined(JSON_HEDLEY_IBM_VERSION_CHECK)
341  #undef JSON_HEDLEY_IBM_VERSION_CHECK
342 #endif
343 #if defined(JSON_HEDLEY_IBM_VERSION)
344  #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IBM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
345 #else
346  #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0)
347 #endif
348 
349 #if defined(JSON_HEDLEY_TI_VERSION)
350  #undef JSON_HEDLEY_TI_VERSION
351 #endif
352 #if \
353  defined(__TI_COMPILER_VERSION__) && \
354  ( \
355  defined(__TMS470__) || defined(__TI_ARM__) || \
356  defined(__MSP430__) || \
357  defined(__TMS320C2000__) \
358  )
359 #if (__TI_COMPILER_VERSION__ >= 16000000)
360  #define JSON_HEDLEY_TI_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
361 #endif
362 #endif
363 
364 #if defined(JSON_HEDLEY_TI_VERSION_CHECK)
365  #undef JSON_HEDLEY_TI_VERSION_CHECK
366 #endif
367 #if defined(JSON_HEDLEY_TI_VERSION)
368  #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
369 #else
370  #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0)
371 #endif
372 
373 #if defined(JSON_HEDLEY_TI_CL2000_VERSION)
374  #undef JSON_HEDLEY_TI_CL2000_VERSION
375 #endif
376 #if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C2000__)
377  #define JSON_HEDLEY_TI_CL2000_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
378 #endif
379 
380 #if defined(JSON_HEDLEY_TI_CL2000_VERSION_CHECK)
381  #undef JSON_HEDLEY_TI_CL2000_VERSION_CHECK
382 #endif
383 #if defined(JSON_HEDLEY_TI_CL2000_VERSION)
384  #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL2000_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
385 #else
386  #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (0)
387 #endif
388 
389 #if defined(JSON_HEDLEY_TI_CL430_VERSION)
390  #undef JSON_HEDLEY_TI_CL430_VERSION
391 #endif
392 #if defined(__TI_COMPILER_VERSION__) && defined(__MSP430__)
393  #define JSON_HEDLEY_TI_CL430_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
394 #endif
395 
396 #if defined(JSON_HEDLEY_TI_CL430_VERSION_CHECK)
397  #undef JSON_HEDLEY_TI_CL430_VERSION_CHECK
398 #endif
399 #if defined(JSON_HEDLEY_TI_CL430_VERSION)
400  #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL430_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
401 #else
402  #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (0)
403 #endif
404 
405 #if defined(JSON_HEDLEY_TI_ARMCL_VERSION)
406  #undef JSON_HEDLEY_TI_ARMCL_VERSION
407 #endif
408 #if defined(__TI_COMPILER_VERSION__) && (defined(__TMS470__) || defined(__TI_ARM__))
409  #define JSON_HEDLEY_TI_ARMCL_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
410 #endif
411 
412 #if defined(JSON_HEDLEY_TI_ARMCL_VERSION_CHECK)
413  #undef JSON_HEDLEY_TI_ARMCL_VERSION_CHECK
414 #endif
415 #if defined(JSON_HEDLEY_TI_ARMCL_VERSION)
416  #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_ARMCL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
417 #else
418  #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (0)
419 #endif
420 
421 #if defined(JSON_HEDLEY_TI_CL6X_VERSION)
422  #undef JSON_HEDLEY_TI_CL6X_VERSION
423 #endif
424 #if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C6X__)
425  #define JSON_HEDLEY_TI_CL6X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
426 #endif
427 
428 #if defined(JSON_HEDLEY_TI_CL6X_VERSION_CHECK)
429  #undef JSON_HEDLEY_TI_CL6X_VERSION_CHECK
430 #endif
431 #if defined(JSON_HEDLEY_TI_CL6X_VERSION)
432  #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL6X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
433 #else
434  #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (0)
435 #endif
436 
437 #if defined(JSON_HEDLEY_TI_CL7X_VERSION)
438  #undef JSON_HEDLEY_TI_CL7X_VERSION
439 #endif
440 #if defined(__TI_COMPILER_VERSION__) && defined(__C7000__)
441  #define JSON_HEDLEY_TI_CL7X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
442 #endif
443 
444 #if defined(JSON_HEDLEY_TI_CL7X_VERSION_CHECK)
445  #undef JSON_HEDLEY_TI_CL7X_VERSION_CHECK
446 #endif
447 #if defined(JSON_HEDLEY_TI_CL7X_VERSION)
448  #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL7X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
449 #else
450  #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (0)
451 #endif
452 
453 #if defined(JSON_HEDLEY_TI_CLPRU_VERSION)
454  #undef JSON_HEDLEY_TI_CLPRU_VERSION
455 #endif
456 #if defined(__TI_COMPILER_VERSION__) && defined(__PRU__)
457  #define JSON_HEDLEY_TI_CLPRU_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
458 #endif
459 
460 #if defined(JSON_HEDLEY_TI_CLPRU_VERSION_CHECK)
461  #undef JSON_HEDLEY_TI_CLPRU_VERSION_CHECK
462 #endif
463 #if defined(JSON_HEDLEY_TI_CLPRU_VERSION)
464  #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CLPRU_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
465 #else
466  #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (0)
467 #endif
468 
469 #if defined(JSON_HEDLEY_CRAY_VERSION)
470  #undef JSON_HEDLEY_CRAY_VERSION
471 #endif
472 #if defined(_CRAYC)
473  #if defined(_RELEASE_PATCHLEVEL)
474  #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL)
475  #else
476  #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0)
477  #endif
478 #endif
479 
480 #if defined(JSON_HEDLEY_CRAY_VERSION_CHECK)
481  #undef JSON_HEDLEY_CRAY_VERSION_CHECK
482 #endif
483 #if defined(JSON_HEDLEY_CRAY_VERSION)
484  #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_CRAY_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
485 #else
486  #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0)
487 #endif
488 
489 #if defined(JSON_HEDLEY_IAR_VERSION)
490  #undef JSON_HEDLEY_IAR_VERSION
491 #endif
492 #if defined(__IAR_SYSTEMS_ICC__)
493  #if __VER__ > 1000
494  #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000))
495  #else
496  #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE(__VER__ / 100, __VER__ % 100, 0)
497  #endif
498 #endif
499 
500 #if defined(JSON_HEDLEY_IAR_VERSION_CHECK)
501  #undef JSON_HEDLEY_IAR_VERSION_CHECK
502 #endif
503 #if defined(JSON_HEDLEY_IAR_VERSION)
504  #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IAR_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
505 #else
506  #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0)
507 #endif
508 
509 #if defined(JSON_HEDLEY_TINYC_VERSION)
510  #undef JSON_HEDLEY_TINYC_VERSION
511 #endif
512 #if defined(__TINYC__)
513  #define JSON_HEDLEY_TINYC_VERSION JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100)
514 #endif
515 
516 #if defined(JSON_HEDLEY_TINYC_VERSION_CHECK)
517  #undef JSON_HEDLEY_TINYC_VERSION_CHECK
518 #endif
519 #if defined(JSON_HEDLEY_TINYC_VERSION)
520  #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TINYC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
521 #else
522  #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0)
523 #endif
524 
525 #if defined(JSON_HEDLEY_DMC_VERSION)
526  #undef JSON_HEDLEY_DMC_VERSION
527 #endif
528 #if defined(__DMC__)
529  #define JSON_HEDLEY_DMC_VERSION JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf)
530 #endif
531 
532 #if defined(JSON_HEDLEY_DMC_VERSION_CHECK)
533  #undef JSON_HEDLEY_DMC_VERSION_CHECK
534 #endif
535 #if defined(JSON_HEDLEY_DMC_VERSION)
536  #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_DMC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
537 #else
538  #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0)
539 #endif
540 
541 #if defined(JSON_HEDLEY_COMPCERT_VERSION)
542  #undef JSON_HEDLEY_COMPCERT_VERSION
543 #endif
544 #if defined(__COMPCERT_VERSION__)
545  #define JSON_HEDLEY_COMPCERT_VERSION JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100)
546 #endif
547 
548 #if defined(JSON_HEDLEY_COMPCERT_VERSION_CHECK)
549  #undef JSON_HEDLEY_COMPCERT_VERSION_CHECK
550 #endif
551 #if defined(JSON_HEDLEY_COMPCERT_VERSION)
552  #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_COMPCERT_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
553 #else
554  #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0)
555 #endif
556 
557 #if defined(JSON_HEDLEY_PELLES_VERSION)
558  #undef JSON_HEDLEY_PELLES_VERSION
559 #endif
560 #if defined(__POCC__)
561  #define JSON_HEDLEY_PELLES_VERSION JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0)
562 #endif
563 
564 #if defined(JSON_HEDLEY_PELLES_VERSION_CHECK)
565  #undef JSON_HEDLEY_PELLES_VERSION_CHECK
566 #endif
567 #if defined(JSON_HEDLEY_PELLES_VERSION)
568  #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PELLES_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
569 #else
570  #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0)
571 #endif
572 
573 #if defined(JSON_HEDLEY_MCST_LCC_VERSION)
574  #undef JSON_HEDLEY_MCST_LCC_VERSION
575 #endif
576 #if defined(__LCC__) && defined(__LCC_MINOR__)
577  #define JSON_HEDLEY_MCST_LCC_VERSION JSON_HEDLEY_VERSION_ENCODE(__LCC__ / 100, __LCC__ % 100, __LCC_MINOR__)
578 #endif
579 
580 #if defined(JSON_HEDLEY_MCST_LCC_VERSION_CHECK)
581  #undef JSON_HEDLEY_MCST_LCC_VERSION_CHECK
582 #endif
583 #if defined(JSON_HEDLEY_MCST_LCC_VERSION)
584  #define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_MCST_LCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
585 #else
586  #define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (0)
587 #endif
588 
589 #if defined(JSON_HEDLEY_GCC_VERSION)
590  #undef JSON_HEDLEY_GCC_VERSION
591 #endif
592 #if \
593  defined(JSON_HEDLEY_GNUC_VERSION) && \
594  !defined(__clang__) && \
595  !defined(JSON_HEDLEY_INTEL_VERSION) && \
596  !defined(JSON_HEDLEY_PGI_VERSION) && \
597  !defined(JSON_HEDLEY_ARM_VERSION) && \
598  !defined(JSON_HEDLEY_CRAY_VERSION) && \
599  !defined(JSON_HEDLEY_TI_VERSION) && \
600  !defined(JSON_HEDLEY_TI_ARMCL_VERSION) && \
601  !defined(JSON_HEDLEY_TI_CL430_VERSION) && \
602  !defined(JSON_HEDLEY_TI_CL2000_VERSION) && \
603  !defined(JSON_HEDLEY_TI_CL6X_VERSION) && \
604  !defined(JSON_HEDLEY_TI_CL7X_VERSION) && \
605  !defined(JSON_HEDLEY_TI_CLPRU_VERSION) && \
606  !defined(__COMPCERT__) && \
607  !defined(JSON_HEDLEY_MCST_LCC_VERSION)
608  #define JSON_HEDLEY_GCC_VERSION JSON_HEDLEY_GNUC_VERSION
609 #endif
610 
611 #if defined(JSON_HEDLEY_GCC_VERSION_CHECK)
612  #undef JSON_HEDLEY_GCC_VERSION_CHECK
613 #endif
614 #if defined(JSON_HEDLEY_GCC_VERSION)
615  #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
616 #else
617  #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0)
618 #endif
619 
620 #if defined(JSON_HEDLEY_HAS_ATTRIBUTE)
621  #undef JSON_HEDLEY_HAS_ATTRIBUTE
622 #endif
623 #if \
624  defined(__has_attribute) && \
625  ( \
626  (!defined(JSON_HEDLEY_IAR_VERSION) || JSON_HEDLEY_IAR_VERSION_CHECK(8,5,9)) \
627  )
628 # define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute)
629 #else
630 # define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0)
631 #endif
632 
633 #if defined(JSON_HEDLEY_GNUC_HAS_ATTRIBUTE)
634  #undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE
635 #endif
636 #if defined(__has_attribute)
637  #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute)
638 #else
639  #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
640 #endif
641 
642 #if defined(JSON_HEDLEY_GCC_HAS_ATTRIBUTE)
643  #undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE
644 #endif
645 #if defined(__has_attribute)
646  #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute)
647 #else
648  #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
649 #endif
650 
651 #if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE)
652  #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE
653 #endif
654 #if \
655  defined(__has_cpp_attribute) && \
656  defined(__cplusplus) && \
657  (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0))
658  #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute)
659 #else
660  #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0)
661 #endif
662 
663 #if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS)
664  #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS
665 #endif
666 #if !defined(__cplusplus) || !defined(__has_cpp_attribute)
667  #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0)
668 #elif \
669  !defined(JSON_HEDLEY_PGI_VERSION) && \
670  !defined(JSON_HEDLEY_IAR_VERSION) && \
671  (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \
672  (!defined(JSON_HEDLEY_MSVC_VERSION) || JSON_HEDLEY_MSVC_VERSION_CHECK(19,20,0))
673  #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(ns::attribute)
674 #else
675  #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0)
676 #endif
677 
678 #if defined(JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE)
679  #undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE
680 #endif
681 #if defined(__has_cpp_attribute) && defined(__cplusplus)
682  #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute)
683 #else
684  #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
685 #endif
686 
687 #if defined(JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE)
688  #undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE
689 #endif
690 #if defined(__has_cpp_attribute) && defined(__cplusplus)
691  #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute)
692 #else
693  #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
694 #endif
695 
696 #if defined(JSON_HEDLEY_HAS_BUILTIN)
697  #undef JSON_HEDLEY_HAS_BUILTIN
698 #endif
699 #if defined(__has_builtin)
700  #define JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin)
701 #else
702  #define JSON_HEDLEY_HAS_BUILTIN(builtin) (0)
703 #endif
704 
705 #if defined(JSON_HEDLEY_GNUC_HAS_BUILTIN)
706  #undef JSON_HEDLEY_GNUC_HAS_BUILTIN
707 #endif
708 #if defined(__has_builtin)
709  #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin)
710 #else
711  #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
712 #endif
713 
714 #if defined(JSON_HEDLEY_GCC_HAS_BUILTIN)
715  #undef JSON_HEDLEY_GCC_HAS_BUILTIN
716 #endif
717 #if defined(__has_builtin)
718  #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin)
719 #else
720  #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
721 #endif
722 
723 #if defined(JSON_HEDLEY_HAS_FEATURE)
724  #undef JSON_HEDLEY_HAS_FEATURE
725 #endif
726 #if defined(__has_feature)
727  #define JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature)
728 #else
729  #define JSON_HEDLEY_HAS_FEATURE(feature) (0)
730 #endif
731 
732 #if defined(JSON_HEDLEY_GNUC_HAS_FEATURE)
733  #undef JSON_HEDLEY_GNUC_HAS_FEATURE
734 #endif
735 #if defined(__has_feature)
736  #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature)
737 #else
738  #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
739 #endif
740 
741 #if defined(JSON_HEDLEY_GCC_HAS_FEATURE)
742  #undef JSON_HEDLEY_GCC_HAS_FEATURE
743 #endif
744 #if defined(__has_feature)
745  #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature)
746 #else
747  #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
748 #endif
749 
750 #if defined(JSON_HEDLEY_HAS_EXTENSION)
751  #undef JSON_HEDLEY_HAS_EXTENSION
752 #endif
753 #if defined(__has_extension)
754  #define JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension)
755 #else
756  #define JSON_HEDLEY_HAS_EXTENSION(extension) (0)
757 #endif
758 
759 #if defined(JSON_HEDLEY_GNUC_HAS_EXTENSION)
760  #undef JSON_HEDLEY_GNUC_HAS_EXTENSION
761 #endif
762 #if defined(__has_extension)
763  #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension)
764 #else
765  #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
766 #endif
767 
768 #if defined(JSON_HEDLEY_GCC_HAS_EXTENSION)
769  #undef JSON_HEDLEY_GCC_HAS_EXTENSION
770 #endif
771 #if defined(__has_extension)
772  #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension)
773 #else
774  #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
775 #endif
776 
777 #if defined(JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE)
778  #undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE
779 #endif
780 #if defined(__has_declspec_attribute)
781  #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute)
782 #else
783  #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0)
784 #endif
785 
786 #if defined(JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE)
787  #undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE
788 #endif
789 #if defined(__has_declspec_attribute)
790  #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute)
791 #else
792  #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
793 #endif
794 
795 #if defined(JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE)
796  #undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE
797 #endif
798 #if defined(__has_declspec_attribute)
799  #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute)
800 #else
801  #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
802 #endif
803 
804 #if defined(JSON_HEDLEY_HAS_WARNING)
805  #undef JSON_HEDLEY_HAS_WARNING
806 #endif
807 #if defined(__has_warning)
808  #define JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning)
809 #else
810  #define JSON_HEDLEY_HAS_WARNING(warning) (0)
811 #endif
812 
813 #if defined(JSON_HEDLEY_GNUC_HAS_WARNING)
814  #undef JSON_HEDLEY_GNUC_HAS_WARNING
815 #endif
816 #if defined(__has_warning)
817  #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning)
818 #else
819  #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
820 #endif
821 
822 #if defined(JSON_HEDLEY_GCC_HAS_WARNING)
823  #undef JSON_HEDLEY_GCC_HAS_WARNING
824 #endif
825 #if defined(__has_warning)
826  #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning)
827 #else
828  #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
829 #endif
830 
831 #if \
832  (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \
833  defined(__clang__) || \
834  JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \
835  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
836  JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \
837  JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \
838  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
839  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
840  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \
841  JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \
842  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \
843  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,0,0) || \
844  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
845  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
846  JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \
847  JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \
848  JSON_HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \
849  (JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR))
850  #define JSON_HEDLEY_PRAGMA(value) _Pragma(#value)
851 #elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0)
852  #define JSON_HEDLEY_PRAGMA(value) __pragma(value)
853 #else
854  #define JSON_HEDLEY_PRAGMA(value)
855 #endif
856 
857 #if defined(JSON_HEDLEY_DIAGNOSTIC_PUSH)
858  #undef JSON_HEDLEY_DIAGNOSTIC_PUSH
859 #endif
860 #if defined(JSON_HEDLEY_DIAGNOSTIC_POP)
861  #undef JSON_HEDLEY_DIAGNOSTIC_POP
862 #endif
863 #if defined(__clang__)
864  #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push")
865  #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop")
866 #elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
867  #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)")
868  #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)")
869 #elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0)
870  #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
871  #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
872 #elif \
873  JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \
874  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
875  #define JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push))
876  #define JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop))
877 #elif JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0)
878  #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push")
879  #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop")
880 #elif \
881  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
882  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
883  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,4,0) || \
884  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \
885  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
886  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0)
887  #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push")
888  #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop")
889 #elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0)
890  #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)")
891  #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)")
892 #else
893  #define JSON_HEDLEY_DIAGNOSTIC_PUSH
894  #define JSON_HEDLEY_DIAGNOSTIC_POP
895 #endif
896 
897 /* JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ is for
898  HEDLEY INTERNAL USE ONLY. API subject to change without notice. */
899 #if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_)
900  #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_
901 #endif
902 #if defined(__cplusplus)
903 # if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat")
904 # if JSON_HEDLEY_HAS_WARNING("-Wc++17-extensions")
905 # if JSON_HEDLEY_HAS_WARNING("-Wc++1z-extensions")
906 # define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \
907  JSON_HEDLEY_DIAGNOSTIC_PUSH \
908  _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \
909  _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \
910  _Pragma("clang diagnostic ignored \"-Wc++1z-extensions\"") \
911  xpr \
912  JSON_HEDLEY_DIAGNOSTIC_POP
913 # else
914 # define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \
915  JSON_HEDLEY_DIAGNOSTIC_PUSH \
916  _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \
917  _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \
918  xpr \
919  JSON_HEDLEY_DIAGNOSTIC_POP
920 # endif
921 # else
922 # define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \
923  JSON_HEDLEY_DIAGNOSTIC_PUSH \
924  _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \
925  xpr \
926  JSON_HEDLEY_DIAGNOSTIC_POP
927 # endif
928 # endif
929 #endif
930 #if !defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_)
931  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(x) x
932 #endif
933 
934 #if defined(JSON_HEDLEY_CONST_CAST)
935  #undef JSON_HEDLEY_CONST_CAST
936 #endif
937 #if defined(__cplusplus)
938 # define JSON_HEDLEY_CONST_CAST(T, expr) (const_cast<T>(expr))
939 #elif \
940  JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || \
941  JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) || \
942  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
943 # define JSON_HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \
944  JSON_HEDLEY_DIAGNOSTIC_PUSH \
945  JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \
946  ((T) (expr)); \
947  JSON_HEDLEY_DIAGNOSTIC_POP \
948  }))
949 #else
950 # define JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr))
951 #endif
952 
953 #if defined(JSON_HEDLEY_REINTERPRET_CAST)
954  #undef JSON_HEDLEY_REINTERPRET_CAST
955 #endif
956 #if defined(__cplusplus)
957  #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast<T>(expr))
958 #else
959  #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) ((T) (expr))
960 #endif
961 
962 #if defined(JSON_HEDLEY_STATIC_CAST)
963  #undef JSON_HEDLEY_STATIC_CAST
964 #endif
965 #if defined(__cplusplus)
966  #define JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast<T>(expr))
967 #else
968  #define JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr))
969 #endif
970 
971 #if defined(JSON_HEDLEY_CPP_CAST)
972  #undef JSON_HEDLEY_CPP_CAST
973 #endif
974 #if defined(__cplusplus)
975 # if JSON_HEDLEY_HAS_WARNING("-Wold-style-cast")
976 # define JSON_HEDLEY_CPP_CAST(T, expr) \
977  JSON_HEDLEY_DIAGNOSTIC_PUSH \
978  _Pragma("clang diagnostic ignored \"-Wold-style-cast\"") \
979  ((T) (expr)) \
980  JSON_HEDLEY_DIAGNOSTIC_POP
981 # elif JSON_HEDLEY_IAR_VERSION_CHECK(8,3,0)
982 # define JSON_HEDLEY_CPP_CAST(T, expr) \
983  JSON_HEDLEY_DIAGNOSTIC_PUSH \
984  _Pragma("diag_suppress=Pe137") \
985  JSON_HEDLEY_DIAGNOSTIC_POP
986 # else
987 # define JSON_HEDLEY_CPP_CAST(T, expr) ((T) (expr))
988 # endif
989 #else
990 # define JSON_HEDLEY_CPP_CAST(T, expr) (expr)
991 #endif
992 
993 #if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED)
994  #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
995 #endif
996 #if JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations")
997  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
998 #elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
999  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)")
1000 #elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1001  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:1478 1786))
1002 #elif JSON_HEDLEY_PGI_VERSION_CHECK(20,7,0)
1003  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1216,1444,1445")
1004 #elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0)
1005  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444")
1006 #elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0)
1007  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
1008 #elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0)
1009  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996))
1010 #elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1011  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444")
1012 #elif \
1013  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1014  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1015  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1016  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1017  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1018  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1019  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1020  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1021  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1022  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1023  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0)
1024  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718")
1025 #elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus)
1026  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)")
1027 #elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus)
1028  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)")
1029 #elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1030  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215")
1031 #elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0)
1032  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)")
1033 #else
1034  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
1035 #endif
1036 
1037 #if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS)
1038  #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS
1039 #endif
1040 #if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas")
1041  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"")
1042 #elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
1043  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)")
1044 #elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1045  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:161))
1046 #elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0)
1047  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675")
1048 #elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0)
1049  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"")
1050 #elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0)
1051  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068))
1052 #elif \
1053  JSON_HEDLEY_TI_VERSION_CHECK(16,9,0) || \
1054  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \
1055  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1056  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0)
1057  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163")
1058 #elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0)
1059  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163")
1060 #elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1061  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161")
1062 #elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1063  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 161")
1064 #else
1065  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS
1066 #endif
1067 
1068 #if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES)
1069  #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES
1070 #endif
1071 #if JSON_HEDLEY_HAS_WARNING("-Wunknown-attributes")
1072  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("clang diagnostic ignored \"-Wunknown-attributes\"")
1073 #elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0)
1074  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
1075 #elif JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0)
1076  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("warning(disable:1292)")
1077 #elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1078  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:1292))
1079 #elif JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,0)
1080  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:5030))
1081 #elif JSON_HEDLEY_PGI_VERSION_CHECK(20,7,0)
1082  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097,1098")
1083 #elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0)
1084  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097")
1085 #elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)
1086  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("error_messages(off,attrskipunsup)")
1087 #elif \
1088  JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \
1089  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \
1090  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0)
1091  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1173")
1092 #elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1093  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress=Pe1097")
1094 #elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1095  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097")
1096 #else
1097  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES
1098 #endif
1099 
1100 #if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL)
1101  #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL
1102 #endif
1103 #if JSON_HEDLEY_HAS_WARNING("-Wcast-qual")
1104  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"")
1105 #elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
1106  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)")
1107 #elif JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0)
1108  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"")
1109 #else
1110  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL
1111 #endif
1112 
1113 #if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION)
1114  #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION
1115 #endif
1116 #if JSON_HEDLEY_HAS_WARNING("-Wunused-function")
1117  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("clang diagnostic ignored \"-Wunused-function\"")
1118 #elif JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0)
1119  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("GCC diagnostic ignored \"-Wunused-function\"")
1120 #elif JSON_HEDLEY_MSVC_VERSION_CHECK(1,0,0)
1121  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION __pragma(warning(disable:4505))
1122 #elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1123  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("diag_suppress 3142")
1124 #else
1125  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION
1126 #endif
1127 
1128 #if defined(JSON_HEDLEY_DEPRECATED)
1129  #undef JSON_HEDLEY_DEPRECATED
1130 #endif
1131 #if defined(JSON_HEDLEY_DEPRECATED_FOR)
1132  #undef JSON_HEDLEY_DEPRECATED_FOR
1133 #endif
1134 #if \
1135  JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \
1136  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1137  #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since))
1138  #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement))
1139 #elif \
1140  (JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) && !defined(JSON_HEDLEY_IAR_VERSION)) || \
1141  JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \
1142  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1143  JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \
1144  JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \
1145  JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \
1146  JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \
1147  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(18,1,0) || \
1148  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \
1149  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1150  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) || \
1151  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1152  #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since)))
1153  #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement)))
1154 #elif defined(__cplusplus) && (__cplusplus >= 201402L)
1155  #define JSON_HEDLEY_DEPRECATED(since) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since)]])
1156  #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since "; use " #replacement)]])
1157 #elif \
1158  JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || \
1159  JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \
1160  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1161  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1162  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1163  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1164  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1165  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1166  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1167  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1168  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1169  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1170  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1171  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1172  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \
1173  JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0)
1174  #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__))
1175  #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__))
1176 #elif \
1177  JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \
1178  JSON_HEDLEY_PELLES_VERSION_CHECK(6,50,0) || \
1179  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1180  #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated)
1181  #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated)
1182 #elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1183  #define JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated")
1184  #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated")
1185 #else
1186  #define JSON_HEDLEY_DEPRECATED(since)
1187  #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement)
1188 #endif
1189 
1190 #if defined(JSON_HEDLEY_UNAVAILABLE)
1191  #undef JSON_HEDLEY_UNAVAILABLE
1192 #endif
1193 #if \
1194  JSON_HEDLEY_HAS_ATTRIBUTE(warning) || \
1195  JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) || \
1196  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1197  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1198  #define JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since)))
1199 #else
1200  #define JSON_HEDLEY_UNAVAILABLE(available_since)
1201 #endif
1202 
1203 #if defined(JSON_HEDLEY_WARN_UNUSED_RESULT)
1204  #undef JSON_HEDLEY_WARN_UNUSED_RESULT
1205 #endif
1206 #if defined(JSON_HEDLEY_WARN_UNUSED_RESULT_MSG)
1207  #undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG
1208 #endif
1209 #if \
1210  JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \
1211  JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \
1212  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1213  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1214  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1215  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1216  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1217  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1218  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1219  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1220  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1221  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1222  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1223  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1224  (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \
1225  JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \
1226  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1227  #define JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
1228  #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) __attribute__((__warn_unused_result__))
1229 #elif (JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) >= 201907L)
1230  #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]])
1231  #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard(msg)]])
1232 #elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard)
1233  #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]])
1234  #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]])
1235 #elif defined(_Check_return_) /* SAL */
1236  #define JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_
1237  #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) _Check_return_
1238 #else
1239  #define JSON_HEDLEY_WARN_UNUSED_RESULT
1240  #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg)
1241 #endif
1242 
1243 #if defined(JSON_HEDLEY_SENTINEL)
1244  #undef JSON_HEDLEY_SENTINEL
1245 #endif
1246 #if \
1247  JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || \
1248  JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \
1249  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1250  JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \
1251  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1252  #define JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position)))
1253 #else
1254  #define JSON_HEDLEY_SENTINEL(position)
1255 #endif
1256 
1257 #if defined(JSON_HEDLEY_NO_RETURN)
1258  #undef JSON_HEDLEY_NO_RETURN
1259 #endif
1260 #if JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1261  #define JSON_HEDLEY_NO_RETURN __noreturn
1262 #elif \
1263  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1264  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1265  #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__))
1266 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
1267  #define JSON_HEDLEY_NO_RETURN _Noreturn
1268 #elif defined(__cplusplus) && (__cplusplus >= 201103L)
1269  #define JSON_HEDLEY_NO_RETURN JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[noreturn]])
1270 #elif \
1271  JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || \
1272  JSON_HEDLEY_GCC_VERSION_CHECK(3,2,0) || \
1273  JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1274  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1275  JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1276  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1277  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1278  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1279  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1280  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1281  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1282  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1283  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1284  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1285  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1286  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1287  JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0)
1288  #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__))
1289 #elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0)
1290  #define JSON_HEDLEY_NO_RETURN _Pragma("does_not_return")
1291 #elif \
1292  JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \
1293  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1294  #define JSON_HEDLEY_NO_RETURN __declspec(noreturn)
1295 #elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus)
1296  #define JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;")
1297 #elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0)
1298  #define JSON_HEDLEY_NO_RETURN __attribute((noreturn))
1299 #elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0)
1300  #define JSON_HEDLEY_NO_RETURN __declspec(noreturn)
1301 #else
1302  #define JSON_HEDLEY_NO_RETURN
1303 #endif
1304 
1305 #if defined(JSON_HEDLEY_NO_ESCAPE)
1306  #undef JSON_HEDLEY_NO_ESCAPE
1307 #endif
1308 #if JSON_HEDLEY_HAS_ATTRIBUTE(noescape)
1309  #define JSON_HEDLEY_NO_ESCAPE __attribute__((__noescape__))
1310 #else
1311  #define JSON_HEDLEY_NO_ESCAPE
1312 #endif
1313 
1314 #if defined(JSON_HEDLEY_UNREACHABLE)
1315  #undef JSON_HEDLEY_UNREACHABLE
1316 #endif
1317 #if defined(JSON_HEDLEY_UNREACHABLE_RETURN)
1318  #undef JSON_HEDLEY_UNREACHABLE_RETURN
1319 #endif
1320 #if defined(JSON_HEDLEY_ASSUME)
1321  #undef JSON_HEDLEY_ASSUME
1322 #endif
1323 #if \
1324  JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \
1325  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1326  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1327  #define JSON_HEDLEY_ASSUME(expr) __assume(expr)
1328 #elif JSON_HEDLEY_HAS_BUILTIN(__builtin_assume)
1329  #define JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr)
1330 #elif \
1331  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \
1332  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0)
1333  #if defined(__cplusplus)
1334  #define JSON_HEDLEY_ASSUME(expr) std::_nassert(expr)
1335  #else
1336  #define JSON_HEDLEY_ASSUME(expr) _nassert(expr)
1337  #endif
1338 #endif
1339 #if \
1340  (JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(JSON_HEDLEY_ARM_VERSION))) || \
1341  JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \
1342  JSON_HEDLEY_PGI_VERSION_CHECK(18,10,0) || \
1343  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1344  JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) || \
1345  JSON_HEDLEY_CRAY_VERSION_CHECK(10,0,0) || \
1346  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1347  #define JSON_HEDLEY_UNREACHABLE() __builtin_unreachable()
1348 #elif defined(JSON_HEDLEY_ASSUME)
1349  #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0)
1350 #endif
1351 #if !defined(JSON_HEDLEY_ASSUME)
1352  #if defined(JSON_HEDLEY_UNREACHABLE)
1353  #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, ((expr) ? 1 : (JSON_HEDLEY_UNREACHABLE(), 1)))
1354  #else
1355  #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, expr)
1356  #endif
1357 #endif
1358 #if defined(JSON_HEDLEY_UNREACHABLE)
1359  #if \
1360  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \
1361  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0)
1362  #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (JSON_HEDLEY_STATIC_CAST(void, JSON_HEDLEY_ASSUME(0)), (value))
1363  #else
1364  #define JSON_HEDLEY_UNREACHABLE_RETURN(value) JSON_HEDLEY_UNREACHABLE()
1365  #endif
1366 #else
1367  #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (value)
1368 #endif
1369 #if !defined(JSON_HEDLEY_UNREACHABLE)
1370  #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0)
1371 #endif
1372 
1374 #if JSON_HEDLEY_HAS_WARNING("-Wpedantic")
1375  #pragma clang diagnostic ignored "-Wpedantic"
1376 #endif
1377 #if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic") && defined(__cplusplus)
1378  #pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
1379 #endif
1380 #if JSON_HEDLEY_GCC_HAS_WARNING("-Wvariadic-macros",4,0,0)
1381  #if defined(__clang__)
1382  #pragma clang diagnostic ignored "-Wvariadic-macros"
1383  #elif defined(JSON_HEDLEY_GCC_VERSION)
1384  #pragma GCC diagnostic ignored "-Wvariadic-macros"
1385  #endif
1386 #endif
1387 #if defined(JSON_HEDLEY_NON_NULL)
1388  #undef JSON_HEDLEY_NON_NULL
1389 #endif
1390 #if \
1391  JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || \
1392  JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \
1393  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1394  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0)
1395  #define JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__)))
1396 #else
1397  #define JSON_HEDLEY_NON_NULL(...)
1398 #endif
1400 
1401 #if defined(JSON_HEDLEY_PRINTF_FORMAT)
1402  #undef JSON_HEDLEY_PRINTF_FORMAT
1403 #endif
1404 #if defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO)
1405  #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check)))
1406 #elif defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO)
1407  #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check)))
1408 #elif \
1409  JSON_HEDLEY_HAS_ATTRIBUTE(format) || \
1410  JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \
1411  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1412  JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \
1413  JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1414  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1415  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1416  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1417  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1418  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1419  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1420  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1421  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1422  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1423  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1424  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1425  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1426  #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check)))
1427 #elif JSON_HEDLEY_PELLES_VERSION_CHECK(6,0,0)
1428  #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check))
1429 #else
1430  #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check)
1431 #endif
1432 
1433 #if defined(JSON_HEDLEY_CONSTEXPR)
1434  #undef JSON_HEDLEY_CONSTEXPR
1435 #endif
1436 #if defined(__cplusplus)
1437  #if __cplusplus >= 201103L
1438  #define JSON_HEDLEY_CONSTEXPR JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(constexpr)
1439  #endif
1440 #endif
1441 #if !defined(JSON_HEDLEY_CONSTEXPR)
1442  #define JSON_HEDLEY_CONSTEXPR
1443 #endif
1444 
1445 #if defined(JSON_HEDLEY_PREDICT)
1446  #undef JSON_HEDLEY_PREDICT
1447 #endif
1448 #if defined(JSON_HEDLEY_LIKELY)
1449  #undef JSON_HEDLEY_LIKELY
1450 #endif
1451 #if defined(JSON_HEDLEY_UNLIKELY)
1452  #undef JSON_HEDLEY_UNLIKELY
1453 #endif
1454 #if defined(JSON_HEDLEY_UNPREDICTABLE)
1455  #undef JSON_HEDLEY_UNPREDICTABLE
1456 #endif
1457 #if JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable)
1458  #define JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable((expr))
1459 #endif
1460 #if \
1461  (JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) && !defined(JSON_HEDLEY_PGI_VERSION)) || \
1462  JSON_HEDLEY_GCC_VERSION_CHECK(9,0,0) || \
1463  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1464 # define JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability( (expr), (value), (probability))
1465 # define JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1 , (probability))
1466 # define JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0 , (probability))
1467 # define JSON_HEDLEY_LIKELY(expr) __builtin_expect (!!(expr), 1 )
1468 # define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect (!!(expr), 0 )
1469 #elif \
1470  (JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) && !defined(JSON_HEDLEY_INTEL_CL_VERSION)) || \
1471  JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \
1472  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1473  (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \
1474  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1475  JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1476  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1477  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \
1478  JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \
1479  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \
1480  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \
1481  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1482  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1483  JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,27) || \
1484  JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \
1485  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1486 # define JSON_HEDLEY_PREDICT(expr, expected, probability) \
1487  (((probability) >= 0.9) ? __builtin_expect((expr), (expected)) : (JSON_HEDLEY_STATIC_CAST(void, expected), (expr)))
1488 # define JSON_HEDLEY_PREDICT_TRUE(expr, probability) \
1489  (__extension__ ({ \
1490  double hedley_probability_ = (probability); \
1491  ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \
1492  }))
1493 # define JSON_HEDLEY_PREDICT_FALSE(expr, probability) \
1494  (__extension__ ({ \
1495  double hedley_probability_ = (probability); \
1496  ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \
1497  }))
1498 # define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1)
1499 # define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0)
1500 #else
1501 # define JSON_HEDLEY_PREDICT(expr, expected, probability) (JSON_HEDLEY_STATIC_CAST(void, expected), (expr))
1502 # define JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr))
1503 # define JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr))
1504 # define JSON_HEDLEY_LIKELY(expr) (!!(expr))
1505 # define JSON_HEDLEY_UNLIKELY(expr) (!!(expr))
1506 #endif
1507 #if !defined(JSON_HEDLEY_UNPREDICTABLE)
1508  #define JSON_HEDLEY_UNPREDICTABLE(expr) JSON_HEDLEY_PREDICT(expr, 1, 0.5)
1509 #endif
1510 
1511 #if defined(JSON_HEDLEY_MALLOC)
1512  #undef JSON_HEDLEY_MALLOC
1513 #endif
1514 #if \
1515  JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || \
1516  JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \
1517  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1518  JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1519  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1520  JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \
1521  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1522  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1523  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1524  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1525  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1526  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1527  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1528  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1529  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1530  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1531  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1532  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1533  #define JSON_HEDLEY_MALLOC __attribute__((__malloc__))
1534 #elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0)
1535  #define JSON_HEDLEY_MALLOC _Pragma("returns_new_memory")
1536 #elif \
1537  JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \
1538  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1539  #define JSON_HEDLEY_MALLOC __declspec(restrict)
1540 #else
1541  #define JSON_HEDLEY_MALLOC
1542 #endif
1543 
1544 #if defined(JSON_HEDLEY_PURE)
1545  #undef JSON_HEDLEY_PURE
1546 #endif
1547 #if \
1548  JSON_HEDLEY_HAS_ATTRIBUTE(pure) || \
1549  JSON_HEDLEY_GCC_VERSION_CHECK(2,96,0) || \
1550  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1551  JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1552  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1553  JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1554  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1555  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1556  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1557  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1558  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1559  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1560  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1561  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1562  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1563  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1564  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1565  JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \
1566  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1567 # define JSON_HEDLEY_PURE __attribute__((__pure__))
1568 #elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0)
1569 # define JSON_HEDLEY_PURE _Pragma("does_not_write_global_data")
1570 #elif defined(__cplusplus) && \
1571  ( \
1572  JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \
1573  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) || \
1574  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) \
1575  )
1576 # define JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;")
1577 #else
1578 # define JSON_HEDLEY_PURE
1579 #endif
1580 
1581 #if defined(JSON_HEDLEY_CONST)
1582  #undef JSON_HEDLEY_CONST
1583 #endif
1584 #if \
1585  JSON_HEDLEY_HAS_ATTRIBUTE(const) || \
1586  JSON_HEDLEY_GCC_VERSION_CHECK(2,5,0) || \
1587  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1588  JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1589  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1590  JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1591  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1592  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1593  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1594  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1595  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1596  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1597  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1598  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1599  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1600  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1601  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1602  JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \
1603  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1604  #define JSON_HEDLEY_CONST __attribute__((__const__))
1605 #elif \
1606  JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0)
1607  #define JSON_HEDLEY_CONST _Pragma("no_side_effect")
1608 #else
1609  #define JSON_HEDLEY_CONST JSON_HEDLEY_PURE
1610 #endif
1611 
1612 #if defined(JSON_HEDLEY_RESTRICT)
1613  #undef JSON_HEDLEY_RESTRICT
1614 #endif
1615 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus)
1616  #define JSON_HEDLEY_RESTRICT restrict
1617 #elif \
1618  JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \
1619  JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \
1620  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1621  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \
1622  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1623  JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1624  JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \
1625  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1626  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,4) || \
1627  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \
1628  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1629  (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \
1630  JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \
1631  defined(__clang__) || \
1632  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1633  #define JSON_HEDLEY_RESTRICT __restrict
1634 #elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus)
1635  #define JSON_HEDLEY_RESTRICT _Restrict
1636 #else
1637  #define JSON_HEDLEY_RESTRICT
1638 #endif
1639 
1640 #if defined(JSON_HEDLEY_INLINE)
1641  #undef JSON_HEDLEY_INLINE
1642 #endif
1643 #if \
1644  (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \
1645  (defined(__cplusplus) && (__cplusplus >= 199711L))
1646  #define JSON_HEDLEY_INLINE inline
1647 #elif \
1648  defined(JSON_HEDLEY_GCC_VERSION) || \
1649  JSON_HEDLEY_ARM_VERSION_CHECK(6,2,0)
1650  #define JSON_HEDLEY_INLINE __inline__
1651 #elif \
1652  JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \
1653  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \
1654  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1655  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,1,0) || \
1656  JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \
1657  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \
1658  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \
1659  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1660  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1661  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1662  #define JSON_HEDLEY_INLINE __inline
1663 #else
1664  #define JSON_HEDLEY_INLINE
1665 #endif
1666 
1667 #if defined(JSON_HEDLEY_ALWAYS_INLINE)
1668  #undef JSON_HEDLEY_ALWAYS_INLINE
1669 #endif
1670 #if \
1671  JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || \
1672  JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \
1673  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1674  JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1675  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1676  JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1677  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1678  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1679  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1680  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1681  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1682  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1683  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1684  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1685  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1686  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1687  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1688  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \
1689  JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0)
1690 # define JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) JSON_HEDLEY_INLINE
1691 #elif \
1692  JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \
1693  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1694 # define JSON_HEDLEY_ALWAYS_INLINE __forceinline
1695 #elif defined(__cplusplus) && \
1696  ( \
1697  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1698  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1699  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1700  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \
1701  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1702  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) \
1703  )
1704 # define JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;")
1705 #elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1706 # define JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced")
1707 #else
1708 # define JSON_HEDLEY_ALWAYS_INLINE JSON_HEDLEY_INLINE
1709 #endif
1710 
1711 #if defined(JSON_HEDLEY_NEVER_INLINE)
1712  #undef JSON_HEDLEY_NEVER_INLINE
1713 #endif
1714 #if \
1715  JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || \
1716  JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \
1717  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1718  JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1719  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1720  JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1721  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1722  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1723  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1724  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1725  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1726  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1727  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1728  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1729  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1730  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1731  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1732  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \
1733  JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0)
1734  #define JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__))
1735 #elif \
1736  JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \
1737  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1738  #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline)
1739 #elif JSON_HEDLEY_PGI_VERSION_CHECK(10,2,0)
1740  #define JSON_HEDLEY_NEVER_INLINE _Pragma("noinline")
1741 #elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus)
1742  #define JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;")
1743 #elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1744  #define JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never")
1745 #elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0)
1746  #define JSON_HEDLEY_NEVER_INLINE __attribute((noinline))
1747 #elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0)
1748  #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline)
1749 #else
1750  #define JSON_HEDLEY_NEVER_INLINE
1751 #endif
1752 
1753 #if defined(JSON_HEDLEY_PRIVATE)
1754  #undef JSON_HEDLEY_PRIVATE
1755 #endif
1756 #if defined(JSON_HEDLEY_PUBLIC)
1757  #undef JSON_HEDLEY_PUBLIC
1758 #endif
1759 #if defined(JSON_HEDLEY_IMPORT)
1760  #undef JSON_HEDLEY_IMPORT
1761 #endif
1762 #if defined(_WIN32) || defined(__CYGWIN__)
1763 # define JSON_HEDLEY_PRIVATE
1764 # define JSON_HEDLEY_PUBLIC __declspec(dllexport)
1765 # define JSON_HEDLEY_IMPORT __declspec(dllimport)
1766 #else
1767 # if \
1768  JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || \
1769  JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \
1770  JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1771  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1772  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1773  JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \
1774  ( \
1775  defined(__TI_EABI__) && \
1776  ( \
1777  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1778  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) \
1779  ) \
1780  ) || \
1781  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1782 # define JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden")))
1783 # define JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default")))
1784 # else
1785 # define JSON_HEDLEY_PRIVATE
1786 # define JSON_HEDLEY_PUBLIC
1787 # endif
1788 # define JSON_HEDLEY_IMPORT extern
1789 #endif
1790 
1791 #if defined(JSON_HEDLEY_NO_THROW)
1792  #undef JSON_HEDLEY_NO_THROW
1793 #endif
1794 #if \
1795  JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || \
1796  JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \
1797  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1798  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1799  #define JSON_HEDLEY_NO_THROW __attribute__((__nothrow__))
1800 #elif \
1801  JSON_HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \
1802  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \
1803  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0)
1804  #define JSON_HEDLEY_NO_THROW __declspec(nothrow)
1805 #else
1806  #define JSON_HEDLEY_NO_THROW
1807 #endif
1808 
1809 #if defined(JSON_HEDLEY_FALL_THROUGH)
1810  #undef JSON_HEDLEY_FALL_THROUGH
1811 #endif
1812 #if \
1813  JSON_HEDLEY_HAS_ATTRIBUTE(fallthrough) || \
1814  JSON_HEDLEY_GCC_VERSION_CHECK(7,0,0) || \
1815  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1816  #define JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__))
1817 #elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(clang,fallthrough)
1818  #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[clang::fallthrough]])
1819 #elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough)
1820  #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[fallthrough]])
1821 #elif defined(__fallthrough) /* SAL */
1822  #define JSON_HEDLEY_FALL_THROUGH __fallthrough
1823 #else
1824  #define JSON_HEDLEY_FALL_THROUGH
1825 #endif
1826 
1827 #if defined(JSON_HEDLEY_RETURNS_NON_NULL)
1828  #undef JSON_HEDLEY_RETURNS_NON_NULL
1829 #endif
1830 #if \
1831  JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \
1832  JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \
1833  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1834  #define JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__))
1835 #elif defined(_Ret_notnull_) /* SAL */
1836  #define JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_
1837 #else
1838  #define JSON_HEDLEY_RETURNS_NON_NULL
1839 #endif
1840 
1841 #if defined(JSON_HEDLEY_ARRAY_PARAM)
1842  #undef JSON_HEDLEY_ARRAY_PARAM
1843 #endif
1844 #if \
1845  defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
1846  !defined(__STDC_NO_VLA__) && \
1847  !defined(__cplusplus) && \
1848  !defined(JSON_HEDLEY_PGI_VERSION) && \
1849  !defined(JSON_HEDLEY_TINYC_VERSION)
1850  #define JSON_HEDLEY_ARRAY_PARAM(name) (name)
1851 #else
1852  #define JSON_HEDLEY_ARRAY_PARAM(name)
1853 #endif
1854 
1855 #if defined(JSON_HEDLEY_IS_CONSTANT)
1856  #undef JSON_HEDLEY_IS_CONSTANT
1857 #endif
1858 #if defined(JSON_HEDLEY_REQUIRE_CONSTEXPR)
1859  #undef JSON_HEDLEY_REQUIRE_CONSTEXPR
1860 #endif
1861 /* JSON_HEDLEY_IS_CONSTEXPR_ is for
1862  HEDLEY INTERNAL USE ONLY. API subject to change without notice. */
1863 #if defined(JSON_HEDLEY_IS_CONSTEXPR_)
1864  #undef JSON_HEDLEY_IS_CONSTEXPR_
1865 #endif
1866 #if \
1867  JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \
1868  JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \
1869  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1870  JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \
1871  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1872  JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \
1873  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \
1874  (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) && !defined(__cplusplus)) || \
1875  JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \
1876  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1877  #define JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr)
1878 #endif
1879 #if !defined(__cplusplus)
1880 # if \
1881  JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \
1882  JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \
1883  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1884  JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \
1885  JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \
1886  JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \
1887  JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,24)
1888 #if defined(__INTPTR_TYPE__)
1889  #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*)
1890 #else
1891  #include <stdint.h>
1892  #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*)
1893 #endif
1894 # elif \
1895  ( \
1896  defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && \
1897  !defined(JSON_HEDLEY_SUNPRO_VERSION) && \
1898  !defined(JSON_HEDLEY_PGI_VERSION) && \
1899  !defined(JSON_HEDLEY_IAR_VERSION)) || \
1900  (JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) && !defined(JSON_HEDLEY_IAR_VERSION)) || \
1901  JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \
1902  JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \
1903  JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \
1904  JSON_HEDLEY_ARM_VERSION_CHECK(5,3,0)
1905 #if defined(__INTPTR_TYPE__)
1906  #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0)
1907 #else
1908  #include <stdint.h>
1909  #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0)
1910 #endif
1911 # elif \
1912  defined(JSON_HEDLEY_GCC_VERSION) || \
1913  defined(JSON_HEDLEY_INTEL_VERSION) || \
1914  defined(JSON_HEDLEY_TINYC_VERSION) || \
1915  defined(JSON_HEDLEY_TI_ARMCL_VERSION) || \
1916  JSON_HEDLEY_TI_CL430_VERSION_CHECK(18,12,0) || \
1917  defined(JSON_HEDLEY_TI_CL2000_VERSION) || \
1918  defined(JSON_HEDLEY_TI_CL6X_VERSION) || \
1919  defined(JSON_HEDLEY_TI_CL7X_VERSION) || \
1920  defined(JSON_HEDLEY_TI_CLPRU_VERSION) || \
1921  defined(__clang__)
1922 # define JSON_HEDLEY_IS_CONSTEXPR_(expr) ( \
1923  sizeof(void) != \
1924  sizeof(*( \
1925  1 ? \
1926  ((void*) ((expr) * 0L) ) : \
1927 ((struct { char v[sizeof(void) * 2]; } *) 1) \
1928  ) \
1929  ) \
1930  )
1931 # endif
1932 #endif
1933 #if defined(JSON_HEDLEY_IS_CONSTEXPR_)
1934  #if !defined(JSON_HEDLEY_IS_CONSTANT)
1935  #define JSON_HEDLEY_IS_CONSTANT(expr) JSON_HEDLEY_IS_CONSTEXPR_(expr)
1936  #endif
1937  #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (JSON_HEDLEY_IS_CONSTEXPR_(expr) ? (expr) : (-1))
1938 #else
1939  #if !defined(JSON_HEDLEY_IS_CONSTANT)
1940  #define JSON_HEDLEY_IS_CONSTANT(expr) (0)
1941  #endif
1942  #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr)
1943 #endif
1944 
1945 #if defined(JSON_HEDLEY_BEGIN_C_DECLS)
1946  #undef JSON_HEDLEY_BEGIN_C_DECLS
1947 #endif
1948 #if defined(JSON_HEDLEY_END_C_DECLS)
1949  #undef JSON_HEDLEY_END_C_DECLS
1950 #endif
1951 #if defined(JSON_HEDLEY_C_DECL)
1952  #undef JSON_HEDLEY_C_DECL
1953 #endif
1954 #if defined(__cplusplus)
1955  #define JSON_HEDLEY_BEGIN_C_DECLS extern "C" {
1956  #define JSON_HEDLEY_END_C_DECLS }
1957  #define JSON_HEDLEY_C_DECL extern "C"
1958 #else
1959  #define JSON_HEDLEY_BEGIN_C_DECLS
1960  #define JSON_HEDLEY_END_C_DECLS
1961  #define JSON_HEDLEY_C_DECL
1962 #endif
1963 
1964 #if defined(JSON_HEDLEY_STATIC_ASSERT)
1965  #undef JSON_HEDLEY_STATIC_ASSERT
1966 #endif
1967 #if \
1968  !defined(__cplusplus) && ( \
1969  (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \
1970  (JSON_HEDLEY_HAS_FEATURE(c_static_assert) && !defined(JSON_HEDLEY_INTEL_CL_VERSION)) || \
1971  JSON_HEDLEY_GCC_VERSION_CHECK(6,0,0) || \
1972  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1973  defined(_Static_assert) \
1974  )
1975 # define JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message)
1976 #elif \
1977  (defined(__cplusplus) && (__cplusplus >= 201103L)) || \
1978  JSON_HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \
1979  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1980 # define JSON_HEDLEY_STATIC_ASSERT(expr, message) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(static_assert(expr, message))
1981 #else
1982 # define JSON_HEDLEY_STATIC_ASSERT(expr, message)
1983 #endif
1984 
1985 #if defined(JSON_HEDLEY_NULL)
1986  #undef JSON_HEDLEY_NULL
1987 #endif
1988 #if defined(__cplusplus)
1989  #if __cplusplus >= 201103L
1990  #define JSON_HEDLEY_NULL JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(nullptr)
1991  #elif defined(NULL)
1992  #define JSON_HEDLEY_NULL NULL
1993  #else
1994  #define JSON_HEDLEY_NULL JSON_HEDLEY_STATIC_CAST(void*, 0)
1995  #endif
1996 #elif defined(NULL)
1997  #define JSON_HEDLEY_NULL NULL
1998 #else
1999  #define JSON_HEDLEY_NULL ((void*) 0)
2000 #endif
2001 
2002 #if defined(JSON_HEDLEY_MESSAGE)
2003  #undef JSON_HEDLEY_MESSAGE
2004 #endif
2005 #if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas")
2006 # define JSON_HEDLEY_MESSAGE(msg) \
2007  JSON_HEDLEY_DIAGNOSTIC_PUSH \
2008  JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \
2009  JSON_HEDLEY_PRAGMA(message msg) \
2010  JSON_HEDLEY_DIAGNOSTIC_POP
2011 #elif \
2012  JSON_HEDLEY_GCC_VERSION_CHECK(4,4,0) || \
2013  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
2014 # define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message msg)
2015 #elif JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0)
2016 # define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(_CRI message msg)
2017 #elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
2018 # define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg))
2019 #elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,0,0)
2020 # define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg))
2021 #else
2022 # define JSON_HEDLEY_MESSAGE(msg)
2023 #endif
2024 
2025 #if defined(JSON_HEDLEY_WARNING)
2026  #undef JSON_HEDLEY_WARNING
2027 #endif
2028 #if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas")
2029 # define JSON_HEDLEY_WARNING(msg) \
2030  JSON_HEDLEY_DIAGNOSTIC_PUSH \
2031  JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \
2032  JSON_HEDLEY_PRAGMA(clang warning msg) \
2033  JSON_HEDLEY_DIAGNOSTIC_POP
2034 #elif \
2035  JSON_HEDLEY_GCC_VERSION_CHECK(4,8,0) || \
2036  JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \
2037  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
2038 # define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(GCC warning msg)
2039 #elif \
2040  JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \
2041  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
2042 # define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(message(msg))
2043 #else
2044 # define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_MESSAGE(msg)
2045 #endif
2046 
2047 #if defined(JSON_HEDLEY_REQUIRE)
2048  #undef JSON_HEDLEY_REQUIRE
2049 #endif
2050 #if defined(JSON_HEDLEY_REQUIRE_MSG)
2051  #undef JSON_HEDLEY_REQUIRE_MSG
2052 #endif
2053 #if JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if)
2054 # if JSON_HEDLEY_HAS_WARNING("-Wgcc-compat")
2055 # define JSON_HEDLEY_REQUIRE(expr) \
2056  JSON_HEDLEY_DIAGNOSTIC_PUSH \
2057  _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \
2058  __attribute__((diagnose_if(!(expr), #expr, "error"))) \
2059  JSON_HEDLEY_DIAGNOSTIC_POP
2060 # define JSON_HEDLEY_REQUIRE_MSG(expr,msg) \
2061  JSON_HEDLEY_DIAGNOSTIC_PUSH \
2062  _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \
2063  __attribute__((diagnose_if(!(expr), msg, "error"))) \
2064  JSON_HEDLEY_DIAGNOSTIC_POP
2065 # else
2066 # define JSON_HEDLEY_REQUIRE(expr) __attribute__((diagnose_if(!(expr), #expr, "error")))
2067 # define JSON_HEDLEY_REQUIRE_MSG(expr,msg) __attribute__((diagnose_if(!(expr), msg, "error")))
2068 # endif
2069 #else
2070 # define JSON_HEDLEY_REQUIRE(expr)
2071 # define JSON_HEDLEY_REQUIRE_MSG(expr,msg)
2072 #endif
2073 
2074 #if defined(JSON_HEDLEY_FLAGS)
2075  #undef JSON_HEDLEY_FLAGS
2076 #endif
2077 #if JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) && (!defined(__cplusplus) || JSON_HEDLEY_HAS_WARNING("-Wbitfield-enum-conversion"))
2078  #define JSON_HEDLEY_FLAGS __attribute__((__flag_enum__))
2079 #else
2080  #define JSON_HEDLEY_FLAGS
2081 #endif
2082 
2083 #if defined(JSON_HEDLEY_FLAGS_CAST)
2084  #undef JSON_HEDLEY_FLAGS_CAST
2085 #endif
2086 #if JSON_HEDLEY_INTEL_VERSION_CHECK(19,0,0)
2087 # define JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \
2088  JSON_HEDLEY_DIAGNOSTIC_PUSH \
2089  _Pragma("warning(disable:188)") \
2090  ((T) (expr)); \
2091  JSON_HEDLEY_DIAGNOSTIC_POP \
2092  }))
2093 #else
2094 # define JSON_HEDLEY_FLAGS_CAST(T, expr) JSON_HEDLEY_STATIC_CAST(T, expr)
2095 #endif
2096 
2097 #if defined(JSON_HEDLEY_EMPTY_BASES)
2098  #undef JSON_HEDLEY_EMPTY_BASES
2099 #endif
2100 #if \
2101  (JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,23918) && !JSON_HEDLEY_MSVC_VERSION_CHECK(20,0,0)) || \
2102  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
2103  #define JSON_HEDLEY_EMPTY_BASES __declspec(empty_bases)
2104 #else
2105  #define JSON_HEDLEY_EMPTY_BASES
2106 #endif
2107 
2108 /* Remaining macros are deprecated. */
2109 
2110 #if defined(JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK)
2111  #undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK
2112 #endif
2113 #if defined(__clang__)
2114  #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0)
2115 #else
2116  #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
2117 #endif
2118 
2119 #if defined(JSON_HEDLEY_CLANG_HAS_ATTRIBUTE)
2120  #undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE
2121 #endif
2122 #define JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_ATTRIBUTE(attribute)
2123 
2124 #if defined(JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE)
2125  #undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE
2126 #endif
2127 #define JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute)
2128 
2129 #if defined(JSON_HEDLEY_CLANG_HAS_BUILTIN)
2130  #undef JSON_HEDLEY_CLANG_HAS_BUILTIN
2131 #endif
2132 #define JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) JSON_HEDLEY_HAS_BUILTIN(builtin)
2133 
2134 #if defined(JSON_HEDLEY_CLANG_HAS_FEATURE)
2135  #undef JSON_HEDLEY_CLANG_HAS_FEATURE
2136 #endif
2137 #define JSON_HEDLEY_CLANG_HAS_FEATURE(feature) JSON_HEDLEY_HAS_FEATURE(feature)
2138 
2139 #if defined(JSON_HEDLEY_CLANG_HAS_EXTENSION)
2140  #undef JSON_HEDLEY_CLANG_HAS_EXTENSION
2141 #endif
2142 #define JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) JSON_HEDLEY_HAS_EXTENSION(extension)
2143 
2144 #if defined(JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE)
2145  #undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE
2146 #endif
2147 #define JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute)
2148 
2149 #if defined(JSON_HEDLEY_CLANG_HAS_WARNING)
2150  #undef JSON_HEDLEY_CLANG_HAS_WARNING
2151 #endif
2152 #define JSON_HEDLEY_CLANG_HAS_WARNING(warning) JSON_HEDLEY_HAS_WARNING(warning)
2153 
2154 #endif /* !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < X) */
2155 
2156 // #include <nlohmann/detail/meta/detected.hpp>
2157 
2158 
2159 #include <type_traits>
2160 
2161 // #include <nlohmann/detail/meta/void_t.hpp>
2162 
2163 
2164 namespace nlohmann
2165 {
2166 namespace detail
2167 {
2168 template<typename ...Ts> struct make_void
2169 {
2170  using type = void;
2171 };
2172 template<typename ...Ts> using void_t = typename make_void<Ts...>::type;
2173 } // namespace detail
2174 } // namespace nlohmann
2175 
2176 
2177 // https://en.cppreference.com/w/cpp/experimental/is_detected
2178 namespace nlohmann
2179 {
2180 namespace detail
2181 {
2182 struct nonesuch
2183 {
2184  nonesuch() = delete;
2185  ~nonesuch() = delete;
2186  nonesuch(nonesuch const&) = delete;
2187  nonesuch(nonesuch const&&) = delete;
2188  void operator=(nonesuch const&) = delete;
2189  void operator=(nonesuch&&) = delete;
2190 };
2191 
2192 template<class Default,
2193  class AlwaysVoid,
2194  template<class...> class Op,
2195  class... Args>
2196 struct detector
2197 {
2198  using value_t = std::false_type;
2199  using type = Default;
2200 };
2201 
2202 template<class Default, template<class...> class Op, class... Args>
2203 struct detector<Default, void_t<Op<Args...>>, Op, Args...>
2204 {
2205  using value_t = std::true_type;
2206  using type = Op<Args...>;
2207 };
2208 
2209 template<template<class...> class Op, class... Args>
2210 using is_detected = typename detector<nonesuch, void, Op, Args...>::value_t;
2211 
2212 template<template<class...> class Op, class... Args>
2213 struct is_detected_lazy : is_detected<Op, Args...> { };
2214 
2215 template<template<class...> class Op, class... Args>
2216 using detected_t = typename detector<nonesuch, void, Op, Args...>::type;
2217 
2218 template<class Default, template<class...> class Op, class... Args>
2219 using detected_or = detector<Default, void, Op, Args...>;
2220 
2221 template<class Default, template<class...> class Op, class... Args>
2222 using detected_or_t = typename detected_or<Default, Op, Args...>::type;
2223 
2224 template<class Expected, template<class...> class Op, class... Args>
2225 using is_detected_exact = std::is_same<Expected, detected_t<Op, Args...>>;
2226 
2227 template<class To, template<class...> class Op, class... Args>
2229  std::is_convertible<detected_t<Op, Args...>, To>;
2230 } // namespace detail
2231 } // namespace nlohmann
2232 
2233 
2234 // This file contains all internal macro definitions
2235 // You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them
2236 
2237 // exclude unsupported compilers
2238 #if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK)
2239  #if defined(__clang__)
2240  #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400
2241  #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers"
2242  #endif
2243  #elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER))
2244  #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800
2245  #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"
2246  #endif
2247  #endif
2248 #endif
2249 
2250 // C++ language standard detection
2251 // if the user manually specified the used c++ version this is skipped
2252 #if !defined(JSON_HAS_CPP_20) && !defined(JSON_HAS_CPP_17) && !defined(JSON_HAS_CPP_14) && !defined(JSON_HAS_CPP_11)
2253  #if (defined(__cplusplus) && __cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)
2254  #define JSON_HAS_CPP_20
2255  #define JSON_HAS_CPP_17
2256  #define JSON_HAS_CPP_14
2257  #elif (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464
2258  #define JSON_HAS_CPP_17
2259  #define JSON_HAS_CPP_14
2260  #elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1)
2261  #define JSON_HAS_CPP_14
2262  #endif
2263  // the cpp 11 flag is always specified because it is the minimal required version
2264  #define JSON_HAS_CPP_11
2265 #endif
2266 
2267 #ifdef __has_include
2268  #if __has_include(<version>)
2269  #include <version>
2270  #endif
2271 #endif
2272 
2273 #if !defined(JSON_HAS_FILESYSTEM) && !defined(JSON_HAS_EXPERIMENTAL_FILESYSTEM)
2274  #ifdef JSON_HAS_CPP_17
2275  #if defined(__cpp_lib_filesystem)
2276  #define JSON_HAS_FILESYSTEM 1
2277  #elif defined(__cpp_lib_experimental_filesystem)
2278  #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1
2279  #elif !defined(__has_include)
2280  #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1
2281  #elif __has_include(<filesystem>)
2282  #define JSON_HAS_FILESYSTEM 1
2283  #elif __has_include(<experimental/filesystem>)
2284  #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1
2285  #endif
2286 
2287  // std::filesystem does not work on MinGW GCC 8: https://sourceforge.net/p/mingw-w64/bugs/737/
2288  #if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ == 8
2289  #undef JSON_HAS_FILESYSTEM
2290  #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM
2291  #endif
2292 
2293  // no filesystem support before GCC 8: https://en.cppreference.com/w/cpp/compiler_support
2294  #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 8
2295  #undef JSON_HAS_FILESYSTEM
2296  #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM
2297  #endif
2298 
2299  // no filesystem support before Clang 7: https://en.cppreference.com/w/cpp/compiler_support
2300  #if defined(__clang_major__) && __clang_major__ < 7
2301  #undef JSON_HAS_FILESYSTEM
2302  #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM
2303  #endif
2304 
2305  // no filesystem support before MSVC 19.14: https://en.cppreference.com/w/cpp/compiler_support
2306  #if defined(_MSC_VER) && _MSC_VER < 1914
2307  #undef JSON_HAS_FILESYSTEM
2308  #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM
2309  #endif
2310 
2311  // no filesystem support before iOS 13
2312  #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 130000
2313  #undef JSON_HAS_FILESYSTEM
2314  #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM
2315  #endif
2316 
2317  // no filesystem support before macOS Catalina
2318  #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500
2319  #undef JSON_HAS_FILESYSTEM
2320  #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM
2321  #endif
2322  #endif
2323 #endif
2324 
2325 #ifndef JSON_HAS_EXPERIMENTAL_FILESYSTEM
2326  #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 0
2327 #endif
2328 
2329 #ifndef JSON_HAS_FILESYSTEM
2330  #define JSON_HAS_FILESYSTEM 0
2331 #endif
2332 
2333 #ifndef JSON_HAS_THREE_WAY_COMPARISON
2334  #if defined(__cpp_impl_three_way_comparison) && __cpp_impl_three_way_comparison >= 201907L \
2335  && defined(__cpp_lib_three_way_comparison) && __cpp_lib_three_way_comparison >= 201907L
2336  #define JSON_HAS_THREE_WAY_COMPARISON 1
2337  #else
2338  #define JSON_HAS_THREE_WAY_COMPARISON 0
2339  #endif
2340 #endif
2341 
2342 #ifndef JSON_HAS_RANGES
2343  // ranges header shipping in GCC 11.1.0 (released 2021-04-27) has syntax error
2344  #if defined(__GLIBCXX__) && __GLIBCXX__ == 20210427
2345  #define JSON_HAS_RANGES 0
2346  #elif defined(__cpp_lib_ranges)
2347  #define JSON_HAS_RANGES 1
2348  #else
2349  #define JSON_HAS_RANGES 0
2350  #endif
2351 #endif
2352 
2353 #ifdef JSON_HAS_CPP_17
2354  #define JSON_INLINE_VARIABLE inline
2355 #else
2356  #define JSON_INLINE_VARIABLE
2357 #endif
2358 
2359 #if JSON_HEDLEY_HAS_ATTRIBUTE(no_unique_address)
2360  #define JSON_NO_UNIQUE_ADDRESS [[no_unique_address]]
2361 #else
2362  #define JSON_NO_UNIQUE_ADDRESS
2363 #endif
2364 
2365 // disable documentation warnings on clang
2366 #if defined(__clang__)
2367  #pragma clang diagnostic push
2368  #pragma clang diagnostic ignored "-Wdocumentation"
2369  #pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
2370 #endif
2371 
2372 // allow disabling exceptions
2373 #if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION)
2374  #define JSON_THROW(exception) throw exception
2375  #define JSON_TRY try
2376  #define JSON_CATCH(exception) catch(exception)
2377  #define JSON_INTERNAL_CATCH(exception) catch(exception)
2378 #else
2379  #include <cstdlib>
2380  #define JSON_THROW(exception) std::abort()
2381  #define JSON_TRY if(true)
2382  #define JSON_CATCH(exception) if(false)
2383  #define JSON_INTERNAL_CATCH(exception) if(false)
2384 #endif
2385 
2386 // override exception macros
2387 #if defined(JSON_THROW_USER)
2388  #undef JSON_THROW
2389  #define JSON_THROW JSON_THROW_USER
2390 #endif
2391 #if defined(JSON_TRY_USER)
2392  #undef JSON_TRY
2393  #define JSON_TRY JSON_TRY_USER
2394 #endif
2395 #if defined(JSON_CATCH_USER)
2396  #undef JSON_CATCH
2397  #define JSON_CATCH JSON_CATCH_USER
2398  #undef JSON_INTERNAL_CATCH
2399  #define JSON_INTERNAL_CATCH JSON_CATCH_USER
2400 #endif
2401 #if defined(JSON_INTERNAL_CATCH_USER)
2402  #undef JSON_INTERNAL_CATCH
2403  #define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER
2404 #endif
2405 
2406 // allow overriding assert
2407 #if !defined(JSON_ASSERT)
2408  #include <cassert> // assert
2409  #define JSON_ASSERT(x) assert(x)
2410 #endif
2411 
2412 // allow to access some private functions (needed by the test suite)
2413 #if defined(JSON_TESTS_PRIVATE)
2414  #define JSON_PRIVATE_UNLESS_TESTED public
2415 #else
2416  #define JSON_PRIVATE_UNLESS_TESTED private
2417 #endif
2418 
2424 #define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \
2425  template<typename BasicJsonType> \
2426  inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \
2427  { \
2428  static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \
2429  static const std::pair<ENUM_TYPE, BasicJsonType> m[] = __VA_ARGS__; \
2430  auto it = std::find_if(std::begin(m), std::end(m), \
2431  [e](const std::pair<ENUM_TYPE, BasicJsonType>& ej_pair) -> bool \
2432  { \
2433  return ej_pair.first == e; \
2434  }); \
2435  j = ((it != std::end(m)) ? it : std::begin(m))->second; \
2436  } \
2437  template<typename BasicJsonType> \
2438  inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \
2439  { \
2440  static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \
2441  static const std::pair<ENUM_TYPE, BasicJsonType> m[] = __VA_ARGS__; \
2442  auto it = std::find_if(std::begin(m), std::end(m), \
2443  [&j](const std::pair<ENUM_TYPE, BasicJsonType>& ej_pair) -> bool \
2444  { \
2445  return ej_pair.second == j; \
2446  }); \
2447  e = ((it != std::end(m)) ? it : std::begin(m))->first; \
2448  }
2449 
2450 // Ugly macros to avoid uglier copy-paste when specializing basic_json. They
2451 // may be removed in the future once the class is split.
2452 
2453 #define NLOHMANN_BASIC_JSON_TPL_DECLARATION \
2454  template<template<typename, typename, typename...> class ObjectType, \
2455  template<typename, typename...> class ArrayType, \
2456  class StringType, class BooleanType, class NumberIntegerType, \
2457  class NumberUnsignedType, class NumberFloatType, \
2458  template<typename> class AllocatorType, \
2459  template<typename, typename = void> class JSONSerializer, \
2460  class BinaryType>
2461 
2462 #define NLOHMANN_BASIC_JSON_TPL \
2463  basic_json<ObjectType, ArrayType, StringType, BooleanType, \
2464  NumberIntegerType, NumberUnsignedType, NumberFloatType, \
2465  AllocatorType, JSONSerializer, BinaryType>
2466 
2467 // Macros to simplify conversion from/to types
2468 
2469 #define NLOHMANN_JSON_EXPAND( x ) x
2470 #define NLOHMANN_JSON_GET_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, NAME,...) NAME
2471 #define NLOHMANN_JSON_PASTE(...) NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_GET_MACRO(__VA_ARGS__, \
2472  NLOHMANN_JSON_PASTE64, \
2473  NLOHMANN_JSON_PASTE63, \
2474  NLOHMANN_JSON_PASTE62, \
2475  NLOHMANN_JSON_PASTE61, \
2476  NLOHMANN_JSON_PASTE60, \
2477  NLOHMANN_JSON_PASTE59, \
2478  NLOHMANN_JSON_PASTE58, \
2479  NLOHMANN_JSON_PASTE57, \
2480  NLOHMANN_JSON_PASTE56, \
2481  NLOHMANN_JSON_PASTE55, \
2482  NLOHMANN_JSON_PASTE54, \
2483  NLOHMANN_JSON_PASTE53, \
2484  NLOHMANN_JSON_PASTE52, \
2485  NLOHMANN_JSON_PASTE51, \
2486  NLOHMANN_JSON_PASTE50, \
2487  NLOHMANN_JSON_PASTE49, \
2488  NLOHMANN_JSON_PASTE48, \
2489  NLOHMANN_JSON_PASTE47, \
2490  NLOHMANN_JSON_PASTE46, \
2491  NLOHMANN_JSON_PASTE45, \
2492  NLOHMANN_JSON_PASTE44, \
2493  NLOHMANN_JSON_PASTE43, \
2494  NLOHMANN_JSON_PASTE42, \
2495  NLOHMANN_JSON_PASTE41, \
2496  NLOHMANN_JSON_PASTE40, \
2497  NLOHMANN_JSON_PASTE39, \
2498  NLOHMANN_JSON_PASTE38, \
2499  NLOHMANN_JSON_PASTE37, \
2500  NLOHMANN_JSON_PASTE36, \
2501  NLOHMANN_JSON_PASTE35, \
2502  NLOHMANN_JSON_PASTE34, \
2503  NLOHMANN_JSON_PASTE33, \
2504  NLOHMANN_JSON_PASTE32, \
2505  NLOHMANN_JSON_PASTE31, \
2506  NLOHMANN_JSON_PASTE30, \
2507  NLOHMANN_JSON_PASTE29, \
2508  NLOHMANN_JSON_PASTE28, \
2509  NLOHMANN_JSON_PASTE27, \
2510  NLOHMANN_JSON_PASTE26, \
2511  NLOHMANN_JSON_PASTE25, \
2512  NLOHMANN_JSON_PASTE24, \
2513  NLOHMANN_JSON_PASTE23, \
2514  NLOHMANN_JSON_PASTE22, \
2515  NLOHMANN_JSON_PASTE21, \
2516  NLOHMANN_JSON_PASTE20, \
2517  NLOHMANN_JSON_PASTE19, \
2518  NLOHMANN_JSON_PASTE18, \
2519  NLOHMANN_JSON_PASTE17, \
2520  NLOHMANN_JSON_PASTE16, \
2521  NLOHMANN_JSON_PASTE15, \
2522  NLOHMANN_JSON_PASTE14, \
2523  NLOHMANN_JSON_PASTE13, \
2524  NLOHMANN_JSON_PASTE12, \
2525  NLOHMANN_JSON_PASTE11, \
2526  NLOHMANN_JSON_PASTE10, \
2527  NLOHMANN_JSON_PASTE9, \
2528  NLOHMANN_JSON_PASTE8, \
2529  NLOHMANN_JSON_PASTE7, \
2530  NLOHMANN_JSON_PASTE6, \
2531  NLOHMANN_JSON_PASTE5, \
2532  NLOHMANN_JSON_PASTE4, \
2533  NLOHMANN_JSON_PASTE3, \
2534  NLOHMANN_JSON_PASTE2, \
2535  NLOHMANN_JSON_PASTE1)(__VA_ARGS__))
2536 #define NLOHMANN_JSON_PASTE2(func, v1) func(v1)
2537 #define NLOHMANN_JSON_PASTE3(func, v1, v2) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE2(func, v2)
2538 #define NLOHMANN_JSON_PASTE4(func, v1, v2, v3) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE3(func, v2, v3)
2539 #define NLOHMANN_JSON_PASTE5(func, v1, v2, v3, v4) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE4(func, v2, v3, v4)
2540 #define NLOHMANN_JSON_PASTE6(func, v1, v2, v3, v4, v5) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE5(func, v2, v3, v4, v5)
2541 #define NLOHMANN_JSON_PASTE7(func, v1, v2, v3, v4, v5, v6) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE6(func, v2, v3, v4, v5, v6)
2542 #define NLOHMANN_JSON_PASTE8(func, v1, v2, v3, v4, v5, v6, v7) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE7(func, v2, v3, v4, v5, v6, v7)
2543 #define NLOHMANN_JSON_PASTE9(func, v1, v2, v3, v4, v5, v6, v7, v8) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE8(func, v2, v3, v4, v5, v6, v7, v8)
2544 #define NLOHMANN_JSON_PASTE10(func, v1, v2, v3, v4, v5, v6, v7, v8, v9) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE9(func, v2, v3, v4, v5, v6, v7, v8, v9)
2545 #define NLOHMANN_JSON_PASTE11(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE10(func, v2, v3, v4, v5, v6, v7, v8, v9, v10)
2546 #define NLOHMANN_JSON_PASTE12(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE11(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)
2547 #define NLOHMANN_JSON_PASTE13(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE12(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12)
2548 #define NLOHMANN_JSON_PASTE14(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE13(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13)
2549 #define NLOHMANN_JSON_PASTE15(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE14(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14)
2550 #define NLOHMANN_JSON_PASTE16(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE15(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15)
2551 #define NLOHMANN_JSON_PASTE17(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE16(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16)
2552 #define NLOHMANN_JSON_PASTE18(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE17(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17)
2553 #define NLOHMANN_JSON_PASTE19(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE18(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18)
2554 #define NLOHMANN_JSON_PASTE20(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE19(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19)
2555 #define NLOHMANN_JSON_PASTE21(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE20(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20)
2556 #define NLOHMANN_JSON_PASTE22(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE21(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21)
2557 #define NLOHMANN_JSON_PASTE23(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE22(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22)
2558 #define NLOHMANN_JSON_PASTE24(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE23(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23)
2559 #define NLOHMANN_JSON_PASTE25(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE24(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24)
2560 #define NLOHMANN_JSON_PASTE26(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE25(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25)
2561 #define NLOHMANN_JSON_PASTE27(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE26(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26)
2562 #define NLOHMANN_JSON_PASTE28(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE27(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27)
2563 #define NLOHMANN_JSON_PASTE29(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE28(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28)
2564 #define NLOHMANN_JSON_PASTE30(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE29(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29)
2565 #define NLOHMANN_JSON_PASTE31(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE30(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30)
2566 #define NLOHMANN_JSON_PASTE32(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE31(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31)
2567 #define NLOHMANN_JSON_PASTE33(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE32(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32)
2568 #define NLOHMANN_JSON_PASTE34(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE33(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33)
2569 #define NLOHMANN_JSON_PASTE35(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE34(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34)
2570 #define NLOHMANN_JSON_PASTE36(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE35(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35)
2571 #define NLOHMANN_JSON_PASTE37(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE36(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36)
2572 #define NLOHMANN_JSON_PASTE38(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE37(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37)
2573 #define NLOHMANN_JSON_PASTE39(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE38(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38)
2574 #define NLOHMANN_JSON_PASTE40(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE39(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39)
2575 #define NLOHMANN_JSON_PASTE41(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE40(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40)
2576 #define NLOHMANN_JSON_PASTE42(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE41(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41)
2577 #define NLOHMANN_JSON_PASTE43(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE42(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42)
2578 #define NLOHMANN_JSON_PASTE44(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE43(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43)
2579 #define NLOHMANN_JSON_PASTE45(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE44(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44)
2580 #define NLOHMANN_JSON_PASTE46(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE45(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45)
2581 #define NLOHMANN_JSON_PASTE47(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE46(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46)
2582 #define NLOHMANN_JSON_PASTE48(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE47(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47)
2583 #define NLOHMANN_JSON_PASTE49(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE48(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48)
2584 #define NLOHMANN_JSON_PASTE50(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE49(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49)
2585 #define NLOHMANN_JSON_PASTE51(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE50(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50)
2586 #define NLOHMANN_JSON_PASTE52(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE51(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51)
2587 #define NLOHMANN_JSON_PASTE53(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE52(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52)
2588 #define NLOHMANN_JSON_PASTE54(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE53(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53)
2589 #define NLOHMANN_JSON_PASTE55(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE54(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54)
2590 #define NLOHMANN_JSON_PASTE56(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE55(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55)
2591 #define NLOHMANN_JSON_PASTE57(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE56(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56)
2592 #define NLOHMANN_JSON_PASTE58(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE57(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57)
2593 #define NLOHMANN_JSON_PASTE59(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE58(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58)
2594 #define NLOHMANN_JSON_PASTE60(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE59(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59)
2595 #define NLOHMANN_JSON_PASTE61(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE60(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60)
2596 #define NLOHMANN_JSON_PASTE62(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE61(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61)
2597 #define NLOHMANN_JSON_PASTE63(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE62(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62)
2598 #define NLOHMANN_JSON_PASTE64(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE63(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63)
2599 
2600 #define NLOHMANN_JSON_TO(v1) nlohmann_json_j[#v1] = nlohmann_json_t.v1;
2601 #define NLOHMANN_JSON_FROM(v1) nlohmann_json_j.at(#v1).get_to(nlohmann_json_t.v1);
2602 #define NLOHMANN_JSON_FROM_WITH_DEFAULT(v1) nlohmann_json_t.v1 = nlohmann_json_j.value(#v1, nlohmann_json_default_obj.v1);
2603 
2609 #define NLOHMANN_DEFINE_TYPE_INTRUSIVE(Type, ...) \
2610  friend void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \
2611  friend void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) }
2612 
2613 #define NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(Type, ...) \
2614  friend void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \
2615  friend void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { Type nlohmann_json_default_obj; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) }
2616 
2622 #define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Type, ...) \
2623  inline void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \
2624  inline void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) }
2625 
2626 #define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(Type, ...) \
2627  inline void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \
2628  inline void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { Type nlohmann_json_default_obj; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) }
2629 
2630 
2631 // inspired from https://stackoverflow.com/a/26745591
2632 // allows to call any std function as if (e.g. with begin):
2633 // using std::begin; begin(x);
2634 //
2635 // it allows using the detected idiom to retrieve the return type
2636 // of such an expression
2637 #define NLOHMANN_CAN_CALL_STD_FUNC_IMPL(std_name) \
2638  namespace detail { \
2639  using std::std_name; \
2640  \
2641  template<typename... T> \
2642  using result_of_##std_name = decltype(std_name(std::declval<T>()...)); \
2643  } \
2644  \
2645  namespace detail2 { \
2646  struct std_name##_tag \
2647  { \
2648  }; \
2649  \
2650  template<typename... T> \
2651  std_name##_tag std_name(T&&...); \
2652  \
2653  template<typename... T> \
2654  using result_of_##std_name = decltype(std_name(std::declval<T>()...)); \
2655  \
2656  template<typename... T> \
2657  struct would_call_std_##std_name \
2658  { \
2659  static constexpr auto const value = ::nlohmann::detail:: \
2660  is_detected_exact<std_name##_tag, result_of_##std_name, T...>::value; \
2661  }; \
2662  } /* namespace detail2 */ \
2663  \
2664  template<typename... T> \
2665  struct would_call_std_##std_name : detail2::would_call_std_##std_name<T...> \
2666  { \
2667  }
2668 
2669 #ifndef JSON_USE_IMPLICIT_CONVERSIONS
2670  #define JSON_USE_IMPLICIT_CONVERSIONS 1
2671 #endif
2672 
2673 #if JSON_USE_IMPLICIT_CONVERSIONS
2674  #define JSON_EXPLICIT
2675 #else
2676  #define JSON_EXPLICIT explicit
2677 #endif
2678 
2679 #ifndef JSON_DIAGNOSTICS
2680  #define JSON_DIAGNOSTICS 0
2681 #endif
2682 
2683 #ifndef JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON
2684  #define JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 0
2685 #endif
2686 
2687 #ifndef JSON_DISABLE_ENUM_SERIALIZATION
2688  #define JSON_DISABLE_ENUM_SERIALIZATION 0
2689 #endif
2690 
2691 #if JSON_HAS_THREE_WAY_COMPARISON
2692  #include <compare> // partial_ordering
2693 #endif
2694 
2695 namespace nlohmann
2696 {
2697 namespace detail
2698 {
2700 // JSON type enumeration //
2702 
2727 enum class value_t : std::uint8_t
2728 {
2729  null,
2730  object,
2731  array,
2732  string,
2733  boolean,
2734  number_integer,
2735  number_unsigned,
2736  number_float,
2737  binary,
2738  discarded
2739 };
2740 
2754 #if JSON_HAS_THREE_WAY_COMPARISON
2755  inline std::partial_ordering operator<=>(const value_t lhs, const value_t rhs) noexcept // *NOPAD*
2756 #else
2757  inline bool operator<(const value_t lhs, const value_t rhs) noexcept
2758 #endif
2759 {
2760  static constexpr std::array<std::uint8_t, 9> order = {{
2761  0 /* null */, 3 /* object */, 4 /* array */, 5 /* string */,
2762  1 /* boolean */, 2 /* integer */, 2 /* unsigned */, 2 /* float */,
2763  6 /* binary */
2764  }
2765  };
2766 
2767  const auto l_index = static_cast<std::size_t>(lhs);
2768  const auto r_index = static_cast<std::size_t>(rhs);
2769 #if JSON_HAS_THREE_WAY_COMPARISON
2770  if (l_index < order.size() && r_index < order.size())
2771  {
2772  return order[l_index] <=> order[r_index]; // *NOPAD*
2773  }
2774  return std::partial_ordering::unordered;
2775 #else
2776  return l_index < order.size() && r_index < order.size() && order[l_index] < order[r_index];
2777 #endif
2778 }
2779 
2780 // GCC selects the built-in operator< over an operator rewritten from
2781 // a user-defined spaceship operator
2782 // Clang, MSVC, and ICC select the rewritten candidate
2783 // (see GCC bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105200)
2784 #if JSON_HAS_THREE_WAY_COMPARISON && defined(__GNUC__)
2785 inline bool operator<(const value_t lhs, const value_t rhs) noexcept
2786 {
2787  return std::is_lt(lhs <=> rhs); // *NOPAD*
2788 }
2789 #endif
2790 } // namespace detail
2791 } // namespace nlohmann
2792 
2793 // #include <nlohmann/detail/string_escape.hpp>
2794 
2795 
2796 // #include <nlohmann/detail/macro_scope.hpp>
2797 
2798 
2799 namespace nlohmann
2800 {
2801 namespace detail
2802 {
2803 
2817 template<typename StringType>
2818 inline void replace_substring(StringType& s, const StringType& f,
2819  const StringType& t)
2820 {
2821  JSON_ASSERT(!f.empty());
2822  for (auto pos = s.find(f); // find first occurrence of f
2823  pos != StringType::npos; // make sure f was found
2824  s.replace(pos, f.size(), t), // replace with t, and
2825  pos = s.find(f, pos + t.size())) // find next occurrence of f
2826  {}
2827 }
2828 
2836 template<typename StringType>
2837 inline StringType escape(StringType s)
2838 {
2839  replace_substring(s, StringType{"~"}, StringType{"~0"});
2840  replace_substring(s, StringType{"/"}, StringType{"~1"});
2841  return s;
2842 }
2843 
2851 template<typename StringType>
2852 static void unescape(StringType& s)
2853 {
2854  replace_substring(s, StringType{"~1"}, StringType{"/"});
2855  replace_substring(s, StringType{"~0"}, StringType{"~"});
2856 }
2857 
2858 } // namespace detail
2859 } // namespace nlohmann
2860 
2861 // #include <nlohmann/detail/input/position_t.hpp>
2862 
2863 
2864 #include <cstddef> // size_t
2865 
2866 namespace nlohmann
2867 {
2868 namespace detail
2869 {
2872 {
2874  std::size_t chars_read_total = 0;
2876  std::size_t chars_read_current_line = 0;
2878  std::size_t lines_read = 0;
2879 
2881  constexpr operator size_t() const
2882  {
2883  return chars_read_total;
2884  }
2885 };
2886 
2887 } // namespace detail
2888 } // namespace nlohmann
2889 
2890 // #include <nlohmann/detail/macro_scope.hpp>
2891 
2892 // #include <nlohmann/detail/meta/cpp_future.hpp>
2893 
2894 
2895 #include <cstddef> // size_t
2896 #include <type_traits> // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type
2897 #include <utility> // index_sequence, make_index_sequence, index_sequence_for
2898 
2899 // #include <nlohmann/detail/macro_scope.hpp>
2900 
2901 
2902 namespace nlohmann
2903 {
2904 namespace detail
2905 {
2906 
2907 template<typename T>
2909 
2910 #ifdef JSON_HAS_CPP_14
2911 
2912 // the following utilities are natively available in C++14
2913 using std::enable_if_t;
2914 using std::index_sequence;
2917 
2918 #else
2919 
2920 // alias templates to reduce boilerplate
2921 template<bool B, typename T = void>
2923 
2924 // The following code is taken from https://github.com/abseil/abseil-cpp/blob/10cb35e459f5ecca5b2ff107635da0bfa41011b4/absl/utility/utility.h
2925 // which is part of Google Abseil (https://github.com/abseil/abseil-cpp), licensed under the Apache License 2.0.
2926 
2928 
2929 // integer_sequence
2930 //
2931 // Class template representing a compile-time integer sequence. An instantiation
2932 // of `integer_sequence<T, Ints...>` has a sequence of integers encoded in its
2933 // type through its template arguments (which is a common need when
2934 // working with C++11 variadic templates). `absl::integer_sequence` is designed
2935 // to be a drop-in replacement for C++14's `std::integer_sequence`.
2936 //
2937 // Example:
2938 //
2939 // template< class T, T... Ints >
2940 // void user_function(integer_sequence<T, Ints...>);
2941 //
2942 // int main()
2943 // {
2944 // // user_function's `T` will be deduced to `int` and `Ints...`
2945 // // will be deduced to `0, 1, 2, 3, 4`.
2946 // user_function(make_integer_sequence<int, 5>());
2947 // }
2948 template <typename T, T... Ints>
2950 {
2951  using value_type = T;
2952  static constexpr std::size_t size() noexcept
2953  {
2954  return sizeof...(Ints);
2955  }
2956 };
2957 
2958 // index_sequence
2959 //
2960 // A helper template for an `integer_sequence` of `size_t`,
2961 // `absl::index_sequence` is designed to be a drop-in replacement for C++14's
2962 // `std::index_sequence`.
2963 template <size_t... Ints>
2964 using index_sequence = integer_sequence<size_t, Ints...>;
2965 
2966 namespace utility_internal
2967 {
2968 
2969 template <typename Seq, size_t SeqSize, size_t Rem>
2970 struct Extend;
2971 
2972 // Note that SeqSize == sizeof...(Ints). It's passed explicitly for efficiency.
2973 template <typename T, T... Ints, size_t SeqSize>
2974 struct Extend<integer_sequence<T, Ints...>, SeqSize, 0>
2975 {
2976  using type = integer_sequence < T, Ints..., (Ints + SeqSize)... >;
2977 };
2978 
2979 template <typename T, T... Ints, size_t SeqSize>
2980 struct Extend<integer_sequence<T, Ints...>, SeqSize, 1>
2981 {
2982  using type = integer_sequence < T, Ints..., (Ints + SeqSize)..., 2 * SeqSize >;
2983 };
2984 
2985 // Recursion helper for 'make_integer_sequence<T, N>'.
2986 // 'Gen<T, N>::type' is an alias for 'integer_sequence<T, 0, 1, ... N-1>'.
2987 template <typename T, size_t N>
2988 struct Gen
2989 {
2990  using type =
2991  typename Extend < typename Gen < T, N / 2 >::type, N / 2, N % 2 >::type;
2992 };
2993 
2994 template <typename T>
2995 struct Gen<T, 0>
2996 {
2998 };
2999 
3000 } // namespace utility_internal
3001 
3002 // Compile-time sequences of integers
3003 
3004 // make_integer_sequence
3005 //
3006 // This template alias is equivalent to
3007 // `integer_sequence<int, 0, 1, ..., N-1>`, and is designed to be a drop-in
3008 // replacement for C++14's `std::make_integer_sequence`.
3009 template <typename T, T N>
3011 
3012 // make_index_sequence
3013 //
3014 // This template alias is equivalent to `index_sequence<0, 1, ..., N-1>`,
3015 // and is designed to be a drop-in replacement for C++14's
3016 // `std::make_index_sequence`.
3017 template <size_t N>
3019 
3020 // index_sequence_for
3021 //
3022 // Converts a typename pack into an index sequence of the same length, and
3023 // is designed to be a drop-in replacement for C++14's
3024 // `std::index_sequence_for()`
3025 template <typename... Ts>
3027 
3029 
3030 #endif
3031 
3032 // dispatch utility (taken from ranges-v3)
3033 template<unsigned N> struct priority_tag : priority_tag < N - 1 > {};
3034 template<> struct priority_tag<0> {};
3035 
3036 // taken from ranges-v3
3037 template<typename T>
3039 {
3040  static constexpr T value{};
3041 };
3042 
3043 #ifndef JSON_HAS_CPP_17
3044 
3045  template<typename T>
3046  constexpr T static_const<T>::value; // NOLINT(readability-redundant-declaration)
3047 
3048 #endif
3049 
3050 } // namespace detail
3051 } // namespace nlohmann
3052 
3053 // #include <nlohmann/detail/meta/type_traits.hpp>
3054 
3055 
3056 #include <limits> // numeric_limits
3057 #include <type_traits> // false_type, is_constructible, is_integral, is_same, true_type
3058 #include <utility> // declval
3059 #include <tuple> // tuple
3060 
3061 // #include <nlohmann/detail/macro_scope.hpp>
3062 
3063 
3064 // #include <nlohmann/detail/iterators/iterator_traits.hpp>
3065 
3066 
3067 #include <iterator> // random_access_iterator_tag
3068 
3069 // #include <nlohmann/detail/meta/void_t.hpp>
3070 
3071 // #include <nlohmann/detail/meta/cpp_future.hpp>
3072 
3073 
3074 namespace nlohmann
3075 {
3076 namespace detail
3077 {
3078 template<typename It, typename = void>
3079 struct iterator_types {};
3080 
3081 template<typename It>
3083  It,
3084  void_t<typename It::difference_type, typename It::value_type, typename It::pointer,
3085  typename It::reference, typename It::iterator_category >>
3086 {
3087  using difference_type = typename It::difference_type;
3088  using value_type = typename It::value_type;
3089  using pointer = typename It::pointer;
3090  using reference = typename It::reference;
3091  using iterator_category = typename It::iterator_category;
3092 };
3093 
3094 // This is required as some compilers implement std::iterator_traits in a way that
3095 // doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341.
3096 template<typename T, typename = void>
3098 {
3099 };
3100 
3101 template<typename T>
3102 struct iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >>
3103  : iterator_types<T>
3104 {
3105 };
3106 
3107 template<typename T>
3109 {
3110  using iterator_category = std::random_access_iterator_tag;
3111  using value_type = T;
3112  using difference_type = ptrdiff_t;
3113  using pointer = T*;
3114  using reference = T&;
3115 };
3116 } // namespace detail
3117 } // namespace nlohmann
3118 
3119 // #include <nlohmann/detail/meta/call_std/begin.hpp>
3120 
3121 
3122 // #include <nlohmann/detail/macro_scope.hpp>
3123 
3124 
3125 namespace nlohmann
3126 {
3128 } // namespace nlohmann
3129 
3130 // #include <nlohmann/detail/meta/call_std/end.hpp>
3131 
3132 
3133 // #include <nlohmann/detail/macro_scope.hpp>
3134 
3135 
3136 namespace nlohmann
3137 {
3139 } // namespace nlohmann
3140 
3141 // #include <nlohmann/detail/meta/cpp_future.hpp>
3142 
3143 // #include <nlohmann/detail/meta/detected.hpp>
3144 
3145 // #include <nlohmann/json_fwd.hpp>
3146 #ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_
3147 #define INCLUDE_NLOHMANN_JSON_FWD_HPP_
3148 
3149 #include <cstdint> // int64_t, uint64_t
3150 #include <map> // map
3151 #include <memory> // allocator
3152 #include <string> // string
3153 #include <vector> // vector
3154 
3160 namespace nlohmann
3161 {
3169 template<typename T = void, typename SFINAE = void>
3170 struct adl_serializer;
3171 
3174 template<template<typename U, typename V, typename... Args> class ObjectType =
3175  std::map,
3176  template<typename U, typename... Args> class ArrayType = std::vector,
3177  class StringType = std::string, class BooleanType = bool,
3178  class NumberIntegerType = std::int64_t,
3179  class NumberUnsignedType = std::uint64_t,
3180  class NumberFloatType = double,
3181  template<typename U> class AllocatorType = std::allocator,
3182  template<typename T, typename SFINAE = void> class JSONSerializer =
3183  adl_serializer,
3184  class BinaryType = std::vector<std::uint8_t>>
3185 class basic_json;
3186 
3189 template<typename BasicJsonType>
3190 class json_pointer;
3191 
3197 
3200 template<class Key, class T, class IgnoredLess, class Allocator>
3201 struct ordered_map;
3202 
3206 
3207 } // namespace nlohmann
3208 
3209 #endif // INCLUDE_NLOHMANN_JSON_FWD_HPP_
3210 
3211 
3212 namespace nlohmann
3213 {
3222 namespace detail
3223 {
3225 // helpers //
3227 
3228 // Note to maintainers:
3229 //
3230 // Every trait in this file expects a non CV-qualified type.
3231 // The only exceptions are in the 'aliases for detected' section
3232 // (i.e. those of the form: decltype(T::member_function(std::declval<T>())))
3233 //
3234 // In this case, T has to be properly CV-qualified to constraint the function arguments
3235 // (e.g. to_json(BasicJsonType&, const T&))
3236 
3237 template<typename> struct is_basic_json : std::false_type {};
3238 
3240 struct is_basic_json<NLOHMANN_BASIC_JSON_TPL> : std::true_type {};
3241 
3242 // used by exceptions create() member functions
3243 // true_type for pointer to possibly cv-qualified basic_json or std::nullptr_t
3244 // false_type otherwise
3245 template<typename BasicJsonContext>
3247  std::integral_constant < bool,
3248  is_basic_json<typename std::remove_cv<typename std::remove_pointer<BasicJsonContext>::type>::type>::value
3249  || std::is_same<BasicJsonContext, std::nullptr_t>::value >
3250 {};
3251 
3253 // json_ref helpers //
3255 
3256 template<typename>
3257 class json_ref;
3258 
3259 template<typename>
3260 struct is_json_ref : std::false_type {};
3261 
3262 template<typename T>
3263 struct is_json_ref<json_ref<T>> : std::true_type {};
3264 
3266 // aliases for detected //
3268 
3269 template<typename T>
3270 using mapped_type_t = typename T::mapped_type;
3271 
3272 template<typename T>
3273 using key_type_t = typename T::key_type;
3274 
3275 template<typename T>
3276 using value_type_t = typename T::value_type;
3277 
3278 template<typename T>
3279 using difference_type_t = typename T::difference_type;
3280 
3281 template<typename T>
3282 using pointer_t = typename T::pointer;
3283 
3284 template<typename T>
3285 using reference_t = typename T::reference;
3286 
3287 template<typename T>
3288 using iterator_category_t = typename T::iterator_category;
3289 
3290 template<typename T, typename... Args>
3291 using to_json_function = decltype(T::to_json(std::declval<Args>()...));
3292 
3293 template<typename T, typename... Args>
3294 using from_json_function = decltype(T::from_json(std::declval<Args>()...));
3295 
3296 template<typename T, typename U>
3297 using get_template_function = decltype(std::declval<T>().template get<U>());
3298 
3299 // trait checking if JSONSerializer<T>::from_json(json const&, udt&) exists
3300 template<typename BasicJsonType, typename T, typename = void>
3301 struct has_from_json : std::false_type {};
3302 
3303 // trait checking if j.get<T> is valid
3304 // use this trait instead of std::is_constructible or std::is_convertible,
3305 // both rely on, or make use of implicit conversions, and thus fail when T
3306 // has several constructors/operator= (see https://github.com/nlohmann/json/issues/958)
3307 template <typename BasicJsonType, typename T>
3309 {
3311 };
3312 
3313 template<typename BasicJsonType, typename T>
3314 struct has_from_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >>
3315 {
3316  using serializer = typename BasicJsonType::template json_serializer<T, void>;
3317 
3318  static constexpr bool value =
3320  const BasicJsonType&, T&>::value;
3321 };
3322 
3323 // This trait checks if JSONSerializer<T>::from_json(json const&) exists
3324 // this overload is used for non-default-constructible user-defined-types
3325 template<typename BasicJsonType, typename T, typename = void>
3326 struct has_non_default_from_json : std::false_type {};
3327 
3328 template<typename BasicJsonType, typename T>
3329 struct has_non_default_from_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >>
3330 {
3331  using serializer = typename BasicJsonType::template json_serializer<T, void>;
3332 
3333  static constexpr bool value =
3335  const BasicJsonType&>::value;
3336 };
3337 
3338 // This trait checks if BasicJsonType::json_serializer<T>::to_json exists
3339 // Do not evaluate the trait when T is a basic_json type, to avoid template instantiation infinite recursion.
3340 template<typename BasicJsonType, typename T, typename = void>
3341 struct has_to_json : std::false_type {};
3342 
3343 template<typename BasicJsonType, typename T>
3344 struct has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >>
3345 {
3346  using serializer = typename BasicJsonType::template json_serializer<T, void>;
3347 
3348  static constexpr bool value =
3349  is_detected_exact<void, to_json_function, serializer, BasicJsonType&,
3350  T>::value;
3351 };
3352 
3353 template<typename T>
3354 using detect_key_compare = typename T::key_compare;
3355 
3356 template<typename T>
3357 struct has_key_compare : std::integral_constant<bool, is_detected<detect_key_compare, T>::value> {};
3358 
3359 // obtains the actual object key comparator
3360 template<typename BasicJsonType>
3362 {
3363  using object_t = typename BasicJsonType::object_t;
3364  using object_comparator_t = typename BasicJsonType::default_object_comparator_t;
3365  using type = typename std::conditional < has_key_compare<object_t>::value,
3366  typename object_t::key_compare, object_comparator_t>::type;
3367 };
3368 
3369 template<typename BasicJsonType>
3371 
3373 // is_ functions //
3375 
3376 // https://en.cppreference.com/w/cpp/types/conjunction
3377 template<class...> struct conjunction : std::true_type { };
3378 template<class B> struct conjunction<B> : B { };
3379 template<class B, class... Bn>
3380 struct conjunction<B, Bn...>
3381 : std::conditional<static_cast<bool>(B::value), conjunction<Bn...>, B>::type {};
3382 
3383 // https://en.cppreference.com/w/cpp/types/negation
3384 template<class B> struct negation : std::integral_constant < bool, !B::value > { };
3385 
3386 // Reimplementation of is_constructible and is_default_constructible, due to them being broken for
3387 // std::pair and std::tuple until LWG 2367 fix (see https://cplusplus.github.io/LWG/lwg-defects.html#2367).
3388 // This causes compile errors in e.g. clang 3.5 or gcc 4.9.
3389 template <typename T>
3390 struct is_default_constructible : std::is_default_constructible<T> {};
3391 
3392 template <typename T1, typename T2>
3393 struct is_default_constructible<std::pair<T1, T2>>
3394  : conjunction<is_default_constructible<T1>, is_default_constructible<T2>> {};
3395 
3396 template <typename T1, typename T2>
3397 struct is_default_constructible<const std::pair<T1, T2>>
3398  : conjunction<is_default_constructible<T1>, is_default_constructible<T2>> {};
3399 
3400 template <typename... Ts>
3401 struct is_default_constructible<std::tuple<Ts...>>
3402  : conjunction<is_default_constructible<Ts>...> {};
3403 
3404 template <typename... Ts>
3405 struct is_default_constructible<const std::tuple<Ts...>>
3406  : conjunction<is_default_constructible<Ts>...> {};
3407 
3408 
3409 template <typename T, typename... Args>
3410 struct is_constructible : std::is_constructible<T, Args...> {};
3411 
3412 template <typename T1, typename T2>
3413 struct is_constructible<std::pair<T1, T2>> : is_default_constructible<std::pair<T1, T2>> {};
3414 
3415 template <typename T1, typename T2>
3416 struct is_constructible<const std::pair<T1, T2>> : is_default_constructible<const std::pair<T1, T2>> {};
3417 
3418 template <typename... Ts>
3419 struct is_constructible<std::tuple<Ts...>> : is_default_constructible<std::tuple<Ts...>> {};
3420 
3421 template <typename... Ts>
3422 struct is_constructible<const std::tuple<Ts...>> : is_default_constructible<const std::tuple<Ts...>> {};
3423 
3424 
3425 template<typename T, typename = void>
3426 struct is_iterator_traits : std::false_type {};
3427 
3428 template<typename T>
3430 {
3431  private:
3432  using traits = iterator_traits<T>;
3433 
3434  public:
3435  static constexpr auto value =
3441 };
3442 
3443 template<typename T>
3444 struct is_range
3445 {
3446  private:
3447  using t_ref = typename std::add_lvalue_reference<T>::type;
3448 
3449  using iterator = detected_t<result_of_begin, t_ref>;
3450  using sentinel = detected_t<result_of_end, t_ref>;
3451 
3452  // to be 100% correct, it should use https://en.cppreference.com/w/cpp/iterator/input_or_output_iterator
3453  // and https://en.cppreference.com/w/cpp/iterator/sentinel_for
3454  // but reimplementing these would be too much work, as a lot of other concepts are used underneath
3455  static constexpr auto is_iterator_begin =
3457 
3458  public:
3459  static constexpr bool value = !std::is_same<iterator, nonesuch>::value && !std::is_same<sentinel, nonesuch>::value && is_iterator_begin;
3460 };
3461 
3462 template<typename R>
3463 using iterator_t = enable_if_t<is_range<R>::value, result_of_begin<decltype(std::declval<R&>())>>;
3464 
3465 template<typename T>
3467 
3468 // The following implementation of is_complete_type is taken from
3469 // https://blogs.msdn.microsoft.com/vcblog/2015/12/02/partial-support-for-expression-sfinae-in-vs-2015-update-1/
3470 // and is written by Xiang Fan who agreed to using it in this library.
3471 
3472 template<typename T, typename = void>
3473 struct is_complete_type : std::false_type {};
3474 
3475 template<typename T>
3476 struct is_complete_type<T, decltype(void(sizeof(T)))> : std::true_type {};
3477 
3478 template<typename BasicJsonType, typename CompatibleObjectType,
3479  typename = void>
3480 struct is_compatible_object_type_impl : std::false_type {};
3481 
3482 template<typename BasicJsonType, typename CompatibleObjectType>
3484  BasicJsonType, CompatibleObjectType,
3485  enable_if_t < is_detected<mapped_type_t, CompatibleObjectType>::value&&
3486  is_detected<key_type_t, CompatibleObjectType>::value >>
3487 {
3488  using object_t = typename BasicJsonType::object_t;
3489 
3490  // macOS's is_constructible does not play well with nonesuch...
3491  static constexpr bool value =
3492  is_constructible<typename object_t::key_type,
3493  typename CompatibleObjectType::key_type>::value &&
3494  is_constructible<typename object_t::mapped_type,
3495  typename CompatibleObjectType::mapped_type>::value;
3496 };
3497 
3498 template<typename BasicJsonType, typename CompatibleObjectType>
3500  : is_compatible_object_type_impl<BasicJsonType, CompatibleObjectType> {};
3501 
3502 template<typename BasicJsonType, typename ConstructibleObjectType,
3503  typename = void>
3504 struct is_constructible_object_type_impl : std::false_type {};
3505 
3506 template<typename BasicJsonType, typename ConstructibleObjectType>
3508  BasicJsonType, ConstructibleObjectType,
3509  enable_if_t < is_detected<mapped_type_t, ConstructibleObjectType>::value&&
3510  is_detected<key_type_t, ConstructibleObjectType>::value >>
3511 {
3512  using object_t = typename BasicJsonType::object_t;
3513 
3514  static constexpr bool value =
3516  (std::is_move_assignable<ConstructibleObjectType>::value ||
3517  std::is_copy_assignable<ConstructibleObjectType>::value) &&
3518  (is_constructible<typename ConstructibleObjectType::key_type,
3519  typename object_t::key_type>::value &&
3520  std::is_same <
3521  typename object_t::mapped_type,
3522  typename ConstructibleObjectType::mapped_type >::value)) ||
3523  (has_from_json<BasicJsonType,
3524  typename ConstructibleObjectType::mapped_type>::value ||
3526  BasicJsonType,
3527  typename ConstructibleObjectType::mapped_type >::value);
3528 };
3529 
3530 template<typename BasicJsonType, typename ConstructibleObjectType>
3532  : is_constructible_object_type_impl<BasicJsonType,
3533  ConstructibleObjectType> {};
3534 
3535 template<typename BasicJsonType, typename CompatibleStringType>
3537 {
3538  static constexpr auto value =
3540 };
3541 
3542 template<typename BasicJsonType, typename ConstructibleStringType>
3544 {
3545  // launder type through decltype() to fix compilation failure on ICPC
3546 #ifdef __INTEL_COMPILER
3547  using laundered_type = decltype(std::declval<ConstructibleStringType>());
3548 #else
3549  using laundered_type = ConstructibleStringType;
3550 #endif
3551 
3552  static constexpr auto value =
3554  typename BasicJsonType::string_t>::value;
3555 };
3556 
3557 template<typename BasicJsonType, typename CompatibleArrayType, typename = void>
3558 struct is_compatible_array_type_impl : std::false_type {};
3559 
3560 template<typename BasicJsonType, typename CompatibleArrayType>
3562  BasicJsonType, CompatibleArrayType,
3563  enable_if_t <
3564  is_detected<iterator_t, CompatibleArrayType>::value&&
3565  is_iterator_traits<iterator_traits<detected_t<iterator_t, CompatibleArrayType>>>::value&&
3566 // special case for types like std::filesystem::path whose iterator's value_type are themselves
3567 // c.f. https://github.com/nlohmann/json/pull/3073
3568  !std::is_same<CompatibleArrayType, detected_t<range_value_t, CompatibleArrayType>>::value >>
3569 {
3570  static constexpr bool value =
3571  is_constructible<BasicJsonType,
3573 };
3574 
3575 template<typename BasicJsonType, typename CompatibleArrayType>
3577  : is_compatible_array_type_impl<BasicJsonType, CompatibleArrayType> {};
3578 
3579 template<typename BasicJsonType, typename ConstructibleArrayType, typename = void>
3580 struct is_constructible_array_type_impl : std::false_type {};
3581 
3582 template<typename BasicJsonType, typename ConstructibleArrayType>
3584  BasicJsonType, ConstructibleArrayType,
3585  enable_if_t<std::is_same<ConstructibleArrayType,
3586  typename BasicJsonType::value_type>::value >>
3587  : std::true_type {};
3588 
3589 template<typename BasicJsonType, typename ConstructibleArrayType>
3591  BasicJsonType, ConstructibleArrayType,
3592  enable_if_t < !std::is_same<ConstructibleArrayType,
3593  typename BasicJsonType::value_type>::value&&
3594  !is_compatible_string_type<BasicJsonType, ConstructibleArrayType>::value&&
3595  is_default_constructible<ConstructibleArrayType>::value&&
3596 (std::is_move_assignable<ConstructibleArrayType>::value ||
3597  std::is_copy_assignable<ConstructibleArrayType>::value)&&
3598 is_detected<iterator_t, ConstructibleArrayType>::value&&
3599 is_iterator_traits<iterator_traits<detected_t<iterator_t, ConstructibleArrayType>>>::value&&
3600 is_detected<range_value_t, ConstructibleArrayType>::value&&
3601 // special case for types like std::filesystem::path whose iterator's value_type are themselves
3602 // c.f. https://github.com/nlohmann/json/pull/3073
3603 !std::is_same<ConstructibleArrayType, detected_t<range_value_t, ConstructibleArrayType>>::value&&
3605  detected_t<range_value_t, ConstructibleArrayType >>::value >>
3606 {
3608 
3609  static constexpr bool value =
3610  std::is_same<value_type,
3611  typename BasicJsonType::array_t::value_type>::value ||
3612  has_from_json<BasicJsonType,
3613  value_type>::value ||
3615  BasicJsonType,
3616  value_type >::value;
3617 };
3618 
3619 template<typename BasicJsonType, typename ConstructibleArrayType>
3621  : is_constructible_array_type_impl<BasicJsonType, ConstructibleArrayType> {};
3622 
3623 template<typename RealIntegerType, typename CompatibleNumberIntegerType,
3624  typename = void>
3625 struct is_compatible_integer_type_impl : std::false_type {};
3626 
3627 template<typename RealIntegerType, typename CompatibleNumberIntegerType>
3629  RealIntegerType, CompatibleNumberIntegerType,
3630  enable_if_t < std::is_integral<RealIntegerType>::value&&
3631  std::is_integral<CompatibleNumberIntegerType>::value&&
3632  !std::is_same<bool, CompatibleNumberIntegerType>::value >>
3633 {
3634  // is there an assert somewhere on overflows?
3635  using RealLimits = std::numeric_limits<RealIntegerType>;
3636  using CompatibleLimits = std::numeric_limits<CompatibleNumberIntegerType>;
3637 
3638  static constexpr auto value =
3639  is_constructible<RealIntegerType,
3640  CompatibleNumberIntegerType>::value &&
3641  CompatibleLimits::is_integer &&
3642  RealLimits::is_signed == CompatibleLimits::is_signed;
3643 };
3644 
3645 template<typename RealIntegerType, typename CompatibleNumberIntegerType>
3647  : is_compatible_integer_type_impl<RealIntegerType,
3648  CompatibleNumberIntegerType> {};
3649 
3650 template<typename BasicJsonType, typename CompatibleType, typename = void>
3651 struct is_compatible_type_impl: std::false_type {};
3652 
3653 template<typename BasicJsonType, typename CompatibleType>
3655  BasicJsonType, CompatibleType,
3656  enable_if_t<is_complete_type<CompatibleType>::value >>
3657 {
3658  static constexpr bool value =
3660 };
3661 
3662 template<typename BasicJsonType, typename CompatibleType>
3664  : is_compatible_type_impl<BasicJsonType, CompatibleType> {};
3665 
3666 template<typename T1, typename T2>
3667 struct is_constructible_tuple : std::false_type {};
3668 
3669 template<typename T1, typename... Args>
3670 struct is_constructible_tuple<T1, std::tuple<Args...>> : conjunction<is_constructible<T1, Args>...> {};
3671 
3672 template<typename BasicJsonType, typename T>
3673 struct is_json_iterator_of : std::false_type {};
3674 
3675 template<typename BasicJsonType>
3676 struct is_json_iterator_of<BasicJsonType, typename BasicJsonType::iterator> : std::true_type {};
3677 
3678 template<typename BasicJsonType>
3679 struct is_json_iterator_of<BasicJsonType, typename BasicJsonType::const_iterator> : std::true_type
3680 {};
3681 
3682 // checks if a given type T is a template specialization of Primary
3683 template<template <typename...> class Primary, typename T>
3684 struct is_specialization_of : std::false_type {};
3685 
3686 template<template <typename...> class Primary, typename... Args>
3687 struct is_specialization_of<Primary, Primary<Args...>> : std::true_type {};
3688 
3689 template<typename T>
3691 
3692 // checks if A and B are comparable using Compare functor
3693 template<typename Compare, typename A, typename B, typename = void>
3694 struct is_comparable : std::false_type {};
3695 
3696 template<typename Compare, typename A, typename B>
3697 struct is_comparable<Compare, A, B, void_t<
3698 decltype(std::declval<Compare>()(std::declval<A>(), std::declval<B>())),
3699 decltype(std::declval<Compare>()(std::declval<B>(), std::declval<A>()))
3700 >> : std::true_type {};
3701 
3702 template<typename T>
3703 using detect_is_transparent = typename T::is_transparent;
3704 
3705 // type trait to check if KeyType can be used as object key (without a BasicJsonType)
3706 // see is_usable_as_basic_json_key_type below
3707 template<typename Comparator, typename ObjectKeyType, typename KeyTypeCVRef, bool RequireTransparentComparator = true,
3708  bool ExcludeObjectKeyType = RequireTransparentComparator, typename KeyType = uncvref_t<KeyTypeCVRef>>
3709 using is_usable_as_key_type = typename std::conditional <
3711  && !(ExcludeObjectKeyType && std::is_same<KeyType,
3712  ObjectKeyType>::value)
3713  && (!RequireTransparentComparator
3716  std::true_type,
3717  std::false_type >::type;
3718 
3719 // type trait to check if KeyType can be used as object key
3720 // true if:
3721 // - KeyType is comparable with BasicJsonType::object_t::key_type
3722 // - if ExcludeObjectKeyType is true, KeyType is not BasicJsonType::object_t::key_type
3723 // - the comparator is transparent or RequireTransparentComparator is false
3724 // - KeyType is not a JSON iterator or json_pointer
3725 template<typename BasicJsonType, typename KeyTypeCVRef, bool RequireTransparentComparator = true,
3726  bool ExcludeObjectKeyType = RequireTransparentComparator, typename KeyType = uncvref_t<KeyTypeCVRef>>
3727 using is_usable_as_basic_json_key_type = typename std::conditional <
3728  is_usable_as_key_type<typename BasicJsonType::object_comparator_t,
3729  typename BasicJsonType::object_t::key_type, KeyTypeCVRef,
3730  RequireTransparentComparator, ExcludeObjectKeyType>::value
3732  std::true_type,
3733  std::false_type >::type;
3734 
3735 template<typename ObjectType, typename KeyType>
3736 using detect_erase_with_key_type = decltype(std::declval<ObjectType&>().erase(std::declval<KeyType>()));
3737 
3738 // type trait to check if object_t has an erase() member functions accepting KeyType
3739 template<typename BasicJsonType, typename KeyType>
3740 using has_erase_with_key_type = typename std::conditional <
3741  is_detected <
3743  typename BasicJsonType::object_t, KeyType >::value,
3744  std::true_type,
3745  std::false_type >::type;
3746 
3747 // a naive helper to check if a type is an ordered_map (exploits the fact that
3748 // ordered_map inherits capacity() from std::vector)
3749 template <typename T>
3751 {
3752  using one = char;
3753 
3754  struct two
3755  {
3756  char x[2]; // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
3757  };
3758 
3759  template <typename C> static one test( decltype(&C::capacity) ) ;
3760  template <typename C> static two test(...);
3761 
3762  enum { value = sizeof(test<T>(nullptr)) == sizeof(char) }; // NOLINT(cppcoreguidelines-pro-type-vararg,hicpp-vararg)
3763 };
3764 
3765 // to avoid useless casts (see https://github.com/nlohmann/json/issues/2893#issuecomment-889152324)
3766 template < typename T, typename U, enable_if_t < !std::is_same<T, U>::value, int > = 0 >
3768 {
3769  return static_cast<T>(value);
3770 }
3771 
3772 template<typename T, typename U, enable_if_t<std::is_same<T, U>::value, int> = 0>
3773 T conditional_static_cast(U value)
3774 {
3775  return value;
3776 }
3777 
3778 template<typename... Types>
3780 
3781 template<typename... Types>
3783 
3784 template<typename... Types>
3786 
3787 // there's a disjunction trait in another PR; replace when merged
3788 template<typename... Types>
3789 using same_sign = std::integral_constant < bool,
3790  all_signed<Types...>::value || all_unsigned<Types...>::value >;
3791 
3792 template<typename OfType, typename T>
3793 using never_out_of_range = std::integral_constant < bool,
3794  (std::is_signed<OfType>::value && (sizeof(T) < sizeof(OfType)))
3795  || (same_sign<OfType, T>::value && sizeof(OfType) == sizeof(T)) >;
3796 
3797 template<typename OfType, typename T,
3798  bool OfTypeSigned = std::is_signed<OfType>::value,
3799  bool TSigned = std::is_signed<T>::value>
3801 
3802 template<typename OfType, typename T>
3803 struct value_in_range_of_impl2<OfType, T, false, false>
3804 {
3805  static constexpr bool test(T val)
3806  {
3807  using CommonType = typename std::common_type<OfType, T>::type;
3808  return static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
3809  }
3810 };
3811 
3812 template<typename OfType, typename T>
3813 struct value_in_range_of_impl2<OfType, T, true, false>
3814 {
3815  static constexpr bool test(T val)
3816  {
3817  using CommonType = typename std::common_type<OfType, T>::type;
3818  return static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
3819  }
3820 };
3821 
3822 template<typename OfType, typename T>
3823 struct value_in_range_of_impl2<OfType, T, false, true>
3824 {
3825  static constexpr bool test(T val)
3826  {
3827  using CommonType = typename std::common_type<OfType, T>::type;
3828  return val >= 0 && static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
3829  }
3830 };
3831 
3832 
3833 template<typename OfType, typename T>
3834 struct value_in_range_of_impl2<OfType, T, true, true>
3835 {
3836  static constexpr bool test(T val)
3837  {
3838  using CommonType = typename std::common_type<OfType, T>::type;
3839  return static_cast<CommonType>(val) >= static_cast<CommonType>(std::numeric_limits<OfType>::min())
3840  && static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
3841  }
3842 };
3843 
3844 template<typename OfType, typename T,
3845  bool NeverOutOfRange = never_out_of_range<OfType, T>::value,
3848 
3849 template<typename OfType, typename T>
3850 struct value_in_range_of_impl1<OfType, T, false>
3851 {
3852  static constexpr bool test(T val)
3853  {
3855  }
3856 };
3857 
3858 template<typename OfType, typename T>
3859 struct value_in_range_of_impl1<OfType, T, true>
3860 {
3861  static constexpr bool test(T /*val*/)
3862  {
3863  return true;
3864  }
3865 };
3866 
3867 template<typename OfType, typename T>
3868 inline constexpr bool value_in_range_of(T val)
3869 {
3871 }
3872 
3873 } // namespace detail
3874 } // namespace nlohmann
3875 
3876 // #include <nlohmann/detail/string_concat.hpp>
3877 
3878 
3879 #include <cstring> // strlen
3880 #include <string> // string
3881 #include <utility> // forward
3882 
3883 // #include <nlohmann/detail/meta/cpp_future.hpp>
3884 
3885 // #include <nlohmann/detail/meta/detected.hpp>
3886 
3887 
3888 namespace nlohmann
3889 {
3890 namespace detail
3891 {
3892 
3893 inline std::size_t concat_length()
3894 {
3895  return 0;
3896 }
3897 
3898 template<typename... Args>
3899 inline std::size_t concat_length(const char* cstr, Args&& ... rest);
3900 
3901 template<typename StringType, typename... Args>
3902 inline std::size_t concat_length(const StringType& str, Args&& ... rest);
3903 
3904 template<typename... Args>
3905 inline std::size_t concat_length(const char /*c*/, Args&& ... rest)
3906 {
3907  return 1 + concat_length(std::forward<Args>(rest)...);
3908 }
3909 
3910 template<typename... Args>
3911 inline std::size_t concat_length(const char* cstr, Args&& ... rest)
3912 {
3913  // cppcheck-suppress ignoredReturnValue
3914  return ::strlen(cstr) + concat_length(std::forward<Args>(rest)...);
3915 }
3916 
3917 template<typename StringType, typename... Args>
3918 inline std::size_t concat_length(const StringType& str, Args&& ... rest)
3919 {
3920  return str.size() + concat_length(std::forward<Args>(rest)...);
3921 }
3922 
3923 template<typename OutStringType>
3924 inline void concat_into(OutStringType& /*out*/)
3925 {}
3926 
3927 template<typename StringType, typename Arg>
3928 using string_can_append = decltype(std::declval<StringType&>().append(std::declval < Arg && > ()));
3929 
3930 template<typename StringType, typename Arg>
3932 
3933 template<typename StringType, typename Arg>
3934 using string_can_append_op = decltype(std::declval<StringType&>() += std::declval < Arg && > ());
3935 
3936 template<typename StringType, typename Arg>
3938 
3939 template<typename StringType, typename Arg>
3940 using string_can_append_iter = decltype(std::declval<StringType&>().append(std::declval<const Arg&>().begin(), std::declval<const Arg&>().end()));
3941 
3942 template<typename StringType, typename Arg>
3944 
3945 template<typename StringType, typename Arg>
3946 using string_can_append_data = decltype(std::declval<StringType&>().append(std::declval<const Arg&>().data(), std::declval<const Arg&>().size()));
3947 
3948 template<typename StringType, typename Arg>
3950 
3951 template < typename OutStringType, typename Arg, typename... Args,
3954 inline void concat_into(OutStringType& out, Arg && arg, Args && ... rest);
3955 
3956 template < typename OutStringType, typename Arg, typename... Args,
3960 inline void concat_into(OutStringType& out, const Arg& arg, Args && ... rest);
3961 
3962 template < typename OutStringType, typename Arg, typename... Args,
3967 inline void concat_into(OutStringType& out, const Arg& arg, Args && ... rest);
3968 
3969 template<typename OutStringType, typename Arg, typename... Args,
3971 inline void concat_into(OutStringType& out, Arg && arg, Args && ... rest)
3972 {
3973  out.append(std::forward<Arg>(arg));
3974  concat_into(out, std::forward<Args>(rest)...);
3975 }
3976 
3977 template < typename OutStringType, typename Arg, typename... Args,
3978  enable_if_t < !detect_string_can_append<OutStringType, Arg>::value
3979  && detect_string_can_append_op<OutStringType, Arg>::value, int > >
3980 inline void concat_into(OutStringType& out, Arg&& arg, Args&& ... rest)
3981 {
3982  out += std::forward<Arg>(arg);
3983  concat_into(out, std::forward<Args>(rest)...);
3984 }
3985 
3986 template < typename OutStringType, typename Arg, typename... Args,
3987  enable_if_t < !detect_string_can_append<OutStringType, Arg>::value
3988  && !detect_string_can_append_op<OutStringType, Arg>::value
3989  && detect_string_can_append_iter<OutStringType, Arg>::value, int > >
3990 inline void concat_into(OutStringType& out, const Arg& arg, Args&& ... rest)
3991 {
3992  out.append(arg.begin(), arg.end());
3993  concat_into(out, std::forward<Args>(rest)...);
3994 }
3995 
3996 template < typename OutStringType, typename Arg, typename... Args,
3997  enable_if_t < !detect_string_can_append<OutStringType, Arg>::value
3998  && !detect_string_can_append_op<OutStringType, Arg>::value
3999  && !detect_string_can_append_iter<OutStringType, Arg>::value
4000  && detect_string_can_append_data<OutStringType, Arg>::value, int > >
4001 inline void concat_into(OutStringType& out, const Arg& arg, Args&& ... rest)
4002 {
4003  out.append(arg.data(), arg.size());
4004  concat_into(out, std::forward<Args>(rest)...);
4005 }
4006 
4007 template<typename OutStringType = std::string, typename... Args>
4008 inline OutStringType concat(Args && ... args)
4009 {
4010  OutStringType str;
4011  str.reserve(concat_length(std::forward<Args>(args)...));
4012  concat_into(str, std::forward<Args>(args)...);
4013  return str;
4014 }
4015 
4016 } // namespace detail
4017 } // namespace nlohmann
4018 
4019 
4020 
4021 namespace nlohmann
4022 {
4023 namespace detail
4024 {
4026 // exceptions //
4028 
4031 class exception : public std::exception
4032 {
4033  public:
4035  const char* what() const noexcept override
4036  {
4037  return m.what();
4038  }
4039 
4041  const int id; // NOLINT(cppcoreguidelines-non-private-member-variables-in-classes)
4042 
4043  protected:
4045  exception(int id_, const char* what_arg) : id(id_), m(what_arg) {} // NOLINT(bugprone-throw-keyword-missing)
4046 
4047  static std::string name(const std::string& ename, int id_)
4048  {
4049  return concat("[json.exception.", ename, '.', std::to_string(id_), "] ");
4050  }
4051 
4052  static std::string diagnostics(std::nullptr_t /*leaf_element*/)
4053  {
4054  return "";
4055  }
4056 
4057  template<typename BasicJsonType>
4058  static std::string diagnostics(const BasicJsonType* leaf_element)
4059  {
4060 #if JSON_DIAGNOSTICS
4061  std::vector<std::string> tokens;
4062  for (const auto* current = leaf_element; current != nullptr && current->m_parent != nullptr; current = current->m_parent)
4063  {
4064  switch (current->m_parent->type())
4065  {
4066  case value_t::array:
4067  {
4068  for (std::size_t i = 0; i < current->m_parent->m_value.array->size(); ++i)
4069  {
4070  if (&current->m_parent->m_value.array->operator[](i) == current)
4071  {
4072  tokens.emplace_back(std::to_string(i));
4073  break;
4074  }
4075  }
4076  break;
4077  }
4078 
4079  case value_t::object:
4080  {
4081  for (const auto& element : *current->m_parent->m_value.object)
4082  {
4083  if (&element.second == current)
4084  {
4085  tokens.emplace_back(element.first.c_str());
4086  break;
4087  }
4088  }
4089  break;
4090  }
4091 
4092  case value_t::null: // LCOV_EXCL_LINE
4093  case value_t::string: // LCOV_EXCL_LINE
4094  case value_t::boolean: // LCOV_EXCL_LINE
4095  case value_t::number_integer: // LCOV_EXCL_LINE
4096  case value_t::number_unsigned: // LCOV_EXCL_LINE
4097  case value_t::number_float: // LCOV_EXCL_LINE
4098  case value_t::binary: // LCOV_EXCL_LINE
4099  case value_t::discarded: // LCOV_EXCL_LINE
4100  default: // LCOV_EXCL_LINE
4101  break; // LCOV_EXCL_LINE
4102  }
4103  }
4104 
4105  if (tokens.empty())
4106  {
4107  return "";
4108  }
4109 
4110  auto str = std::accumulate(tokens.rbegin(), tokens.rend(), std::string{},
4111  [](const std::string & a, const std::string & b)
4112  {
4113  return concat(a, '/', detail::escape(b));
4114  });
4115  return concat('(', str, ") ");
4116 #else
4117  static_cast<void>(leaf_element);
4118  return "";
4119 #endif
4120  }
4121 
4122  private:
4124  std::runtime_error m;
4125 };
4126 
4129 class parse_error : public exception
4130 {
4131  public:
4141  template<typename BasicJsonContext, enable_if_t<is_basic_json_context<BasicJsonContext>::value, int> = 0>
4142  static parse_error create(int id_, const position_t& pos, const std::string& what_arg, BasicJsonContext context)
4143  {
4144  std::string w = concat(exception::name("parse_error", id_), "parse error",
4145  position_string(pos), ": ", exception::diagnostics(context), what_arg);
4146  return {id_, pos.chars_read_total, w.c_str()};
4147  }
4148 
4149  template<typename BasicJsonContext, enable_if_t<is_basic_json_context<BasicJsonContext>::value, int> = 0>
4150  static parse_error create(int id_, std::size_t byte_, const std::string& what_arg, BasicJsonContext context)
4151  {
4152  std::string w = concat(exception::name("parse_error", id_), "parse error",
4153  (byte_ != 0 ? (concat(" at byte ", std::to_string(byte_))) : ""),
4154  ": ", exception::diagnostics(context), what_arg);
4155  return {id_, byte_, w.c_str()};
4156  }
4157 
4167  const std::size_t byte;
4168 
4169  private:
4170  parse_error(int id_, std::size_t byte_, const char* what_arg)
4171  : exception(id_, what_arg), byte(byte_) {}
4172 
4173  static std::string position_string(const position_t& pos)
4174  {
4175  return concat(" at line ", std::to_string(pos.lines_read + 1),
4176  ", column ", std::to_string(pos.chars_read_current_line));
4177  }
4178 };
4179 
4183 {
4184  public:
4185  template<typename BasicJsonContext, enable_if_t<is_basic_json_context<BasicJsonContext>::value, int> = 0>
4186  static invalid_iterator create(int id_, const std::string& what_arg, BasicJsonContext context)
4187  {
4188  std::string w = concat(exception::name("invalid_iterator", id_), exception::diagnostics(context), what_arg);
4189  return {id_, w.c_str()};
4190  }
4191 
4192  private:
4194  invalid_iterator(int id_, const char* what_arg)
4195  : exception(id_, what_arg) {}
4196 };
4197 
4200 class type_error : public exception
4201 {
4202  public:
4203  template<typename BasicJsonContext, enable_if_t<is_basic_json_context<BasicJsonContext>::value, int> = 0>
4204  static type_error create(int id_, const std::string& what_arg, BasicJsonContext context)
4205  {
4206  std::string w = concat(exception::name("type_error", id_), exception::diagnostics(context), what_arg);
4207  return {id_, w.c_str()};
4208  }
4209 
4210  private:
4212  type_error(int id_, const char* what_arg) : exception(id_, what_arg) {}
4213 };
4214 
4217 class out_of_range : public exception
4218 {
4219  public:
4220  template<typename BasicJsonContext, enable_if_t<is_basic_json_context<BasicJsonContext>::value, int> = 0>
4221  static out_of_range create(int id_, const std::string& what_arg, BasicJsonContext context)
4222  {
4223  std::string w = concat(exception::name("out_of_range", id_), exception::diagnostics(context), what_arg);
4224  return {id_, w.c_str()};
4225  }
4226 
4227  private:
4229  out_of_range(int id_, const char* what_arg) : exception(id_, what_arg) {}
4230 };
4231 
4234 class other_error : public exception
4235 {
4236  public:
4237  template<typename BasicJsonContext, enable_if_t<is_basic_json_context<BasicJsonContext>::value, int> = 0>
4238  static other_error create(int id_, const std::string& what_arg, BasicJsonContext context)
4239  {
4240  std::string w = concat(exception::name("other_error", id_), exception::diagnostics(context), what_arg);
4241  return {id_, w.c_str()};
4242  }
4243 
4244  private:
4246  other_error(int id_, const char* what_arg) : exception(id_, what_arg) {}
4247 };
4248 
4249 } // namespace detail
4250 } // namespace nlohmann
4251 
4252 // #include <nlohmann/detail/macro_scope.hpp>
4253 
4254 // #include <nlohmann/detail/meta/cpp_future.hpp>
4255 
4256 // #include <nlohmann/detail/meta/identity_tag.hpp>
4257 
4258 
4259 namespace nlohmann
4260 {
4261 namespace detail
4262 {
4263 // dispatching helper struct
4264 template <class T> struct identity_tag {};
4265 } // namespace detail
4266 } // namespace nlohmann
4267 
4268 // #include <nlohmann/detail/meta/type_traits.hpp>
4269 
4270 // #include <nlohmann/detail/string_concat.hpp>
4271 
4272 // #include <nlohmann/detail/value_t.hpp>
4273 
4274 
4275 #if JSON_HAS_EXPERIMENTAL_FILESYSTEM
4276 #include <experimental/filesystem>
4277 namespace nlohmann::detail
4278 {
4279 namespace std_fs = std::experimental::filesystem;
4280 } // namespace nlohmann::detail
4281 #elif JSON_HAS_FILESYSTEM
4282 #include <filesystem>
4283 namespace nlohmann::detail
4284 {
4285 namespace std_fs = std::filesystem;
4286 } // namespace nlohmann::detail
4287 #endif
4288 
4289 namespace nlohmann
4290 {
4291 namespace detail
4292 {
4293 template<typename BasicJsonType>
4294 inline void from_json(const BasicJsonType& j, typename std::nullptr_t& n)
4295 {
4296  if (JSON_HEDLEY_UNLIKELY(!j.is_null()))
4297  {
4298  JSON_THROW(type_error::create(302, concat("type must be null, but is ", j.type_name()), &j));
4299  }
4300  n = nullptr;
4301 }
4302 
4303 // overloads for basic_json template parameters
4304 template < typename BasicJsonType, typename ArithmeticType,
4305  enable_if_t < std::is_arithmetic<ArithmeticType>::value&&
4306  !std::is_same<ArithmeticType, typename BasicJsonType::boolean_t>::value,
4307  int > = 0 >
4308 void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val)
4309 {
4310  switch (static_cast<value_t>(j))
4311  {
4313  {
4314  val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_unsigned_t*>());
4315  break;
4316  }
4318  {
4319  val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_integer_t*>());
4320  break;
4321  }
4322  case value_t::number_float:
4323  {
4324  val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t*>());
4325  break;
4326  }
4327 
4328  case value_t::null:
4329  case value_t::object:
4330  case value_t::array:
4331  case value_t::string:
4332  case value_t::boolean:
4333  case value_t::binary:
4334  case value_t::discarded:
4335  default:
4336  JSON_THROW(type_error::create(302, concat("type must be number, but is ", j.type_name()), &j));
4337  }
4338 }
4339 
4340 template<typename BasicJsonType>
4341 inline void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b)
4342 {
4343  if (JSON_HEDLEY_UNLIKELY(!j.is_boolean()))
4344  {
4345  JSON_THROW(type_error::create(302, concat("type must be boolean, but is ", j.type_name()), &j));
4346  }
4347  b = *j.template get_ptr<const typename BasicJsonType::boolean_t*>();
4348 }
4349 
4350 template<typename BasicJsonType>
4351 inline void from_json(const BasicJsonType& j, typename BasicJsonType::string_t& s)
4352 {
4353  if (JSON_HEDLEY_UNLIKELY(!j.is_string()))
4354  {
4355  JSON_THROW(type_error::create(302, concat("type must be string, but is ", j.type_name()), &j));
4356  }
4357  s = *j.template get_ptr<const typename BasicJsonType::string_t*>();
4358 }
4359 
4360 template <
4361  typename BasicJsonType, typename StringType,
4362  enable_if_t <
4363  std::is_assignable<StringType&, const typename BasicJsonType::string_t>::value
4364  && !std::is_same<typename BasicJsonType::string_t, StringType>::value
4365  && !is_json_ref<StringType>::value, int > = 0 >
4366 inline void from_json(const BasicJsonType& j, StringType& s)
4367 {
4368  if (JSON_HEDLEY_UNLIKELY(!j.is_string()))
4369  {
4370  JSON_THROW(type_error::create(302, concat("type must be string, but is ", j.type_name()), &j));
4371  }
4372 
4373  s = *j.template get_ptr<const typename BasicJsonType::string_t*>();
4374 }
4375 
4376 template<typename BasicJsonType>
4377 inline void from_json(const BasicJsonType& j, typename BasicJsonType::number_float_t& val)
4378 {
4379  get_arithmetic_value(j, val);
4380 }
4381 
4382 template<typename BasicJsonType>
4383 inline void from_json(const BasicJsonType& j, typename BasicJsonType::number_unsigned_t& val)
4384 {
4385  get_arithmetic_value(j, val);
4386 }
4387 
4388 template<typename BasicJsonType>
4389 inline void from_json(const BasicJsonType& j, typename BasicJsonType::number_integer_t& val)
4390 {
4391  get_arithmetic_value(j, val);
4392 }
4393 
4394 #if !JSON_DISABLE_ENUM_SERIALIZATION
4395 template<typename BasicJsonType, typename EnumType,
4396  enable_if_t<std::is_enum<EnumType>::value, int> = 0>
4397 inline void from_json(const BasicJsonType& j, EnumType& e)
4398 {
4400  get_arithmetic_value(j, val);
4401  e = static_cast<EnumType>(val);
4402 }
4403 #endif // JSON_DISABLE_ENUM_SERIALIZATION
4404 
4405 // forward_list doesn't have an insert method
4406 template<typename BasicJsonType, typename T, typename Allocator,
4407  enable_if_t<is_getable<BasicJsonType, T>::value, int> = 0>
4408 inline void from_json(const BasicJsonType& j, std::forward_list<T, Allocator>& l)
4409 {
4410  if (JSON_HEDLEY_UNLIKELY(!j.is_array()))
4411  {
4412  JSON_THROW(type_error::create(302, concat("type must be array, but is ", j.type_name()), &j));
4413  }
4414  l.clear();
4415  std::transform(j.rbegin(), j.rend(),
4416  std::front_inserter(l), [](const BasicJsonType & i)
4417  {
4418  return i.template get<T>();
4419  });
4420 }
4421 
4422 // valarray doesn't have an insert method
4423 template<typename BasicJsonType, typename T,
4424  enable_if_t<is_getable<BasicJsonType, T>::value, int> = 0>
4425 inline void from_json(const BasicJsonType& j, std::valarray<T>& l)
4426 {
4427  if (JSON_HEDLEY_UNLIKELY(!j.is_array()))
4428  {
4429  JSON_THROW(type_error::create(302, concat("type must be array, but is ", j.type_name()), &j));
4430  }
4431  l.resize(j.size());
4432  std::transform(j.begin(), j.end(), std::begin(l),
4433  [](const BasicJsonType & elem)
4434  {
4435  return elem.template get<T>();
4436  });
4437 }
4438 
4439 template<typename BasicJsonType, typename T, std::size_t N>
4440 auto from_json(const BasicJsonType& j, T (&arr)[N]) // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
4441 -> decltype(j.template get<T>(), void())
4442 {
4443  for (std::size_t i = 0; i < N; ++i)
4444  {
4445  arr[i] = j.at(i).template get<T>();
4446  }
4447 }
4448 
4449 template<typename BasicJsonType>
4450 inline void from_json_array_impl(const BasicJsonType& j, typename BasicJsonType::array_t& arr, priority_tag<3> /*unused*/)
4451 {
4452  arr = *j.template get_ptr<const typename BasicJsonType::array_t*>();
4453 }
4454 
4455 template<typename BasicJsonType, typename T, std::size_t N>
4456 auto from_json_array_impl(const BasicJsonType& j, std::array<T, N>& arr,
4457  priority_tag<2> /*unused*/)
4458 -> decltype(j.template get<T>(), void())
4459 {
4460  for (std::size_t i = 0; i < N; ++i)
4461  {
4462  arr[i] = j.at(i).template get<T>();
4463  }
4464 }
4465 
4466 template<typename BasicJsonType, typename ConstructibleArrayType,
4467  enable_if_t<
4468  std::is_assignable<ConstructibleArrayType&, ConstructibleArrayType>::value,
4469  int> = 0>
4470 auto from_json_array_impl(const BasicJsonType& j, ConstructibleArrayType& arr, priority_tag<1> /*unused*/)
4471 -> decltype(
4472  arr.reserve(std::declval<typename ConstructibleArrayType::size_type>()),
4473  j.template get<typename ConstructibleArrayType::value_type>(),
4474  void())
4475 {
4476  using std::end;
4477 
4478  ConstructibleArrayType ret;
4479  ret.reserve(j.size());
4480  std::transform(j.begin(), j.end(),
4481  std::inserter(ret, end(ret)), [](const BasicJsonType & i)
4482  {
4483  // get<BasicJsonType>() returns *this, this won't call a from_json
4484  // method when value_type is BasicJsonType
4485  return i.template get<typename ConstructibleArrayType::value_type>();
4486  });
4487  arr = std::move(ret);
4488 }
4489 
4490 template<typename BasicJsonType, typename ConstructibleArrayType,
4491  enable_if_t<
4492  std::is_assignable<ConstructibleArrayType&, ConstructibleArrayType>::value,
4493  int> = 0>
4494 inline void from_json_array_impl(const BasicJsonType& j, ConstructibleArrayType& arr,
4495  priority_tag<0> /*unused*/)
4496 {
4497  using std::end;
4498 
4499  ConstructibleArrayType ret;
4500  std::transform(
4501  j.begin(), j.end(), std::inserter(ret, end(ret)),
4502  [](const BasicJsonType & i)
4503  {
4504  // get<BasicJsonType>() returns *this, this won't call a from_json
4505  // method when value_type is BasicJsonType
4506  return i.template get<typename ConstructibleArrayType::value_type>();
4507  });
4508  arr = std::move(ret);
4509 }
4510 
4511 template < typename BasicJsonType, typename ConstructibleArrayType,
4512  enable_if_t <
4513  is_constructible_array_type<BasicJsonType, ConstructibleArrayType>::value&&
4514  !is_constructible_object_type<BasicJsonType, ConstructibleArrayType>::value&&
4516  !std::is_same<ConstructibleArrayType, typename BasicJsonType::binary_t>::value&&
4517  !is_basic_json<ConstructibleArrayType>::value,
4518  int > = 0 >
4519 auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr)
4520 -> decltype(from_json_array_impl(j, arr, priority_tag<3> {}),
4521 j.template get<typename ConstructibleArrayType::value_type>(),
4522 void())
4523 {
4524  if (JSON_HEDLEY_UNLIKELY(!j.is_array()))
4525  {
4526  JSON_THROW(type_error::create(302, concat("type must be array, but is ", j.type_name()), &j));
4527  }
4528 
4529  from_json_array_impl(j, arr, priority_tag<3> {});
4530 }
4531 
4532 template < typename BasicJsonType, typename T, std::size_t... Idx >
4533 std::array<T, sizeof...(Idx)> from_json_inplace_array_impl(BasicJsonType&& j,
4534  identity_tag<std::array<T, sizeof...(Idx)>> /*unused*/, index_sequence<Idx...> /*unused*/)
4535 {
4536  return { { std::forward<BasicJsonType>(j).at(Idx).template get<T>()... } };
4537 }
4538 
4539 template < typename BasicJsonType, typename T, std::size_t N >
4540 auto from_json(BasicJsonType&& j, identity_tag<std::array<T, N>> tag)
4541 -> decltype(from_json_inplace_array_impl(std::forward<BasicJsonType>(j), tag, make_index_sequence<N> {}))
4542 {
4543  if (JSON_HEDLEY_UNLIKELY(!j.is_array()))
4544  {
4545  JSON_THROW(type_error::create(302, concat("type must be array, but is ", j.type_name()), &j));
4546  }
4547 
4548  return from_json_inplace_array_impl(std::forward<BasicJsonType>(j), tag, make_index_sequence<N> {});
4549 }
4550 
4551 template<typename BasicJsonType>
4552 inline void from_json(const BasicJsonType& j, typename BasicJsonType::binary_t& bin)
4553 {
4554  if (JSON_HEDLEY_UNLIKELY(!j.is_binary()))
4555  {
4556  JSON_THROW(type_error::create(302, concat("type must be binary, but is ", j.type_name()), &j));
4557  }
4558 
4559  bin = *j.template get_ptr<const typename BasicJsonType::binary_t*>();
4560 }
4561 
4562 template<typename BasicJsonType, typename ConstructibleObjectType,
4563  enable_if_t<is_constructible_object_type<BasicJsonType, ConstructibleObjectType>::value, int> = 0>
4564 inline void from_json(const BasicJsonType& j, ConstructibleObjectType& obj)
4565 {
4566  if (JSON_HEDLEY_UNLIKELY(!j.is_object()))
4567  {
4568  JSON_THROW(type_error::create(302, concat("type must be object, but is ", j.type_name()), &j));
4569  }
4570 
4571  ConstructibleObjectType ret;
4572  const auto* inner_object = j.template get_ptr<const typename BasicJsonType::object_t*>();
4573  using value_type = typename ConstructibleObjectType::value_type;
4574  std::transform(
4575  inner_object->begin(), inner_object->end(),
4576  std::inserter(ret, ret.begin()),
4577  [](typename BasicJsonType::object_t::value_type const & p)
4578  {
4579  return value_type(p.first, p.second.template get<typename ConstructibleObjectType::mapped_type>());
4580  });
4581  obj = std::move(ret);
4582 }
4583 
4584 // overload for arithmetic types, not chosen for basic_json template arguments
4585 // (BooleanType, etc..); note: Is it really necessary to provide explicit
4586 // overloads for boolean_t etc. in case of a custom BooleanType which is not
4587 // an arithmetic type?
4588 template < typename BasicJsonType, typename ArithmeticType,
4589  enable_if_t <
4590  std::is_arithmetic<ArithmeticType>::value&&
4591  !std::is_same<ArithmeticType, typename BasicJsonType::number_unsigned_t>::value&&
4592  !std::is_same<ArithmeticType, typename BasicJsonType::number_integer_t>::value&&
4593  !std::is_same<ArithmeticType, typename BasicJsonType::number_float_t>::value&&
4594  !std::is_same<ArithmeticType, typename BasicJsonType::boolean_t>::value,
4595  int > = 0 >
4596 inline void from_json(const BasicJsonType& j, ArithmeticType& val)
4597 {
4598  switch (static_cast<value_t>(j))
4599  {
4601  {
4602  val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_unsigned_t*>());
4603  break;
4604  }
4606  {
4607  val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_integer_t*>());
4608  break;
4609  }
4610  case value_t::number_float:
4611  {
4612  val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t*>());
4613  break;
4614  }
4615  case value_t::boolean:
4616  {
4617  val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::boolean_t*>());
4618  break;
4619  }
4620 
4621  case value_t::null:
4622  case value_t::object:
4623  case value_t::array:
4624  case value_t::string:
4625  case value_t::binary:
4626  case value_t::discarded:
4627  default:
4628  JSON_THROW(type_error::create(302, concat("type must be number, but is ", j.type_name()), &j));
4629  }
4630 }
4631 
4632 template<typename BasicJsonType, typename... Args, std::size_t... Idx>
4633 std::tuple<Args...> from_json_tuple_impl_base(BasicJsonType&& j, index_sequence<Idx...> /*unused*/)
4634 {
4635  return std::make_tuple(std::forward<BasicJsonType>(j).at(Idx).template get<Args>()...);
4636 }
4637 
4638 template < typename BasicJsonType, class A1, class A2 >
4639 std::pair<A1, A2> from_json_tuple_impl(BasicJsonType&& j, identity_tag<std::pair<A1, A2>> /*unused*/, priority_tag<0> /*unused*/)
4640 {
4641  return {std::forward<BasicJsonType>(j).at(0).template get<A1>(),
4642  std::forward<BasicJsonType>(j).at(1).template get<A2>()};
4643 }
4644 
4645 template<typename BasicJsonType, typename A1, typename A2>
4646 inline void from_json_tuple_impl(BasicJsonType&& j, std::pair<A1, A2>& p, priority_tag<1> /*unused*/)
4647 {
4648  p = from_json_tuple_impl(std::forward<BasicJsonType>(j), identity_tag<std::pair<A1, A2>> {}, priority_tag<0> {});
4649 }
4650 
4651 template<typename BasicJsonType, typename... Args>
4652 std::tuple<Args...> from_json_tuple_impl(BasicJsonType&& j, identity_tag<std::tuple<Args...>> /*unused*/, priority_tag<2> /*unused*/)
4653 {
4654  return from_json_tuple_impl_base<BasicJsonType, Args...>(std::forward<BasicJsonType>(j), index_sequence_for<Args...> {});
4655 }
4656 
4657 template<typename BasicJsonType, typename... Args>
4658 inline void from_json_tuple_impl(BasicJsonType&& j, std::tuple<Args...>& t, priority_tag<3> /*unused*/)
4659 {
4660  t = from_json_tuple_impl_base<BasicJsonType, Args...>(std::forward<BasicJsonType>(j), index_sequence_for<Args...> {});
4661 }
4662 
4663 template<typename BasicJsonType, typename TupleRelated>
4664 auto from_json(BasicJsonType&& j, TupleRelated&& t)
4665 -> decltype(from_json_tuple_impl(std::forward<BasicJsonType>(j), std::forward<TupleRelated>(t), priority_tag<3> {}))
4666 {
4667  if (JSON_HEDLEY_UNLIKELY(!j.is_array()))
4668  {
4669  JSON_THROW(type_error::create(302, concat("type must be array, but is ", j.type_name()), &j));
4670  }
4671 
4672  return from_json_tuple_impl(std::forward<BasicJsonType>(j), std::forward<TupleRelated>(t), priority_tag<3> {});
4673 }
4674 
4675 template < typename BasicJsonType, typename Key, typename Value, typename Compare, typename Allocator,
4676  typename = enable_if_t < !std::is_constructible <
4677  typename BasicJsonType::string_t, Key >::value >>
4678 inline void from_json(const BasicJsonType& j, std::map<Key, Value, Compare, Allocator>& m)
4679 {
4680  if (JSON_HEDLEY_UNLIKELY(!j.is_array()))
4681  {
4682  JSON_THROW(type_error::create(302, concat("type must be array, but is ", j.type_name()), &j));
4683  }
4684  m.clear();
4685  for (const auto& p : j)
4686  {
4687  if (JSON_HEDLEY_UNLIKELY(!p.is_array()))
4688  {
4689  JSON_THROW(type_error::create(302, concat("type must be array, but is ", p.type_name()), &j));
4690  }
4691  m.emplace(p.at(0).template get<Key>(), p.at(1).template get<Value>());
4692  }
4693 }
4694 
4695 template < typename BasicJsonType, typename Key, typename Value, typename Hash, typename KeyEqual, typename Allocator,
4696  typename = enable_if_t < !std::is_constructible <
4697  typename BasicJsonType::string_t, Key >::value >>
4698 inline void from_json(const BasicJsonType& j, std::unordered_map<Key, Value, Hash, KeyEqual, Allocator>& m)
4699 {
4700  if (JSON_HEDLEY_UNLIKELY(!j.is_array()))
4701  {
4702  JSON_THROW(type_error::create(302, concat("type must be array, but is ", j.type_name()), &j));
4703  }
4704  m.clear();
4705  for (const auto& p : j)
4706  {
4707  if (JSON_HEDLEY_UNLIKELY(!p.is_array()))
4708  {
4709  JSON_THROW(type_error::create(302, concat("type must be array, but is ", p.type_name()), &j));
4710  }
4711  m.emplace(p.at(0).template get<Key>(), p.at(1).template get<Value>());
4712  }
4713 }
4714 
4715 #if JSON_HAS_FILESYSTEM || JSON_HAS_EXPERIMENTAL_FILESYSTEM
4716 template<typename BasicJsonType>
4717 inline void from_json(const BasicJsonType& j, std_fs::path& p)
4718 {
4719  if (JSON_HEDLEY_UNLIKELY(!j.is_string()))
4720  {
4721  JSON_THROW(type_error::create(302, concat("type must be string, but is ", j.type_name()), &j));
4722  }
4723  p = *j.template get_ptr<const typename BasicJsonType::string_t*>();
4724 }
4725 #endif
4726 
4728 {
4729  template<typename BasicJsonType, typename T>
4730  auto operator()(const BasicJsonType& j, T&& val) const
4731  noexcept(noexcept(from_json(j, std::forward<T>(val))))
4732  -> decltype(from_json(j, std::forward<T>(val)))
4733  {
4734  return from_json(j, std::forward<T>(val));
4735  }
4736 };
4737 } // namespace detail
4738 
4739 #ifndef JSON_HAS_CPP_17
4743 namespace // NOLINT(cert-dcl59-cpp,fuchsia-header-anon-namespaces,google-build-namespaces)
4744 {
4745 #endif
4746 JSON_INLINE_VARIABLE constexpr const auto& from_json = // NOLINT(misc-definitions-in-headers)
4748 #ifndef JSON_HAS_CPP_17
4749 } // namespace
4750 #endif
4751 } // namespace nlohmann
4752 
4753 // #include <nlohmann/detail/conversions/to_json.hpp>
4754 
4755 
4756 #include <algorithm> // copy
4757 #include <iterator> // begin, end
4758 #include <string> // string
4759 #include <tuple> // tuple, get
4760 #include <type_traits> // is_same, is_constructible, is_floating_point, is_enum, underlying_type
4761 #include <utility> // move, forward, declval, pair
4762 #include <valarray> // valarray
4763 #include <vector> // vector
4764 
4765 // #include <nlohmann/detail/macro_scope.hpp>
4766 
4767 // #include <nlohmann/detail/iterators/iteration_proxy.hpp>
4768 
4769 
4770 #include <cstddef> // size_t
4771 #include <iterator> // input_iterator_tag
4772 #include <string> // string, to_string
4773 #include <tuple> // tuple_size, get, tuple_element
4774 #include <utility> // move
4775 
4776 #if JSON_HAS_RANGES
4777  #include <ranges> // enable_borrowed_range
4778 #endif
4779 
4780 // #include <nlohmann/detail/meta/type_traits.hpp>
4781 
4782 // #include <nlohmann/detail/value_t.hpp>
4783 
4784 
4785 namespace nlohmann
4786 {
4787 namespace detail
4788 {
4789 template<typename string_type>
4790 void int_to_string( string_type& target, std::size_t value )
4791 {
4792  // For ADL
4793  using std::to_string;
4794  target = to_string(value);
4795 }
4796 template<typename IteratorType> class iteration_proxy_value
4797 {
4798  public:
4799  using difference_type = std::ptrdiff_t;
4801  using pointer = value_type *;
4803  using iterator_category = std::input_iterator_tag;
4804  using string_type = typename std::remove_cv< typename std::remove_reference<decltype( std::declval<IteratorType>().key() ) >::type >::type;
4805 
4806  private:
4808  IteratorType anchor{};
4810  std::size_t array_index = 0;
4812  mutable std::size_t array_index_last = 0;
4814  mutable string_type array_index_str = "0";
4816  string_type empty_str{};
4817 
4818  public:
4819  explicit iteration_proxy_value() = default;
4820  explicit iteration_proxy_value(IteratorType it, std::size_t array_index_ = 0)
4821  noexcept(std::is_nothrow_move_constructible<IteratorType>::value
4822  && std::is_nothrow_default_constructible<string_type>::value)
4823  : anchor(std::move(it))
4824  , array_index(array_index_)
4825  {}
4826 
4829  // older GCCs are a bit fussy and require explicit noexcept specifiers on defaulted functions
4831  noexcept(std::is_nothrow_move_constructible<IteratorType>::value
4832  && std::is_nothrow_move_constructible<string_type>::value) = default;
4834  noexcept(std::is_nothrow_move_assignable<IteratorType>::value
4835  && std::is_nothrow_move_assignable<string_type>::value) = default;
4837 
4839  const iteration_proxy_value& operator*() const
4840  {
4841  return *this;
4842  }
4843 
4846  {
4847  ++anchor;
4848  ++array_index;
4849 
4850  return *this;
4851  }
4852 
4853  iteration_proxy_value operator++(int)& // NOLINT(cert-dcl21-cpp)
4854  {
4855  auto tmp = iteration_proxy_value(anchor, array_index);
4856  ++anchor;
4857  ++array_index;
4858  return tmp;
4859  }
4860 
4862  bool operator==(const iteration_proxy_value& o) const
4863  {
4864  return anchor == o.anchor;
4865  }
4866 
4868  bool operator!=(const iteration_proxy_value& o) const
4869  {
4870  return anchor != o.anchor;
4871  }
4872 
4874  const string_type& key() const
4875  {
4876  JSON_ASSERT(anchor.m_object != nullptr);
4877 
4878  switch (anchor.m_object->type())
4879  {
4880  // use integer array index as key
4881  case value_t::array:
4882  {
4883  if (array_index != array_index_last)
4884  {
4885  int_to_string( array_index_str, array_index );
4886  array_index_last = array_index;
4887  }
4888  return array_index_str;
4889  }
4890 
4891  // use key from the object
4892  case value_t::object:
4893  return anchor.key();
4894 
4895  // use an empty key for all primitive types
4896  case value_t::null:
4897  case value_t::string:
4898  case value_t::boolean:
4901  case value_t::number_float:
4902  case value_t::binary:
4903  case value_t::discarded:
4904  default:
4905  return empty_str;
4906  }
4907  }
4908 
4910  typename IteratorType::reference value() const
4911  {
4912  return anchor.value();
4913  }
4914 };
4915 
4917 template<typename IteratorType> class iteration_proxy
4918 {
4919  private:
4921  typename IteratorType::pointer container = nullptr;
4922 
4923  public:
4924  explicit iteration_proxy() = default;
4925 
4927  explicit iteration_proxy(typename IteratorType::reference cont) noexcept
4928  : container(&cont) {}
4929 
4932  iteration_proxy(iteration_proxy&&) noexcept = default;
4933  iteration_proxy& operator=(iteration_proxy&&) noexcept = default;
4934  ~iteration_proxy() = default;
4935 
4937  iteration_proxy_value<IteratorType> begin() const noexcept
4938  {
4939  return iteration_proxy_value<IteratorType>(container->begin());
4940  }
4941 
4944  {
4945  return iteration_proxy_value<IteratorType>(container->end());
4946  }
4947 };
4948 
4949 // Structured Bindings Support
4950 // For further reference see https://blog.tartanllama.xyz/structured-bindings/
4951 // And see https://github.com/nlohmann/json/pull/1391
4952 template<std::size_t N, typename IteratorType, enable_if_t<N == 0, int> = 0>
4954 {
4955  return i.key();
4956 }
4957 // Structured Bindings Support
4958 // For further reference see https://blog.tartanllama.xyz/structured-bindings/
4959 // And see https://github.com/nlohmann/json/pull/1391
4960 template<std::size_t N, typename IteratorType, enable_if_t<N == 1, int> = 0>
4961 auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>& i) -> decltype(i.value())
4962 {
4963  return i.value();
4964 }
4965 } // namespace detail
4966 } // namespace nlohmann
4967 
4968 // The Addition to the STD Namespace is required to add
4969 // Structured Bindings Support to the iteration_proxy_value class
4970 // For further reference see https://blog.tartanllama.xyz/structured-bindings/
4971 // And see https://github.com/nlohmann/json/pull/1391
4972 namespace std
4973 {
4974 #if defined(__clang__)
4975  // Fix: https://github.com/nlohmann/json/issues/1401
4976  #pragma clang diagnostic push
4977  #pragma clang diagnostic ignored "-Wmismatched-tags"
4978 #endif
4979 template<typename IteratorType>
4980 class tuple_size<::nlohmann::detail::iteration_proxy_value<IteratorType>>
4981  : public std::integral_constant<std::size_t, 2> {};
4982 
4983 template<std::size_t N, typename IteratorType>
4984 class tuple_element<N, ::nlohmann::detail::iteration_proxy_value<IteratorType >>
4985 {
4986  public:
4987  using type = decltype(
4988  get<N>(std::declval <
4990 };
4991 #if defined(__clang__)
4992  #pragma clang diagnostic pop
4993 #endif
4994 } // namespace std
4995 
4996 #if JSON_HAS_RANGES
4997  template <typename IteratorType>
4998  inline constexpr bool ::std::ranges::enable_borrowed_range<::nlohmann::detail::iteration_proxy<IteratorType>> = true;
4999 #endif
5000 
5001 // #include <nlohmann/detail/meta/cpp_future.hpp>
5002 
5003 // #include <nlohmann/detail/meta/type_traits.hpp>
5004 
5005 // #include <nlohmann/detail/value_t.hpp>
5006 
5007 
5008 #if JSON_HAS_EXPERIMENTAL_FILESYSTEM
5009 #include <experimental/filesystem>
5010 namespace nlohmann::detail
5011 {
5012 namespace std_fs = std::experimental::filesystem;
5013 } // namespace nlohmann::detail
5014 #elif JSON_HAS_FILESYSTEM
5015 #include <filesystem>
5016 namespace nlohmann::detail
5017 {
5018 namespace std_fs = std::filesystem;
5019 } // namespace nlohmann::detail
5020 #endif
5021 
5022 namespace nlohmann
5023 {
5024 namespace detail
5025 {
5027 // constructors //
5029 
5030 /*
5031  * Note all external_constructor<>::construct functions need to call
5032  * j.m_value.destroy(j.m_type) to avoid a memory leak in case j contains an
5033  * allocated value (e.g., a string). See bug issue
5034  * https://github.com/nlohmann/json/issues/2865 for more information.
5035  */
5036 
5037 template<value_t> struct external_constructor;
5038 
5039 template<>
5041 {
5042  template<typename BasicJsonType>
5043  static void construct(BasicJsonType& j, typename BasicJsonType::boolean_t b) noexcept
5044  {
5045  j.m_value.destroy(j.m_type);
5046  j.m_type = value_t::boolean;
5047  j.m_value = b;
5048  j.assert_invariant();
5049  }
5050 };
5051 
5052 template<>
5054 {
5055  template<typename BasicJsonType>
5056  static void construct(BasicJsonType& j, const typename BasicJsonType::string_t& s)
5057  {
5058  j.m_value.destroy(j.m_type);
5059  j.m_type = value_t::string;
5060  j.m_value = s;
5061  j.assert_invariant();
5062  }
5063 
5064  template<typename BasicJsonType>
5065  static void construct(BasicJsonType& j, typename BasicJsonType::string_t&& s)
5066  {
5067  j.m_value.destroy(j.m_type);
5068  j.m_type = value_t::string;
5069  j.m_value = std::move(s);
5070  j.assert_invariant();
5071  }
5072 
5073  template < typename BasicJsonType, typename CompatibleStringType,
5075  int > = 0 >
5076  static void construct(BasicJsonType& j, const CompatibleStringType& str)
5077  {
5078  j.m_value.destroy(j.m_type);
5079  j.m_type = value_t::string;
5080  j.m_value.string = j.template create<typename BasicJsonType::string_t>(str);
5081  j.assert_invariant();
5082  }
5083 };
5084 
5085 template<>
5087 {
5088  template<typename BasicJsonType>
5089  static void construct(BasicJsonType& j, const typename BasicJsonType::binary_t& b)
5090  {
5091  j.m_value.destroy(j.m_type);
5092  j.m_type = value_t::binary;
5093  j.m_value = typename BasicJsonType::binary_t(b);
5094  j.assert_invariant();
5095  }
5096 
5097  template<typename BasicJsonType>
5098  static void construct(BasicJsonType& j, typename BasicJsonType::binary_t&& b)
5099  {
5100  j.m_value.destroy(j.m_type);
5101  j.m_type = value_t::binary;
5102  j.m_value = typename BasicJsonType::binary_t(std::move(b));
5103  j.assert_invariant();
5104  }
5105 };
5106 
5107 template<>
5109 {
5110  template<typename BasicJsonType>
5111  static void construct(BasicJsonType& j, typename BasicJsonType::number_float_t val) noexcept
5112  {
5113  j.m_value.destroy(j.m_type);
5114  j.m_type = value_t::number_float;
5115  j.m_value = val;
5116  j.assert_invariant();
5117  }
5118 };
5119 
5120 template<>
5122 {
5123  template<typename BasicJsonType>
5124  static void construct(BasicJsonType& j, typename BasicJsonType::number_unsigned_t val) noexcept
5125  {
5126  j.m_value.destroy(j.m_type);
5127  j.m_type = value_t::number_unsigned;
5128  j.m_value = val;
5129  j.assert_invariant();
5130  }
5131 };
5132 
5133 template<>
5135 {
5136  template<typename BasicJsonType>
5137  static void construct(BasicJsonType& j, typename BasicJsonType::number_integer_t val) noexcept
5138  {
5139  j.m_value.destroy(j.m_type);
5140  j.m_type = value_t::number_integer;
5141  j.m_value = val;
5142  j.assert_invariant();
5143  }
5144 };
5145 
5146 template<>
5148 {
5149  template<typename BasicJsonType>
5150  static void construct(BasicJsonType& j, const typename BasicJsonType::array_t& arr)
5151  {
5152  j.m_value.destroy(j.m_type);
5153  j.m_type = value_t::array;
5154  j.m_value = arr;
5155  j.set_parents();
5156  j.assert_invariant();
5157  }
5158 
5159  template<typename BasicJsonType>
5160  static void construct(BasicJsonType& j, typename BasicJsonType::array_t&& arr)
5161  {
5162  j.m_value.destroy(j.m_type);
5163  j.m_type = value_t::array;
5164  j.m_value = std::move(arr);
5165  j.set_parents();
5166  j.assert_invariant();
5167  }
5168 
5169  template < typename BasicJsonType, typename CompatibleArrayType,
5171  int > = 0 >
5172  static void construct(BasicJsonType& j, const CompatibleArrayType& arr)
5173  {
5174  using std::begin;
5175  using std::end;
5176 
5177  j.m_value.destroy(j.m_type);
5178  j.m_type = value_t::array;
5179  j.m_value.array = j.template create<typename BasicJsonType::array_t>(begin(arr), end(arr));
5180  j.set_parents();
5181  j.assert_invariant();
5182  }
5183 
5184  template<typename BasicJsonType>
5185  static void construct(BasicJsonType& j, const std::vector<bool>& arr)
5186  {
5187  j.m_value.destroy(j.m_type);
5188  j.m_type = value_t::array;
5189  j.m_value = value_t::array;
5190  j.m_value.array->reserve(arr.size());
5191  for (const bool x : arr)
5192  {
5193  j.m_value.array->push_back(x);
5194  j.set_parent(j.m_value.array->back());
5195  }
5196  j.assert_invariant();
5197  }
5198 
5199  template<typename BasicJsonType, typename T,
5201  static void construct(BasicJsonType& j, const std::valarray<T>& arr)
5202  {
5203  j.m_value.destroy(j.m_type);
5204  j.m_type = value_t::array;
5205  j.m_value = value_t::array;
5206  j.m_value.array->resize(arr.size());
5207  if (arr.size() > 0)
5208  {
5209  std::copy(std::begin(arr), std::end(arr), j.m_value.array->begin());
5210  }
5211  j.set_parents();
5212  j.assert_invariant();
5213  }
5214 };
5215 
5216 template<>
5218 {
5219  template<typename BasicJsonType>
5220  static void construct(BasicJsonType& j, const typename BasicJsonType::object_t& obj)
5221  {
5222  j.m_value.destroy(j.m_type);
5223  j.m_type = value_t::object;
5224  j.m_value = obj;
5225  j.set_parents();
5226  j.assert_invariant();
5227  }
5228 
5229  template<typename BasicJsonType>
5230  static void construct(BasicJsonType& j, typename BasicJsonType::object_t&& obj)
5231  {
5232  j.m_value.destroy(j.m_type);
5233  j.m_type = value_t::object;
5234  j.m_value = std::move(obj);
5235  j.set_parents();
5236  j.assert_invariant();
5237  }
5238 
5239  template < typename BasicJsonType, typename CompatibleObjectType,
5241  static void construct(BasicJsonType& j, const CompatibleObjectType& obj)
5242  {
5243  using std::begin;
5244  using std::end;
5245 
5246  j.m_value.destroy(j.m_type);
5247  j.m_type = value_t::object;
5248  j.m_value.object = j.template create<typename BasicJsonType::object_t>(begin(obj), end(obj));
5249  j.set_parents();
5250  j.assert_invariant();
5251  }
5252 };
5253 
5255 // to_json //
5257 
5258 template<typename BasicJsonType, typename T,
5259  enable_if_t<std::is_same<T, typename BasicJsonType::boolean_t>::value, int> = 0>
5260 inline void to_json(BasicJsonType& j, T b) noexcept
5261 {
5263 }
5264 
5265 template<typename BasicJsonType,
5266  enable_if_t<std::is_convertible<const std::vector<bool>::reference&, typename BasicJsonType::boolean_t>::value, int> = 0>
5267 inline void to_json(BasicJsonType& j, const std::vector<bool>::reference& b) noexcept
5268 {
5269  external_constructor<value_t::boolean>::construct(j, static_cast<typename BasicJsonType::boolean_t>(b));
5270 }
5271 
5272 template<typename BasicJsonType, typename CompatibleString,
5273  enable_if_t<std::is_constructible<typename BasicJsonType::string_t, CompatibleString>::value, int> = 0>
5274 inline void to_json(BasicJsonType& j, const CompatibleString& s)
5275 {
5277 }
5278 
5279 template<typename BasicJsonType>
5280 inline void to_json(BasicJsonType& j, typename BasicJsonType::string_t&& s)
5281 {
5283 }
5284 
5285 template<typename BasicJsonType, typename FloatType,
5286  enable_if_t<std::is_floating_point<FloatType>::value, int> = 0>
5287 inline void to_json(BasicJsonType& j, FloatType val) noexcept
5288 {
5289  external_constructor<value_t::number_float>::construct(j, static_cast<typename BasicJsonType::number_float_t>(val));
5290 }
5291 
5292 template<typename BasicJsonType, typename CompatibleNumberUnsignedType,
5293  enable_if_t<is_compatible_integer_type<typename BasicJsonType::number_unsigned_t, CompatibleNumberUnsignedType>::value, int> = 0>
5294 inline void to_json(BasicJsonType& j, CompatibleNumberUnsignedType val) noexcept
5295 {
5296  external_constructor<value_t::number_unsigned>::construct(j, static_cast<typename BasicJsonType::number_unsigned_t>(val));
5297 }
5298 
5299 template<typename BasicJsonType, typename CompatibleNumberIntegerType,
5300  enable_if_t<is_compatible_integer_type<typename BasicJsonType::number_integer_t, CompatibleNumberIntegerType>::value, int> = 0>
5301 inline void to_json(BasicJsonType& j, CompatibleNumberIntegerType val) noexcept
5302 {
5303  external_constructor<value_t::number_integer>::construct(j, static_cast<typename BasicJsonType::number_integer_t>(val));
5304 }
5305 
5306 #if !JSON_DISABLE_ENUM_SERIALIZATION
5307 template<typename BasicJsonType, typename EnumType,
5308  enable_if_t<std::is_enum<EnumType>::value, int> = 0>
5309 inline void to_json(BasicJsonType& j, EnumType e) noexcept
5310 {
5311  using underlying_type = typename std::underlying_type<EnumType>::type;
5312  external_constructor<value_t::number_integer>::construct(j, static_cast<underlying_type>(e));
5313 }
5314 #endif // JSON_DISABLE_ENUM_SERIALIZATION
5315 
5316 template<typename BasicJsonType>
5317 inline void to_json(BasicJsonType& j, const std::vector<bool>& e)
5318 {
5320 }
5321 
5322 template < typename BasicJsonType, typename CompatibleArrayType,
5323  enable_if_t < is_compatible_array_type<BasicJsonType,
5324  CompatibleArrayType>::value&&
5325  !is_compatible_object_type<BasicJsonType, CompatibleArrayType>::value&&
5327  !std::is_same<typename BasicJsonType::binary_t, CompatibleArrayType>::value&&
5328  !is_basic_json<CompatibleArrayType>::value,
5329  int > = 0 >
5330 inline void to_json(BasicJsonType& j, const CompatibleArrayType& arr)
5331 {
5333 }
5334 
5335 template<typename BasicJsonType>
5336 inline void to_json(BasicJsonType& j, const typename BasicJsonType::binary_t& bin)
5337 {
5339 }
5340 
5341 template<typename BasicJsonType, typename T,
5342  enable_if_t<std::is_convertible<T, BasicJsonType>::value, int> = 0>
5343 inline void to_json(BasicJsonType& j, const std::valarray<T>& arr)
5344 {
5346 }
5347 
5348 template<typename BasicJsonType>
5349 inline void to_json(BasicJsonType& j, typename BasicJsonType::array_t&& arr)
5350 {
5352 }
5353 
5354 template < typename BasicJsonType, typename CompatibleObjectType,
5355  enable_if_t < is_compatible_object_type<BasicJsonType, CompatibleObjectType>::value&& !is_basic_json<CompatibleObjectType>::value, int > = 0 >
5356 inline void to_json(BasicJsonType& j, const CompatibleObjectType& obj)
5357 {
5359 }
5360 
5361 template<typename BasicJsonType>
5362 inline void to_json(BasicJsonType& j, typename BasicJsonType::object_t&& obj)
5363 {
5365 }
5366 
5367 template <
5368  typename BasicJsonType, typename T, std::size_t N,
5369  enable_if_t < !std::is_constructible<typename BasicJsonType::string_t,
5370  const T(&)[N]>::value, // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
5371  int > = 0 >
5372 inline void to_json(BasicJsonType& j, const T(&arr)[N]) // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
5373 {
5375 }
5376 
5377 template < typename BasicJsonType, typename T1, typename T2, enable_if_t < std::is_constructible<BasicJsonType, T1>::value&& std::is_constructible<BasicJsonType, T2>::value, int > = 0 >
5378 inline void to_json(BasicJsonType& j, const std::pair<T1, T2>& p)
5379 {
5380  j = { p.first, p.second };
5381 }
5382 
5383 // for https://github.com/nlohmann/json/pull/1134
5384 template<typename BasicJsonType, typename T,
5385  enable_if_t<std::is_same<T, iteration_proxy_value<typename BasicJsonType::iterator>>::value, int> = 0>
5386 inline void to_json(BasicJsonType& j, const T& b)
5387 {
5388  j = { {b.key(), b.value()} };
5389 }
5390 
5391 template<typename BasicJsonType, typename Tuple, std::size_t... Idx>
5392 inline void to_json_tuple_impl(BasicJsonType& j, const Tuple& t, index_sequence<Idx...> /*unused*/)
5393 {
5394  j = { std::get<Idx>(t)... };
5395 }
5396 
5397 template<typename BasicJsonType, typename T, enable_if_t<is_constructible_tuple<BasicJsonType, T>::value, int > = 0>
5398 inline void to_json(BasicJsonType& j, const T& t)
5399 {
5400  to_json_tuple_impl(j, t, make_index_sequence<std::tuple_size<T>::value> {});
5401 }
5402 
5403 #if JSON_HAS_FILESYSTEM || JSON_HAS_EXPERIMENTAL_FILESYSTEM
5404 template<typename BasicJsonType>
5405 inline void to_json(BasicJsonType& j, const std_fs::path& p)
5406 {
5407  j = p.string();
5408 }
5409 #endif
5410 
5412 {
5413  template<typename BasicJsonType, typename T>
5414  auto operator()(BasicJsonType& j, T&& val) const noexcept(noexcept(to_json(j, std::forward<T>(val))))
5415  -> decltype(to_json(j, std::forward<T>(val)), void())
5416  {
5417  return to_json(j, std::forward<T>(val));
5418  }
5419 };
5420 } // namespace detail
5421 
5422 #ifndef JSON_HAS_CPP_17
5426 namespace // NOLINT(cert-dcl59-cpp,fuchsia-header-anon-namespaces,google-build-namespaces)
5427 {
5428 #endif
5429 JSON_INLINE_VARIABLE constexpr const auto& to_json = // NOLINT(misc-definitions-in-headers)
5431 #ifndef JSON_HAS_CPP_17
5432 } // namespace
5433 #endif
5434 } // namespace nlohmann
5435 
5436 // #include <nlohmann/detail/meta/identity_tag.hpp>
5437 
5438 // #include <nlohmann/detail/meta/type_traits.hpp>
5439 
5440 
5441 namespace nlohmann
5442 {
5443 
5445 template<typename ValueType, typename>
5447 {
5450  template<typename BasicJsonType, typename TargetType = ValueType>
5451  static auto from_json(BasicJsonType && j, TargetType& val) noexcept(
5452  noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), val)))
5453  -> decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), val), void())
5454  {
5455  ::nlohmann::from_json(std::forward<BasicJsonType>(j), val);
5456  }
5457 
5460  template<typename BasicJsonType, typename TargetType = ValueType>
5461  static auto from_json(BasicJsonType && j) noexcept(
5462  noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {})))
5463  -> decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {}))
5464  {
5465  return ::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {});
5466  }
5467 
5470  template<typename BasicJsonType, typename TargetType = ValueType>
5471  static auto to_json(BasicJsonType& j, TargetType && val) noexcept(
5472  noexcept(::nlohmann::to_json(j, std::forward<TargetType>(val))))
5473  -> decltype(::nlohmann::to_json(j, std::forward<TargetType>(val)), void())
5474  {
5475  ::nlohmann::to_json(j, std::forward<TargetType>(val));
5476  }
5477 };
5478 } // namespace nlohmann
5479 
5480 // #include <nlohmann/byte_container_with_subtype.hpp>
5481 
5482 
5483 #include <cstdint> // uint8_t, uint64_t
5484 #include <tuple> // tie
5485 #include <utility> // move
5486 
5487 namespace nlohmann
5488 {
5489 
5492 template<typename BinaryType>
5493 class byte_container_with_subtype : public BinaryType
5494 {
5495  public:
5496  using container_type = BinaryType;
5497  using subtype_type = std::uint64_t;
5498 
5501  : container_type()
5502  {}
5503 
5506  : container_type(b)
5507  {}
5508 
5510  byte_container_with_subtype(container_type&& b) noexcept(noexcept(container_type(std::move(b))))
5511  : container_type(std::move(b))
5512  {}
5513 
5515  byte_container_with_subtype(const container_type& b, subtype_type subtype_) noexcept(noexcept(container_type(b)))
5516  : container_type(b)
5517  , m_subtype(subtype_)
5518  , m_has_subtype(true)
5519  {}
5520 
5522  byte_container_with_subtype(container_type&& b, subtype_type subtype_) noexcept(noexcept(container_type(std::move(b))))
5523  : container_type(std::move(b))
5524  , m_subtype(subtype_)
5525  , m_has_subtype(true)
5526  {}
5527 
5529  {
5530  return std::tie(static_cast<const BinaryType&>(*this), m_subtype, m_has_subtype) ==
5531  std::tie(static_cast<const BinaryType&>(rhs), rhs.m_subtype, rhs.m_has_subtype);
5532  }
5533 
5535  {
5536  return !(rhs == *this);
5537  }
5538 
5541  void set_subtype(subtype_type subtype_) noexcept
5542  {
5543  m_subtype = subtype_;
5544  m_has_subtype = true;
5545  }
5546 
5549  constexpr subtype_type subtype() const noexcept
5550  {
5551  return m_has_subtype ? m_subtype : static_cast<subtype_type>(-1);
5552  }
5553 
5556  constexpr bool has_subtype() const noexcept
5557  {
5558  return m_has_subtype;
5559  }
5560 
5563  void clear_subtype() noexcept
5564  {
5565  m_subtype = 0;
5566  m_has_subtype = false;
5567  }
5568 
5569  private:
5570  subtype_type m_subtype = 0;
5571  bool m_has_subtype = false;
5572 };
5573 
5574 } // namespace nlohmann
5575 
5576 // #include <nlohmann/detail/conversions/from_json.hpp>
5577 
5578 // #include <nlohmann/detail/conversions/to_json.hpp>
5579 
5580 // #include <nlohmann/detail/exceptions.hpp>
5581 
5582 // #include <nlohmann/detail/hash.hpp>
5583 
5584 
5585 #include <cstdint> // uint8_t
5586 #include <cstddef> // size_t
5587 #include <functional> // hash
5588 
5589 // #include <nlohmann/detail/macro_scope.hpp>
5590 
5591 // #include <nlohmann/detail/value_t.hpp>
5592 
5593 
5594 namespace nlohmann
5595 {
5596 namespace detail
5597 {
5598 
5599 // boost::hash_combine
5600 inline std::size_t combine(std::size_t seed, std::size_t h) noexcept
5601 {
5602  seed ^= h + 0x9e3779b9 + (seed << 6U) + (seed >> 2U);
5603  return seed;
5604 }
5605 
5617 template<typename BasicJsonType>
5618 std::size_t hash(const BasicJsonType& j)
5619 {
5620  using string_t = typename BasicJsonType::string_t;
5621  using number_integer_t = typename BasicJsonType::number_integer_t;
5622  using number_unsigned_t = typename BasicJsonType::number_unsigned_t;
5623  using number_float_t = typename BasicJsonType::number_float_t;
5624 
5625  const auto type = static_cast<std::size_t>(j.type());
5626  switch (j.type())
5627  {
5628  case BasicJsonType::value_t::null:
5629  case BasicJsonType::value_t::discarded:
5630  {
5631  return combine(type, 0);
5632  }
5633 
5634  case BasicJsonType::value_t::object:
5635  {
5636  auto seed = combine(type, j.size());
5637  for (const auto& element : j.items())
5638  {
5639  const auto h = std::hash<string_t> {}(element.key());
5640  seed = combine(seed, h);
5641  seed = combine(seed, hash(element.value()));
5642  }
5643  return seed;
5644  }
5645 
5646  case BasicJsonType::value_t::array:
5647  {
5648  auto seed = combine(type, j.size());
5649  for (const auto& element : j)
5650  {
5651  seed = combine(seed, hash(element));
5652  }
5653  return seed;
5654  }
5655 
5656  case BasicJsonType::value_t::string:
5657  {
5658  const auto h = std::hash<string_t> {}(j.template get_ref<const string_t&>());
5659  return combine(type, h);
5660  }
5661 
5662  case BasicJsonType::value_t::boolean:
5663  {
5664  const auto h = std::hash<bool> {}(j.template get<bool>());
5665  return combine(type, h);
5666  }
5667 
5668  case BasicJsonType::value_t::number_integer:
5669  {
5670  const auto h = std::hash<number_integer_t> {}(j.template get<number_integer_t>());
5671  return combine(type, h);
5672  }
5673 
5674  case BasicJsonType::value_t::number_unsigned:
5675  {
5676  const auto h = std::hash<number_unsigned_t> {}(j.template get<number_unsigned_t>());
5677  return combine(type, h);
5678  }
5679 
5680  case BasicJsonType::value_t::number_float:
5681  {
5682  const auto h = std::hash<number_float_t> {}(j.template get<number_float_t>());
5683  return combine(type, h);
5684  }
5685 
5686  case BasicJsonType::value_t::binary:
5687  {
5688  auto seed = combine(type, j.get_binary().size());
5689  const auto h = std::hash<bool> {}(j.get_binary().has_subtype());
5690  seed = combine(seed, h);
5691  seed = combine(seed, static_cast<std::size_t>(j.get_binary().subtype()));
5692  for (const auto byte : j.get_binary())
5693  {
5694  seed = combine(seed, std::hash<std::uint8_t> {}(byte));
5695  }
5696  return seed;
5697  }
5698 
5699  default: // LCOV_EXCL_LINE
5700  JSON_ASSERT(false); // NOLINT(cert-dcl03-c,hicpp-static-assert,misc-static-assert) LCOV_EXCL_LINE
5701  return 0; // LCOV_EXCL_LINE
5702  }
5703 }
5704 
5705 } // namespace detail
5706 } // namespace nlohmann
5707 
5708 // #include <nlohmann/detail/input/binary_reader.hpp>
5709 
5710 
5711 #include <algorithm> // generate_n
5712 #include <array> // array
5713 #include <cmath> // ldexp
5714 #include <cstddef> // size_t
5715 #include <cstdint> // uint8_t, uint16_t, uint32_t, uint64_t
5716 #include <cstdio> // snprintf
5717 #include <cstring> // memcpy
5718 #include <iterator> // back_inserter
5719 #include <limits> // numeric_limits
5720 #include <string> // char_traits, string
5721 #include <utility> // make_pair, move
5722 #include <vector> // vector
5723 #include <map> // map
5724 
5725 // #include <nlohmann/detail/exceptions.hpp>
5726 
5727 // #include <nlohmann/detail/input/input_adapters.hpp>
5728 
5729 
5730 #include <array> // array
5731 #include <cstddef> // size_t
5732 #include <cstring> // strlen
5733 #include <iterator> // begin, end, iterator_traits, random_access_iterator_tag, distance, next
5734 #include <memory> // shared_ptr, make_shared, addressof
5735 #include <numeric> // accumulate
5736 #include <string> // string, char_traits
5737 #include <type_traits> // enable_if, is_base_of, is_pointer, is_integral, remove_pointer
5738 #include <utility> // pair, declval
5739 
5740 #ifndef JSON_NO_IO
5741  #include <cstdio> // FILE *
5742  #include <istream> // istream
5743 #endif // JSON_NO_IO
5744 
5745 // #include <nlohmann/detail/iterators/iterator_traits.hpp>
5746 
5747 // #include <nlohmann/detail/macro_scope.hpp>
5748 
5749 
5750 namespace nlohmann
5751 {
5752 namespace detail
5753 {
5756 
5758 // input adapters //
5760 
5761 #ifndef JSON_NO_IO
5767 {
5768  public:
5769  using char_type = char;
5770 
5772  explicit file_input_adapter(std::FILE* f) noexcept
5773  : m_file(f)
5774  {}
5775 
5776  // make class move-only
5779  file_input_adapter& operator=(const file_input_adapter&) = delete;
5780  file_input_adapter& operator=(file_input_adapter&&) = delete;
5781  ~file_input_adapter() = default;
5782 
5783  std::char_traits<char>::int_type get_character() noexcept
5784  {
5785  return std::fgetc(m_file);
5786  }
5787 
5788  private:
5790  std::FILE* m_file;
5791 };
5792 
5793 
5804 {
5805  public:
5806  using char_type = char;
5807 
5809  {
5810  // clear stream flags; we use underlying streambuf I/O, do not
5811  // maintain ifstream flags, except eof
5812  if (is != nullptr)
5813  {
5814  is->clear(is->rdstate() & std::ios::eofbit);
5815  }
5816  }
5817 
5818  explicit input_stream_adapter(std::istream& i)
5819  : is(&i), sb(i.rdbuf())
5820  {}
5821 
5822  // delete because of pointer members
5826 
5828  : is(rhs.is), sb(rhs.sb)
5829  {
5830  rhs.is = nullptr;
5831  rhs.sb = nullptr;
5832  }
5833 
5834  // std::istream/std::streambuf use std::char_traits<char>::to_int_type, to
5835  // ensure that std::char_traits<char>::eof() and the character 0xFF do not
5836  // end up as the same value, e.g. 0xFFFFFFFF.
5837  std::char_traits<char>::int_type get_character()
5838  {
5839  auto res = sb->sbumpc();
5840  // set eof manually, as we don't use the istream interface.
5841  if (JSON_HEDLEY_UNLIKELY(res == std::char_traits<char>::eof()))
5842  {
5843  is->clear(is->rdstate() | std::ios::eofbit);
5844  }
5845  return res;
5846  }
5847 
5848  private:
5850  std::istream* is = nullptr;
5851  std::streambuf* sb = nullptr;
5852 };
5853 #endif // JSON_NO_IO
5854 
5855&#