Crossfire Server, Trunk
json.hpp
Go to the documentation of this file.
1 /*
2  __ _____ _____ _____
3  __| | __| | | | JSON for Modern C++
4 | | |__ | | | | | | version 3.10.0
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-2019 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 #ifndef INCLUDE_NLOHMANN_JSON_HPP_
31 #define INCLUDE_NLOHMANN_JSON_HPP_
32 
33 #define NLOHMANN_JSON_VERSION_MAJOR 3
34 #define NLOHMANN_JSON_VERSION_MINOR 10
35 #define NLOHMANN_JSON_VERSION_PATCH 0
36 
37 #include <algorithm> // all_of, find, for_each
38 #include <cstddef> // nullptr_t, ptrdiff_t, size_t
39 #include <functional> // hash, less
40 #include <initializer_list> // initializer_list
41 #ifndef JSON_NO_IO
42  #include <iosfwd> // istream, ostream
43 #endif // JSON_NO_IO
44 #include <iterator> // random_access_iterator_tag
45 #include <memory> // unique_ptr
46 #include <numeric> // accumulate
47 #include <string> // string, stoi, to_string
48 #include <utility> // declval, forward, move, pair, swap
49 #include <vector> // vector
50 
51 // #include <nlohmann/adl_serializer.hpp>
52 
53 
54 #include <type_traits>
55 #include <utility>
56 
57 // #include <nlohmann/detail/conversions/from_json.hpp>
58 
59 
60 #include <algorithm> // transform
61 #include <array> // array
62 #include <forward_list> // forward_list
63 #include <iterator> // inserter, front_inserter, end
64 #include <map> // map
65 #include <string> // string
66 #include <tuple> // tuple, make_tuple
67 #include <type_traits> // is_arithmetic, is_same, is_enum, underlying_type, is_convertible
68 #include <unordered_map> // unordered_map
69 #include <utility> // pair, declval
70 #include <valarray> // valarray
71 
72 // #include <nlohmann/detail/exceptions.hpp>
73 
74 
75 #include <exception> // exception
76 #include <stdexcept> // runtime_error
77 #include <string> // to_string
78 #include <vector> // vector
79 
80 // #include <nlohmann/detail/value_t.hpp>
81 
82 
83 #include <array> // array
84 #include <cstddef> // size_t
85 #include <cstdint> // uint8_t
86 #include <string> // string
87 
88 namespace nlohmann
89 {
90 namespace detail
91 {
93 // JSON type enumeration //
95 
120 enum class value_t : std::uint8_t
121 {
122  null,
123  object,
124  array,
125  string,
126  boolean,
129  number_float,
130  binary,
131  discarded
132 };
133 
147 inline bool operator<(const value_t lhs, const value_t rhs) noexcept
148 {
149  static constexpr std::array<std::uint8_t, 9> order = {{
150  0 /* null */, 3 /* object */, 4 /* array */, 5 /* string */,
151  1 /* boolean */, 2 /* integer */, 2 /* unsigned */, 2 /* float */,
152  6 /* binary */
153  }
154  };
155 
156  const auto l_index = static_cast<std::size_t>(lhs);
157  const auto r_index = static_cast<std::size_t>(rhs);
158  return l_index < order.size() && r_index < order.size() && order[l_index] < order[r_index];
159 }
160 } // namespace detail
161 } // namespace nlohmann
162 
163 // #include <nlohmann/detail/string_escape.hpp>
164 
165 
166 #include <string>
167 // #include <nlohmann/detail/macro_scope.hpp>
168 
169 
170 #include <utility> // pair
171 // #include <nlohmann/thirdparty/hedley/hedley.hpp>
172 
173 
174 /* Hedley - https://nemequ.github.io/hedley
175  * Created by Evan Nemerson <evan@nemerson.com>
176  *
177  * To the extent possible under law, the author(s) have dedicated all
178  * copyright and related and neighboring rights to this software to
179  * the public domain worldwide. This software is distributed without
180  * any warranty.
181  *
182  * For details, see <http://creativecommons.org/publicdomain/zero/1.0/>.
183  * SPDX-License-Identifier: CC0-1.0
184  */
185 
186 #if !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < 15)
187 #if defined(JSON_HEDLEY_VERSION)
188  #undef JSON_HEDLEY_VERSION
189 #endif
190 #define JSON_HEDLEY_VERSION 15
191 
192 #if defined(JSON_HEDLEY_STRINGIFY_EX)
193  #undef JSON_HEDLEY_STRINGIFY_EX
194 #endif
195 #define JSON_HEDLEY_STRINGIFY_EX(x) #x
196 
197 #if defined(JSON_HEDLEY_STRINGIFY)
198  #undef JSON_HEDLEY_STRINGIFY
199 #endif
200 #define JSON_HEDLEY_STRINGIFY(x) JSON_HEDLEY_STRINGIFY_EX(x)
201 
202 #if defined(JSON_HEDLEY_CONCAT_EX)
203  #undef JSON_HEDLEY_CONCAT_EX
204 #endif
205 #define JSON_HEDLEY_CONCAT_EX(a,b) a##b
206 
207 #if defined(JSON_HEDLEY_CONCAT)
208  #undef JSON_HEDLEY_CONCAT
209 #endif
210 #define JSON_HEDLEY_CONCAT(a,b) JSON_HEDLEY_CONCAT_EX(a,b)
211 
212 #if defined(JSON_HEDLEY_CONCAT3_EX)
213  #undef JSON_HEDLEY_CONCAT3_EX
214 #endif
215 #define JSON_HEDLEY_CONCAT3_EX(a,b,c) a##b##c
216 
217 #if defined(JSON_HEDLEY_CONCAT3)
218  #undef JSON_HEDLEY_CONCAT3
219 #endif
220 #define JSON_HEDLEY_CONCAT3(a,b,c) JSON_HEDLEY_CONCAT3_EX(a,b,c)
221 
222 #if defined(JSON_HEDLEY_VERSION_ENCODE)
223  #undef JSON_HEDLEY_VERSION_ENCODE
224 #endif
225 #define JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision))
226 
227 #if defined(JSON_HEDLEY_VERSION_DECODE_MAJOR)
228  #undef JSON_HEDLEY_VERSION_DECODE_MAJOR
229 #endif
230 #define JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000)
231 
232 #if defined(JSON_HEDLEY_VERSION_DECODE_MINOR)
233  #undef JSON_HEDLEY_VERSION_DECODE_MINOR
234 #endif
235 #define JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000)
236 
237 #if defined(JSON_HEDLEY_VERSION_DECODE_REVISION)
238  #undef JSON_HEDLEY_VERSION_DECODE_REVISION
239 #endif
240 #define JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000)
241 
242 #if defined(JSON_HEDLEY_GNUC_VERSION)
243  #undef JSON_HEDLEY_GNUC_VERSION
244 #endif
245 #if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__)
246  #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
247 #elif defined(__GNUC__)
248  #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0)
249 #endif
250 
251 #if defined(JSON_HEDLEY_GNUC_VERSION_CHECK)
252  #undef JSON_HEDLEY_GNUC_VERSION_CHECK
253 #endif
254 #if defined(JSON_HEDLEY_GNUC_VERSION)
255  #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GNUC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
256 #else
257  #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0)
258 #endif
259 
260 #if defined(JSON_HEDLEY_MSVC_VERSION)
261  #undef JSON_HEDLEY_MSVC_VERSION
262 #endif
263 #if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) && !defined(__ICL)
264  #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100)
265 #elif defined(_MSC_FULL_VER) && !defined(__ICL)
266  #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10)
267 #elif defined(_MSC_VER) && !defined(__ICL)
268  #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0)
269 #endif
270 
271 #if defined(JSON_HEDLEY_MSVC_VERSION_CHECK)
272  #undef JSON_HEDLEY_MSVC_VERSION_CHECK
273 #endif
274 #if !defined(JSON_HEDLEY_MSVC_VERSION)
275  #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0)
276 #elif defined(_MSC_VER) && (_MSC_VER >= 1400)
277  #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch)))
278 #elif defined(_MSC_VER) && (_MSC_VER >= 1200)
279  #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch)))
280 #else
281  #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor)))
282 #endif
283 
284 #if defined(JSON_HEDLEY_INTEL_VERSION)
285  #undef JSON_HEDLEY_INTEL_VERSION
286 #endif
287 #if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && !defined(__ICL)
288  #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE)
289 #elif defined(__INTEL_COMPILER) && !defined(__ICL)
290  #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0)
291 #endif
292 
293 #if defined(JSON_HEDLEY_INTEL_VERSION_CHECK)
294  #undef JSON_HEDLEY_INTEL_VERSION_CHECK
295 #endif
296 #if defined(JSON_HEDLEY_INTEL_VERSION)
297  #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
298 #else
299  #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0)
300 #endif
301 
302 #if defined(JSON_HEDLEY_INTEL_CL_VERSION)
303  #undef JSON_HEDLEY_INTEL_CL_VERSION
304 #endif
305 #if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && defined(__ICL)
306  #define JSON_HEDLEY_INTEL_CL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER, __INTEL_COMPILER_UPDATE, 0)
307 #endif
308 
309 #if defined(JSON_HEDLEY_INTEL_CL_VERSION_CHECK)
310  #undef JSON_HEDLEY_INTEL_CL_VERSION_CHECK
311 #endif
312 #if defined(JSON_HEDLEY_INTEL_CL_VERSION)
313  #define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_CL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
314 #else
315  #define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (0)
316 #endif
317 
318 #if defined(JSON_HEDLEY_PGI_VERSION)
319  #undef JSON_HEDLEY_PGI_VERSION
320 #endif
321 #if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__)
322  #define JSON_HEDLEY_PGI_VERSION JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__)
323 #endif
324 
325 #if defined(JSON_HEDLEY_PGI_VERSION_CHECK)
326  #undef JSON_HEDLEY_PGI_VERSION_CHECK
327 #endif
328 #if defined(JSON_HEDLEY_PGI_VERSION)
329  #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PGI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
330 #else
331  #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0)
332 #endif
333 
334 #if defined(JSON_HEDLEY_SUNPRO_VERSION)
335  #undef JSON_HEDLEY_SUNPRO_VERSION
336 #endif
337 #if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000)
338  #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)
339 #elif defined(__SUNPRO_C)
340  #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf)
341 #elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000)
342  #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)
343 #elif defined(__SUNPRO_CC)
344  #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf)
345 #endif
346 
347 #if defined(JSON_HEDLEY_SUNPRO_VERSION_CHECK)
348  #undef JSON_HEDLEY_SUNPRO_VERSION_CHECK
349 #endif
350 #if defined(JSON_HEDLEY_SUNPRO_VERSION)
351  #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_SUNPRO_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
352 #else
353  #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0)
354 #endif
355 
356 #if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION)
357  #undef JSON_HEDLEY_EMSCRIPTEN_VERSION
358 #endif
359 #if defined(__EMSCRIPTEN__)
360  #define JSON_HEDLEY_EMSCRIPTEN_VERSION JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__)
361 #endif
362 
363 #if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK)
364  #undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK
365 #endif
366 #if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION)
367  #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_EMSCRIPTEN_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
368 #else
369  #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0)
370 #endif
371 
372 #if defined(JSON_HEDLEY_ARM_VERSION)
373  #undef JSON_HEDLEY_ARM_VERSION
374 #endif
375 #if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION)
376  #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100)
377 #elif defined(__CC_ARM) && defined(__ARMCC_VERSION)
378  #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100)
379 #endif
380 
381 #if defined(JSON_HEDLEY_ARM_VERSION_CHECK)
382  #undef JSON_HEDLEY_ARM_VERSION_CHECK
383 #endif
384 #if defined(JSON_HEDLEY_ARM_VERSION)
385  #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_ARM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
386 #else
387  #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0)
388 #endif
389 
390 #if defined(JSON_HEDLEY_IBM_VERSION)
391  #undef JSON_HEDLEY_IBM_VERSION
392 #endif
393 #if defined(__ibmxl__)
394  #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__)
395 #elif defined(__xlC__) && defined(__xlC_ver__)
396  #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff)
397 #elif defined(__xlC__)
398  #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0)
399 #endif
400 
401 #if defined(JSON_HEDLEY_IBM_VERSION_CHECK)
402  #undef JSON_HEDLEY_IBM_VERSION_CHECK
403 #endif
404 #if defined(JSON_HEDLEY_IBM_VERSION)
405  #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IBM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
406 #else
407  #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0)
408 #endif
409 
410 #if defined(JSON_HEDLEY_TI_VERSION)
411  #undef JSON_HEDLEY_TI_VERSION
412 #endif
413 #if \
414  defined(__TI_COMPILER_VERSION__) && \
415  ( \
416  defined(__TMS470__) || defined(__TI_ARM__) || \
417  defined(__MSP430__) || \
418  defined(__TMS320C2000__) \
419  )
420 #if (__TI_COMPILER_VERSION__ >= 16000000)
421  #define JSON_HEDLEY_TI_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
422 #endif
423 #endif
424 
425 #if defined(JSON_HEDLEY_TI_VERSION_CHECK)
426  #undef JSON_HEDLEY_TI_VERSION_CHECK
427 #endif
428 #if defined(JSON_HEDLEY_TI_VERSION)
429  #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
430 #else
431  #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0)
432 #endif
433 
434 #if defined(JSON_HEDLEY_TI_CL2000_VERSION)
435  #undef JSON_HEDLEY_TI_CL2000_VERSION
436 #endif
437 #if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C2000__)
438  #define JSON_HEDLEY_TI_CL2000_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
439 #endif
440 
441 #if defined(JSON_HEDLEY_TI_CL2000_VERSION_CHECK)
442  #undef JSON_HEDLEY_TI_CL2000_VERSION_CHECK
443 #endif
444 #if defined(JSON_HEDLEY_TI_CL2000_VERSION)
445  #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL2000_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
446 #else
447  #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (0)
448 #endif
449 
450 #if defined(JSON_HEDLEY_TI_CL430_VERSION)
451  #undef JSON_HEDLEY_TI_CL430_VERSION
452 #endif
453 #if defined(__TI_COMPILER_VERSION__) && defined(__MSP430__)
454  #define JSON_HEDLEY_TI_CL430_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
455 #endif
456 
457 #if defined(JSON_HEDLEY_TI_CL430_VERSION_CHECK)
458  #undef JSON_HEDLEY_TI_CL430_VERSION_CHECK
459 #endif
460 #if defined(JSON_HEDLEY_TI_CL430_VERSION)
461  #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL430_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
462 #else
463  #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (0)
464 #endif
465 
466 #if defined(JSON_HEDLEY_TI_ARMCL_VERSION)
467  #undef JSON_HEDLEY_TI_ARMCL_VERSION
468 #endif
469 #if defined(__TI_COMPILER_VERSION__) && (defined(__TMS470__) || defined(__TI_ARM__))
470  #define JSON_HEDLEY_TI_ARMCL_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
471 #endif
472 
473 #if defined(JSON_HEDLEY_TI_ARMCL_VERSION_CHECK)
474  #undef JSON_HEDLEY_TI_ARMCL_VERSION_CHECK
475 #endif
476 #if defined(JSON_HEDLEY_TI_ARMCL_VERSION)
477  #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_ARMCL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
478 #else
479  #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (0)
480 #endif
481 
482 #if defined(JSON_HEDLEY_TI_CL6X_VERSION)
483  #undef JSON_HEDLEY_TI_CL6X_VERSION
484 #endif
485 #if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C6X__)
486  #define JSON_HEDLEY_TI_CL6X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
487 #endif
488 
489 #if defined(JSON_HEDLEY_TI_CL6X_VERSION_CHECK)
490  #undef JSON_HEDLEY_TI_CL6X_VERSION_CHECK
491 #endif
492 #if defined(JSON_HEDLEY_TI_CL6X_VERSION)
493  #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL6X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
494 #else
495  #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (0)
496 #endif
497 
498 #if defined(JSON_HEDLEY_TI_CL7X_VERSION)
499  #undef JSON_HEDLEY_TI_CL7X_VERSION
500 #endif
501 #if defined(__TI_COMPILER_VERSION__) && defined(__C7000__)
502  #define JSON_HEDLEY_TI_CL7X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
503 #endif
504 
505 #if defined(JSON_HEDLEY_TI_CL7X_VERSION_CHECK)
506  #undef JSON_HEDLEY_TI_CL7X_VERSION_CHECK
507 #endif
508 #if defined(JSON_HEDLEY_TI_CL7X_VERSION)
509  #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL7X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
510 #else
511  #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (0)
512 #endif
513 
514 #if defined(JSON_HEDLEY_TI_CLPRU_VERSION)
515  #undef JSON_HEDLEY_TI_CLPRU_VERSION
516 #endif
517 #if defined(__TI_COMPILER_VERSION__) && defined(__PRU__)
518  #define JSON_HEDLEY_TI_CLPRU_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
519 #endif
520 
521 #if defined(JSON_HEDLEY_TI_CLPRU_VERSION_CHECK)
522  #undef JSON_HEDLEY_TI_CLPRU_VERSION_CHECK
523 #endif
524 #if defined(JSON_HEDLEY_TI_CLPRU_VERSION)
525  #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CLPRU_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
526 #else
527  #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (0)
528 #endif
529 
530 #if defined(JSON_HEDLEY_CRAY_VERSION)
531  #undef JSON_HEDLEY_CRAY_VERSION
532 #endif
533 #if defined(_CRAYC)
534  #if defined(_RELEASE_PATCHLEVEL)
535  #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL)
536  #else
537  #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0)
538  #endif
539 #endif
540 
541 #if defined(JSON_HEDLEY_CRAY_VERSION_CHECK)
542  #undef JSON_HEDLEY_CRAY_VERSION_CHECK
543 #endif
544 #if defined(JSON_HEDLEY_CRAY_VERSION)
545  #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_CRAY_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
546 #else
547  #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0)
548 #endif
549 
550 #if defined(JSON_HEDLEY_IAR_VERSION)
551  #undef JSON_HEDLEY_IAR_VERSION
552 #endif
553 #if defined(__IAR_SYSTEMS_ICC__)
554  #if __VER__ > 1000
555  #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000))
556  #else
557  #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE(__VER__ / 100, __VER__ % 100, 0)
558  #endif
559 #endif
560 
561 #if defined(JSON_HEDLEY_IAR_VERSION_CHECK)
562  #undef JSON_HEDLEY_IAR_VERSION_CHECK
563 #endif
564 #if defined(JSON_HEDLEY_IAR_VERSION)
565  #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IAR_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
566 #else
567  #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0)
568 #endif
569 
570 #if defined(JSON_HEDLEY_TINYC_VERSION)
571  #undef JSON_HEDLEY_TINYC_VERSION
572 #endif
573 #if defined(__TINYC__)
574  #define JSON_HEDLEY_TINYC_VERSION JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100)
575 #endif
576 
577 #if defined(JSON_HEDLEY_TINYC_VERSION_CHECK)
578  #undef JSON_HEDLEY_TINYC_VERSION_CHECK
579 #endif
580 #if defined(JSON_HEDLEY_TINYC_VERSION)
581  #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TINYC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
582 #else
583  #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0)
584 #endif
585 
586 #if defined(JSON_HEDLEY_DMC_VERSION)
587  #undef JSON_HEDLEY_DMC_VERSION
588 #endif
589 #if defined(__DMC__)
590  #define JSON_HEDLEY_DMC_VERSION JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf)
591 #endif
592 
593 #if defined(JSON_HEDLEY_DMC_VERSION_CHECK)
594  #undef JSON_HEDLEY_DMC_VERSION_CHECK
595 #endif
596 #if defined(JSON_HEDLEY_DMC_VERSION)
597  #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_DMC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
598 #else
599  #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0)
600 #endif
601 
602 #if defined(JSON_HEDLEY_COMPCERT_VERSION)
603  #undef JSON_HEDLEY_COMPCERT_VERSION
604 #endif
605 #if defined(__COMPCERT_VERSION__)
606  #define JSON_HEDLEY_COMPCERT_VERSION JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100)
607 #endif
608 
609 #if defined(JSON_HEDLEY_COMPCERT_VERSION_CHECK)
610  #undef JSON_HEDLEY_COMPCERT_VERSION_CHECK
611 #endif
612 #if defined(JSON_HEDLEY_COMPCERT_VERSION)
613  #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_COMPCERT_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
614 #else
615  #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0)
616 #endif
617 
618 #if defined(JSON_HEDLEY_PELLES_VERSION)
619  #undef JSON_HEDLEY_PELLES_VERSION
620 #endif
621 #if defined(__POCC__)
622  #define JSON_HEDLEY_PELLES_VERSION JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0)
623 #endif
624 
625 #if defined(JSON_HEDLEY_PELLES_VERSION_CHECK)
626  #undef JSON_HEDLEY_PELLES_VERSION_CHECK
627 #endif
628 #if defined(JSON_HEDLEY_PELLES_VERSION)
629  #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PELLES_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
630 #else
631  #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0)
632 #endif
633 
634 #if defined(JSON_HEDLEY_MCST_LCC_VERSION)
635  #undef JSON_HEDLEY_MCST_LCC_VERSION
636 #endif
637 #if defined(__LCC__) && defined(__LCC_MINOR__)
638  #define JSON_HEDLEY_MCST_LCC_VERSION JSON_HEDLEY_VERSION_ENCODE(__LCC__ / 100, __LCC__ % 100, __LCC_MINOR__)
639 #endif
640 
641 #if defined(JSON_HEDLEY_MCST_LCC_VERSION_CHECK)
642  #undef JSON_HEDLEY_MCST_LCC_VERSION_CHECK
643 #endif
644 #if defined(JSON_HEDLEY_MCST_LCC_VERSION)
645  #define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_MCST_LCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
646 #else
647  #define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (0)
648 #endif
649 
650 #if defined(JSON_HEDLEY_GCC_VERSION)
651  #undef JSON_HEDLEY_GCC_VERSION
652 #endif
653 #if \
654  defined(JSON_HEDLEY_GNUC_VERSION) && \
655  !defined(__clang__) && \
656  !defined(JSON_HEDLEY_INTEL_VERSION) && \
657  !defined(JSON_HEDLEY_PGI_VERSION) && \
658  !defined(JSON_HEDLEY_ARM_VERSION) && \
659  !defined(JSON_HEDLEY_CRAY_VERSION) && \
660  !defined(JSON_HEDLEY_TI_VERSION) && \
661  !defined(JSON_HEDLEY_TI_ARMCL_VERSION) && \
662  !defined(JSON_HEDLEY_TI_CL430_VERSION) && \
663  !defined(JSON_HEDLEY_TI_CL2000_VERSION) && \
664  !defined(JSON_HEDLEY_TI_CL6X_VERSION) && \
665  !defined(JSON_HEDLEY_TI_CL7X_VERSION) && \
666  !defined(JSON_HEDLEY_TI_CLPRU_VERSION) && \
667  !defined(__COMPCERT__) && \
668  !defined(JSON_HEDLEY_MCST_LCC_VERSION)
669  #define JSON_HEDLEY_GCC_VERSION JSON_HEDLEY_GNUC_VERSION
670 #endif
671 
672 #if defined(JSON_HEDLEY_GCC_VERSION_CHECK)
673  #undef JSON_HEDLEY_GCC_VERSION_CHECK
674 #endif
675 #if defined(JSON_HEDLEY_GCC_VERSION)
676  #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
677 #else
678  #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0)
679 #endif
680 
681 #if defined(JSON_HEDLEY_HAS_ATTRIBUTE)
682  #undef JSON_HEDLEY_HAS_ATTRIBUTE
683 #endif
684 #if \
685  defined(__has_attribute) && \
686  ( \
687  (!defined(JSON_HEDLEY_IAR_VERSION) || JSON_HEDLEY_IAR_VERSION_CHECK(8,5,9)) \
688  )
689 # define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute)
690 #else
691 # define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0)
692 #endif
693 
694 #if defined(JSON_HEDLEY_GNUC_HAS_ATTRIBUTE)
695  #undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE
696 #endif
697 #if defined(__has_attribute)
698  #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute)
699 #else
700  #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
701 #endif
702 
703 #if defined(JSON_HEDLEY_GCC_HAS_ATTRIBUTE)
704  #undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE
705 #endif
706 #if defined(__has_attribute)
707  #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute)
708 #else
709  #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
710 #endif
711 
712 #if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE)
713  #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE
714 #endif
715 #if \
716  defined(__has_cpp_attribute) && \
717  defined(__cplusplus) && \
718  (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0))
719  #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute)
720 #else
721  #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0)
722 #endif
723 
724 #if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS)
725  #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS
726 #endif
727 #if !defined(__cplusplus) || !defined(__has_cpp_attribute)
728  #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0)
729 #elif \
730  !defined(JSON_HEDLEY_PGI_VERSION) && \
731  !defined(JSON_HEDLEY_IAR_VERSION) && \
732  (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \
733  (!defined(JSON_HEDLEY_MSVC_VERSION) || JSON_HEDLEY_MSVC_VERSION_CHECK(19,20,0))
734  #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(ns::attribute)
735 #else
736  #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0)
737 #endif
738 
739 #if defined(JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE)
740  #undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE
741 #endif
742 #if defined(__has_cpp_attribute) && defined(__cplusplus)
743  #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute)
744 #else
745  #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
746 #endif
747 
748 #if defined(JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE)
749  #undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE
750 #endif
751 #if defined(__has_cpp_attribute) && defined(__cplusplus)
752  #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute)
753 #else
754  #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
755 #endif
756 
757 #if defined(JSON_HEDLEY_HAS_BUILTIN)
758  #undef JSON_HEDLEY_HAS_BUILTIN
759 #endif
760 #if defined(__has_builtin)
761  #define JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin)
762 #else
763  #define JSON_HEDLEY_HAS_BUILTIN(builtin) (0)
764 #endif
765 
766 #if defined(JSON_HEDLEY_GNUC_HAS_BUILTIN)
767  #undef JSON_HEDLEY_GNUC_HAS_BUILTIN
768 #endif
769 #if defined(__has_builtin)
770  #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin)
771 #else
772  #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
773 #endif
774 
775 #if defined(JSON_HEDLEY_GCC_HAS_BUILTIN)
776  #undef JSON_HEDLEY_GCC_HAS_BUILTIN
777 #endif
778 #if defined(__has_builtin)
779  #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin)
780 #else
781  #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
782 #endif
783 
784 #if defined(JSON_HEDLEY_HAS_FEATURE)
785  #undef JSON_HEDLEY_HAS_FEATURE
786 #endif
787 #if defined(__has_feature)
788  #define JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature)
789 #else
790  #define JSON_HEDLEY_HAS_FEATURE(feature) (0)
791 #endif
792 
793 #if defined(JSON_HEDLEY_GNUC_HAS_FEATURE)
794  #undef JSON_HEDLEY_GNUC_HAS_FEATURE
795 #endif
796 #if defined(__has_feature)
797  #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature)
798 #else
799  #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
800 #endif
801 
802 #if defined(JSON_HEDLEY_GCC_HAS_FEATURE)
803  #undef JSON_HEDLEY_GCC_HAS_FEATURE
804 #endif
805 #if defined(__has_feature)
806  #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature)
807 #else
808  #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
809 #endif
810 
811 #if defined(JSON_HEDLEY_HAS_EXTENSION)
812  #undef JSON_HEDLEY_HAS_EXTENSION
813 #endif
814 #if defined(__has_extension)
815  #define JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension)
816 #else
817  #define JSON_HEDLEY_HAS_EXTENSION(extension) (0)
818 #endif
819 
820 #if defined(JSON_HEDLEY_GNUC_HAS_EXTENSION)
821  #undef JSON_HEDLEY_GNUC_HAS_EXTENSION
822 #endif
823 #if defined(__has_extension)
824  #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension)
825 #else
826  #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
827 #endif
828 
829 #if defined(JSON_HEDLEY_GCC_HAS_EXTENSION)
830  #undef JSON_HEDLEY_GCC_HAS_EXTENSION
831 #endif
832 #if defined(__has_extension)
833  #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension)
834 #else
835  #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
836 #endif
837 
838 #if defined(JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE)
839  #undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE
840 #endif
841 #if defined(__has_declspec_attribute)
842  #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute)
843 #else
844  #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0)
845 #endif
846 
847 #if defined(JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE)
848  #undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE
849 #endif
850 #if defined(__has_declspec_attribute)
851  #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute)
852 #else
853  #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
854 #endif
855 
856 #if defined(JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE)
857  #undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE
858 #endif
859 #if defined(__has_declspec_attribute)
860  #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute)
861 #else
862  #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
863 #endif
864 
865 #if defined(JSON_HEDLEY_HAS_WARNING)
866  #undef JSON_HEDLEY_HAS_WARNING
867 #endif
868 #if defined(__has_warning)
869  #define JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning)
870 #else
871  #define JSON_HEDLEY_HAS_WARNING(warning) (0)
872 #endif
873 
874 #if defined(JSON_HEDLEY_GNUC_HAS_WARNING)
875  #undef JSON_HEDLEY_GNUC_HAS_WARNING
876 #endif
877 #if defined(__has_warning)
878  #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning)
879 #else
880  #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
881 #endif
882 
883 #if defined(JSON_HEDLEY_GCC_HAS_WARNING)
884  #undef JSON_HEDLEY_GCC_HAS_WARNING
885 #endif
886 #if defined(__has_warning)
887  #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning)
888 #else
889  #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
890 #endif
891 
892 #if \
893  (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \
894  defined(__clang__) || \
895  JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \
896  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
897  JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \
898  JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \
899  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
900  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
901  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \
902  JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \
903  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \
904  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,0,0) || \
905  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
906  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
907  JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \
908  JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \
909  JSON_HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \
910  (JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR))
911  #define JSON_HEDLEY_PRAGMA(value) _Pragma(#value)
912 #elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0)
913  #define JSON_HEDLEY_PRAGMA(value) __pragma(value)
914 #else
915  #define JSON_HEDLEY_PRAGMA(value)
916 #endif
917 
918 #if defined(JSON_HEDLEY_DIAGNOSTIC_PUSH)
919  #undef JSON_HEDLEY_DIAGNOSTIC_PUSH
920 #endif
921 #if defined(JSON_HEDLEY_DIAGNOSTIC_POP)
922  #undef JSON_HEDLEY_DIAGNOSTIC_POP
923 #endif
924 #if defined(__clang__)
925  #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push")
926  #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop")
927 #elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
928  #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)")
929  #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)")
930 #elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0)
931  #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
932  #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
933 #elif \
934  JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \
935  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
936  #define JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push))
937  #define JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop))
938 #elif JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0)
939  #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push")
940  #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop")
941 #elif \
942  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
943  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
944  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,4,0) || \
945  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \
946  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
947  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0)
948  #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push")
949  #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop")
950 #elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0)
951  #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)")
952  #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)")
953 #else
954  #define JSON_HEDLEY_DIAGNOSTIC_PUSH
955  #define JSON_HEDLEY_DIAGNOSTIC_POP
956 #endif
957 
958 /* JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ is for
959  HEDLEY INTERNAL USE ONLY. API subject to change without notice. */
960 #if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_)
961  #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_
962 #endif
963 #if defined(__cplusplus)
964 # if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat")
965 # if JSON_HEDLEY_HAS_WARNING("-Wc++17-extensions")
966 # if JSON_HEDLEY_HAS_WARNING("-Wc++1z-extensions")
967 # define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \
968  JSON_HEDLEY_DIAGNOSTIC_PUSH \
969  _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \
970  _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \
971  _Pragma("clang diagnostic ignored \"-Wc++1z-extensions\"") \
972  xpr \
973  JSON_HEDLEY_DIAGNOSTIC_POP
974 # else
975 # define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \
976  JSON_HEDLEY_DIAGNOSTIC_PUSH \
977  _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \
978  _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \
979  xpr \
980  JSON_HEDLEY_DIAGNOSTIC_POP
981 # endif
982 # else
983 # define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \
984  JSON_HEDLEY_DIAGNOSTIC_PUSH \
985  _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \
986  xpr \
987  JSON_HEDLEY_DIAGNOSTIC_POP
988 # endif
989 # endif
990 #endif
991 #if !defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_)
992  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(x) x
993 #endif
994 
995 #if defined(JSON_HEDLEY_CONST_CAST)
996  #undef JSON_HEDLEY_CONST_CAST
997 #endif
998 #if defined(__cplusplus)
999 # define JSON_HEDLEY_CONST_CAST(T, expr) (const_cast<T>(expr))
1000 #elif \
1001  JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || \
1002  JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) || \
1003  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
1004 # define JSON_HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \
1005  JSON_HEDLEY_DIAGNOSTIC_PUSH \
1006  JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \
1007  ((T) (expr)); \
1008  JSON_HEDLEY_DIAGNOSTIC_POP \
1009  }))
1010 #else
1011 # define JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr))
1012 #endif
1013 
1014 #if defined(JSON_HEDLEY_REINTERPRET_CAST)
1015  #undef JSON_HEDLEY_REINTERPRET_CAST
1016 #endif
1017 #if defined(__cplusplus)
1018  #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast<T>(expr))
1019 #else
1020  #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) ((T) (expr))
1021 #endif
1022 
1023 #if defined(JSON_HEDLEY_STATIC_CAST)
1024  #undef JSON_HEDLEY_STATIC_CAST
1025 #endif
1026 #if defined(__cplusplus)
1027  #define JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast<T>(expr))
1028 #else
1029  #define JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr))
1030 #endif
1031 
1032 #if defined(JSON_HEDLEY_CPP_CAST)
1033  #undef JSON_HEDLEY_CPP_CAST
1034 #endif
1035 #if defined(__cplusplus)
1036 # if JSON_HEDLEY_HAS_WARNING("-Wold-style-cast")
1037 # define JSON_HEDLEY_CPP_CAST(T, expr) \
1038  JSON_HEDLEY_DIAGNOSTIC_PUSH \
1039  _Pragma("clang diagnostic ignored \"-Wold-style-cast\"") \
1040  ((T) (expr)) \
1041  JSON_HEDLEY_DIAGNOSTIC_POP
1042 # elif JSON_HEDLEY_IAR_VERSION_CHECK(8,3,0)
1043 # define JSON_HEDLEY_CPP_CAST(T, expr) \
1044  JSON_HEDLEY_DIAGNOSTIC_PUSH \
1045  _Pragma("diag_suppress=Pe137") \
1046  JSON_HEDLEY_DIAGNOSTIC_POP
1047 # else
1048 # define JSON_HEDLEY_CPP_CAST(T, expr) ((T) (expr))
1049 # endif
1050 #else
1051 # define JSON_HEDLEY_CPP_CAST(T, expr) (expr)
1052 #endif
1053 
1054 #if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED)
1055  #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
1056 #endif
1057 #if JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations")
1058  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
1059 #elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
1060  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)")
1061 #elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1062  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:1478 1786))
1063 #elif JSON_HEDLEY_PGI_VERSION_CHECK(20,7,0)
1064  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1216,1444,1445")
1065 #elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0)
1066  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444")
1067 #elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0)
1068  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
1069 #elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0)
1070  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996))
1071 #elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1072  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444")
1073 #elif \
1074  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1075  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1076  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1077  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1078  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1079  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1080  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1081  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1082  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1083  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1084  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0)
1085  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718")
1086 #elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus)
1087  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)")
1088 #elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus)
1089  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)")
1090 #elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1091  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215")
1092 #elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0)
1093  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)")
1094 #else
1095  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
1096 #endif
1097 
1098 #if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS)
1099  #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS
1100 #endif
1101 #if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas")
1102  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"")
1103 #elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
1104  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)")
1105 #elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1106  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:161))
1107 #elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0)
1108  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675")
1109 #elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0)
1110  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"")
1111 #elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0)
1112  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068))
1113 #elif \
1114  JSON_HEDLEY_TI_VERSION_CHECK(16,9,0) || \
1115  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \
1116  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1117  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0)
1118  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163")
1119 #elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0)
1120  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163")
1121 #elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1122  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161")
1123 #elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1124  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 161")
1125 #else
1126  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS
1127 #endif
1128 
1129 #if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES)
1130  #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES
1131 #endif
1132 #if JSON_HEDLEY_HAS_WARNING("-Wunknown-attributes")
1133  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("clang diagnostic ignored \"-Wunknown-attributes\"")
1134 #elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0)
1135  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
1136 #elif JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0)
1137  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("warning(disable:1292)")
1138 #elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1139  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:1292))
1140 #elif JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,0)
1141  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:5030))
1142 #elif JSON_HEDLEY_PGI_VERSION_CHECK(20,7,0)
1143  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097,1098")
1144 #elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0)
1145  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097")
1146 #elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)
1147  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("error_messages(off,attrskipunsup)")
1148 #elif \
1149  JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \
1150  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \
1151  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0)
1152  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1173")
1153 #elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1154  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress=Pe1097")
1155 #elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1156  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097")
1157 #else
1158  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES
1159 #endif
1160 
1161 #if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL)
1162  #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL
1163 #endif
1164 #if JSON_HEDLEY_HAS_WARNING("-Wcast-qual")
1165  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"")
1166 #elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
1167  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)")
1168 #elif JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0)
1169  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"")
1170 #else
1171  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL
1172 #endif
1173 
1174 #if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION)
1175  #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION
1176 #endif
1177 #if JSON_HEDLEY_HAS_WARNING("-Wunused-function")
1178  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("clang diagnostic ignored \"-Wunused-function\"")
1179 #elif JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0)
1180  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("GCC diagnostic ignored \"-Wunused-function\"")
1181 #elif JSON_HEDLEY_MSVC_VERSION_CHECK(1,0,0)
1182  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION __pragma(warning(disable:4505))
1183 #elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1184  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("diag_suppress 3142")
1185 #else
1186  #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION
1187 #endif
1188 
1189 #if defined(JSON_HEDLEY_DEPRECATED)
1190  #undef JSON_HEDLEY_DEPRECATED
1191 #endif
1192 #if defined(JSON_HEDLEY_DEPRECATED_FOR)
1193  #undef JSON_HEDLEY_DEPRECATED_FOR
1194 #endif
1195 #if \
1196  JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \
1197  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1198  #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since))
1199  #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement))
1200 #elif \
1201  (JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) && !defined(JSON_HEDLEY_IAR_VERSION)) || \
1202  JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \
1203  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1204  JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \
1205  JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \
1206  JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \
1207  JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \
1208  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(18,1,0) || \
1209  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \
1210  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1211  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) || \
1212  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1213  #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since)))
1214  #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement)))
1215 #elif defined(__cplusplus) && (__cplusplus >= 201402L)
1216  #define JSON_HEDLEY_DEPRECATED(since) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since)]])
1217  #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since "; use " #replacement)]])
1218 #elif \
1219  JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || \
1220  JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \
1221  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1222  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1223  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1224  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1225  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1226  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1227  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1228  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1229  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1230  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1231  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1232  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1233  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \
1234  JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0)
1235  #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__))
1236  #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__))
1237 #elif \
1238  JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \
1239  JSON_HEDLEY_PELLES_VERSION_CHECK(6,50,0) || \
1240  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1241  #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated)
1242  #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated)
1243 #elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1244  #define JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated")
1245  #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated")
1246 #else
1247  #define JSON_HEDLEY_DEPRECATED(since)
1248  #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement)
1249 #endif
1250 
1251 #if defined(JSON_HEDLEY_UNAVAILABLE)
1252  #undef JSON_HEDLEY_UNAVAILABLE
1253 #endif
1254 #if \
1255  JSON_HEDLEY_HAS_ATTRIBUTE(warning) || \
1256  JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) || \
1257  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1258  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1259  #define JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since)))
1260 #else
1261  #define JSON_HEDLEY_UNAVAILABLE(available_since)
1262 #endif
1263 
1264 #if defined(JSON_HEDLEY_WARN_UNUSED_RESULT)
1265  #undef JSON_HEDLEY_WARN_UNUSED_RESULT
1266 #endif
1267 #if defined(JSON_HEDLEY_WARN_UNUSED_RESULT_MSG)
1268  #undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG
1269 #endif
1270 #if \
1271  JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \
1272  JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \
1273  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1274  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1275  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1276  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1277  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1278  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1279  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1280  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1281  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1282  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1283  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1284  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1285  (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \
1286  JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \
1287  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1288  #define JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
1289  #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) __attribute__((__warn_unused_result__))
1290 #elif (JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) >= 201907L)
1291  #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]])
1292  #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard(msg)]])
1293 #elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard)
1294  #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]])
1295  #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]])
1296 #elif defined(_Check_return_) /* SAL */
1297  #define JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_
1298  #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) _Check_return_
1299 #else
1300  #define JSON_HEDLEY_WARN_UNUSED_RESULT
1301  #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg)
1302 #endif
1303 
1304 #if defined(JSON_HEDLEY_SENTINEL)
1305  #undef JSON_HEDLEY_SENTINEL
1306 #endif
1307 #if \
1308  JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || \
1309  JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \
1310  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1311  JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \
1312  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1313  #define JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position)))
1314 #else
1315  #define JSON_HEDLEY_SENTINEL(position)
1316 #endif
1317 
1318 #if defined(JSON_HEDLEY_NO_RETURN)
1319  #undef JSON_HEDLEY_NO_RETURN
1320 #endif
1321 #if JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1322  #define JSON_HEDLEY_NO_RETURN __noreturn
1323 #elif \
1324  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1325  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1326  #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__))
1327 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
1328  #define JSON_HEDLEY_NO_RETURN _Noreturn
1329 #elif defined(__cplusplus) && (__cplusplus >= 201103L)
1330  #define JSON_HEDLEY_NO_RETURN JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[noreturn]])
1331 #elif \
1332  JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || \
1333  JSON_HEDLEY_GCC_VERSION_CHECK(3,2,0) || \
1334  JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1335  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1336  JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1337  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1338  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1339  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1340  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1341  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1342  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1343  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1344  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1345  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1346  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1347  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1348  JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0)
1349  #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__))
1350 #elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0)
1351  #define JSON_HEDLEY_NO_RETURN _Pragma("does_not_return")
1352 #elif \
1353  JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \
1354  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1355  #define JSON_HEDLEY_NO_RETURN __declspec(noreturn)
1356 #elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus)
1357  #define JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;")
1358 #elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0)
1359  #define JSON_HEDLEY_NO_RETURN __attribute((noreturn))
1360 #elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0)
1361  #define JSON_HEDLEY_NO_RETURN __declspec(noreturn)
1362 #else
1363  #define JSON_HEDLEY_NO_RETURN
1364 #endif
1365 
1366 #if defined(JSON_HEDLEY_NO_ESCAPE)
1367  #undef JSON_HEDLEY_NO_ESCAPE
1368 #endif
1369 #if JSON_HEDLEY_HAS_ATTRIBUTE(noescape)
1370  #define JSON_HEDLEY_NO_ESCAPE __attribute__((__noescape__))
1371 #else
1372  #define JSON_HEDLEY_NO_ESCAPE
1373 #endif
1374 
1375 #if defined(JSON_HEDLEY_UNREACHABLE)
1376  #undef JSON_HEDLEY_UNREACHABLE
1377 #endif
1378 #if defined(JSON_HEDLEY_UNREACHABLE_RETURN)
1379  #undef JSON_HEDLEY_UNREACHABLE_RETURN
1380 #endif
1381 #if defined(JSON_HEDLEY_ASSUME)
1382  #undef JSON_HEDLEY_ASSUME
1383 #endif
1384 #if \
1385  JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \
1386  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1387  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1388  #define JSON_HEDLEY_ASSUME(expr) __assume(expr)
1389 #elif JSON_HEDLEY_HAS_BUILTIN(__builtin_assume)
1390  #define JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr)
1391 #elif \
1392  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \
1393  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0)
1394  #if defined(__cplusplus)
1395  #define JSON_HEDLEY_ASSUME(expr) std::_nassert(expr)
1396  #else
1397  #define JSON_HEDLEY_ASSUME(expr) _nassert(expr)
1398  #endif
1399 #endif
1400 #if \
1401  (JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(JSON_HEDLEY_ARM_VERSION))) || \
1402  JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \
1403  JSON_HEDLEY_PGI_VERSION_CHECK(18,10,0) || \
1404  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1405  JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) || \
1406  JSON_HEDLEY_CRAY_VERSION_CHECK(10,0,0) || \
1407  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1408  #define JSON_HEDLEY_UNREACHABLE() __builtin_unreachable()
1409 #elif defined(JSON_HEDLEY_ASSUME)
1410  #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0)
1411 #endif
1412 #if !defined(JSON_HEDLEY_ASSUME)
1413  #if defined(JSON_HEDLEY_UNREACHABLE)
1414  #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, ((expr) ? 1 : (JSON_HEDLEY_UNREACHABLE(), 1)))
1415  #else
1416  #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, expr)
1417  #endif
1418 #endif
1419 #if defined(JSON_HEDLEY_UNREACHABLE)
1420  #if \
1421  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \
1422  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0)
1423  #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (JSON_HEDLEY_STATIC_CAST(void, JSON_HEDLEY_ASSUME(0)), (value))
1424  #else
1425  #define JSON_HEDLEY_UNREACHABLE_RETURN(value) JSON_HEDLEY_UNREACHABLE()
1426  #endif
1427 #else
1428  #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (value)
1429 #endif
1430 #if !defined(JSON_HEDLEY_UNREACHABLE)
1431  #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0)
1432 #endif
1433 
1435 #if JSON_HEDLEY_HAS_WARNING("-Wpedantic")
1436  #pragma clang diagnostic ignored "-Wpedantic"
1437 #endif
1438 #if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic") && defined(__cplusplus)
1439  #pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
1440 #endif
1441 #if JSON_HEDLEY_GCC_HAS_WARNING("-Wvariadic-macros",4,0,0)
1442  #if defined(__clang__)
1443  #pragma clang diagnostic ignored "-Wvariadic-macros"
1444  #elif defined(JSON_HEDLEY_GCC_VERSION)
1445  #pragma GCC diagnostic ignored "-Wvariadic-macros"
1446  #endif
1447 #endif
1448 #if defined(JSON_HEDLEY_NON_NULL)
1449  #undef JSON_HEDLEY_NON_NULL
1450 #endif
1451 #if \
1452  JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || \
1453  JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \
1454  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1455  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0)
1456  #define JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__)))
1457 #else
1458  #define JSON_HEDLEY_NON_NULL(...)
1459 #endif
1461 
1462 #if defined(JSON_HEDLEY_PRINTF_FORMAT)
1463  #undef JSON_HEDLEY_PRINTF_FORMAT
1464 #endif
1465 #if defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO)
1466  #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check)))
1467 #elif defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO)
1468  #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check)))
1469 #elif \
1470  JSON_HEDLEY_HAS_ATTRIBUTE(format) || \
1471  JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \
1472  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1473  JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \
1474  JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1475  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1476  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1477  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1478  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1479  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1480  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1481  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1482  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1483  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1484  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1485  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1486  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1487  #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check)))
1488 #elif JSON_HEDLEY_PELLES_VERSION_CHECK(6,0,0)
1489  #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check))
1490 #else
1491  #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check)
1492 #endif
1493 
1494 #if defined(JSON_HEDLEY_CONSTEXPR)
1495  #undef JSON_HEDLEY_CONSTEXPR
1496 #endif
1497 #if defined(__cplusplus)
1498  #if __cplusplus >= 201103L
1499  #define JSON_HEDLEY_CONSTEXPR JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(constexpr)
1500  #endif
1501 #endif
1502 #if !defined(JSON_HEDLEY_CONSTEXPR)
1503  #define JSON_HEDLEY_CONSTEXPR
1504 #endif
1505 
1506 #if defined(JSON_HEDLEY_PREDICT)
1507  #undef JSON_HEDLEY_PREDICT
1508 #endif
1509 #if defined(JSON_HEDLEY_LIKELY)
1510  #undef JSON_HEDLEY_LIKELY
1511 #endif
1512 #if defined(JSON_HEDLEY_UNLIKELY)
1513  #undef JSON_HEDLEY_UNLIKELY
1514 #endif
1515 #if defined(JSON_HEDLEY_UNPREDICTABLE)
1516  #undef JSON_HEDLEY_UNPREDICTABLE
1517 #endif
1518 #if JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable)
1519  #define JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable((expr))
1520 #endif
1521 #if \
1522  (JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) && !defined(JSON_HEDLEY_PGI_VERSION)) || \
1523  JSON_HEDLEY_GCC_VERSION_CHECK(9,0,0) || \
1524  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1525 # define JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability( (expr), (value), (probability))
1526 # define JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1 , (probability))
1527 # define JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0 , (probability))
1528 # define JSON_HEDLEY_LIKELY(expr) __builtin_expect (!!(expr), 1 )
1529 # define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect (!!(expr), 0 )
1530 #elif \
1531  (JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) && !defined(JSON_HEDLEY_INTEL_CL_VERSION)) || \
1532  JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \
1533  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1534  (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \
1535  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1536  JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1537  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1538  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \
1539  JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \
1540  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \
1541  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \
1542  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1543  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1544  JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,27) || \
1545  JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \
1546  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1547 # define JSON_HEDLEY_PREDICT(expr, expected, probability) \
1548  (((probability) >= 0.9) ? __builtin_expect((expr), (expected)) : (JSON_HEDLEY_STATIC_CAST(void, expected), (expr)))
1549 # define JSON_HEDLEY_PREDICT_TRUE(expr, probability) \
1550  (__extension__ ({ \
1551  double hedley_probability_ = (probability); \
1552  ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \
1553  }))
1554 # define JSON_HEDLEY_PREDICT_FALSE(expr, probability) \
1555  (__extension__ ({ \
1556  double hedley_probability_ = (probability); \
1557  ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \
1558  }))
1559 # define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1)
1560 # define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0)
1561 #else
1562 # define JSON_HEDLEY_PREDICT(expr, expected, probability) (JSON_HEDLEY_STATIC_CAST(void, expected), (expr))
1563 # define JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr))
1564 # define JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr))
1565 # define JSON_HEDLEY_LIKELY(expr) (!!(expr))
1566 # define JSON_HEDLEY_UNLIKELY(expr) (!!(expr))
1567 #endif
1568 #if !defined(JSON_HEDLEY_UNPREDICTABLE)
1569  #define JSON_HEDLEY_UNPREDICTABLE(expr) JSON_HEDLEY_PREDICT(expr, 1, 0.5)
1570 #endif
1571 
1572 #if defined(JSON_HEDLEY_MALLOC)
1573  #undef JSON_HEDLEY_MALLOC
1574 #endif
1575 #if \
1576  JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || \
1577  JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \
1578  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1579  JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1580  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1581  JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \
1582  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1583  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1584  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1585  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1586  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1587  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1588  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1589  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1590  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1591  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1592  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1593  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1594  #define JSON_HEDLEY_MALLOC __attribute__((__malloc__))
1595 #elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0)
1596  #define JSON_HEDLEY_MALLOC _Pragma("returns_new_memory")
1597 #elif \
1598  JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \
1599  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1600  #define JSON_HEDLEY_MALLOC __declspec(restrict)
1601 #else
1602  #define JSON_HEDLEY_MALLOC
1603 #endif
1604 
1605 #if defined(JSON_HEDLEY_PURE)
1606  #undef JSON_HEDLEY_PURE
1607 #endif
1608 #if \
1609  JSON_HEDLEY_HAS_ATTRIBUTE(pure) || \
1610  JSON_HEDLEY_GCC_VERSION_CHECK(2,96,0) || \
1611  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1612  JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1613  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1614  JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1615  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1616  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1617  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1618  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1619  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1620  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1621  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1622  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1623  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1624  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1625  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1626  JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \
1627  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1628 # define JSON_HEDLEY_PURE __attribute__((__pure__))
1629 #elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0)
1630 # define JSON_HEDLEY_PURE _Pragma("does_not_write_global_data")
1631 #elif defined(__cplusplus) && \
1632  ( \
1633  JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \
1634  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) || \
1635  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) \
1636  )
1637 # define JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;")
1638 #else
1639 # define JSON_HEDLEY_PURE
1640 #endif
1641 
1642 #if defined(JSON_HEDLEY_CONST)
1643  #undef JSON_HEDLEY_CONST
1644 #endif
1645 #if \
1646  JSON_HEDLEY_HAS_ATTRIBUTE(const) || \
1647  JSON_HEDLEY_GCC_VERSION_CHECK(2,5,0) || \
1648  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1649  JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1650  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1651  JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1652  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1653  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1654  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1655  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1656  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1657  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1658  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1659  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1660  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1661  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1662  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1663  JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \
1664  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1665  #define JSON_HEDLEY_CONST __attribute__((__const__))
1666 #elif \
1667  JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0)
1668  #define JSON_HEDLEY_CONST _Pragma("no_side_effect")
1669 #else
1670  #define JSON_HEDLEY_CONST JSON_HEDLEY_PURE
1671 #endif
1672 
1673 #if defined(JSON_HEDLEY_RESTRICT)
1674  #undef JSON_HEDLEY_RESTRICT
1675 #endif
1676 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus)
1677  #define JSON_HEDLEY_RESTRICT restrict
1678 #elif \
1679  JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \
1680  JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \
1681  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1682  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \
1683  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1684  JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1685  JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \
1686  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1687  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,4) || \
1688  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \
1689  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1690  (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \
1691  JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \
1692  defined(__clang__) || \
1693  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1694  #define JSON_HEDLEY_RESTRICT __restrict
1695 #elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus)
1696  #define JSON_HEDLEY_RESTRICT _Restrict
1697 #else
1698  #define JSON_HEDLEY_RESTRICT
1699 #endif
1700 
1701 #if defined(JSON_HEDLEY_INLINE)
1702  #undef JSON_HEDLEY_INLINE
1703 #endif
1704 #if \
1705  (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \
1706  (defined(__cplusplus) && (__cplusplus >= 199711L))
1707  #define JSON_HEDLEY_INLINE inline
1708 #elif \
1709  defined(JSON_HEDLEY_GCC_VERSION) || \
1710  JSON_HEDLEY_ARM_VERSION_CHECK(6,2,0)
1711  #define JSON_HEDLEY_INLINE __inline__
1712 #elif \
1713  JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \
1714  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \
1715  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1716  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,1,0) || \
1717  JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \
1718  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \
1719  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \
1720  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1721  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1722  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1723  #define JSON_HEDLEY_INLINE __inline
1724 #else
1725  #define JSON_HEDLEY_INLINE
1726 #endif
1727 
1728 #if defined(JSON_HEDLEY_ALWAYS_INLINE)
1729  #undef JSON_HEDLEY_ALWAYS_INLINE
1730 #endif
1731 #if \
1732  JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || \
1733  JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \
1734  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1735  JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1736  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1737  JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1738  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1739  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1740  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1741  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1742  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1743  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1744  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1745  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1746  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1747  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1748  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1749  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \
1750  JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0)
1751 # define JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) JSON_HEDLEY_INLINE
1752 #elif \
1753  JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \
1754  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1755 # define JSON_HEDLEY_ALWAYS_INLINE __forceinline
1756 #elif defined(__cplusplus) && \
1757  ( \
1758  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1759  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1760  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1761  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \
1762  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1763  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) \
1764  )
1765 # define JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;")
1766 #elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1767 # define JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced")
1768 #else
1769 # define JSON_HEDLEY_ALWAYS_INLINE JSON_HEDLEY_INLINE
1770 #endif
1771 
1772 #if defined(JSON_HEDLEY_NEVER_INLINE)
1773  #undef JSON_HEDLEY_NEVER_INLINE
1774 #endif
1775 #if \
1776  JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || \
1777  JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \
1778  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1779  JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1780  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1781  JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1782  JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1783  (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1784  JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1785  (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1786  JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1787  (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1788  JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1789  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1790  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1791  JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1792  JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1793  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \
1794  JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0)
1795  #define JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__))
1796 #elif \
1797  JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \
1798  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1799  #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline)
1800 #elif JSON_HEDLEY_PGI_VERSION_CHECK(10,2,0)
1801  #define JSON_HEDLEY_NEVER_INLINE _Pragma("noinline")
1802 #elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus)
1803  #define JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;")
1804 #elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1805  #define JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never")
1806 #elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0)
1807  #define JSON_HEDLEY_NEVER_INLINE __attribute((noinline))
1808 #elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0)
1809  #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline)
1810 #else
1811  #define JSON_HEDLEY_NEVER_INLINE
1812 #endif
1813 
1814 #if defined(JSON_HEDLEY_PRIVATE)
1815  #undef JSON_HEDLEY_PRIVATE
1816 #endif
1817 #if defined(JSON_HEDLEY_PUBLIC)
1818  #undef JSON_HEDLEY_PUBLIC
1819 #endif
1820 #if defined(JSON_HEDLEY_IMPORT)
1821  #undef JSON_HEDLEY_IMPORT
1822 #endif
1823 #if defined(_WIN32) || defined(__CYGWIN__)
1824 # define JSON_HEDLEY_PRIVATE
1825 # define JSON_HEDLEY_PUBLIC __declspec(dllexport)
1826 # define JSON_HEDLEY_IMPORT __declspec(dllimport)
1827 #else
1828 # if \
1829  JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || \
1830  JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \
1831  JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1832  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1833  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1834  JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \
1835  ( \
1836  defined(__TI_EABI__) && \
1837  ( \
1838  (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1839  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) \
1840  ) \
1841  ) || \
1842  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1843 # define JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden")))
1844 # define JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default")))
1845 # else
1846 # define JSON_HEDLEY_PRIVATE
1847 # define JSON_HEDLEY_PUBLIC
1848 # endif
1849 # define JSON_HEDLEY_IMPORT extern
1850 #endif
1851 
1852 #if defined(JSON_HEDLEY_NO_THROW)
1853  #undef JSON_HEDLEY_NO_THROW
1854 #endif
1855 #if \
1856  JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || \
1857  JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \
1858  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1859  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1860  #define JSON_HEDLEY_NO_THROW __attribute__((__nothrow__))
1861 #elif \
1862  JSON_HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \
1863  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \
1864  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0)
1865  #define JSON_HEDLEY_NO_THROW __declspec(nothrow)
1866 #else
1867  #define JSON_HEDLEY_NO_THROW
1868 #endif
1869 
1870 #if defined(JSON_HEDLEY_FALL_THROUGH)
1871  #undef JSON_HEDLEY_FALL_THROUGH
1872 #endif
1873 #if \
1874  JSON_HEDLEY_HAS_ATTRIBUTE(fallthrough) || \
1875  JSON_HEDLEY_GCC_VERSION_CHECK(7,0,0) || \
1876  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1877  #define JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__))
1878 #elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(clang,fallthrough)
1879  #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[clang::fallthrough]])
1880 #elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough)
1881  #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[fallthrough]])
1882 #elif defined(__fallthrough) /* SAL */
1883  #define JSON_HEDLEY_FALL_THROUGH __fallthrough
1884 #else
1885  #define JSON_HEDLEY_FALL_THROUGH
1886 #endif
1887 
1888 #if defined(JSON_HEDLEY_RETURNS_NON_NULL)
1889  #undef JSON_HEDLEY_RETURNS_NON_NULL
1890 #endif
1891 #if \
1892  JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \
1893  JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \
1894  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1895  #define JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__))
1896 #elif defined(_Ret_notnull_) /* SAL */
1897  #define JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_
1898 #else
1899  #define JSON_HEDLEY_RETURNS_NON_NULL
1900 #endif
1901 
1902 #if defined(JSON_HEDLEY_ARRAY_PARAM)
1903  #undef JSON_HEDLEY_ARRAY_PARAM
1904 #endif
1905 #if \
1906  defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
1907  !defined(__STDC_NO_VLA__) && \
1908  !defined(__cplusplus) && \
1909  !defined(JSON_HEDLEY_PGI_VERSION) && \
1910  !defined(JSON_HEDLEY_TINYC_VERSION)
1911  #define JSON_HEDLEY_ARRAY_PARAM(name) (name)
1912 #else
1913  #define JSON_HEDLEY_ARRAY_PARAM(name)
1914 #endif
1915 
1916 #if defined(JSON_HEDLEY_IS_CONSTANT)
1917  #undef JSON_HEDLEY_IS_CONSTANT
1918 #endif
1919 #if defined(JSON_HEDLEY_REQUIRE_CONSTEXPR)
1920  #undef JSON_HEDLEY_REQUIRE_CONSTEXPR
1921 #endif
1922 /* JSON_HEDLEY_IS_CONSTEXPR_ is for
1923  HEDLEY INTERNAL USE ONLY. API subject to change without notice. */
1924 #if defined(JSON_HEDLEY_IS_CONSTEXPR_)
1925  #undef JSON_HEDLEY_IS_CONSTEXPR_
1926 #endif
1927 #if \
1928  JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \
1929  JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \
1930  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1931  JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \
1932  JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1933  JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \
1934  JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \
1935  (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) && !defined(__cplusplus)) || \
1936  JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \
1937  JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1938  #define JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr)
1939 #endif
1940 #if !defined(__cplusplus)
1941 # if \
1942  JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \
1943  JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \
1944  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1945  JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \
1946  JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \
1947  JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \
1948  JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,24)
1949 #if defined(__INTPTR_TYPE__)
1950  #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*)
1951 #else
1952  #include <stdint.h>
1953  #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*)
1954 #endif
1955 # elif \
1956  ( \
1957  defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && \
1958  !defined(JSON_HEDLEY_SUNPRO_VERSION) && \
1959  !defined(JSON_HEDLEY_PGI_VERSION) && \
1960  !defined(JSON_HEDLEY_IAR_VERSION)) || \
1961  (JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) && !defined(JSON_HEDLEY_IAR_VERSION)) || \
1962  JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \
1963  JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \
1964  JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \
1965  JSON_HEDLEY_ARM_VERSION_CHECK(5,3,0)
1966 #if defined(__INTPTR_TYPE__)
1967  #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0)
1968 #else
1969  #include <stdint.h>
1970  #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0)
1971 #endif
1972 # elif \
1973  defined(JSON_HEDLEY_GCC_VERSION) || \
1974  defined(JSON_HEDLEY_INTEL_VERSION) || \
1975  defined(JSON_HEDLEY_TINYC_VERSION) || \
1976  defined(JSON_HEDLEY_TI_ARMCL_VERSION) || \
1977  JSON_HEDLEY_TI_CL430_VERSION_CHECK(18,12,0) || \
1978  defined(JSON_HEDLEY_TI_CL2000_VERSION) || \
1979  defined(JSON_HEDLEY_TI_CL6X_VERSION) || \
1980  defined(JSON_HEDLEY_TI_CL7X_VERSION) || \
1981  defined(JSON_HEDLEY_TI_CLPRU_VERSION) || \
1982  defined(__clang__)
1983 # define JSON_HEDLEY_IS_CONSTEXPR_(expr) ( \
1984  sizeof(void) != \
1985  sizeof(*( \
1986  1 ? \
1987  ((void*) ((expr) * 0L) ) : \
1988 ((struct { char v[sizeof(void) * 2]; } *) 1) \
1989  ) \
1990  ) \
1991  )
1992 # endif
1993 #endif
1994 #if defined(JSON_HEDLEY_IS_CONSTEXPR_)
1995  #if !defined(JSON_HEDLEY_IS_CONSTANT)
1996  #define JSON_HEDLEY_IS_CONSTANT(expr) JSON_HEDLEY_IS_CONSTEXPR_(expr)
1997  #endif
1998  #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (JSON_HEDLEY_IS_CONSTEXPR_(expr) ? (expr) : (-1))
1999 #else
2000  #if !defined(JSON_HEDLEY_IS_CONSTANT)
2001  #define JSON_HEDLEY_IS_CONSTANT(expr) (0)
2002  #endif
2003  #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr)
2004 #endif
2005 
2006 #if defined(JSON_HEDLEY_BEGIN_C_DECLS)
2007  #undef JSON_HEDLEY_BEGIN_C_DECLS
2008 #endif
2009 #if defined(JSON_HEDLEY_END_C_DECLS)
2010  #undef JSON_HEDLEY_END_C_DECLS
2011 #endif
2012 #if defined(JSON_HEDLEY_C_DECL)
2013  #undef JSON_HEDLEY_C_DECL
2014 #endif
2015 #if defined(__cplusplus)
2016  #define JSON_HEDLEY_BEGIN_C_DECLS extern "C" {
2017  #define JSON_HEDLEY_END_C_DECLS }
2018  #define JSON_HEDLEY_C_DECL extern "C"
2019 #else
2020  #define JSON_HEDLEY_BEGIN_C_DECLS
2021  #define JSON_HEDLEY_END_C_DECLS
2022  #define JSON_HEDLEY_C_DECL
2023 #endif
2024 
2025 #if defined(JSON_HEDLEY_STATIC_ASSERT)
2026  #undef JSON_HEDLEY_STATIC_ASSERT
2027 #endif
2028 #if \
2029  !defined(__cplusplus) && ( \
2030  (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \
2031  (JSON_HEDLEY_HAS_FEATURE(c_static_assert) && !defined(JSON_HEDLEY_INTEL_CL_VERSION)) || \
2032  JSON_HEDLEY_GCC_VERSION_CHECK(6,0,0) || \
2033  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
2034  defined(_Static_assert) \
2035  )
2036 # define JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message)
2037 #elif \
2038  (defined(__cplusplus) && (__cplusplus >= 201103L)) || \
2039  JSON_HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \
2040  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
2041 # define JSON_HEDLEY_STATIC_ASSERT(expr, message) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(static_assert(expr, message))
2042 #else
2043 # define JSON_HEDLEY_STATIC_ASSERT(expr, message)
2044 #endif
2045 
2046 #if defined(JSON_HEDLEY_NULL)
2047  #undef JSON_HEDLEY_NULL
2048 #endif
2049 #if defined(__cplusplus)
2050  #if __cplusplus >= 201103L
2051  #define JSON_HEDLEY_NULL JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(nullptr)
2052  #elif defined(NULL)
2053  #define JSON_HEDLEY_NULL NULL
2054  #else
2055  #define JSON_HEDLEY_NULL JSON_HEDLEY_STATIC_CAST(void*, 0)
2056  #endif
2057 #elif defined(NULL)
2058  #define JSON_HEDLEY_NULL NULL
2059 #else
2060  #define JSON_HEDLEY_NULL ((void*) 0)
2061 #endif
2062 
2063 #if defined(JSON_HEDLEY_MESSAGE)
2064  #undef JSON_HEDLEY_MESSAGE
2065 #endif
2066 #if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas")
2067 # define JSON_HEDLEY_MESSAGE(msg) \
2068  JSON_HEDLEY_DIAGNOSTIC_PUSH \
2069  JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \
2070  JSON_HEDLEY_PRAGMA(message msg) \
2071  JSON_HEDLEY_DIAGNOSTIC_POP
2072 #elif \
2073  JSON_HEDLEY_GCC_VERSION_CHECK(4,4,0) || \
2074  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
2075 # define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message msg)
2076 #elif JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0)
2077 # define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(_CRI message msg)
2078 #elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
2079 # define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg))
2080 #elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,0,0)
2081 # define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg))
2082 #else
2083 # define JSON_HEDLEY_MESSAGE(msg)
2084 #endif
2085 
2086 #if defined(JSON_HEDLEY_WARNING)
2087  #undef JSON_HEDLEY_WARNING
2088 #endif
2089 #if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas")
2090 # define JSON_HEDLEY_WARNING(msg) \
2091  JSON_HEDLEY_DIAGNOSTIC_PUSH \
2092  JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \
2093  JSON_HEDLEY_PRAGMA(clang warning msg) \
2094  JSON_HEDLEY_DIAGNOSTIC_POP
2095 #elif \
2096  JSON_HEDLEY_GCC_VERSION_CHECK(4,8,0) || \
2097  JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \
2098  JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
2099 # define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(GCC warning msg)
2100 #elif \
2101  JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \
2102  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
2103 # define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(message(msg))
2104 #else
2105 # define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_MESSAGE(msg)
2106 #endif
2107 
2108 #if defined(JSON_HEDLEY_REQUIRE)
2109  #undef JSON_HEDLEY_REQUIRE
2110 #endif
2111 #if defined(JSON_HEDLEY_REQUIRE_MSG)
2112  #undef JSON_HEDLEY_REQUIRE_MSG
2113 #endif
2114 #if JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if)
2115 # if JSON_HEDLEY_HAS_WARNING("-Wgcc-compat")
2116 # define JSON_HEDLEY_REQUIRE(expr) \
2117  JSON_HEDLEY_DIAGNOSTIC_PUSH \
2118  _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \
2119  __attribute__((diagnose_if(!(expr), #expr, "error"))) \
2120  JSON_HEDLEY_DIAGNOSTIC_POP
2121 # define JSON_HEDLEY_REQUIRE_MSG(expr,msg) \
2122  JSON_HEDLEY_DIAGNOSTIC_PUSH \
2123  _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \
2124  __attribute__((diagnose_if(!(expr), msg, "error"))) \
2125  JSON_HEDLEY_DIAGNOSTIC_POP
2126 # else
2127 # define JSON_HEDLEY_REQUIRE(expr) __attribute__((diagnose_if(!(expr), #expr, "error")))
2128 # define JSON_HEDLEY_REQUIRE_MSG(expr,msg) __attribute__((diagnose_if(!(expr), msg, "error")))
2129 # endif
2130 #else
2131 # define JSON_HEDLEY_REQUIRE(expr)
2132 # define JSON_HEDLEY_REQUIRE_MSG(expr,msg)
2133 #endif
2134 
2135 #if defined(JSON_HEDLEY_FLAGS)
2136  #undef JSON_HEDLEY_FLAGS
2137 #endif
2138 #if JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) && (!defined(__cplusplus) || JSON_HEDLEY_HAS_WARNING("-Wbitfield-enum-conversion"))
2139  #define JSON_HEDLEY_FLAGS __attribute__((__flag_enum__))
2140 #else
2141  #define JSON_HEDLEY_FLAGS
2142 #endif
2143 
2144 #if defined(JSON_HEDLEY_FLAGS_CAST)
2145  #undef JSON_HEDLEY_FLAGS_CAST
2146 #endif
2147 #if JSON_HEDLEY_INTEL_VERSION_CHECK(19,0,0)
2148 # define JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \
2149  JSON_HEDLEY_DIAGNOSTIC_PUSH \
2150  _Pragma("warning(disable:188)") \
2151  ((T) (expr)); \
2152  JSON_HEDLEY_DIAGNOSTIC_POP \
2153  }))
2154 #else
2155 # define JSON_HEDLEY_FLAGS_CAST(T, expr) JSON_HEDLEY_STATIC_CAST(T, expr)
2156 #endif
2157 
2158 #if defined(JSON_HEDLEY_EMPTY_BASES)
2159  #undef JSON_HEDLEY_EMPTY_BASES
2160 #endif
2161 #if \
2162  (JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,23918) && !JSON_HEDLEY_MSVC_VERSION_CHECK(20,0,0)) || \
2163  JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
2164  #define JSON_HEDLEY_EMPTY_BASES __declspec(empty_bases)
2165 #else
2166  #define JSON_HEDLEY_EMPTY_BASES
2167 #endif
2168 
2169 /* Remaining macros are deprecated. */
2170 
2171 #if defined(JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK)
2172  #undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK
2173 #endif
2174 #if defined(__clang__)
2175  #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0)
2176 #else
2177  #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
2178 #endif
2179 
2180 #if defined(JSON_HEDLEY_CLANG_HAS_ATTRIBUTE)
2181  #undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE
2182 #endif
2183 #define JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_ATTRIBUTE(attribute)
2184 
2185 #if defined(JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE)
2186  #undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE
2187 #endif
2188 #define JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute)
2189 
2190 #if defined(JSON_HEDLEY_CLANG_HAS_BUILTIN)
2191  #undef JSON_HEDLEY_CLANG_HAS_BUILTIN
2192 #endif
2193 #define JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) JSON_HEDLEY_HAS_BUILTIN(builtin)
2194 
2195 #if defined(JSON_HEDLEY_CLANG_HAS_FEATURE)
2196  #undef JSON_HEDLEY_CLANG_HAS_FEATURE
2197 #endif
2198 #define JSON_HEDLEY_CLANG_HAS_FEATURE(feature) JSON_HEDLEY_HAS_FEATURE(feature)
2199 
2200 #if defined(JSON_HEDLEY_CLANG_HAS_EXTENSION)
2201  #undef JSON_HEDLEY_CLANG_HAS_EXTENSION
2202 #endif
2203 #define JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) JSON_HEDLEY_HAS_EXTENSION(extension)
2204 
2205 #if defined(JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE)
2206  #undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE
2207 #endif
2208 #define JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute)
2209 
2210 #if defined(JSON_HEDLEY_CLANG_HAS_WARNING)
2211  #undef JSON_HEDLEY_CLANG_HAS_WARNING
2212 #endif
2213 #define JSON_HEDLEY_CLANG_HAS_WARNING(warning) JSON_HEDLEY_HAS_WARNING(warning)
2214 
2215 #endif /* !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < X) */
2216 
2217 
2218 // This file contains all internal macro definitions
2219 // You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them
2220 
2221 // exclude unsupported compilers
2222 #if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK)
2223  #if defined(__clang__)
2224  #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400
2225  #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers"
2226  #endif
2227  #elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER))
2228  #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800
2229  #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"
2230  #endif
2231  #endif
2232 #endif
2233 
2234 // C++ language standard detection
2235 // if the user manually specified the used c++ version this is skipped
2236 #if !defined(JSON_HAS_CPP_20) && !defined(JSON_HAS_CPP_17) && !defined(JSON_HAS_CPP_14) && !defined(JSON_HAS_CPP_11)
2237  #if (defined(__cplusplus) && __cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)
2238  #define JSON_HAS_CPP_20
2239  #define JSON_HAS_CPP_17
2240  #define JSON_HAS_CPP_14
2241  #elif (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464
2242  #define JSON_HAS_CPP_17
2243  #define JSON_HAS_CPP_14
2244  #elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1)
2245  #define JSON_HAS_CPP_14
2246  #endif
2247  // the cpp 11 flag is always specified because it is the minimal required version
2248  #define JSON_HAS_CPP_11
2249 #endif
2250 
2251 // disable documentation warnings on clang
2252 #if defined(__clang__)
2253  #pragma clang diagnostic push
2254  #pragma clang diagnostic ignored "-Wdocumentation"
2255  #pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
2256 #endif
2257 
2258 // allow to disable exceptions
2259 #if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION)
2260  #define JSON_THROW(exception) throw exception
2261  #define JSON_TRY try
2262  #define JSON_CATCH(exception) catch(exception)
2263  #define JSON_INTERNAL_CATCH(exception) catch(exception)
2264 #else
2265  #include <cstdlib>
2266  #define JSON_THROW(exception) std::abort()
2267  #define JSON_TRY if(true)
2268  #define JSON_CATCH(exception) if(false)
2269  #define JSON_INTERNAL_CATCH(exception) if(false)
2270 #endif
2271 
2272 // override exception macros
2273 #if defined(JSON_THROW_USER)
2274  #undef JSON_THROW
2275  #define JSON_THROW JSON_THROW_USER
2276 #endif
2277 #if defined(JSON_TRY_USER)
2278  #undef JSON_TRY
2279  #define JSON_TRY JSON_TRY_USER
2280 #endif
2281 #if defined(JSON_CATCH_USER)
2282  #undef JSON_CATCH
2283  #define JSON_CATCH JSON_CATCH_USER
2284  #undef JSON_INTERNAL_CATCH
2285  #define JSON_INTERNAL_CATCH JSON_CATCH_USER
2286 #endif
2287 #if defined(JSON_INTERNAL_CATCH_USER)
2288  #undef JSON_INTERNAL_CATCH
2289  #define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER
2290 #endif
2291 
2292 // allow to override assert
2293 #if !defined(JSON_ASSERT)
2294  #include <cassert> // assert
2295  #define JSON_ASSERT(x) assert(x)
2296 #endif
2297 
2298 // allow to access some private functions (needed by the test suite)
2299 #if defined(JSON_TESTS_PRIVATE)
2300  #define JSON_PRIVATE_UNLESS_TESTED public
2301 #else
2302  #define JSON_PRIVATE_UNLESS_TESTED private
2303 #endif
2304 
2310 #define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \
2311  template<typename BasicJsonType> \
2312  inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \
2313  { \
2314  static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \
2315  static const std::pair<ENUM_TYPE, BasicJsonType> m[] = __VA_ARGS__; \
2316  auto it = std::find_if(std::begin(m), std::end(m), \
2317  [e](const std::pair<ENUM_TYPE, BasicJsonType>& ej_pair) -> bool \
2318  { \
2319  return ej_pair.first == e; \
2320  }); \
2321  j = ((it != std::end(m)) ? it : std::begin(m))->second; \
2322  } \
2323  template<typename BasicJsonType> \
2324  inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \
2325  { \
2326  static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \
2327  static const std::pair<ENUM_TYPE, BasicJsonType> m[] = __VA_ARGS__; \
2328  auto it = std::find_if(std::begin(m), std::end(m), \
2329  [&j](const std::pair<ENUM_TYPE, BasicJsonType>& ej_pair) -> bool \
2330  { \
2331  return ej_pair.second == j; \
2332  }); \
2333  e = ((it != std::end(m)) ? it : std::begin(m))->first; \
2334  }
2335 
2336 // Ugly macros to avoid uglier copy-paste when specializing basic_json. They
2337 // may be removed in the future once the class is split.
2338 
2339 #define NLOHMANN_BASIC_JSON_TPL_DECLARATION \
2340  template<template<typename, typename, typename...> class ObjectType, \
2341  template<typename, typename...> class ArrayType, \
2342  class StringType, class BooleanType, class NumberIntegerType, \
2343  class NumberUnsignedType, class NumberFloatType, \
2344  template<typename> class AllocatorType, \
2345  template<typename, typename = void> class JSONSerializer, \
2346  class BinaryType>
2347 
2348 #define NLOHMANN_BASIC_JSON_TPL \
2349  basic_json<ObjectType, ArrayType, StringType, BooleanType, \
2350  NumberIntegerType, NumberUnsignedType, NumberFloatType, \
2351  AllocatorType, JSONSerializer, BinaryType>
2352 
2353 // Macros to simplify conversion from/to types
2354 
2355 #define NLOHMANN_JSON_EXPAND( x ) x
2356 #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
2357 #define NLOHMANN_JSON_PASTE(...) NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_GET_MACRO(__VA_ARGS__, \
2358  NLOHMANN_JSON_PASTE64, \
2359  NLOHMANN_JSON_PASTE63, \
2360  NLOHMANN_JSON_PASTE62, \
2361  NLOHMANN_JSON_PASTE61, \
2362  NLOHMANN_JSON_PASTE60, \
2363  NLOHMANN_JSON_PASTE59, \
2364  NLOHMANN_JSON_PASTE58, \
2365  NLOHMANN_JSON_PASTE57, \
2366  NLOHMANN_JSON_PASTE56, \
2367  NLOHMANN_JSON_PASTE55, \
2368  NLOHMANN_JSON_PASTE54, \
2369  NLOHMANN_JSON_PASTE53, \
2370  NLOHMANN_JSON_PASTE52, \
2371  NLOHMANN_JSON_PASTE51, \
2372  NLOHMANN_JSON_PASTE50, \
2373  NLOHMANN_JSON_PASTE49, \
2374  NLOHMANN_JSON_PASTE48, \
2375  NLOHMANN_JSON_PASTE47, \
2376  NLOHMANN_JSON_PASTE46, \
2377  NLOHMANN_JSON_PASTE45, \
2378  NLOHMANN_JSON_PASTE44, \
2379  NLOHMANN_JSON_PASTE43, \
2380  NLOHMANN_JSON_PASTE42, \
2381  NLOHMANN_JSON_PASTE41, \
2382  NLOHMANN_JSON_PASTE40, \
2383  NLOHMANN_JSON_PASTE39, \
2384  NLOHMANN_JSON_PASTE38, \
2385  NLOHMANN_JSON_PASTE37, \
2386  NLOHMANN_JSON_PASTE36, \
2387  NLOHMANN_JSON_PASTE35, \
2388  NLOHMANN_JSON_PASTE34, \
2389  NLOHMANN_JSON_PASTE33, \
2390  NLOHMANN_JSON_PASTE32, \
2391  NLOHMANN_JSON_PASTE31, \
2392  NLOHMANN_JSON_PASTE30, \
2393  NLOHMANN_JSON_PASTE29, \
2394  NLOHMANN_JSON_PASTE28, \
2395  NLOHMANN_JSON_PASTE27, \
2396  NLOHMANN_JSON_PASTE26, \
2397  NLOHMANN_JSON_PASTE25, \
2398  NLOHMANN_JSON_PASTE24, \
2399  NLOHMANN_JSON_PASTE23, \
2400  NLOHMANN_JSON_PASTE22, \
2401  NLOHMANN_JSON_PASTE21, \
2402  NLOHMANN_JSON_PASTE20, \
2403  NLOHMANN_JSON_PASTE19, \
2404  NLOHMANN_JSON_PASTE18, \
2405  NLOHMANN_JSON_PASTE17, \
2406  NLOHMANN_JSON_PASTE16, \
2407  NLOHMANN_JSON_PASTE15, \
2408  NLOHMANN_JSON_PASTE14, \
2409  NLOHMANN_JSON_PASTE13, \
2410  NLOHMANN_JSON_PASTE12, \
2411  NLOHMANN_JSON_PASTE11, \
2412  NLOHMANN_JSON_PASTE10, \
2413  NLOHMANN_JSON_PASTE9, \
2414  NLOHMANN_JSON_PASTE8, \
2415  NLOHMANN_JSON_PASTE7, \
2416  NLOHMANN_JSON_PASTE6, \
2417  NLOHMANN_JSON_PASTE5, \
2418  NLOHMANN_JSON_PASTE4, \
2419  NLOHMANN_JSON_PASTE3, \
2420  NLOHMANN_JSON_PASTE2, \
2421  NLOHMANN_JSON_PASTE1)(__VA_ARGS__))
2422 #define NLOHMANN_JSON_PASTE2(func, v1) func(v1)
2423 #define NLOHMANN_JSON_PASTE3(func, v1, v2) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE2(func, v2)
2424 #define NLOHMANN_JSON_PASTE4(func, v1, v2, v3) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE3(func, v2, v3)
2425 #define NLOHMANN_JSON_PASTE5(func, v1, v2, v3, v4) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE4(func, v2, v3, v4)
2426 #define NLOHMANN_JSON_PASTE6(func, v1, v2, v3, v4, v5) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE5(func, v2, v3, v4, v5)
2427 #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)
2428 #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)
2429 #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)
2430 #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)
2431 #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)
2432 #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)
2433 #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)
2434 #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)
2435 #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)
2436 #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)
2437 #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)
2438 #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)
2439 #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)
2440 #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)
2441 #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)
2442 #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)
2443 #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)
2444 #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)
2445 #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)
2446 #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)
2447 #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)
2448 #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)
2449 #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)
2450 #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)
2451 #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)
2452 #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)
2453 #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)
2454 #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)
2455 #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)
2456 #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)
2457 #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)
2458 #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)
2459 #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)
2460 #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)
2461 #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)
2462 #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)
2463 #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)
2464 #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)
2465 #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)
2466 #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)
2467 #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)
2468 #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)
2469 #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)
2470 #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)
2471 #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)
2472 #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)
2473 #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)
2474 #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)
2475 #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)
2476 #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)
2477 #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)
2478 #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)
2479 #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)
2480 #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)
2481 #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)
2482 #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)
2483 #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)
2484 #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)
2485 
2486 #define NLOHMANN_JSON_TO(v1) nlohmann_json_j[#v1] = nlohmann_json_t.v1;
2487 #define NLOHMANN_JSON_FROM(v1) nlohmann_json_j.at(#v1).get_to(nlohmann_json_t.v1);
2488 
2494 #define NLOHMANN_DEFINE_TYPE_INTRUSIVE(Type, ...) \
2495  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__)) } \
2496  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__)) }
2497 
2503 #define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Type, ...) \
2504  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__)) } \
2505  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__)) }
2506 
2507 #ifndef JSON_USE_IMPLICIT_CONVERSIONS
2508  #define JSON_USE_IMPLICIT_CONVERSIONS 1
2509 #endif
2510 
2511 #if JSON_USE_IMPLICIT_CONVERSIONS
2512  #define JSON_EXPLICIT
2513 #else
2514  #define JSON_EXPLICIT explicit
2515 #endif
2516 
2517 
2518 namespace nlohmann
2519 {
2520 namespace detail
2521 {
2522 
2536 inline void replace_substring(std::string& s, const std::string& f,
2537  const std::string& t)
2538 {
2539  JSON_ASSERT(!f.empty());
2540  for (auto pos = s.find(f); // find first occurrence of f
2541  pos != std::string::npos; // make sure f was found
2542  s.replace(pos, f.size(), t), // replace with t, and
2543  pos = s.find(f, pos + t.size())) // find next occurrence of f
2544  {}
2545 }
2546 
2554 inline std::string escape(std::string s)
2555 {
2556  replace_substring(s, "~", "~0");
2557  replace_substring(s, "/", "~1");
2558  return s;
2559 }
2560 
2568 static void unescape(std::string& s)
2569 {
2570  replace_substring(s, "~1", "/");
2571  replace_substring(s, "~0", "~");
2572 }
2573 
2574 } // namespace detail
2575 } // namespace nlohmann
2576 
2577 // #include <nlohmann/detail/input/position_t.hpp>
2578 
2579 
2580 #include <cstddef> // size_t
2581 
2582 namespace nlohmann
2583 {
2584 namespace detail
2585 {
2588 {
2590  std::size_t chars_read_total = 0;
2592  std::size_t chars_read_current_line = 0;
2594  std::size_t lines_read = 0;
2595 
2597  constexpr operator size_t() const
2598  {
2599  return chars_read_total;
2600  }
2601 };
2602 
2603 } // namespace detail
2604 } // namespace nlohmann
2605 
2606 // #include <nlohmann/detail/macro_scope.hpp>
2607 
2608 
2609 namespace nlohmann
2610 {
2611 namespace detail
2612 {
2614 // exceptions //
2616 
2645 class exception : public std::exception
2646 {
2647  public:
2649  const char* what() const noexcept override
2650  {
2651  return m.what();
2652  }
2653 
2655  const int id; // NOLINT(cppcoreguidelines-non-private-member-variables-in-classes)
2656 
2657  protected:
2659  exception(int id_, const char* what_arg) : id(id_), m(what_arg) {}
2660 
2661  static std::string name(const std::string& ename, int id_)
2662  {
2663  return "[json.exception." + ename + "." + std::to_string(id_) + "] ";
2664  }
2665 
2666  template<typename BasicJsonType>
2667  static std::string diagnostics(const BasicJsonType& leaf_element)
2668  {
2669 #if JSON_DIAGNOSTICS
2670  std::vector<std::string> tokens;
2671  for (const auto* current = &leaf_element; current->m_parent != nullptr; current = current->m_parent)
2672  {
2673  switch (current->m_parent->type())
2674  {
2675  case value_t::array:
2676  {
2677  for (std::size_t i = 0; i < current->m_parent->m_value.array->size(); ++i)
2678  {
2679  if (&current->m_parent->m_value.array->operator[](i) == current)
2680  {
2681  tokens.emplace_back(std::to_string(i));
2682  break;
2683  }
2684  }
2685  break;
2686  }
2687 
2688  case value_t::object:
2689  {
2690  for (const auto& element : *current->m_parent->m_value.object)
2691  {
2692  if (&element.second == current)
2693  {
2694  tokens.emplace_back(element.first.c_str());
2695  break;
2696  }
2697  }
2698  break;
2699  }
2700 
2701  case value_t::null: // LCOV_EXCL_LINE
2702  case value_t::string: // LCOV_EXCL_LINE
2703  case value_t::boolean: // LCOV_EXCL_LINE
2704  case value_t::number_integer: // LCOV_EXCL_LINE
2705  case value_t::number_unsigned: // LCOV_EXCL_LINE
2706  case value_t::number_float: // LCOV_EXCL_LINE
2707  case value_t::binary: // LCOV_EXCL_LINE
2708  case value_t::discarded: // LCOV_EXCL_LINE
2709  default: // LCOV_EXCL_LINE
2710  break; // LCOV_EXCL_LINE
2711  }
2712  }
2713 
2714  if (tokens.empty())
2715  {
2716  return "";
2717  }
2718 
2719  return "(" + std::accumulate(tokens.rbegin(), tokens.rend(), std::string{},
2720  [](const std::string & a, const std::string & b)
2721  {
2722  return a + "/" + detail::escape(b);
2723  }) + ") ";
2724 #else
2725  static_cast<void>(leaf_element);
2726  return "";
2727 #endif
2728  }
2729 
2730  private:
2732  std::runtime_error m;
2733 };
2734 
2780 class parse_error : public exception
2781 {
2782  public:
2792  template<typename BasicJsonType>
2793  static parse_error create(int id_, const position_t& pos, const std::string& what_arg, const BasicJsonType& context)
2794  {
2795  std::string w = exception::name("parse_error", id_) + "parse error" +
2796  position_string(pos) + ": " + exception::diagnostics(context) + what_arg;
2797  return parse_error(id_, pos.chars_read_total, w.c_str());
2798  }
2799 
2800  template<typename BasicJsonType>
2801  static parse_error create(int id_, std::size_t byte_, const std::string& what_arg, const BasicJsonType& context)
2802  {
2803  std::string w = exception::name("parse_error", id_) + "parse error" +
2804  (byte_ != 0 ? (" at byte " + std::to_string(byte_)) : "") +
2805  ": " + exception::diagnostics(context) + what_arg;
2806  return parse_error(id_, byte_, w.c_str());
2807  }
2808 
2818  const std::size_t byte;
2819 
2820  private:
2821  parse_error(int id_, std::size_t byte_, const char* what_arg)
2822  : exception(id_, what_arg), byte(byte_) {}
2823 
2824  static std::string position_string(const position_t& pos)
2825  {
2826  return " at line " + std::to_string(pos.lines_read + 1) +
2827  ", column " + std::to_string(pos.chars_read_current_line);
2828  }
2829 };
2830 
2869 {
2870  public:
2871  template<typename BasicJsonType>
2872  static invalid_iterator create(int id_, const std::string& what_arg, const BasicJsonType& context)
2873  {
2874  std::string w = exception::name("invalid_iterator", id_) + exception::diagnostics(context) + what_arg;
2875  return invalid_iterator(id_, w.c_str());
2876  }
2877 
2878  private:
2880  invalid_iterator(int id_, const char* what_arg)
2881  : exception(id_, what_arg) {}
2882 };
2883 
2923 class type_error : public exception
2924 {
2925  public:
2926  template<typename BasicJsonType>
2927  static type_error create(int id_, const std::string& what_arg, const BasicJsonType& context)
2928  {
2929  std::string w = exception::name("type_error", id_) + exception::diagnostics(context) + what_arg;
2930  return type_error(id_, w.c_str());
2931  }
2932 
2933  private:
2935  type_error(int id_, const char* what_arg) : exception(id_, what_arg) {}
2936 };
2937 
2971 class out_of_range : public exception
2972 {
2973  public:
2974  template<typename BasicJsonType>
2975  static out_of_range create(int id_, const std::string& what_arg, const BasicJsonType& context)
2976  {
2977  std::string w = exception::name("out_of_range", id_) + exception::diagnostics(context) + what_arg;
2978  return out_of_range(id_, w.c_str());
2979  }
2980 
2981  private:
2983  out_of_range(int id_, const char* what_arg) : exception(id_, what_arg) {}
2984 };
2985 
3010 class other_error : public exception
3011 {
3012  public:
3013  template<typename BasicJsonType>
3014  static other_error create(int id_, const std::string& what_arg, const BasicJsonType& context)
3015  {
3016  std::string w = exception::name("other_error", id_) + exception::diagnostics(context) + what_arg;
3017  return other_error(id_, w.c_str());
3018  }
3019 
3020  private:
3022  other_error(int id_, const char* what_arg) : exception(id_, what_arg) {}
3023 };
3024 } // namespace detail
3025 } // namespace nlohmann
3026 
3027 // #include <nlohmann/detail/macro_scope.hpp>
3028 
3029 // #include <nlohmann/detail/meta/cpp_future.hpp>
3030 
3031 
3032 #include <cstddef> // size_t
3033 #include <type_traits> // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type
3034 #include <utility> // index_sequence, make_index_sequence, index_sequence_for
3035 
3036 // #include <nlohmann/detail/macro_scope.hpp>
3037 
3038 
3039 namespace nlohmann
3040 {
3041 namespace detail
3042 {
3043 
3044 template<typename T>
3046 
3047 #ifdef JSON_HAS_CPP_14
3048 
3049 // the following utilities are natively available in C++14
3050 using std::enable_if_t;
3051 using std::index_sequence;
3054 
3055 #else
3056 
3057 // alias templates to reduce boilerplate
3058 template<bool B, typename T = void>
3060 
3061 // The following code is taken from https://github.com/abseil/abseil-cpp/blob/10cb35e459f5ecca5b2ff107635da0bfa41011b4/absl/utility/utility.h
3062 // which is part of Google Abseil (https://github.com/abseil/abseil-cpp), licensed under the Apache License 2.0.
3063 
3065 
3066 // integer_sequence
3067 //
3068 // Class template representing a compile-time integer sequence. An instantiation
3069 // of `integer_sequence<T, Ints...>` has a sequence of integers encoded in its
3070 // type through its template arguments (which is a common need when
3071 // working with C++11 variadic templates). `absl::integer_sequence` is designed
3072 // to be a drop-in replacement for C++14's `std::integer_sequence`.
3073 //
3074 // Example:
3075 //
3076 // template< class T, T... Ints >
3077 // void user_function(integer_sequence<T, Ints...>);
3078 //
3079 // int main()
3080 // {
3081 // // user_function's `T` will be deduced to `int` and `Ints...`
3082 // // will be deduced to `0, 1, 2, 3, 4`.
3083 // user_function(make_integer_sequence<int, 5>());
3084 // }
3085 template <typename T, T... Ints>
3087 {
3088  using value_type = T;
3089  static constexpr std::size_t size() noexcept
3090  {
3091  return sizeof...(Ints);
3092  }
3093 };
3094 
3095 // index_sequence
3096 //
3097 // A helper template for an `integer_sequence` of `size_t`,
3098 // `absl::index_sequence` is designed to be a drop-in replacement for C++14's
3099 // `std::index_sequence`.
3100 template <size_t... Ints>
3101 using index_sequence = integer_sequence<size_t, Ints...>;
3102 
3103 namespace utility_internal
3104 {
3105 
3106 template <typename Seq, size_t SeqSize, size_t Rem>
3107 struct Extend;
3108 
3109 // Note that SeqSize == sizeof...(Ints). It's passed explicitly for efficiency.
3110 template <typename T, T... Ints, size_t SeqSize>
3111 struct Extend<integer_sequence<T, Ints...>, SeqSize, 0>
3112 {
3113  using type = integer_sequence < T, Ints..., (Ints + SeqSize)... >;
3114 };
3115 
3116 template <typename T, T... Ints, size_t SeqSize>
3117 struct Extend<integer_sequence<T, Ints...>, SeqSize, 1>
3118 {
3119  using type = integer_sequence < T, Ints..., (Ints + SeqSize)..., 2 * SeqSize >;
3120 };
3121 
3122 // Recursion helper for 'make_integer_sequence<T, N>'.
3123 // 'Gen<T, N>::type' is an alias for 'integer_sequence<T, 0, 1, ... N-1>'.
3124 template <typename T, size_t N>
3125 struct Gen
3126 {
3127  using type =
3128  typename Extend < typename Gen < T, N / 2 >::type, N / 2, N % 2 >::type;
3129 };
3130 
3131 template <typename T>
3132 struct Gen<T, 0>
3133 {
3135 };
3136 
3137 } // namespace utility_internal
3138 
3139 // Compile-time sequences of integers
3140 
3141 // make_integer_sequence
3142 //
3143 // This template alias is equivalent to
3144 // `integer_sequence<int, 0, 1, ..., N-1>`, and is designed to be a drop-in
3145 // replacement for C++14's `std::make_integer_sequence`.
3146 template <typename T, T N>
3148 
3149 // make_index_sequence
3150 //
3151 // This template alias is equivalent to `index_sequence<0, 1, ..., N-1>`,
3152 // and is designed to be a drop-in replacement for C++14's
3153 // `std::make_index_sequence`.
3154 template <size_t N>
3156 
3157 // index_sequence_for
3158 //
3159 // Converts a typename pack into an index sequence of the same length, and
3160 // is designed to be a drop-in replacement for C++14's
3161 // `std::index_sequence_for()`
3162 template <typename... Ts>
3164 
3166 
3167 #endif
3168 
3169 // dispatch utility (taken from ranges-v3)
3170 template<unsigned N> struct priority_tag : priority_tag < N - 1 > {};
3171 template<> struct priority_tag<0> {};
3172 
3173 // taken from ranges-v3
3174 template<typename T>
3176 {
3177  static constexpr T value{};
3178 };
3179 
3180 template<typename T>
3181 constexpr T static_const<T>::value;
3182 
3183 } // namespace detail
3184 } // namespace nlohmann
3185 
3186 // #include <nlohmann/detail/meta/identity_tag.hpp>
3187 
3188 
3189 namespace nlohmann
3190 {
3191 namespace detail
3192 {
3193 // dispatching helper struct
3194 template <class T> struct identity_tag {};
3195 } // namespace detail
3196 } // namespace nlohmann
3197 
3198 // #include <nlohmann/detail/meta/type_traits.hpp>
3199 
3200 
3201 #include <limits> // numeric_limits
3202 #include <type_traits> // false_type, is_constructible, is_integral, is_same, true_type
3203 #include <utility> // declval
3204 #include <tuple> // tuple
3205 
3206 // #include <nlohmann/detail/iterators/iterator_traits.hpp>
3207 
3208 
3209 #include <iterator> // random_access_iterator_tag
3210 
3211 // #include <nlohmann/detail/meta/void_t.hpp>
3212 
3213 
3214 namespace nlohmann
3215 {
3216 namespace detail
3217 {
3218 template<typename ...Ts> struct make_void
3219 {
3220  using type = void;
3221 };
3222 template<typename ...Ts> using void_t = typename make_void<Ts...>::type;
3223 } // namespace detail
3224 } // namespace nlohmann
3225 
3226 // #include <nlohmann/detail/meta/cpp_future.hpp>
3227 
3228 
3229 namespace nlohmann
3230 {
3231 namespace detail
3232 {
3233 template<typename It, typename = void>
3234 struct iterator_types {};
3235 
3236 template<typename It>
3238  It,
3239  void_t<typename It::difference_type, typename It::value_type, typename It::pointer,
3240  typename It::reference, typename It::iterator_category >>
3241 {
3242  using difference_type = typename It::difference_type;
3243  using value_type = typename It::value_type;
3244  using pointer = typename It::pointer;
3245  using reference = typename It::reference;
3246  using iterator_category = typename It::iterator_category;
3247 };
3248 
3249 // This is required as some compilers implement std::iterator_traits in a way that
3250 // doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341.
3251 template<typename T, typename = void>
3253 {
3254 };
3255 
3256 template<typename T>
3257 struct iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >>
3258  : iterator_types<T>
3259 {
3260 };
3261 
3262 template<typename T>
3264 {
3265  using iterator_category = std::random_access_iterator_tag;
3266  using value_type = T;
3267  using difference_type = ptrdiff_t;
3268  using pointer = T*;
3269  using reference = T&;
3270 };
3271 } // namespace detail
3272 } // namespace nlohmann
3273 
3274 // #include <nlohmann/detail/macro_scope.hpp>
3275 
3276 // #include <nlohmann/detail/meta/cpp_future.hpp>
3277 
3278 // #include <nlohmann/detail/meta/detected.hpp>
3279 
3280 
3281 #include <type_traits>
3282 
3283 // #include <nlohmann/detail/meta/void_t.hpp>
3284 
3285 
3286 // https://en.cppreference.com/w/cpp/experimental/is_detected
3287 namespace nlohmann
3288 {
3289 namespace detail
3290 {
3291 struct nonesuch
3292 {
3293  nonesuch() = delete;
3294  ~nonesuch() = delete;
3295  nonesuch(nonesuch const&) = delete;
3296  nonesuch(nonesuch const&&) = delete;
3297  void operator=(nonesuch const&) = delete;
3298  void operator=(nonesuch&&) = delete;
3299 };
3300 
3301 template<class Default,
3302  class AlwaysVoid,
3303  template<class...> class Op,
3304  class... Args>
3305 struct detector
3306 {
3307  using value_t = std::false_type;
3308  using type = Default;
3309 };
3310 
3311 template<class Default, template<class...> class Op, class... Args>
3312 struct detector<Default, void_t<Op<Args...>>, Op, Args...>
3313 {
3314  using value_t = std::true_type;
3315  using type = Op<Args...>;
3316 };
3317 
3318 template<template<class...> class Op, class... Args>
3319 using is_detected = typename detector<nonesuch, void, Op, Args...>::value_t;
3320 
3321 template<template<class...> class Op, class... Args>
3322 struct is_detected_lazy : is_detected<Op, Args...> { };
3323 
3324 template<template<class...> class Op, class... Args>
3325 using detected_t = typename detector<nonesuch, void, Op, Args...>::type;
3326 
3327 template<class Default, template<class...> class Op, class... Args>
3328 using detected_or = detector<Default, void, Op, Args...>;
3329 
3330 template<class Default, template<class...> class Op, class... Args>
3331 using detected_or_t = typename detected_or<Default, Op, Args...>::type;
3332 
3333 template<class Expected, template<class...> class Op, class... Args>
3334 using is_detected_exact = std::is_same<Expected, detected_t<Op, Args...>>;
3335 
3336 template<class To, template<class...> class Op, class... Args>
3338  std::is_convertible<detected_t<Op, Args...>, To>;
3339 } // namespace detail
3340 } // namespace nlohmann
3341 
3342 // #include <nlohmann/json_fwd.hpp>
3343 #ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_
3344 #define INCLUDE_NLOHMANN_JSON_FWD_HPP_
3345 
3346 #include <cstdint> // int64_t, uint64_t
3347 #include <map> // map
3348 #include <memory> // allocator
3349 #include <string> // string
3350 #include <vector> // vector
3351 
3357 namespace nlohmann
3358 {
3366 template<typename T = void, typename SFINAE = void>
3368 
3369 template<template<typename U, typename V, typename... Args> class ObjectType =
3370  std::map,
3371  template<typename U, typename... Args> class ArrayType = std::vector,
3372  class StringType = std::string, class BooleanType = bool,
3373  class NumberIntegerType = std::int64_t,
3374  class NumberUnsignedType = std::uint64_t,
3375  class NumberFloatType = double,
3376  template<typename U> class AllocatorType = std::allocator,
3377  template<typename T, typename SFINAE = void> class JSONSerializer =
3379  class BinaryType = std::vector<std::uint8_t>>
3381 
3393 template<typename BasicJsonType>
3395 
3405 
3406 template<class Key, class T, class IgnoredLess, class Allocator>
3408 
3417 
3418 } // namespace nlohmann
3419 
3420 #endif // INCLUDE_NLOHMANN_JSON_FWD_HPP_
3421 
3422 
3423 namespace nlohmann
3424 {
3433 namespace detail
3434 {
3436 // helpers //
3438 
3439 // Note to maintainers:
3440 //
3441 // Every trait in this file expects a non CV-qualified type.
3442 // The only exceptions are in the 'aliases for detected' section
3443 // (i.e. those of the form: decltype(T::member_function(std::declval<T>())))
3444 //
3445 // In this case, T has to be properly CV-qualified to constraint the function arguments
3446 // (e.g. to_json(BasicJsonType&, const T&))
3447 
3448 template<typename> struct is_basic_json : std::false_type {};
3449 
3451 struct is_basic_json<NLOHMANN_BASIC_JSON_TPL> : std::true_type {};
3452 
3454 // json_ref helpers //
3456 
3457 template<typename>
3458 class json_ref;
3459 
3460 template<typename>
3461 struct is_json_ref : std::false_type {};
3462 
3463 template<typename T>
3464 struct is_json_ref<json_ref<T>> : std::true_type {};
3465 
3467 // aliases for detected //
3469 
3470 template<typename T>
3471 using mapped_type_t = typename T::mapped_type;
3472 
3473 template<typename T>
3474 using key_type_t = typename T::key_type;
3475 
3476 template<typename T>
3477 using value_type_t = typename T::value_type;
3478 
3479 template<typename T>
3480 using difference_type_t = typename T::difference_type;
3481 
3482 template<typename T>
3483 using pointer_t = typename T::pointer;
3484 
3485 template<typename T>
3486 using reference_t = typename T::reference;
3487 
3488 template<typename T>
3489 using iterator_category_t = typename T::iterator_category;
3490 
3491 template<typename T>
3492 using iterator_t = typename T::iterator;
3493 
3494 template<typename T, typename... Args>
3495 using to_json_function = decltype(T::to_json(std::declval<Args>()...));
3496 
3497 template<typename T, typename... Args>
3498 using from_json_function = decltype(T::from_json(std::declval<Args>()...));
3499 
3500 template<typename T, typename U>
3501 using get_template_function = decltype(std::declval<T>().template get<U>());
3502 
3503 // trait checking if JSONSerializer<T>::from_json(json const&, udt&) exists
3504 template<typename BasicJsonType, typename T, typename = void>
3505 struct has_from_json : std::false_type {};
3506 
3507 // trait checking if j.get<T> is valid
3508 // use this trait instead of std::is_constructible or std::is_convertible,
3509 // both rely on, or make use of implicit conversions, and thus fail when T
3510 // has several constructors/operator= (see https://github.com/nlohmann/json/issues/958)
3511 template <typename BasicJsonType, typename T>
3513 {
3515 };
3516 
3517 template<typename BasicJsonType, typename T>
3518 struct has_from_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >>
3519 {
3520  using serializer = typename BasicJsonType::template json_serializer<T, void>;
3521 
3522  static constexpr bool value =
3524  const BasicJsonType&, T&>::value;
3525 };
3526 
3527 // This trait checks if JSONSerializer<T>::from_json(json const&) exists
3528 // this overload is used for non-default-constructible user-defined-types
3529 template<typename BasicJsonType, typename T, typename = void>
3530 struct has_non_default_from_json : std::false_type {};
3531 
3532 template<typename BasicJsonType, typename T>
3533 struct has_non_default_from_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >>
3534 {
3535  using serializer = typename BasicJsonType::template json_serializer<T, void>;
3536 
3537  static constexpr bool value =
3539  const BasicJsonType&>::value;
3540 };
3541 
3542 // This trait checks if BasicJsonType::json_serializer<T>::to_json exists
3543 // Do not evaluate the trait when T is a basic_json type, to avoid template instantiation infinite recursion.
3544 template<typename BasicJsonType, typename T, typename = void>
3545 struct has_to_json : std::false_type {};
3546 
3547 template<typename BasicJsonType, typename T>
3548 struct has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >>
3549 {
3550  using serializer = typename BasicJsonType::template json_serializer<T, void>;
3551 
3552  static constexpr bool value =
3554  T>::value;
3555 };
3556 
3557 
3559 // is_ functions //
3561 
3562 // https://en.cppreference.com/w/cpp/types/conjunction
3563 template<class...> struct conjunction : std::true_type { };
3564 template<class B1> struct conjunction<B1> : B1 { };
3565 template<class B1, class... Bn>
3566 struct conjunction<B1, Bn...>
3567 : std::conditional<bool(B1::value), conjunction<Bn...>, B1>::type {};
3568 
3569 // https://en.cppreference.com/w/cpp/types/negation
3570 template<class B> struct negation : std::integral_constant < bool, !B::value > { };
3571 
3572 // Reimplementation of is_constructible and is_default_constructible, due to them being broken for
3573 // std::pair and std::tuple until LWG 2367 fix (see https://cplusplus.github.io/LWG/lwg-defects.html#2367).
3574 // This causes compile errors in e.g. clang 3.5 or gcc 4.9.
3575 template <typename T>
3576 struct is_default_constructible : std::is_default_constructible<T> {};
3577 
3578 template <typename T1, typename T2>
3579 struct is_default_constructible<std::pair<T1, T2>>
3580  : conjunction<is_default_constructible<T1>, is_default_constructible<T2>> {};
3581 
3582 template <typename T1, typename T2>
3583 struct is_default_constructible<const std::pair<T1, T2>>
3584  : conjunction<is_default_constructible<T1>, is_default_constructible<T2>> {};
3585 
3586 template <typename... Ts>
3587 struct is_default_constructible<std::tuple<Ts...>>
3588  : conjunction<is_default_constructible<Ts>...> {};
3589 
3590 template <typename... Ts>
3591 struct is_default_constructible<const std::tuple<Ts...>>
3592  : conjunction<is_default_constructible<Ts>...> {};
3593 
3594 
3595 template <typename T, typename... Args>
3596 struct is_constructible : std::is_constructible<T, Args...> {};
3597 
3598 template <typename T1, typename T2>
3599 struct is_constructible<std::pair<T1, T2>> : is_default_constructible<std::pair<T1, T2>> {};
3600 
3601 template <typename T1, typename T2>
3602 struct is_constructible<const std::pair<T1, T2>> : is_default_constructible<const std::pair<T1, T2>> {};
3603 
3604 template <typename... Ts>
3605 struct is_constructible<std::tuple<Ts...>> : is_default_constructible<std::tuple<Ts...>> {};
3606 
3607 template <typename... Ts>
3608 struct is_constructible<const std::tuple<Ts...>> : is_default_constructible<const std::tuple<Ts...>> {};
3609 
3610 
3611 template<typename T, typename = void>
3612 struct is_iterator_traits : std::false_type {};
3613 
3614 template<typename T>
3616 {
3617  private:
3619 
3620  public:
3621  static constexpr auto value =
3627 };
3628 
3629 // The following implementation of is_complete_type is taken from
3630 // https://blogs.msdn.microsoft.com/vcblog/2015/12/02/partial-support-for-expression-sfinae-in-vs-2015-update-1/
3631 // and is written by Xiang Fan who agreed to using it in this library.
3632 
3633 template<typename T, typename = void>
3634 struct is_complete_type : std::false_type {};
3635 
3636 template<typename T>
3637 struct is_complete_type<T, decltype(void(sizeof(T)))> : std::true_type {};
3638 
3639 template<typename BasicJsonType, typename CompatibleObjectType,
3640  typename = void>
3641 struct is_compatible_object_type_impl : std::false_type {};
3642 
3643 template<typename BasicJsonType, typename CompatibleObjectType>
3645  BasicJsonType, CompatibleObjectType,
3646  enable_if_t < is_detected<mapped_type_t, CompatibleObjectType>::value&&
3647  is_detected<key_type_t, CompatibleObjectType>::value >>
3648 {
3649  using object_t = typename BasicJsonType::object_t;
3650 
3651  // macOS's is_constructible does not play well with nonesuch...
3652  static constexpr bool value =
3653  is_constructible<typename object_t::key_type,
3654  typename CompatibleObjectType::key_type>::value &&
3655  is_constructible<typename object_t::mapped_type,
3656  typename CompatibleObjectType::mapped_type>::value;
3657 };
3658 
3659 template<typename BasicJsonType, typename CompatibleObjectType>
3661  : is_compatible_object_type_impl<BasicJsonType, CompatibleObjectType> {};
3662 
3663 template<typename BasicJsonType, typename ConstructibleObjectType,
3664  typename = void>
3665 struct is_constructible_object_type_impl : std::false_type {};
3666 
3667 template<typename BasicJsonType, typename ConstructibleObjectType>
3669  BasicJsonType, ConstructibleObjectType,
3670  enable_if_t < is_detected<mapped_type_t, ConstructibleObjectType>::value&&
3671  is_detected<key_type_t, ConstructibleObjectType>::value >>
3672 {
3673  using object_t = typename BasicJsonType::object_t;
3674 
3675  static constexpr bool value =
3679  (is_constructible<typename ConstructibleObjectType::key_type,
3680  typename object_t::key_type>::value &&
3681  std::is_same <
3682  typename object_t::mapped_type,
3683  typename ConstructibleObjectType::mapped_type >::value)) ||
3684  (has_from_json<BasicJsonType,
3685  typename ConstructibleObjectType::mapped_type>::value ||
3687  BasicJsonType,
3688  typename ConstructibleObjectType::mapped_type >::value);
3689 };
3690 
3691 template<typename BasicJsonType, typename ConstructibleObjectType>
3693  : is_constructible_object_type_impl<BasicJsonType,
3694  ConstructibleObjectType> {};
3695 
3696 template<typename BasicJsonType, typename CompatibleStringType,
3697  typename = void>
3698 struct is_compatible_string_type_impl : std::false_type {};
3699 
3700 template<typename BasicJsonType, typename CompatibleStringType>
3702  BasicJsonType, CompatibleStringType,
3703  enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type,
3704  value_type_t, CompatibleStringType>::value >>
3705 {
3706  static constexpr auto value =
3708 };
3709 
3710 template<typename BasicJsonType, typename ConstructibleStringType>
3712  : is_compatible_string_type_impl<BasicJsonType, ConstructibleStringType> {};
3713 
3714 template<typename BasicJsonType, typename ConstructibleStringType,
3715  typename = void>
3716 struct is_constructible_string_type_impl : std::false_type {};
3717 
3718 template<typename BasicJsonType, typename ConstructibleStringType>
3720  BasicJsonType, ConstructibleStringType,
3721  enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type,
3722  value_type_t, ConstructibleStringType>::value >>
3723 {
3724  static constexpr auto value =
3725  is_constructible<ConstructibleStringType,
3726  typename BasicJsonType::string_t>::value;
3727 };
3728 
3729 template<typename BasicJsonType, typename ConstructibleStringType>
3731  : is_constructible_string_type_impl<BasicJsonType, ConstructibleStringType> {};
3732 
3733 template<typename BasicJsonType, typename CompatibleArrayType, typename = void>
3734 struct is_compatible_array_type_impl : std::false_type {};
3735 
3736 template<typename BasicJsonType, typename CompatibleArrayType>
3738  BasicJsonType, CompatibleArrayType,
3739  enable_if_t < is_detected<value_type_t, CompatibleArrayType>::value&&
3740  is_detected<iterator_t, CompatibleArrayType>::value&&
3741 // This is needed because json_reverse_iterator has a ::iterator type...
3742 // Therefore it is detected as a CompatibleArrayType.
3743 // The real fix would be to have an Iterable concept.
3745  iterator_traits<CompatibleArrayType >>::value >>
3746 {
3747  static constexpr bool value =
3748  is_constructible<BasicJsonType,
3749  typename CompatibleArrayType::value_type>::value;
3750 };
3751 
3752 template<typename BasicJsonType, typename CompatibleArrayType>
3754  : is_compatible_array_type_impl<BasicJsonType, CompatibleArrayType> {};
3755 
3756 template<typename BasicJsonType, typename ConstructibleArrayType, typename = void>
3757 struct is_constructible_array_type_impl : std::false_type {};
3758 
3759 template<typename BasicJsonType, typename ConstructibleArrayType>
3761  BasicJsonType, ConstructibleArrayType,
3762  enable_if_t<std::is_same<ConstructibleArrayType,
3763  typename BasicJsonType::value_type>::value >>
3764  : std::true_type {};
3765 
3766 template<typename BasicJsonType, typename ConstructibleArrayType>
3768  BasicJsonType, ConstructibleArrayType,
3769  enable_if_t < !std::is_same<ConstructibleArrayType,
3770  typename BasicJsonType::value_type>::value&&
3771  is_default_constructible<ConstructibleArrayType>::value&&
3772 (std::is_move_assignable<ConstructibleArrayType>::value ||
3773  std::is_copy_assignable<ConstructibleArrayType>::value)&&
3774 is_detected<value_type_t, ConstructibleArrayType>::value&&
3775 is_detected<iterator_t, ConstructibleArrayType>::value&&
3777 detected_t<value_type_t, ConstructibleArrayType >>::value >>
3778 {
3779  static constexpr bool value =
3780  // This is needed because json_reverse_iterator has a ::iterator type,
3781  // furthermore, std::back_insert_iterator (and other iterators) have a
3782  // base class `iterator`... Therefore it is detected as a
3783  // ConstructibleArrayType. The real fix would be to have an Iterable
3784  // concept.
3786 
3787  (std::is_same<typename ConstructibleArrayType::value_type,
3788  typename BasicJsonType::array_t::value_type>::value ||
3789  has_from_json<BasicJsonType,
3790  typename ConstructibleArrayType::value_type>::value ||
3792  BasicJsonType, typename ConstructibleArrayType::value_type >::value);
3793 };
3794 
3795 template<typename BasicJsonType, typename ConstructibleArrayType>
3797  : is_constructible_array_type_impl<BasicJsonType, ConstructibleArrayType> {};
3798 
3799 template<typename RealIntegerType, typename CompatibleNumberIntegerType,
3800  typename = void>
3801 struct is_compatible_integer_type_impl : std::false_type {};
3802 
3803 template<typename RealIntegerType, typename CompatibleNumberIntegerType>
3805  RealIntegerType, CompatibleNumberIntegerType,
3806  enable_if_t < std::is_integral<RealIntegerType>::value&&
3807  std::is_integral<CompatibleNumberIntegerType>::value&&
3808  !std::is_same<bool, CompatibleNumberIntegerType>::value >>
3809 {
3810  // is there an assert somewhere on overflows?
3811  using RealLimits = std::numeric_limits<RealIntegerType>;
3812  using CompatibleLimits = std::numeric_limits<CompatibleNumberIntegerType>;
3813 
3814  static constexpr auto value =
3815  is_constructible<RealIntegerType,
3816  CompatibleNumberIntegerType>::value &&
3817  CompatibleLimits::is_integer &&
3818  RealLimits::is_signed == CompatibleLimits::is_signed;
3819 };
3820 
3821 template<typename RealIntegerType, typename CompatibleNumberIntegerType>
3823  : is_compatible_integer_type_impl<RealIntegerType,
3824  CompatibleNumberIntegerType> {};
3825 
3826 template<typename BasicJsonType, typename CompatibleType, typename = void>
3827 struct is_compatible_type_impl: std::false_type {};
3828 
3829 template<typename BasicJsonType, typename CompatibleType>
3831  BasicJsonType, CompatibleType,
3832  enable_if_t<is_complete_type<CompatibleType>::value >>
3833 {
3834  static constexpr bool value =
3836 };
3837 
3838 template<typename BasicJsonType, typename CompatibleType>
3840  : is_compatible_type_impl<BasicJsonType, CompatibleType> {};
3841 
3842 template<typename T1, typename T2>
3843 struct is_constructible_tuple : std::false_type {};
3844 
3845 template<typename T1, typename... Args>
3846 struct is_constructible_tuple<T1, std::tuple<Args...>> : conjunction<is_constructible<T1, Args>...> {};
3847 
3848 // to avoid useless casts (see https://github.com/nlohmann/json/issues/2893#issuecomment-889152324)
3851 {
3852  return static_cast<T>(value);
3853 }
3854 
3856 T conditional_static_cast(U value)
3857 {
3858  return value;
3859 }
3860 
3861 } // namespace detail
3862 } // namespace nlohmann
3863 
3864 // #include <nlohmann/detail/value_t.hpp>
3865 
3866 
3867 namespace nlohmann
3868 {
3869 namespace detail
3870 {
3871 template<typename BasicJsonType>
3872 void from_json(const BasicJsonType& j, typename std::nullptr_t& n)
3873 {
3874  if (JSON_HEDLEY_UNLIKELY(!j.is_null()))
3875  {
3876  JSON_THROW(type_error::create(302, "type must be null, but is " + std::string(j.type_name()), j));
3877  }
3878  n = nullptr;
3879 }
3880 
3881 // overloads for basic_json template parameters
3882 template < typename BasicJsonType, typename ArithmeticType,
3885  int > = 0 >
3886 void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val)
3887 {
3888  switch (static_cast<value_t>(j))
3889  {
3891  {
3892  val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_unsigned_t*>());
3893  break;
3894  }
3896  {
3897  val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_integer_t*>());
3898  break;
3899  }
3900  case value_t::number_float:
3901  {
3902  val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t*>());
3903  break;
3904  }
3905 
3906  case value_t::null:
3907  case value_t::object:
3908  case value_t::array:
3909  case value_t::string:
3910  case value_t::boolean:
3911  case value_t::binary:
3912  case value_t::discarded:
3913  default:
3914  JSON_THROW(type_error::create(302, "type must be number, but is " + std::string(j.type_name()), j));
3915  }
3916 }
3917 
3918 template<typename BasicJsonType>
3919 void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b)
3920 {
3921  if (JSON_HEDLEY_UNLIKELY(!j.is_boolean()))
3922  {
3923  JSON_THROW(type_error::create(302, "type must be boolean, but is " + std::string(j.type_name()), j));
3924  }
3925  b = *j.template get_ptr<const typename BasicJsonType::boolean_t*>();
3926 }
3927 
3928 template<typename BasicJsonType>
3929 void from_json(const BasicJsonType& j, typename BasicJsonType::string_t& s)
3930 {
3931  if (JSON_HEDLEY_UNLIKELY(!j.is_string()))
3932  {
3933  JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()), j));
3934  }
3935  s = *j.template get_ptr<const typename BasicJsonType::string_t*>();
3936 }
3937 
3938 template <
3939  typename BasicJsonType, typename ConstructibleStringType,
3940  enable_if_t <
3942  !std::is_same<typename BasicJsonType::string_t,
3943  ConstructibleStringType>::value,
3944  int > = 0 >
3945 void from_json(const BasicJsonType& j, ConstructibleStringType& s)
3946 {
3947  if (JSON_HEDLEY_UNLIKELY(!j.is_string()))
3948  {
3949  JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()), j));
3950  }
3951 
3952  s = *j.template get_ptr<const typename BasicJsonType::string_t*>();
3953 }
3954 
3955 template<typename BasicJsonType>
3956 void from_json(const BasicJsonType& j, typename BasicJsonType::number_float_t& val)
3957 {
3958  get_arithmetic_value(j, val);
3959 }
3960 
3961 template<typename BasicJsonType>
3962 void from_json(const BasicJsonType& j, typename BasicJsonType::number_unsigned_t& val)
3963 {
3964  get_arithmetic_value(j, val);
3965 }
3966 
3967 template<typename BasicJsonType>
3968 void from_json(const BasicJsonType& j, typename BasicJsonType::number_integer_t& val)
3969 {
3970  get_arithmetic_value(j, val);
3971 }
3972 
3973 template<typename BasicJsonType, typename EnumType,
3975 void from_json(const BasicJsonType& j, EnumType& e)
3976 {
3978  get_arithmetic_value(j, val);
3979  e = static_cast<EnumType>(val);
3980 }
3981 
3982 // forward_list doesn't have an insert method
3983 template<typename BasicJsonType, typename T, typename Allocator,
3985 void from_json(const BasicJsonType& j, std::forward_list<T, Allocator>& l)
3986 {
3987  if (JSON_HEDLEY_UNLIKELY(!j.is_array()))
3988  {
3989  JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()), j));
3990  }
3991  l.clear();
3992  std::transform(j.rbegin(), j.rend(),
3993  std::front_inserter(l), [](const BasicJsonType & i)
3994  {
3995  return i.template get<T>();
3996  });
3997 }
3998 
3999 // valarray doesn't have an insert method
4000 template<typename BasicJsonType, typename T,
4002 void from_json(const BasicJsonType& j, std::valarray<T>& l)
4003 {
4004  if (JSON_HEDLEY_UNLIKELY(!j.is_array()))
4005  {
4006  JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()), j));
4007  }
4008  l.resize(j.size());
4009  std::transform(j.begin(), j.end(), std::begin(l),
4010  [](const BasicJsonType & elem)
4011  {
4012  return elem.template get<T>();
4013  });
4014 }
4015 
4016 template<typename BasicJsonType, typename T, std::size_t N>
4017 auto from_json(const BasicJsonType& j, T (&arr)[N]) // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
4018 -> decltype(j.template get<T>(), void())
4019 {
4020  for (std::size_t i = 0; i < N; ++i)
4021  {
4022  arr[i] = j.at(i).template get<T>();
4023  }
4024 }
4025 
4026 template<typename BasicJsonType>
4027 void from_json_array_impl(const BasicJsonType& j, typename BasicJsonType::array_t& arr, priority_tag<3> /*unused*/)
4028 {
4029  arr = *j.template get_ptr<const typename BasicJsonType::array_t*>();
4030 }
4031 
4032 template<typename BasicJsonType, typename T, std::size_t N>
4033 auto from_json_array_impl(const BasicJsonType& j, std::array<T, N>& arr,
4034  priority_tag<2> /*unused*/)
4035 -> decltype(j.template get<T>(), void())
4036 {
4037  for (std::size_t i = 0; i < N; ++i)
4038  {
4039  arr[i] = j.at(i).template get<T>();
4040  }
4041 }
4042 
4043 template<typename BasicJsonType, typename ConstructibleArrayType,
4044  enable_if_t<
4046  int> = 0>
4047 auto from_json_array_impl(const BasicJsonType& j, ConstructibleArrayType& arr, priority_tag<1> /*unused*/)
4048 -> decltype(
4049  arr.reserve(std::declval<typename ConstructibleArrayType::size_type>()),
4050  j.template get<typename ConstructibleArrayType::value_type>(),
4051  void())
4052 {
4053  using std::end;
4054 
4055  ConstructibleArrayType ret;
4056  ret.reserve(j.size());
4057  std::transform(j.begin(), j.end(),
4058  std::inserter(ret, end(ret)), [](const BasicJsonType & i)
4059  {
4060  // get<BasicJsonType>() returns *this, this won't call a from_json
4061  // method when value_type is BasicJsonType
4062  return i.template get<typename ConstructibleArrayType::value_type>();
4063  });
4064  arr = std::move(ret);
4065 }
4066 
4067 template<typename BasicJsonType, typename ConstructibleArrayType,
4068  enable_if_t<
4070  int> = 0>
4071 void from_json_array_impl(const BasicJsonType& j, ConstructibleArrayType& arr,
4072  priority_tag<0> /*unused*/)
4073 {
4074  using std::end;
4075 
4076  ConstructibleArrayType ret;
4077  std::transform(
4078  j.begin(), j.end(), std::inserter(ret, end(ret)),
4079  [](const BasicJsonType & i)
4080  {
4081  // get<BasicJsonType>() returns *this, this won't call a from_json
4082  // method when value_type is BasicJsonType
4083  return i.template get<typename ConstructibleArrayType::value_type>();
4084  });
4085  arr = std::move(ret);
4086 }
4087 
4088 template < typename BasicJsonType, typename ConstructibleArrayType,
4089  enable_if_t <
4095  int > = 0 >
4096 auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr)
4097 -> decltype(from_json_array_impl(j, arr, priority_tag<3> {}),
4098 j.template get<typename ConstructibleArrayType::value_type>(),
4099 void())
4100 {
4101  if (JSON_HEDLEY_UNLIKELY(!j.is_array()))
4102  {
4103  JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()), j));
4104  }
4105 
4107 }
4108 
4109 template < typename BasicJsonType, typename T, std::size_t... Idx >
4110 std::array<T, sizeof...(Idx)> from_json_inplace_array_impl(BasicJsonType&& j,
4111  identity_tag<std::array<T, sizeof...(Idx)>> /*unused*/, index_sequence<Idx...> /*unused*/)
4112 {
4113  return { { std::forward<BasicJsonType>(j).at(Idx).template get<T>()... } };
4114 }
4115 
4116 template < typename BasicJsonType, typename T, std::size_t N >
4117 auto from_json(BasicJsonType&& j, identity_tag<std::array<T, N>> tag)
4118 -> decltype(from_json_inplace_array_impl(std::forward<BasicJsonType>(j), tag, make_index_sequence<N> {}))
4119 {
4120  if (JSON_HEDLEY_UNLIKELY(!j.is_array()))
4121  {
4122  JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()), j));
4123  }
4124 
4125  return from_json_inplace_array_impl(std::forward<BasicJsonType>(j), tag, make_index_sequence<N> {});
4126 }
4127 
4128 template<typename BasicJsonType>
4129 void from_json(const BasicJsonType& j, typename BasicJsonType::binary_t& bin)
4130 {
4131  if (JSON_HEDLEY_UNLIKELY(!j.is_binary()))
4132  {
4133  JSON_THROW(type_error::create(302, "type must be binary, but is " + std::string(j.type_name()), j));
4134  }
4135 
4136  bin = *j.template get_ptr<const typename BasicJsonType::binary_t*>();
4137 }
4138 
4139 template<typename BasicJsonType, typename ConstructibleObjectType,
4141 void from_json(const BasicJsonType& j, ConstructibleObjectType& obj)
4142 {
4143  if (JSON_HEDLEY_UNLIKELY(!j.is_object()))
4144  {
4145  JSON_THROW(type_error::create(302, "type must be object, but is " + std::string(j.type_name()), j));
4146  }
4147 
4148  ConstructibleObjectType ret;
4149  const auto* inner_object = j.template get_ptr<const typename BasicJsonType::object_t*>();
4150  using value_type = typename ConstructibleObjectType::value_type;
4151  std::transform(
4152  inner_object->begin(), inner_object->end(),
4153  std::inserter(ret, ret.begin()),
4154  [](typename BasicJsonType::object_t::value_type const & p)
4155  {
4156  return value_type(p.first, p.second.template get<typename ConstructibleObjectType::mapped_type>());
4157  });
4158  obj = std::move(ret);
4159 }
4160 
4161 // overload for arithmetic types, not chosen for basic_json template arguments
4162 // (BooleanType, etc..); note: Is it really necessary to provide explicit
4163 // overloads for boolean_t etc. in case of a custom BooleanType which is not
4164 // an arithmetic type?
4165 template < typename BasicJsonType, typename ArithmeticType,
4166  enable_if_t <
4172  int > = 0 >
4173 void from_json(const BasicJsonType& j, ArithmeticType& val)
4174 {
4175  switch (static_cast<value_t>(j))
4176  {
4178  {
4179  val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_unsigned_t*>());
4180  break;
4181  }
4183  {
4184  val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_integer_t*>());
4185  break;
4186  }
4187  case value_t::number_float:
4188  {
4189  val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t*>());
4190  break;
4191  }
4192  case value_t::boolean:
4193  {
4194  val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::boolean_t*>());
4195  break;
4196  }
4197 
4198  case value_t::null:
4199  case value_t::object:
4200  case value_t::array:
4201  case value_t::string:
4202  case value_t::binary:
4203  case value_t::discarded:
4204  default:
4205  JSON_THROW(type_error::create(302, "type must be number, but is " + std::string(j.type_name()), j));
4206  }
4207 }
4208 
4209 template<typename BasicJsonType, typename... Args, std::size_t... Idx>
4210 std::tuple<Args...> from_json_tuple_impl_base(BasicJsonType&& j, index_sequence<Idx...> /*unused*/)
4211 {
4212  return std::make_tuple(std::forward<BasicJsonType>(j).at(Idx).template get<Args>()...);
4213 }
4214 
4215 template < typename BasicJsonType, class A1, class A2 >
4216 std::pair<A1, A2> from_json_tuple_impl(BasicJsonType&& j, identity_tag<std::pair<A1, A2>> /*unused*/, priority_tag<0> /*unused*/)
4217 {
4218  return {std::forward<BasicJsonType>(j).at(0).template get<A1>(),
4219  std::forward<BasicJsonType>(j).at(1).template get<A2>()};
4220 }
4221 
4222 template<typename BasicJsonType, typename A1, typename A2>
4223 void from_json_tuple_impl(BasicJsonType&& j, std::pair<A1, A2>& p, priority_tag<1> /*unused*/)
4224 {
4225  p = from_json_tuple_impl(std::forward<BasicJsonType>(j), identity_tag<std::pair<A1, A2>> {}, priority_tag<0> {});
4226 }
4227 
4228 template<typename BasicJsonType, typename... Args>
4229 std::tuple<Args...> from_json_tuple_impl(BasicJsonType&& j, identity_tag<std::tuple<Args...>> /*unused*/, priority_tag<2> /*unused*/)
4230 {
4231  return from_json_tuple_impl_base<BasicJsonType, Args...>(std::forward<BasicJsonType>(j), index_sequence_for<Args...> {});
4232 }
4233 
4234 template<typename BasicJsonType, typename... Args>
4235 void from_json_tuple_impl(BasicJsonType&& j, std::tuple<Args...>& t, priority_tag<3> /*unused*/)
4236 {
4237  t = from_json_tuple_impl_base<BasicJsonType, Args...>(std::forward<BasicJsonType>(j), index_sequence_for<Args...> {});
4238 }
4239 
4240 template<typename BasicJsonType, typename TupleRelated>
4241 auto from_json(BasicJsonType&& j, TupleRelated&& t)
4242 -> decltype(from_json_tuple_impl(std::forward<BasicJsonType>(j), std::forward<TupleRelated>(t), priority_tag<3> {}))
4243 {
4244  if (JSON_HEDLEY_UNLIKELY(!j.is_array()))
4245  {
4246  JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()), j));
4247  }
4248 
4249  return from_json_tuple_impl(std::forward<BasicJsonType>(j), std::forward<TupleRelated>(t), priority_tag<3> {});
4250 }
4251 
4252 template < typename BasicJsonType, typename Key, typename Value, typename Compare, typename Allocator,
4253  typename = enable_if_t < !std::is_constructible <
4254  typename BasicJsonType::string_t, Key >::value >>
4255 void from_json(const BasicJsonType& j, std::map<Key, Value, Compare, Allocator>& m)
4256 {
4257  if (JSON_HEDLEY_UNLIKELY(!j.is_array()))
4258  {
4259  JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()), j));
4260  }
4261  m.clear();
4262  for (const auto& p : j)
4263  {
4264  if (JSON_HEDLEY_UNLIKELY(!p.is_array()))
4265  {
4266  JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()), j));
4267  }
4268  m.emplace(p.at(0).template get<Key>(), p.at(1).template get<Value>());
4269  }
4270 }
4271 
4272 template < typename BasicJsonType, typename Key, typename Value, typename Hash, typename KeyEqual, typename Allocator,
4273  typename = enable_if_t < !std::is_constructible <
4274  typename BasicJsonType::string_t, Key >::value >>
4275 void from_json(const BasicJsonType& j, std::unordered_map<Key, Value, Hash, KeyEqual, Allocator>& m)
4276 {
4277  if (JSON_HEDLEY_UNLIKELY(!j.is_array()))
4278  {
4279  JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()), j));
4280  }
4281  m.clear();
4282  for (const auto& p : j)
4283  {
4284  if (JSON_HEDLEY_UNLIKELY(!p.is_array()))
4285  {
4286  JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()), j));
4287  }
4288  m.emplace(p.at(0).template get<Key>(), p.at(1).template get<Value>());
4289  }
4290 }
4291 
4293 {
4294  template<typename BasicJsonType, typename T>
4295  auto operator()(const BasicJsonType& j, T&& val) const
4296  noexcept(noexcept(from_json(j, std::forward<T>(val))))
4297  -> decltype(from_json(j, std::forward<T>(val)))
4298  {
4299  return from_json(j, std::forward<T>(val));
4300  }
4301 };
4302 } // namespace detail
4303 
4307 namespace // NOLINT(cert-dcl59-cpp,fuchsia-header-anon-namespaces,google-build-namespaces)
4308 {
4309 constexpr const auto& from_json = detail::static_const<detail::from_json_fn>::value; // NOLINT(misc-definitions-in-headers)
4310 } // namespace
4311 } // namespace nlohmann
4312 
4313 // #include <nlohmann/detail/conversions/to_json.hpp>
4314 
4315 
4316 #include <algorithm> // copy
4317 #include <iterator> // begin, end
4318 #include <string> // string
4319 #include <tuple> // tuple, get
4320 #include <type_traits> // is_same, is_constructible, is_floating_point, is_enum, underlying_type
4321 #include <utility> // move, forward, declval, pair
4322 #include <valarray> // valarray
4323 #include <vector> // vector
4324 
4325 // #include <nlohmann/detail/iterators/iteration_proxy.hpp>
4326 
4327 
4328 #include <cstddef> // size_t
4329 #include <iterator> // input_iterator_tag
4330 #include <string> // string, to_string
4331 #include <tuple> // tuple_size, get, tuple_element
4332 #include <utility> // move
4333 
4334 // #include <nlohmann/detail/meta/type_traits.hpp>
4335 
4336 // #include <nlohmann/detail/value_t.hpp>
4337 
4338 
4339 namespace nlohmann
4340 {
4341 namespace detail
4342 {
4343 template<typename string_type>
4344 void int_to_string( string_type& target, std::size_t value )
4345 {
4346  // For ADL
4347  using std::to_string;
4348  target = to_string(value);
4349 }
4350 template<typename IteratorType> class iteration_proxy_value
4351 {
4352  public:
4353  using difference_type = std::ptrdiff_t;
4355  using pointer = value_type * ;
4356  using reference = value_type & ;
4357  using iterator_category = std::input_iterator_tag;
4358  using string_type = typename std::remove_cv< typename std::remove_reference<decltype( std::declval<IteratorType>().key() ) >::type >::type;
4359 
4360  private:
4362  IteratorType anchor;
4364  std::size_t array_index = 0;
4366  mutable std::size_t array_index_last = 0;
4371 
4372  public:
4373  explicit iteration_proxy_value(IteratorType it) noexcept
4374  : anchor(std::move(it))
4375  {}
4376 
4379  {
4380  return *this;
4381  }
4382 
4385  {
4386  ++anchor;
4387  ++array_index;
4388 
4389  return *this;
4390  }
4391 
4394  {
4395  return anchor == o.anchor;
4396  }
4397 
4400  {
4401  return anchor != o.anchor;
4402  }
4403 
4405  const string_type& key() const
4406  {
4407  JSON_ASSERT(anchor.m_object != nullptr);
4408 
4409  switch (anchor.m_object->type())
4410  {
4411  // use integer array index as key
4412  case value_t::array:
4413  {
4415  {
4418  }
4419  return array_index_str;
4420  }
4421 
4422  // use key from the object
4423  case value_t::object:
4424  return anchor.key();
4425 
4426  // use an empty key for all primitive types
4427  case value_t::null:
4428  case value_t::string:
4429  case value_t::boolean:
4432  case value_t::number_float:
4433  case value_t::binary:
4434  case value_t::discarded:
4435  default:
4436  return empty_str;
4437  }
4438  }
4439 
4441  typename IteratorType::reference value() const
4442  {
4443  return anchor.value();
4444  }
4445 };
4446 
4448 template<typename IteratorType> class iteration_proxy
4449 {
4450  private:
4452  typename IteratorType::reference container;
4453 
4454  public:
4456  explicit iteration_proxy(typename IteratorType::reference cont) noexcept
4457  : container(cont) {}
4458 
4461  {
4463  }
4464 
4467  {
4469  }
4470 };
4471 // Structured Bindings Support
4472 // For further reference see https://blog.tartanllama.xyz/structured-bindings/
4473 // And see https://github.com/nlohmann/json/pull/1391
4474 template<std::size_t N, typename IteratorType, enable_if_t<N == 0, int> = 0>
4476 {
4477  return i.key();
4478 }
4479 // Structured Bindings Support
4480 // For further reference see https://blog.tartanllama.xyz/structured-bindings/
4481 // And see https://github.com/nlohmann/json/pull/1391
4482 template<std::size_t N, typename IteratorType, enable_if_t<N == 1, int> = 0>
4483 auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>& i) -> decltype(i.value())
4484 {
4485  return i.value();
4486 }
4487 } // namespace detail
4488 } // namespace nlohmann
4489 
4490 // The Addition to the STD Namespace is required to add
4491 // Structured Bindings Support to the iteration_proxy_value class
4492 // For further reference see https://blog.tartanllama.xyz/structured-bindings/
4493 // And see https://github.com/nlohmann/json/pull/1391
4494 namespace std
4495 {
4496 #if defined(__clang__)
4497  // Fix: https://github.com/nlohmann/json/issues/1401
4498  #pragma clang diagnostic push
4499  #pragma clang diagnostic ignored "-Wmismatched-tags"
4500 #endif
4501 template<typename IteratorType>
4502 class tuple_size<::nlohmann::detail::iteration_proxy_value<IteratorType>>
4503  : public std::integral_constant<std::size_t, 2> {};
4504 
4505 template<std::size_t N, typename IteratorType>
4506 class tuple_element<N, ::nlohmann::detail::iteration_proxy_value<IteratorType >>
4507 {
4508  public:
4509  using type = decltype(
4510  get<N>(std::declval <
4512 };
4513 #if defined(__clang__)
4514  #pragma clang diagnostic pop
4515 #endif
4516 } // namespace std
4517 
4518 // #include <nlohmann/detail/meta/cpp_future.hpp>
4519 
4520 // #include <nlohmann/detail/meta/type_traits.hpp>
4521 
4522 // #include <nlohmann/detail/value_t.hpp>
4523 
4524 
4525 namespace nlohmann
4526 {
4527 namespace detail
4528 {
4530 // constructors //
4532 
4533 /*
4534  * Note all external_constructor<>::construct functions need to call
4535  * j.m_value.destroy(j.m_type) to avoid a memory leak in case j contains an
4536  * allocated value (e.g., a string). See bug issue
4537  * https://github.com/nlohmann/json/issues/2865 for more information.
4538  */
4539 
4540 template<value_t> struct external_constructor;
4541 
4542 template<>
4544 {
4545  template<typename BasicJsonType>
4546  static void construct(BasicJsonType& j, typename BasicJsonType::boolean_t b) noexcept
4547  {
4548  j.m_value.destroy(j.m_type);
4549  j.m_type = value_t::boolean;
4550  j.m_value = b;
4551  j.assert_invariant();
4552  }
4553 };
4554 
4555 template<>
4557 {
4558  template<typename BasicJsonType>
4559  static void construct(BasicJsonType& j, const typename BasicJsonType::string_t& s)
4560  {
4561  j.m_value.destroy(j.m_type);
4562  j.m_type = value_t::string;
4563  j.m_value = s;
4564  j.assert_invariant();
4565  }
4566 
4567  template<typename BasicJsonType>
4568  static void construct(BasicJsonType& j, typename BasicJsonType::string_t&& s)
4569  {
4570  j.m_value.destroy(j.m_type);
4571  j.m_type = value_t::string;
4572  j.m_value = std::move(s);
4573  j.assert_invariant();
4574  }
4575 
4576  template < typename BasicJsonType, typename CompatibleStringType,
4578  int > = 0 >
4579  static void construct(BasicJsonType& j, const CompatibleStringType& str)
4580  {
4581  j.m_value.destroy(j.m_type);
4582  j.m_type = value_t::string;
4583  j.m_value.string = j.template create<typename BasicJsonType::string_t>(str);
4584  j.assert_invariant();
4585  }
4586 };
4587 
4588 template<>
4590 {
4591  template<typename BasicJsonType>
4592  static void construct(BasicJsonType& j, const typename BasicJsonType::binary_t& b)
4593  {
4594  j.m_value.destroy(j.m_type);
4595  j.m_type = value_t::binary;
4596  j.m_value = typename BasicJsonType::binary_t(b);
4597  j.assert_invariant();
4598  }
4599 
4600  template<typename BasicJsonType>
4601  static void construct(BasicJsonType& j, typename BasicJsonType::binary_t&& b)
4602  {
4603  j.m_value.destroy(j.m_type);
4604  j.m_type = value_t::binary;
4605  j.m_value = typename BasicJsonType::binary_t(std::move(b));;
4606  j.assert_invariant();
4607  }
4608 };
4609 
4610 template<>
4612 {
4613  template<typename BasicJsonType>
4614  static void construct(BasicJsonType& j, typename BasicJsonType::number_float_t val) noexcept
4615  {
4616  j.m_value.destroy(j.m_type);
4617  j.m_type = value_t::number_float;
4618  j.m_value = val;
4619  j.assert_invariant();
4620  }
4621 };
4622 
4623 template<>
4625 {
4626  template<typename BasicJsonType>
4627  static void construct(BasicJsonType& j, typename BasicJsonType::number_unsigned_t val) noexcept
4628  {
4629  j.m_value.destroy(j.m_type);
4630  j.m_type = value_t::number_unsigned;
4631  j.m_value = val;
4632  j.assert_invariant();
4633  }
4634 };
4635 
4636 template<>
4638 {
4639  template<typename BasicJsonType>
4640  static void construct(BasicJsonType& j, typename BasicJsonType::number_integer_t val) noexcept
4641  {
4642  j.m_value.destroy(j.m_type);
4643  j.m_type = value_t::number_integer;
4644  j.m_value = val;
4645  j.assert_invariant();
4646  }
4647 };
4648 
4649 template<>
4651 {
4652  template<typename BasicJsonType>
4653  static void construct(BasicJsonType& j, const typename BasicJsonType::array_t& arr)
4654  {
4655  j.m_value.destroy(j.m_type);
4656  j.m_type = value_t::array;
4657  j.m_value = arr;
4658  j.set_parents();
4659  j.assert_invariant();
4660  }
4661 
4662  template<typename BasicJsonType>
4663  static void construct(BasicJsonType& j, typename BasicJsonType::array_t&& arr)
4664  {
4665  j.m_value.destroy(j.m_type);
4666  j.m_type = value_t::array;
4667  j.m_value = std::move(arr);
4668  j.set_parents();
4669  j.assert_invariant();
4670  }
4671 
4672  template < typename BasicJsonType, typename CompatibleArrayType,
4674  int > = 0 >
4675  static void construct(BasicJsonType& j, const CompatibleArrayType& arr)
4676  {
4677  using std::begin;
4678  using std::end;
4679 
4680  j.m_value.destroy(j.m_type);
4681  j.m_type = value_t::array;
4682  j.m_value.array = j.template create<typename BasicJsonType::array_t>(begin(arr), end(arr));
4683  j.set_parents();
4684  j.assert_invariant();
4685  }
4686 
4687  template<typename BasicJsonType>
4688  static void construct(BasicJsonType& j, const std::vector<bool>& arr)
4689  {
4690  j.m_value.destroy(j.m_type);
4691  j.m_type = value_t::array;
4692  j.m_value = value_t::array;
4693  j.m_value.array->reserve(arr.size());
4694  for (const bool x : arr)
4695  {
4696  j.m_value.array->push_back(x);
4697  j.set_parent(j.m_value.array->back());
4698  }
4699  j.assert_invariant();
4700  }
4701 
4702  template<typename BasicJsonType, typename T,
4704  static void construct(BasicJsonType& j, const std::valarray<T>& arr)
4705  {
4706  j.m_value.destroy(j.m_type);
4707  j.m_type = value_t::array;
4708  j.m_value = value_t::array;
4709  j.m_value.array->resize(arr.size());
4710  if (arr.size() > 0)
4711  {
4712  std::copy(std::begin(arr), std::end(arr), j.m_value.array->begin());
4713  }
4714  j.set_parents();
4715  j.assert_invariant();
4716  }
4717 };
4718 
4719 template<>
4721 {
4722  template<typename BasicJsonType>
4723  static void construct(BasicJsonType& j, const typename BasicJsonType::object_t& obj)
4724  {
4725  j.m_value.destroy(j.m_type);
4726  j.m_type = value_t::object;
4727  j.m_value = obj;
4728  j.set_parents();
4729  j.assert_invariant();
4730  }
4731 
4732  template<typename BasicJsonType>
4733  static void construct(BasicJsonType& j, typename BasicJsonType::object_t&& obj)
4734  {
4735  j.m_value.destroy(j.m_type);
4736  j.m_type = value_t::object;
4737  j.m_value = std::move(obj);
4738  j.set_parents();
4739  j.assert_invariant();
4740  }
4741 
4742  template < typename BasicJsonType, typename CompatibleObjectType,
4744  static void construct(BasicJsonType& j, const CompatibleObjectType& obj)
4745  {
4746  using std::begin;
4747  using std::end;
4748 
4749  j.m_value.destroy(j.m_type);
4750  j.m_type = value_t::object;
4751  j.m_value.object = j.template create<typename BasicJsonType::object_t>(begin(obj), end(obj));
4752  j.set_parents();
4753  j.assert_invariant();
4754  }
4755 };
4756 
4758 // to_json //
4760 
4761 template<typename BasicJsonType, typename T,
4763 void to_json(BasicJsonType& j, T b) noexcept
4764 {
4766 }
4767 
4768 template<typename BasicJsonType, typename CompatibleString,
4770 void to_json(BasicJsonType& j, const CompatibleString& s)
4771 {
4773 }
4774 
4775 template<typename BasicJsonType>
4776 void to_json(BasicJsonType& j, typename BasicJsonType::string_t&& s)
4777 {
4779 }
4780 
4781 template<typename BasicJsonType, typename FloatType,
4783 void to_json(BasicJsonType& j, FloatType val) noexcept
4784 {
4785  external_constructor<value_t::number_float>::construct(j, static_cast<typename BasicJsonType::number_float_t>(val));
4786 }
4787 
4788 template<typename BasicJsonType, typename CompatibleNumberUnsignedType,
4790 void to_json(BasicJsonType& j, CompatibleNumberUnsignedType val) noexcept
4791 {
4792  external_constructor<value_t::number_unsigned>::construct(j, static_cast<typename BasicJsonType::number_unsigned_t>(val));
4793 }
4794 
4795 template<typename BasicJsonType, typename CompatibleNumberIntegerType,
4797 void to_json(BasicJsonType& j, CompatibleNumberIntegerType val) noexcept
4798 {
4799  external_constructor<value_t::number_integer>::construct(j, static_cast<typename BasicJsonType::number_integer_t>(val));
4800 }
4801 
4802 template<typename BasicJsonType, typename EnumType,
4804 void to_json(BasicJsonType& j, EnumType e) noexcept
4805 {
4806  using underlying_type = typename std::underlying_type<EnumType>::type;
4807  external_constructor<value_t::number_integer>::construct(j, static_cast<underlying_type>(e));
4808 }
4809 
4810 template<typename BasicJsonType>
4811 void to_json(BasicJsonType& j, const std::vector<bool>& e)
4812 {
4814 }
4815 
4816 template < typename BasicJsonType, typename CompatibleArrayType,
4817  enable_if_t < is_compatible_array_type<BasicJsonType,
4818  CompatibleArrayType>::value&&
4823  int > = 0 >
4824 void to_json(BasicJsonType& j, const CompatibleArrayType& arr)
4825 {
4827 }
4828 
4829 template<typename BasicJsonType>
4830 void to_json(BasicJsonType& j, const typename BasicJsonType::binary_t& bin)
4831 {
4833 }
4834 
4835 template<typename BasicJsonType, typename T,
4837 void to_json(BasicJsonType& j, const std::valarray<T>& arr)
4838 {
4840 }
4841 
4842 template<typename BasicJsonType>
4843 void to_json(BasicJsonType& j, typename BasicJsonType::array_t&& arr)
4844 {
4846 }
4847 
4848 template < typename BasicJsonType, typename CompatibleObjectType,
4850 void to_json(BasicJsonType& j, const CompatibleObjectType& obj)
4851 {
4853 }
4854 
4855 template<typename BasicJsonType>
4856 void to_json(BasicJsonType& j, typename BasicJsonType::object_t&& obj)
4857 {
4859 }
4860 
4861 template <
4862  typename BasicJsonType, typename T, std::size_t N,
4863  enable_if_t < !std::is_constructible<typename BasicJsonType::string_t,
4864  const T(&)[N]>::value, // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
4865  int > = 0 >
4866 void to_json(BasicJsonType& j, const T(&arr)[N]) // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
4867 {
4869 }
4870 
4872 void to_json(BasicJsonType& j, const std::pair<T1, T2>& p)
4873 {
4874  j = { p.first, p.second };
4875 }
4876 
4877 // for https://github.com/nlohmann/json/pull/1134
4878 template<typename BasicJsonType, typename T,
4879  enable_if_t<std::is_same<T, iteration_proxy_value<typename BasicJsonType::iterator>>::value, int> = 0>
4880 void to_json(BasicJsonType& j, const T& b)
4881 {
4882  j = { {b.key(), b.value()} };
4883 }
4884 
4885 template<typename BasicJsonType, typename Tuple, std::size_t... Idx>
4886 void to_json_tuple_impl(BasicJsonType& j, const Tuple& t, index_sequence<Idx...> /*unused*/)
4887 {
4888  j = { std::get<Idx>(t)... };
4889 }
4890 
4892 void to_json(BasicJsonType& j, const T& t)
4893 {
4895 }
4896 
4898 {
4899  template<typename BasicJsonType, typename T>
4900  auto operator()(BasicJsonType& j, T&& val) const noexcept(noexcept(to_json(j, std::forward<T>(val))))
4901  -> decltype(to_json(j, std::forward<T>(val)), void())
4902  {
4903  return to_json(j, std::forward<T>(val));
4904  }
4905 };
4906 } // namespace detail
4907 
4911 namespace // NOLINT(cert-dcl59-cpp,fuchsia-header-anon-namespaces,google-build-namespaces)
4912 {
4913 constexpr const auto& to_json = detail::static_const<detail::to_json_fn>::value; // NOLINT(misc-definitions-in-headers)
4914 } // namespace
4915 } // namespace nlohmann
4916 
4917 // #include <nlohmann/detail/meta/identity_tag.hpp>
4918 
4919 // #include <nlohmann/detail/meta/type_traits.hpp>
4920 
4921 
4922 namespace nlohmann
4923 {
4924 
4925 template<typename ValueType, typename>
4926 struct adl_serializer
4927 {
4939  template<typename BasicJsonType, typename TargetType = ValueType>
4940  static auto from_json(BasicJsonType && j, TargetType& val) noexcept(
4941  noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), val)))
4942  -> decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), val), void())
4943  {
4944  ::nlohmann::from_json(std::forward<BasicJsonType>(j), val);
4945  }
4946 
4959  template<typename BasicJsonType, typename TargetType = ValueType>
4960  static auto from_json(BasicJsonType && j) noexcept(
4961  noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {})))
4962  -> decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {}))
4963  {
4964  return ::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {});
4965  }
4966 
4976  template<typename BasicJsonType, typename TargetType = ValueType>
4977  static auto to_json(BasicJsonType& j, TargetType && val) noexcept(
4978  noexcept(::nlohmann::to_json(j, std::forward<TargetType>(val))))
4979  -> decltype(::nlohmann::to_json(j, std::forward<TargetType>(val)), void())
4980  {
4981  ::nlohmann::to_json(j, std::forward<TargetType>(val));
4982  }
4983 };
4984 } // namespace nlohmann
4985 
4986 // #include <nlohmann/byte_container_with_subtype.hpp>
4987 
4988 
4989 #include <cstdint> // uint8_t, uint64_t
4990 #include <tuple> // tie
4991 #include <utility> // move
4992 
4993 namespace nlohmann
4994 {
4995 
5009 template<typename BinaryType>
5010 class byte_container_with_subtype : public BinaryType
5011 {
5012  public:
5014  using container_type = BinaryType;
5016  using subtype_type = std::uint64_t;
5017 
5019  : container_type()
5020  {}
5021 
5023  : container_type(b)
5024  {}
5025 
5026  byte_container_with_subtype(container_type&& b) noexcept(noexcept(container_type(std::move(b))))
5027  : container_type(std::move(b))
5028  {}
5029 
5031  : container_type(b)
5032  , m_subtype(subtype_)
5033  , m_has_subtype(true)
5034  {}
5035 
5036  byte_container_with_subtype(container_type&& b, subtype_type subtype_) noexcept(noexcept(container_type(std::move(b))))
5037  : container_type(std::move(b))
5038  , m_subtype(subtype_)
5039  , m_has_subtype(true)
5040  {}
5041 
5043  {
5044  return std::tie(static_cast<const BinaryType&>(*this), m_subtype, m_has_subtype) ==
5045  std::tie(static_cast<const BinaryType&>(rhs), rhs.m_subtype, rhs.m_has_subtype);
5046  }
5047 
5049  {
5050  return !(rhs == *this);
5051  }
5052 
5071  void set_subtype(subtype_type subtype_) noexcept
5072  {
5073  m_subtype = subtype_;
5074  m_has_subtype = true;
5075  }
5076 
5099  constexpr subtype_type subtype() const noexcept
5100  {
5101  return m_has_subtype ? m_subtype : subtype_type(-1);
5102  }
5103 
5120  constexpr bool has_subtype() const noexcept
5121  {
5122  return m_has_subtype;
5123  }
5124 
5144  void clear_subtype() noexcept
5145  {
5146  m_subtype = 0;
5147  m_has_subtype = false;
5148  }
5149 
5150  private:
5152  bool m_has_subtype = false;
5153 };
5154 
5155 } // namespace nlohmann
5156 
5157 // #include <nlohmann/detail/conversions/from_json.hpp>
5158 
5159 // #include <nlohmann/detail/conversions/to_json.hpp>
5160 
5161 // #include <nlohmann/detail/exceptions.hpp>
5162 
5163 // #include <nlohmann/detail/hash.hpp>
5164 
5165 
5166 #include <cstdint> // uint8_t
5167 #include <cstddef> // size_t
5168 #include <functional> // hash
5169 
5170 // #include <nlohmann/detail/macro_scope.hpp>
5171 
5172 
5173 namespace nlohmann
5174 {
5175 namespace detail
5176 {
5177 
5178 // boost::hash_combine
5179 inline std::size_t combine(std::size_t seed, std::size_t h) noexcept
5180 {
5181  seed ^= h + 0x9e3779b9 + (seed << 6U) + (seed >> 2U);
5182  return seed;
5183 }
5184 
5196 template<typename BasicJsonType>
5197 std::size_t hash(const BasicJsonType& j)
5198 {
5199  using string_t = typename BasicJsonType::string_t;
5200  using number_integer_t = typename BasicJsonType::number_integer_t;
5201  using number_unsigned_t = typename BasicJsonType::number_unsigned_t;
5202  using number_float_t = typename BasicJsonType::number_float_t;
5203 
5204  const auto type = static_cast<std::size_t>(j.type());
5205  switch (j.type())
5206  {
5207  case BasicJsonType::value_t::null:
5208  case BasicJsonType::value_t::discarded:
5209  {
5210  return combine(type, 0);
5211  }
5212 
5214  {
5215  auto seed = combine(type, j.size());
5216  for (const auto& element : j.items())
5217  {
5218  const auto h = std::hash<string_t> {}(element.key());
5219  seed = combine(seed, h);
5220  seed = combine(seed, hash(element.value()));
5221  }
5222  return seed;
5223  }
5224 
5225  case BasicJsonType::value_t::array:
5226  {
5227  auto seed = combine(type, j.size());
5228  for (const auto& element : j)
5229  {
5230  seed = combine(seed, hash(element));
5231  }
5232  return seed;
5233  }
5234 
5235  case BasicJsonType::value_t::string:
5236  {
5237  const auto h = std::hash<string_t> {}(j.template get_ref<const string_t&>());
5238  return combine(type, h);
5239  }
5240 
5241  case BasicJsonType::value_t::boolean:
5242  {
5243  const auto h = std::hash<bool> {}(j.template get<bool>());
5244  return combine(type, h);
5245  }
5246 
5247  case BasicJsonType::value_t::number_integer:
5248  {
5249  const auto h = std::hash<number_integer_t> {}(j.template get<number_integer_t>());
5250  return combine(type, h);
5251  }
5252 
5253  case BasicJsonType::value_t::number_unsigned:
5254  {
5255  const auto h = std::hash<number_unsigned_t> {}(j.template get<number_unsigned_t>());
5256  return combine(type, h);
5257  }
5258 
5259  case BasicJsonType::value_t::number_float:
5260  {
5261  const auto h = std::hash<number_float_t> {}(j.template get<number_float_t>());
5262  return combine(type, h);
5263  }
5264 
5265  case BasicJsonType::value_t::binary:
5266  {
5267  auto seed = combine(type, j.get_binary().size());
5268  const auto h = std::hash<bool> {}(j.get_binary().has_subtype());
5269  seed = combine(seed, h);
5270  seed = combine(seed, static_cast<std::size_t>(j.get_binary().subtype()));
5271  for (const auto byte : j.get_binary())
5272  {
5273  seed = combine(seed, std::hash<std::uint8_t> {}(byte));
5274  }
5275  return seed;
5276  }
5277 
5278  default: // LCOV_EXCL_LINE
5279  JSON_ASSERT(false); // NOLINT(cert-dcl03-c,hicpp-static-assert,misc-static-assert) LCOV_EXCL_LINE
5280  return 0; // LCOV_EXCL_LINE
5281  }
5282 }
5283 
5284 } // namespace detail
5285 } // namespace nlohmann
5286 
5287 // #include <nlohmann/detail/input/binary_reader.hpp>
5288 
5289 
5290 #include <algorithm> // generate_n
5291 #include <array> // array
5292 #include <cmath> // ldexp
5293 #include <cstddef> // size_t
5294 #include <cstdint> // uint8_t, uint16_t, uint32_t, uint64_t
5295 #include <cstdio> // snprintf
5296 #include <cstring> // memcpy
5297 #include <iterator> // back_inserter
5298 #include <limits> // numeric_limits
5299 #include <string> // char_traits, string
5300 #include <utility> // make_pair, move
5301 #include <vector> // vector
5302 
5303 // #include <nlohmann/detail/exceptions.hpp>
5304 
5305 // #include <nlohmann/detail/input/input_adapters.hpp>
5306 
5307 
5308 #include <array> // array
5309 #include <cstddef> // size_t
5310 #include <cstring> // strlen
5311 #include <iterator> // begin, end, iterator_traits, random_access_iterator_tag, distance, next
5312 #include <memory> // shared_ptr, make_shared, addressof
5313 #include <numeric> // accumulate
5314 #include <string> // string, char_traits
5315 #include <type_traits> // enable_if, is_base_of, is_pointer, is_integral, remove_pointer
5316 #include <utility> // pair, declval
5317 
5318 #ifndef JSON_NO_IO
5319  #include <cstdio> // FILE *
5320  #include <istream> // istream
5321 #endif // JSON_NO_IO
5322 
5323 // #include <nlohmann/detail/iterators/iterator_traits.hpp>
5324 
5325 // #include <nlohmann/detail/macro_scope.hpp>
5326 
5327 
5328 namespace nlohmann
5329 {
5330 namespace detail
5331 {
5334 
5336 // input adapters //
5338 
5339 #ifndef JSON_NO_IO
5340 
5345 {
5346  public:
5347  using char_type = char;
5348 
5350  explicit file_input_adapter(std::FILE* f) noexcept
5351  : m_file(f)
5352  {}
5353 
5354  // make class move-only
5355  file_input_adapter(const file_input_adapter&) = delete;
5357  file_input_adapter& operator=(const file_input_adapter&) = delete;
5358  file_input_adapter& operator=(file_input_adapter&&) = delete;
5360 
5361  std::char_traits<char>::int_type get_character() noexcept
5362  {
5363  return std::fgetc(m_file);
5364  }
5365 
5366  private:
5368  std::FILE* m_file;
5369 };
5370 
5371 
5382 {
5383  public:
5384  using char_type = char;
5385 
5387  {
5388  // clear stream flags; we use underlying streambuf I/O, do not
5389  // maintain ifstream flags, except eof
5390  if (is != nullptr)
5391  {
5392  is->clear(is->rdstate() & std::ios::eofbit);
5393  }
5394  }
5395 
5396  explicit input_stream_adapter(std::istream& i)
5397  : is(&i), sb(i.rdbuf())
5398  {}
5399 
5400  // delete because of pointer members
5401  input_stream_adapter(const input_stream_adapter&) = delete;
5404 
5406  : is(rhs.is), sb(rhs.sb)
5407  {
5408  rhs.is = nullptr;
5409  rhs.sb = nullptr;
5410  }
5411 
5412  // std::istream/std::streambuf use std::char_traits<char>::to_int_type, to
5413  // ensure that std::char_traits<char>::eof() and the character 0xFF do not
5414  // end up as the same value, eg. 0xFFFFFFFF.
5415  std::char_traits<char>::int_type get_character()
5416  {
5417  auto res = sb->sbumpc();
5418  // set eof manually, as we don't use the istream interface.
5419  if (JSON_HEDLEY_UNLIKELY(res == std::char_traits<char>::eof()))
5420  {
5421  is->clear(is->rdstate() | std::ios::eofbit);
5422  }
5423  return res;
5424  }
5425 
5426  private:
5428  std::istream* is = nullptr;
5429  std::streambuf* sb = nullptr;
5430 };
5431 #endif // JSON_NO_IO
5432 
5433 // General-purpose iterator-based adapter. It might not be as fast as
5434 // theoretically possible for some containers, but it is extremely versatile.
5435 template<typename IteratorType>
5437 {
5438  public:
5439  using char_type = typename std::iterator_traits<IteratorType>::value_type;
5440 
5441  iterator_input_adapter(IteratorType first, IteratorType last)
5442  : current(std::move(first)), end(std::move(last))
5443  {}
5444 
5445  typename std::char_traits<char_type>::int_type get_character()
5446  {
5447  if (JSON_HEDLEY_LIKELY(current != end))
5448  {
5449  auto result = std::char_traits<char_type>::to_int_type(*current);
5450  std::advance(current, 1);
5451  return result;
5452  }
5453 
5454  return std::char_traits<char_type>::eof();
5455  }
5456 
5457  private:
5458  IteratorType current;
5459  IteratorType end;
5460 
5461  template<typename BaseInputAdapter, size_t T>
5463 
5464  bool empty() const
5465  {
5466  return current == end;
5467  }
5468 };
5469 
5470 
5471 template<typename BaseInputAdapter, size_t T>
5473 
5474 template<typename BaseInputAdapter>
5475 struct wide_string_input_helper<BaseInputAdapter, 4>
5476 {
5477  // UTF-32
5478  static void fill_buffer(BaseInputAdapter& input,
5479  std::array<std::char_traits<char>::int_type, 4>& utf8_bytes,
5480  size_t& utf8_bytes_index,
5481  size_t& utf8_bytes_filled)
5482  {
5483  utf8_bytes_index = 0;
5484 
5485  if (JSON_HEDLEY_UNLIKELY(input.empty()))
5486  {
5487  utf8_bytes[0] = std::char_traits<char>::eof();
5488  utf8_bytes_filled = 1;
5489  }
5490  else
5491  {
5492  // get the current character
5493  const auto wc = input.get_character();
5494 
5495  // UTF-32 to UTF-8 encoding
5496  if (wc < 0x80)
5497  {
5498  utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(wc);
5499  utf8_bytes_filled = 1;
5500  }
5501  else if (wc <= 0x7FF)
5502  {
5503  utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(0xC0u | ((static_cast<unsigned int>(wc) >> 6u) & 0x1Fu));
5504  utf8_bytes[1] = static_cast<std::char_traits<char>::int_type>(0x80u | (static_cast<unsigned int>(wc) & 0x3Fu));
5505  utf8_bytes_filled = 2;
5506  }
5507  else if (wc <= 0xFFFF)
5508  {
5509  utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(0xE0u | ((static_cast<unsigned int>(wc) >> 12u) & 0x0Fu));
5510  utf8_bytes[1] = static_cast<std::char_traits<char>::int_type>(0x80u | ((static_cast<unsigned int>(wc) >> 6u) & 0x3Fu));
5511  utf8_bytes[2] = static_cast<std::char_traits<char>::int_type>(0x80u | (static_cast<unsigned int>(wc) & 0x3Fu));
5512  utf8_bytes_filled = 3;
5513  }
5514  else if (wc <= 0x10FFFF)
5515  {
5516  utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(0xF0u | ((static_cast<unsigned int>(wc) >> 18u) & 0x07u));
5517  utf8_bytes[1] = static_cast<std::char_traits<char>::int_type>(0x80u | ((static_cast<unsigned int>(wc) >> 12u) & 0x3Fu));
5518  utf8_bytes[2] = static_cast<std::char_traits<char>::int_type>(0x80u | ((static_cast<unsigned int>(wc) >> 6u) & 0x3Fu));
5519  utf8_bytes[3] = static_cast<std::char_traits<char>::int_type>(0x80u | (static_cast<unsigned int>(wc) & 0x3Fu));
5520  utf8_bytes_filled = 4;
5521  }
5522  else
5523  {
5524  // unknown character
5525  utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(wc);
5526  utf8_bytes_filled = 1;
5527  }
5528  }
5529  }
5530 };
5531 
5532 template<typename BaseInputAdapter>
5533 struct wide_string_input_helper<BaseInputAdapter, 2>
5534 {
5535  // UTF-16
5536  static void fill_buffer(BaseInputAdapter& input,
5537  std::array<std::char_traits<char>::int_type, 4>& utf8_bytes,
5538  size_t& utf8_bytes_index,
5539  size_t& utf8_bytes_filled)
5540  {
5541  utf8_bytes_index = 0;
5542 
5543  if (JSON_HEDLEY_UNLIKELY(input.empty()))
5544  {
5545  utf8_bytes[0] = std::char_traits<char>::eof();
5546  utf8_bytes_filled = 1;
5547  }
5548  else
5549  {
5550  // get the current character
5551  const auto wc = input.get_character();
5552 
5553  // UTF-16 to UTF-8 encoding
5554  if (wc < 0x80)
5555  {
5556  utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(wc);
5557  utf8_bytes_filled = 1;
5558  }
5559  else if (wc <= 0x7FF)
5560  {
5561  utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(0xC0u | ((static_cast<unsigned int>(wc) >> 6u)));
5562  utf8_bytes[1] = static_cast<std::char_traits<char>::int_type>(0x80u | (static_cast<unsigned int>(wc) & 0x3Fu));
5563  utf8_bytes_filled = 2;
5564  }
5565  else if (0xD800 > wc || wc >= 0xE000)
5566  {
5567  utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(0xE0u | ((static_cast<unsigned int>(wc) >> 12u)));
5568  utf8_bytes[1] = static_cast<std::char_traits<char>::int_type>(0x80u | ((static_cast<unsigned int>(wc) >> 6u) & 0x3Fu));
5569  utf8_bytes[2] = static_cast<std::char_traits<char>::int_type>(0x80u | (static_cast<unsigned int>(wc) & 0x3Fu));
5570  utf8_bytes_filled = 3;
5571  }
5572  else
5573  {
5574  if (JSON_HEDLEY_UNLIKELY(!input.empty()))
5575  {
5576  const auto wc2 = static_cast<unsigned int>(input.get_character());
5577  const auto charcode = 0x10000u + (((static_cast<unsigned int>(wc) & 0x3FFu) << 10u) | (wc2 & 0x3FFu));
5578  utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(0xF0u | (charcode >> 18u));
5579  utf8_bytes[1] = static_cast<std::char_traits<char>::int_type>(0x80u | ((charcode >> 12u) & 0x3Fu));
5580  utf8_bytes[2] = static_cast<std::char_traits<char>::int_type>(0x80u | ((charcode >> 6u) & 0x3Fu));
5581  utf8_bytes[3] = static_cast<std::char_traits<char>::int_type>(0x80u | (charcode & 0x3Fu));
5582  utf8_bytes_filled = 4;
5583  }
5584  else
5585  {
5586  utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(wc);
5587  utf8_bytes_filled = 1;
5588  }
5589  }
5590  }
5591  }
5592 };
5593 
5594 // Wraps another input apdater to convert wide character types into individual bytes.
5595 template<typename BaseInputAdapter, typename WideCharType>
5597 {
5598  public:
5599  using char_type = char;
5600 
5601  wide_string_input_adapter(BaseInputAdapter base)
5602  : base_adapter(base) {}
5603 
5604  typename std::char_traits<char>::int_type get_character() noexcept
5605  {
5606  // check if buffer needs to be filled
5608  {
5609  fill_buffer<sizeof(WideCharType)>();
5610 
5613  }
5614 
5615  // use buffer
5618  return utf8_bytes[utf8_bytes_index++];
5619  }
5620 
5621  private:
5622  BaseInputAdapter base_adapter;
5623 
5624  template<size_t T>
5626  {
5628  }
5629 
5631  std::array<std::char_traits<char>::int_type, 4> utf8_bytes = {{0, 0, 0, 0}};
5632 
5634  std::size_t utf8_bytes_index = 0;
5636  std::size_t utf8_bytes_filled = 0;
5637 };
5638 
5639 
5640 template<typename IteratorType, typename Enable = void>
5642 {
5643  using iterator_type = IteratorType;
5644  using char_type = typename std::iterator_traits<iterator_type>::value_type;
5646 
5647  static adapter_type create(IteratorType first, IteratorType last)
5648  {
5649  return adapter_type(std::move(first), std::move(last));
5650  }
5651 };
5652 
5653 template<typename T>
5655 {
5656  using value_type = typename std::iterator_traits<T>::value_type;
5657  enum
5658  {
5659  value = sizeof(value_type) > 1
5660  };
5661 };
5662 
5663 template<typename IteratorType>
5665 {
5666  using iterator_type = IteratorType;
5667  using char_type = typename std::iterator_traits<iterator_type>::value_type;
5670 
5671  static adapter_type create(IteratorType first, IteratorType last)
5672  {
5673  return adapter_type(base_adapter_type(std::move(first), std::move(last)));
5674  }
5675 };
5676 
5677 // General purpose iterator-based input
5678 template<typename IteratorType>
5679 typename iterator_input_adapter_factory<IteratorType>::adapter_type input_adapter(IteratorType first, IteratorType last)
5680 {
5681  using factory_type = iterator_input_adapter_factory<IteratorType>;
5682  return factory_type::create(first, last);
5683 }
5684 
5685 // Convenience shorthand from container to iterator
5686 // Enables ADL on begin(container) and end(container)
5687 // Encloses the using declarations in namespace for not to leak them to outside scope
5688 
5689 namespace container_input_adapter_factory_impl
5690 {
5691 
5692 using std::begin;
5693 using std::end;
5694 
5695 template<typename ContainerType, typename Enable = void>
5697 
5698 template<typename ContainerType>
5699 struct container_input_adapter_factory< ContainerType,
5700  void_t<decltype(begin(std::declval<ContainerType>()), end(std::declval<ContainerType>()))>>
5701  {
5702  using adapter_type = decltype(input_adapter(begin(std::declval<ContainerType>()), end(std::declval<ContainerType>())));
5703 
5704  static adapter_type create(const ContainerType& container)
5705 {
5706  return input_adapter(begin(container), end(container));
5707 }
5708  };
5709 
5710 } // namespace container_input_adapter_factory_impl
5711 
5712 template<typename ContainerType>
5714 {
5716 }
5717 
5718 #ifndef JSON_NO_IO
5719 // Special cases with fast paths
5721 {
5722  return file_input_adapter(file);
5723 }
5724 
5725 inline input_stream_adapter input_adapter(std::istream& stream)
5726 {
5727  return input_stream_adapter(stream);
5728 }
5729 
5730 inline input_stream_adapter input_adapter(std::istream&& stream)
5731 {
5732  return input_stream_adapter(stream);
5733 }
5734 #endif // JSON_NO_IO
5735 
5736 using contiguous_bytes_input_adapter = decltype(input_adapter(std::declval<const char*>(), std::declval<const char*>()));
5737 
5738 // Null-delimited strings, and the like.
5739 template < typename CharT,
5740  typename std::enable_if <
5744  sizeof(typename std::remove_pointer<CharT>::type) == 1,
5745  int >::type = 0 >
5747 {
5748  auto length = std::strlen(reinterpret_cast<const char*>(b));
5749  const auto* ptr = reinterpret_cast<const char*>(b);
5750  return input_adapter(ptr, ptr + length);
5751 }
5752 
5753 template<typename T, std::size_t N>
5754 auto input_adapter(T (&array)[N]) -> decltype(input_adapter(array, array + N)) // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
5755 {
5756  return input_adapter(array, array + N);
5757 }
5758 
5759 // This class only handles inputs of input_buffer_adapter type.
5760 // It's required so that expressions like {ptr, len} can be implicitely casted
5761 // to the correct adapter.
5763 {
5764  public:
5765  template < typename CharT,
5766  typename std::enable_if <
5769  sizeof(typename std::remove_pointer<CharT>::type) == 1,
5770  int >::type = 0 >
5771  span_input_adapter(CharT b, std::size_t l)
5772  : ia(reinterpret_cast<const char*>(b), reinterpret_cast<const char*>(b) + l) {}
5773 
5774  template<class IteratorType,
5775  typename std::enable_if<
5776  std::is_same<typename iterator_traits<IteratorType>::iterator_category, std::random_access_iterator_tag>::value,
5777  int>::type = 0>
5778  span_input_adapter(IteratorType first, IteratorType last)
5779  : ia(input_adapter(first, last)) {}
5780 
5782  {
5783  return std::move(ia); // NOLINT(hicpp-move-const-arg,performance-move-const-arg)
5784  }
5785 
5786  private:
5788 };
5789 } // namespace detail
5790 } // namespace nlohmann
5791 
5792 // #include <nlohmann/detail/input/json_sax.hpp>
5793 
5794 
5795 #include <cstddef>
5796 #include <string> // string
5797 #include <utility> // move
5798 #include <vector> // vector
5799 
5800 // #include <nlohmann/detail/exceptions.hpp>
5801 
5802 // #include <nlohmann/detail/macro_scope.hpp>
5803 
5804 
5805 namespace nlohmann
5806 {
5807 
5816 template<typename BasicJsonType>
5817 struct json_sax
5818 {
5819  using number_integer_t = typename BasicJsonType::number_integer_t;
5820  using number_unsigned_t = typename BasicJsonType::number_unsigned_t;
5821  using number_float_t = typename BasicJsonType::number_float_t;
5822  using string_t = typename BasicJsonType::string_t;
5823  using binary_t = typename BasicJsonType::binary_t;
5824 
5829  virtual bool null() = 0;
5830 
5836  virtual bool boolean(bool val) = 0;
5837 
5843  virtual bool number_integer(number_integer_t val) = 0;
5844 
5850  virtual bool number_unsigned(number_unsigned_t val) = 0;
5851 
5858  virtual bool number_float(number_float_t val, const string_t& s) = 0;
5859 
5866  virtual bool string(string_t& val) = 0;
5867 
5874  virtual bool binary(binary_t& val) = 0;
5875 
5882  virtual bool start_object(std::size_t elements) = 0;
5883 
5890  virtual bool key(string_t& val) = 0;
5891 
5896  virtual bool end_object() = 0;
5897 
5904  virtual bool start_array(std::size_t elements) = 0;
5905 
5910  virtual bool end_array() = 0;
5911 
5919  virtual bool parse_error(std::size_t position,
5920  const std::string& last_token,
5921  const detail::exception& ex) = 0;
5922 
5923  json_sax() = default;
5924  json_sax(const json_sax&) = default;
5925  json_sax(json_sax&&) noexcept = default;
5926  json_sax& operator=(const json_sax&) = default;
5927  json_sax& operator=(json_sax&&) noexcept = default;
5928  virtual ~json_sax() = default;
5929 };
5930 
5931 
5932 namespace detail
5933 {
5947 template<typename BasicJsonType>
5949 {
5950  public:
5951  using number_integer_t = typename BasicJsonType::number_integer_t;
5952  using number_unsigned_t = typename BasicJsonType::number_unsigned_t;
5953  using number_float_t = typename BasicJsonType::number_float_t;
5954  using string_t = typename BasicJsonType::string_t;
5955  using binary_t = typename BasicJsonType::binary_t;
5956 
5962  explicit json_sax_dom_parser(BasicJsonType& r, const bool allow_exceptions_ = true)
5963  : root(r), allow_exceptions(allow_exceptions_)
5964  {}
5965 
5966  // make class move-only
5967  json_sax_dom_parser(const json_sax_dom_parser&) = delete;
5968  json_sax_dom_parser(json_sax_dom_parser&&) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor)
5970  json_sax_dom_parser& operator=(json_sax_dom_parser&&) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor)
5971  ~json_sax_dom_parser() = default;
5972 
5973  bool null()
5974  {
5975  handle_value(nullptr);
5976  return true;
5977  }
5978 
5979  bool boolean(bool val)
5980  {
5981  handle_value(val);
5982  return true;
5983  }
5984 
5986  {
5987  handle_value(val);
5988  return true;
5989  }
5990 
5992  {
5993  handle_value(val);
5994  return true;
5995  }
5996 
5997  bool number_float(number_float_t val, const string_t& /*unused*/)
5998  {
5999  handle_value(val);
6000  return true;
6001  }
6002 
6003  bool string(string_t& val)
6004  {
6005  handle_value(val);
6006  return true;
6007  }
6008 
6009  bool binary(binary_t& val)
6010  {
6011  handle_value(std::move(val));
6012  return true;
6013  }
6014 
6015  bool start_object(std::size_t len)
6016  {
6017  ref_stack.push_back(handle_value(BasicJsonType::value_t::object));
6018 
6019  if (JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) && len > ref_stack.back()->max_size()))
6020  {
6021  JSON_THROW(out_of_range::create(408, "excessive object size: " + std::to_string(len), *ref_stack.back()));
6022  }
6023 
6024  return true;
6025  }
6026 
6027  bool key(string_t& val)
6028  {
6029  // add null at given key and store the reference for later
6030  object_element = &(ref_stack.back()->m_value.object->operator[](val));
6031  return true;
6032  }
6033 
6034  bool end_object()
6035  {
6036  ref_stack.back()->set_parents();
6037  ref_stack.pop_back();
6038  return true;
6039  }
6040 
6041  bool start_array(std::size_t len)
6042  {
6043  ref_stack.push_back(handle_value(BasicJsonType::value_t::array));
6044 
6045  if (JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) && len > ref_stack.back()->max_size()))
6046  {
6047  JSON_THROW(out_of_range::create(408, "excessive array size: " + std::to_string(len), *ref_stack.back()));
6048  }
6049 
6050  return true;
6051  }
6052 
6053  bool end_array()
6054  {
6055  ref_stack.back()->set_parents();
6056  ref_stack.pop_back();
6057  return true;
6058  }
6059 
6060  template<class Exception>
6061  bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/,
6062  const Exception& ex)
6063  {
6064  errored = true;
6065  static_cast<void>(ex);
6066  if (allow_exceptions)
6067  {
6068  JSON_THROW(ex);
6069  }
6070  return false;
6071  }
6072 
6073  constexpr bool is_errored() const
6074  {
6075  return errored;
6076  }
6077 
6078  private:
6085  template<typename Value>
6087  BasicJsonType* handle_value(Value&& v)
6088  {
6089  if (ref_stack.empty())
6090  {
6091  root = BasicJsonType(std::forward<Value>(v));
6092  return &root;
6093  }
6094 
6095  JSON_ASSERT(ref_stack.back()->is_array() || ref_stack.back()->is_object());
6096 
6097  if (ref_stack.back()->is_array())
6098  {
6099  ref_stack.back()->m_value.array->emplace_back(std::forward<Value>(v));
6100  return &(ref_stack.back()->m_value.array->back());
6101  }
6102 
6103  JSON_ASSERT(ref_stack.back()->is_object());
6104  JSON_ASSERT(object_element);
6105  *object_element = BasicJsonType(std::forward<Value>(v));
6106  return object_element;
6107  }
6108 
6110  BasicJsonType& root;
6112  std::vector<BasicJsonType*> ref_stack {};
6114  BasicJsonType* object_element = nullptr;
6116  bool errored = false;
6118  const bool allow_exceptions = true;
6119 };
6120 
6121 template<typename BasicJsonType>
6123 {
6124  public:
6125  using number_integer_t = typename BasicJsonType::number_integer_t;
6126  using number_unsigned_t = typename BasicJsonType::number_unsigned_t;
6127  using number_float_t = typename BasicJsonType::number_float_t;
6128  using string_t = typename BasicJsonType::string_t;
6129  using binary_t = typename BasicJsonType::binary_t;
6132 
6134  const parser_callback_t cb,
6135  const bool allow_exceptions_ = true)
6136  :