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
30#ifndef INCLUDE_NLOHMANN_JSON_HPP_
31#define INCLUDE_NLOHMANN_JSON_HPP_
33#define NLOHMANN_JSON_VERSION_MAJOR 3
34#define NLOHMANN_JSON_VERSION_MINOR 10
35#define NLOHMANN_JSON_VERSION_PATCH 2
40#include <initializer_list>
62#include <forward_list>
68#include <unordered_map>
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
135
136
137
138
139
140
141
142
143
144
145
146
149 static constexpr std::array<
std::uint8_t, 9> order = { {
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];
175
176
177
178
179
180
181
182
183
184
186#if !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < 15
)
187#if defined(JSON_HEDLEY_VERSION)
188#undef JSON_HEDLEY_VERSION
190#define JSON_HEDLEY_VERSION 15
192#if defined(JSON_HEDLEY_STRINGIFY_EX)
193#undef JSON_HEDLEY_STRINGIFY_EX
195#define JSON_HEDLEY_STRINGIFY_EX(x) #x
197#if defined(JSON_HEDLEY_STRINGIFY)
198#undef JSON_HEDLEY_STRINGIFY
200#define JSON_HEDLEY_STRINGIFY(x) JSON_HEDLEY_STRINGIFY_EX(x)
202#if defined(JSON_HEDLEY_CONCAT_EX)
203#undef JSON_HEDLEY_CONCAT_EX
205#define JSON_HEDLEY_CONCAT_EX(a,b) a##b
207#if defined(JSON_HEDLEY_CONCAT)
208#undef JSON_HEDLEY_CONCAT
210#define JSON_HEDLEY_CONCAT(a,b) JSON_HEDLEY_CONCAT_EX(a,b)
212#if defined(JSON_HEDLEY_CONCAT3_EX)
213#undef JSON_HEDLEY_CONCAT3_EX
215#define JSON_HEDLEY_CONCAT3_EX(a,b,c) a##b##c
217#if defined(JSON_HEDLEY_CONCAT3)
218#undef JSON_HEDLEY_CONCAT3
220#define JSON_HEDLEY_CONCAT3(a,b,c) JSON_HEDLEY_CONCAT3_EX(a,b,c)
222#if defined(JSON_HEDLEY_VERSION_ENCODE)
223#undef JSON_HEDLEY_VERSION_ENCODE
225#define JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000
) + ((minor) * 1000
) + (revision))
227#if defined(JSON_HEDLEY_VERSION_DECODE_MAJOR)
228#undef JSON_HEDLEY_VERSION_DECODE_MAJOR
230#define JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000
)
232#if defined(JSON_HEDLEY_VERSION_DECODE_MINOR)
233#undef JSON_HEDLEY_VERSION_DECODE_MINOR
235#define JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000
) / 1000
)
237#if defined(JSON_HEDLEY_VERSION_DECODE_REVISION)
238#undef JSON_HEDLEY_VERSION_DECODE_REVISION
240#define JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000
)
242#if defined(JSON_HEDLEY_GNUC_VERSION)
243#undef JSON_HEDLEY_GNUC_VERSION
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
)
251#if defined(JSON_HEDLEY_GNUC_VERSION_CHECK)
252#undef JSON_HEDLEY_GNUC_VERSION_CHECK
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))
257#define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0
)
260#if defined(JSON_HEDLEY_MSVC_VERSION)
261#undef JSON_HEDLEY_MSVC_VERSION
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
)
271#if defined(JSON_HEDLEY_MSVC_VERSION_CHECK)
272#undef JSON_HEDLEY_MSVC_VERSION_CHECK
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)))
281#define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100
) + (minor)))
284#if defined(JSON_HEDLEY_INTEL_VERSION)
285#undef JSON_HEDLEY_INTEL_VERSION
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
)
293#if defined(JSON_HEDLEY_INTEL_VERSION_CHECK)
294#undef JSON_HEDLEY_INTEL_VERSION_CHECK
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))
299#define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0
)
302#if defined(JSON_HEDLEY_INTEL_CL_VERSION)
303#undef JSON_HEDLEY_INTEL_CL_VERSION
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
)
309#if defined(JSON_HEDLEY_INTEL_CL_VERSION_CHECK)
310#undef JSON_HEDLEY_INTEL_CL_VERSION_CHECK
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))
315#define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (0
)
318#if defined(JSON_HEDLEY_PGI_VERSION)
319#undef JSON_HEDLEY_PGI_VERSION
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__)
325#if defined(JSON_HEDLEY_PGI_VERSION_CHECK)
326#undef JSON_HEDLEY_PGI_VERSION_CHECK
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))
331#define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0
)
334#if defined(JSON_HEDLEY_SUNPRO_VERSION)
335#undef JSON_HEDLEY_SUNPRO_VERSION
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
)
347#if defined(JSON_HEDLEY_SUNPRO_VERSION_CHECK)
348#undef JSON_HEDLEY_SUNPRO_VERSION_CHECK
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))
353#define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0
)
356#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION)
357#undef JSON_HEDLEY_EMSCRIPTEN_VERSION
359#if defined(__EMSCRIPTEN__)
360#define JSON_HEDLEY_EMSCRIPTEN_VERSION JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__)
363#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK)
364#undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK
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))
369#define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0
)
372#if defined(JSON_HEDLEY_ARM_VERSION)
373#undef JSON_HEDLEY_ARM_VERSION
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
)
381#if defined(JSON_HEDLEY_ARM_VERSION_CHECK)
382#undef JSON_HEDLEY_ARM_VERSION_CHECK
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))
387#define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0
)
390#if defined(JSON_HEDLEY_IBM_VERSION)
391#undef JSON_HEDLEY_IBM_VERSION
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
)
401#if defined(JSON_HEDLEY_IBM_VERSION_CHECK)
402#undef JSON_HEDLEY_IBM_VERSION_CHECK
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))
407#define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0
)
410#if defined(JSON_HEDLEY_TI_VERSION)
411#undef JSON_HEDLEY_TI_VERSION
414 defined(__TI_COMPILER_VERSION__) &&
416 defined(__TMS470__) || defined(__TI_ARM__) ||
417 defined(__MSP430__) ||
418 defined(__TMS320C2000__)
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
))
425#if defined(JSON_HEDLEY_TI_VERSION_CHECK)
426#undef JSON_HEDLEY_TI_VERSION_CHECK
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))
431#define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0
)
434#if defined(JSON_HEDLEY_TI_CL2000_VERSION)
435#undef JSON_HEDLEY_TI_CL2000_VERSION
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
))
441#if defined(JSON_HEDLEY_TI_CL2000_VERSION_CHECK)
442#undef JSON_HEDLEY_TI_CL2000_VERSION_CHECK
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))
447#define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (0
)
450#if defined(JSON_HEDLEY_TI_CL430_VERSION)
451#undef JSON_HEDLEY_TI_CL430_VERSION
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
))
457#if defined(JSON_HEDLEY_TI_CL430_VERSION_CHECK)
458#undef JSON_HEDLEY_TI_CL430_VERSION_CHECK
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))
463#define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (0
)
466#if defined(JSON_HEDLEY_TI_ARMCL_VERSION)
467#undef JSON_HEDLEY_TI_ARMCL_VERSION
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
))
473#if defined(JSON_HEDLEY_TI_ARMCL_VERSION_CHECK)
474#undef JSON_HEDLEY_TI_ARMCL_VERSION_CHECK
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))
479#define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (0
)
482#if defined(JSON_HEDLEY_TI_CL6X_VERSION)
483#undef JSON_HEDLEY_TI_CL6X_VERSION
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
))
489#if defined(JSON_HEDLEY_TI_CL6X_VERSION_CHECK)
490#undef JSON_HEDLEY_TI_CL6X_VERSION_CHECK
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))
495#define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (0
)
498#if defined(JSON_HEDLEY_TI_CL7X_VERSION)
499#undef JSON_HEDLEY_TI_CL7X_VERSION
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
))
505#if defined(JSON_HEDLEY_TI_CL7X_VERSION_CHECK)
506#undef JSON_HEDLEY_TI_CL7X_VERSION_CHECK
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))
511#define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (0
)
514#if defined(JSON_HEDLEY_TI_CLPRU_VERSION)
515#undef JSON_HEDLEY_TI_CLPRU_VERSION
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
))
521#if defined(JSON_HEDLEY_TI_CLPRU_VERSION_CHECK)
522#undef JSON_HEDLEY_TI_CLPRU_VERSION_CHECK
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))
527#define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (0
)
530#if defined(JSON_HEDLEY_CRAY_VERSION)
531#undef JSON_HEDLEY_CRAY_VERSION
534#if defined(_RELEASE_PATCHLEVEL)
535#define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL)
537#define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0
)
541#if defined(JSON_HEDLEY_CRAY_VERSION_CHECK)
542#undef JSON_HEDLEY_CRAY_VERSION_CHECK
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))
547#define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0
)
550#if defined(JSON_HEDLEY_IAR_VERSION)
551#undef JSON_HEDLEY_IAR_VERSION
553#if defined(__IAR_SYSTEMS_ICC__)
555#define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000
), ((__VER__ / 1000
) % 1000
), (__VER__ % 1000
))
557#define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE(__VER__ / 100
, __VER__ % 100
, 0
)
561#if defined(JSON_HEDLEY_IAR_VERSION_CHECK)
562#undef JSON_HEDLEY_IAR_VERSION_CHECK
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))
567#define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0
)
570#if defined(JSON_HEDLEY_TINYC_VERSION)
571#undef JSON_HEDLEY_TINYC_VERSION
573#if defined(__TINYC__)
574#define JSON_HEDLEY_TINYC_VERSION JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000
, (__TINYC__ / 100
) % 10
, __TINYC__ % 100
)
577#if defined(JSON_HEDLEY_TINYC_VERSION_CHECK)
578#undef JSON_HEDLEY_TINYC_VERSION_CHECK
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))
583#define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0
)
586#if defined(JSON_HEDLEY_DMC_VERSION)
587#undef JSON_HEDLEY_DMC_VERSION
590#define JSON_HEDLEY_DMC_VERSION JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8
, (__DMC__ >> 4
) & 0xf
, __DMC__ & 0xf
)
593#if defined(JSON_HEDLEY_DMC_VERSION_CHECK)
594#undef JSON_HEDLEY_DMC_VERSION_CHECK
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))
599#define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0
)
602#if defined(JSON_HEDLEY_COMPCERT_VERSION)
603#undef JSON_HEDLEY_COMPCERT_VERSION
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
)
609#if defined(JSON_HEDLEY_COMPCERT_VERSION_CHECK)
610#undef JSON_HEDLEY_COMPCERT_VERSION_CHECK
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))
615#define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0
)
618#if defined(JSON_HEDLEY_PELLES_VERSION)
619#undef JSON_HEDLEY_PELLES_VERSION
622#define JSON_HEDLEY_PELLES_VERSION JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100
, __POCC__ % 100
, 0
)
625#if defined(JSON_HEDLEY_PELLES_VERSION_CHECK)
626#undef JSON_HEDLEY_PELLES_VERSION_CHECK
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))
631#define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0
)
634#if defined(JSON_HEDLEY_MCST_LCC_VERSION)
635#undef JSON_HEDLEY_MCST_LCC_VERSION
637#if defined(__LCC__) && defined(__LCC_MINOR__)
638#define JSON_HEDLEY_MCST_LCC_VERSION JSON_HEDLEY_VERSION_ENCODE(__LCC__ / 100
, __LCC__ % 100
, __LCC_MINOR__)
641#if defined(JSON_HEDLEY_MCST_LCC_VERSION_CHECK)
642#undef JSON_HEDLEY_MCST_LCC_VERSION_CHECK
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))
647#define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (0
)
650#if defined(JSON_HEDLEY_GCC_VERSION)
651#undef JSON_HEDLEY_GCC_VERSION
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
672#if defined(JSON_HEDLEY_GCC_VERSION_CHECK)
673#undef JSON_HEDLEY_GCC_VERSION_CHECK
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))
678#define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0
)
681#if defined(JSON_HEDLEY_HAS_ATTRIBUTE)
682#undef JSON_HEDLEY_HAS_ATTRIBUTE
685 defined(__has_attribute
) &&
689# define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute)
691# define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0
)
694#if defined(JSON_HEDLEY_GNUC_HAS_ATTRIBUTE)
695#undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE
697#if defined(__has_attribute
)
698#define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute)
700#define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
703#if defined(JSON_HEDLEY_GCC_HAS_ATTRIBUTE)
704#undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE
706#if defined(__has_attribute
)
707#define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute)
709#define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
712#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE)
713#undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE
716 defined(__has_cpp_attribute
) &&
717 defined(__cplusplus
) &&
719#define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute)
721#define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0
)
724#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS)
725#undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS
727#if !defined(__cplusplus
) || !defined(__has_cpp_attribute
)
728#define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0
)
730 !defined(JSON_HEDLEY_PGI_VERSION) &&
731 !defined(JSON_HEDLEY_IAR_VERSION) &&
734#define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(ns::attribute)
736#define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0
)
739#if defined(JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE)
740#undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE
742#if defined(__has_cpp_attribute
) && defined(__cplusplus
)
743#define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute)
745#define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
748#if defined(JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE)
749#undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE
751#if defined(__has_cpp_attribute
) && defined(__cplusplus
)
752#define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute)
754#define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
757#if defined(JSON_HEDLEY_HAS_BUILTIN)
758#undef JSON_HEDLEY_HAS_BUILTIN
760#if defined(__has_builtin
)
761#define JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin)
763#define JSON_HEDLEY_HAS_BUILTIN(builtin) (0
)
766#if defined(JSON_HEDLEY_GNUC_HAS_BUILTIN)
767#undef JSON_HEDLEY_GNUC_HAS_BUILTIN
769#if defined(__has_builtin
)
770#define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin)
772#define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
775#if defined(JSON_HEDLEY_GCC_HAS_BUILTIN)
776#undef JSON_HEDLEY_GCC_HAS_BUILTIN
778#if defined(__has_builtin
)
779#define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin)
781#define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
784#if defined(JSON_HEDLEY_HAS_FEATURE)
785#undef JSON_HEDLEY_HAS_FEATURE
788#define JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature)
790#define JSON_HEDLEY_HAS_FEATURE(feature) (0
)
793#if defined(JSON_HEDLEY_GNUC_HAS_FEATURE)
794#undef JSON_HEDLEY_GNUC_HAS_FEATURE
797#define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature)
799#define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
802#if defined(JSON_HEDLEY_GCC_HAS_FEATURE)
803#undef JSON_HEDLEY_GCC_HAS_FEATURE
806#define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature)
808#define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
811#if defined(JSON_HEDLEY_HAS_EXTENSION)
812#undef JSON_HEDLEY_HAS_EXTENSION
814#if defined(__has_extension
)
815#define JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension)
817#define JSON_HEDLEY_HAS_EXTENSION(extension) (0
)
820#if defined(JSON_HEDLEY_GNUC_HAS_EXTENSION)
821#undef JSON_HEDLEY_GNUC_HAS_EXTENSION
823#if defined(__has_extension
)
824#define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension)
826#define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
829#if defined(JSON_HEDLEY_GCC_HAS_EXTENSION)
830#undef JSON_HEDLEY_GCC_HAS_EXTENSION
832#if defined(__has_extension
)
833#define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension)
835#define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
838#if defined(JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE)
839#undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE
841#if defined(__has_declspec_attribute
)
842#define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute)
844#define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0
)
847#if defined(JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE)
848#undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE
850#if defined(__has_declspec_attribute
)
851#define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute)
853#define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
856#if defined(JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE)
857#undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE
859#if defined(__has_declspec_attribute
)
860#define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute)
862#define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
865#if defined(JSON_HEDLEY_HAS_WARNING)
866#undef JSON_HEDLEY_HAS_WARNING
868#if defined(__has_warning
)
869#define JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning)
871#define JSON_HEDLEY_HAS_WARNING(warning) (0
)
874#if defined(JSON_HEDLEY_GNUC_HAS_WARNING)
875#undef JSON_HEDLEY_GNUC_HAS_WARNING
877#if defined(__has_warning
)
878#define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning)
880#define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
883#if defined(JSON_HEDLEY_GCC_HAS_WARNING)
884#undef JSON_HEDLEY_GCC_HAS_WARNING
886#if defined(__has_warning
)
887#define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning)
889#define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
893 (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L
)) ||
894 defined(__clang__
) ||
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)
915#define JSON_HEDLEY_PRAGMA(value)
918#if defined(JSON_HEDLEY_DIAGNOSTIC_PUSH)
919#undef JSON_HEDLEY_DIAGNOSTIC_PUSH
921#if defined(JSON_HEDLEY_DIAGNOSTIC_POP)
922#undef JSON_HEDLEY_DIAGNOSTIC_POP
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")
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")
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)")
954#define JSON_HEDLEY_DIAGNOSTIC_PUSH
955#define JSON_HEDLEY_DIAGNOSTIC_POP
959
960#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_)
961#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_
963#if defined(__cplusplus
)
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\"")
973 JSON_HEDLEY_DIAGNOSTIC_POP
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\"")
980 JSON_HEDLEY_DIAGNOSTIC_POP
983# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr)
984 JSON_HEDLEY_DIAGNOSTIC_PUSH
985 _Pragma("clang diagnostic ignored \"-Wc++98-compat\"")
987 JSON_HEDLEY_DIAGNOSTIC_POP
992#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(x) x
995#if defined(JSON_HEDLEY_CONST_CAST)
996#undef JSON_HEDLEY_CONST_CAST
998#if defined(__cplusplus
)
999# define JSON_HEDLEY_CONST_CAST(T, expr) (const_cast<T>(expr))
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
1008 JSON_HEDLEY_DIAGNOSTIC_POP
1011# define JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr))
1014#if defined(JSON_HEDLEY_REINTERPRET_CAST)
1015#undef JSON_HEDLEY_REINTERPRET_CAST
1017#if defined(__cplusplus
)
1018#define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast<T>(expr))
1020#define JSON_HEDLEY_REINTERPRET_CAST(T, expr) ((T) (expr))
1023#if defined(JSON_HEDLEY_STATIC_CAST)
1024#undef JSON_HEDLEY_STATIC_CAST
1026#if defined(__cplusplus
)
1027#define JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast<T>(expr))
1029#define JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr))
1032#if defined(JSON_HEDLEY_CPP_CAST)
1033#undef JSON_HEDLEY_CPP_CAST
1035#if defined(__cplusplus
)
1037# define JSON_HEDLEY_CPP_CAST(T, expr)
1038 JSON_HEDLEY_DIAGNOSTIC_PUSH
1039 _Pragma("clang diagnostic ignored \"-Wold-style-cast\"")
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
1048# define JSON_HEDLEY_CPP_CAST(T, expr) ((T) (expr))
1051# define JSON_HEDLEY_CPP_CAST(T, expr) (expr)
1054#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED)
1055#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
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")
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)")
1095#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
1098#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS)
1099#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_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
))
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")
1126#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS
1129#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES)
1130#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_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)")
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")
1158#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES
1161#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL)
1162#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_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\"")
1171#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL
1174#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION)
1175#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_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")
1186#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION
1189#if defined(JSON_HEDLEY_DEPRECATED)
1190#undef JSON_HEDLEY_DEPRECATED
1192#if defined(JSON_HEDLEY_DEPRECATED_FOR)
1193#undef JSON_HEDLEY_DEPRECATED_FOR
1198#define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since))
1199#define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement))
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)]])
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__))
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")
1247#define JSON_HEDLEY_DEPRECATED(since)
1248#define JSON_HEDLEY_DEPRECATED_FOR(since, replacement)
1251#if defined(JSON_HEDLEY_UNAVAILABLE)
1252#undef JSON_HEDLEY_UNAVAILABLE
1259#define JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since)))
1261#define JSON_HEDLEY_UNAVAILABLE(available_since)
1264#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT)
1265#undef JSON_HEDLEY_WARN_UNUSED_RESULT
1267#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT_MSG)
1268#undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG
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_)
1297#define JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_
1298#define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) _Check_return_
1300#define JSON_HEDLEY_WARN_UNUSED_RESULT
1301#define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg)
1304#if defined(JSON_HEDLEY_SENTINEL)
1305#undef JSON_HEDLEY_SENTINEL
1313#define JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position)))
1315#define JSON_HEDLEY_SENTINEL(position)
1318#if defined(JSON_HEDLEY_NO_RETURN)
1319#undef JSON_HEDLEY_NO_RETURN
1322#define JSON_HEDLEY_NO_RETURN __noreturn
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]])
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")
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)
1363#define JSON_HEDLEY_NO_RETURN
1366#if defined(JSON_HEDLEY_NO_ESCAPE)
1367#undef JSON_HEDLEY_NO_ESCAPE
1370#define JSON_HEDLEY_NO_ESCAPE __attribute__((__noescape__))
1372#define JSON_HEDLEY_NO_ESCAPE
1375#if defined(JSON_HEDLEY_UNREACHABLE)
1376#undef JSON_HEDLEY_UNREACHABLE
1378#if defined(JSON_HEDLEY_UNREACHABLE_RETURN)
1379#undef JSON_HEDLEY_UNREACHABLE_RETURN
1381#if defined(JSON_HEDLEY_ASSUME)
1382#undef JSON_HEDLEY_ASSUME
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)
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)
1397#define JSON_HEDLEY_ASSUME(expr) _nassert(expr)
1408#define JSON_HEDLEY_UNREACHABLE() __builtin_unreachable()
1409#elif defined(JSON_HEDLEY_ASSUME)
1410#define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0
)
1413#if defined(JSON_HEDLEY_UNREACHABLE)
1414#define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, ((expr) ? 1
: (JSON_HEDLEY_UNREACHABLE(), 1
)))
1416#define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, expr)
1423#define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (JSON_HEDLEY_STATIC_CAST(void, JSON_HEDLEY_ASSUME(0
)), (value))
1425#define JSON_HEDLEY_UNREACHABLE_RETURN(value) JSON_HEDLEY_UNREACHABLE()
1428#define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (value)
1431#define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0
)
1436#pragma clang diagnostic ignored "-Wpedantic"
1439#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
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"
1448#if defined(JSON_HEDLEY_NON_NULL)
1449#undef JSON_HEDLEY_NON_NULL
1456#define JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__)))
1458#define JSON_HEDLEY_NON_NULL(...)
1462#if defined(JSON_HEDLEY_PRINTF_FORMAT)
1463#undef JSON_HEDLEY_PRINTF_FORMAT
1466#define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check)))
1468#define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check)))
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))
1491#define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check)
1494#if defined(JSON_HEDLEY_CONSTEXPR)
1495#undef JSON_HEDLEY_CONSTEXPR
1497#if defined(__cplusplus
)
1498#if __cplusplus
>= 201103L
1499#define JSON_HEDLEY_CONSTEXPR JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(constexpr)
1503#define JSON_HEDLEY_CONSTEXPR
1506#if defined(JSON_HEDLEY_PREDICT)
1507#undef JSON_HEDLEY_PREDICT
1509#if defined(JSON_HEDLEY_LIKELY)
1510#undef JSON_HEDLEY_LIKELY
1512#if defined(JSON_HEDLEY_UNLIKELY)
1513#undef JSON_HEDLEY_UNLIKELY
1515#if defined(JSON_HEDLEY_UNPREDICTABLE)
1516#undef JSON_HEDLEY_UNPREDICTABLE
1519#define JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable((expr))
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
)
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)
1551 double hedley_probability_ = (probability);
1552 ((hedley_probability_ >= 0.9
) ? __builtin_expect(!!(expr), 1
) : ((hedley_probability_ <= 0.1
) ? __builtin_expect(!!(expr), 0
) : !!(expr)));
1554# define JSON_HEDLEY_PREDICT_FALSE(expr, probability)
1556 double hedley_probability_ = (probability);
1557 ((hedley_probability_ >= 0.9
) ? __builtin_expect(!!(expr), 0
) : ((hedley_probability_ <= 0.1
) ? __builtin_expect(!!(expr), 1
) : !!(expr)));
1559# define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1
)
1560# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0
)
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))
1569#define JSON_HEDLEY_UNPREDICTABLE(expr) JSON_HEDLEY_PREDICT(expr, 1
, 0.5
)
1572#if defined(JSON_HEDLEY_MALLOC)
1573#undef JSON_HEDLEY_MALLOC
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")
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)
1602#define JSON_HEDLEY_MALLOC
1605#if defined(JSON_HEDLEY_PURE)
1606#undef JSON_HEDLEY_PURE
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) &&
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
)
1637# define JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;")
1639# define JSON_HEDLEY_PURE
1642#if defined(JSON_HEDLEY_CONST)
1643#undef JSON_HEDLEY_CONST
1665#define JSON_HEDLEY_CONST __attribute__((__const__))
1667 JSON_HEDLEY_SUNPRO_VERSION_CHECK(5
,10
,0
)
1668#define JSON_HEDLEY_CONST _Pragma("no_side_effect")
1670#define JSON_HEDLEY_CONST JSON_HEDLEY_PURE
1673#if defined(JSON_HEDLEY_RESTRICT)
1674#undef JSON_HEDLEY_RESTRICT
1676#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L
) && !defined(__cplusplus
)
1677#define JSON_HEDLEY_RESTRICT restrict
1692 defined(__clang__
) ||
1694#define JSON_HEDLEY_RESTRICT __restrict
1695#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5
,3
,0
) && !defined(__cplusplus)
1696#define JSON_HEDLEY_RESTRICT _Restrict
1698#define JSON_HEDLEY_RESTRICT
1701#if defined(JSON_HEDLEY_INLINE)
1702#undef JSON_HEDLEY_INLINE
1705 (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L
)) ||
1706 (defined(__cplusplus
) && (__cplusplus
>= 199711L
))
1707#define JSON_HEDLEY_INLINE inline
1709 defined(JSON_HEDLEY_GCC_VERSION) ||
1710 JSON_HEDLEY_ARM_VERSION_CHECK(6
,2
,0
)
1711#define JSON_HEDLEY_INLINE __inline__
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
1725#define JSON_HEDLEY_INLINE
1728#if defined(JSON_HEDLEY_ALWAYS_INLINE)
1729#undef JSON_HEDLEY_ALWAYS_INLINE
1751# define JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) JSON_HEDLEY_INLINE
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) &&
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
)
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")
1769# define JSON_HEDLEY_ALWAYS_INLINE JSON_HEDLEY_INLINE
1772#if defined(JSON_HEDLEY_NEVER_INLINE)
1773#undef JSON_HEDLEY_NEVER_INLINE
1795#define JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__))
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)
1811#define JSON_HEDLEY_NEVER_INLINE
1814#if defined(JSON_HEDLEY_PRIVATE)
1815#undef JSON_HEDLEY_PRIVATE
1817#if defined(JSON_HEDLEY_PUBLIC)
1818#undef JSON_HEDLEY_PUBLIC
1820#if defined(JSON_HEDLEY_IMPORT)
1821#undef JSON_HEDLEY_IMPORT
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)
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
) ||
1836 defined(__TI_EABI__) &&
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
)
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")))
1846# define JSON_HEDLEY_PRIVATE
1847# define JSON_HEDLEY_PUBLIC
1849# define JSON_HEDLEY_IMPORT extern
1852#if defined(JSON_HEDLEY_NO_THROW)
1853#undef JSON_HEDLEY_NO_THROW
1860#define JSON_HEDLEY_NO_THROW __attribute__((__nothrow__))
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)
1867#define JSON_HEDLEY_NO_THROW
1870#if defined(JSON_HEDLEY_FALL_THROUGH)
1871#undef JSON_HEDLEY_FALL_THROUGH
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)
1883#define JSON_HEDLEY_FALL_THROUGH __fallthrough
1885#define JSON_HEDLEY_FALL_THROUGH
1888#if defined(JSON_HEDLEY_RETURNS_NON_NULL)
1889#undef JSON_HEDLEY_RETURNS_NON_NULL
1895#define JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__))
1896#elif defined(_Ret_notnull_)
1897#define JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_
1899#define JSON_HEDLEY_RETURNS_NON_NULL
1902#if defined(JSON_HEDLEY_ARRAY_PARAM)
1903#undef JSON_HEDLEY_ARRAY_PARAM
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)
1913#define JSON_HEDLEY_ARRAY_PARAM(name)
1916#if defined(JSON_HEDLEY_IS_CONSTANT)
1917#undef JSON_HEDLEY_IS_CONSTANT
1919#if defined(JSON_HEDLEY_REQUIRE_CONSTEXPR)
1920#undef JSON_HEDLEY_REQUIRE_CONSTEXPR
1923
1924#if defined(JSON_HEDLEY_IS_CONSTEXPR_)
1925#undef JSON_HEDLEY_IS_CONSTEXPR_
1938#define JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr)
1940#if !defined(__cplusplus
)
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*)
1953#define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1
? (void*) ((intptr_t) ((expr) * 0
)) : (int*) 0
)), int*)
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
)
1970#define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1
? (void*) ((intptr_t) * 0
) : (int*) 0
), int*: 1
, void*: 0
)
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) ||
1983# define JSON_HEDLEY_IS_CONSTEXPR_(expr) (
1987 ((void*) ((expr) * 0L
) ) : \
1988((struct{ char v[sizeof(void) * 2]; } *) 1)
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)
1998#define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (JSON_HEDLEY_IS_CONSTEXPR_(expr) ? (expr) : (-1
))
2001#define JSON_HEDLEY_IS_CONSTANT(expr) (0
)
2003#define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr)
2006#if defined(JSON_HEDLEY_BEGIN_C_DECLS)
2007#undef JSON_HEDLEY_BEGIN_C_DECLS
2009#if defined(JSON_HEDLEY_END_C_DECLS)
2010#undef JSON_HEDLEY_END_C_DECLS
2012#if defined(JSON_HEDLEY_C_DECL)
2013#undef JSON_HEDLEY_C_DECL
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"
2020#define JSON_HEDLEY_BEGIN_C_DECLS
2021#define JSON_HEDLEY_END_C_DECLS
2022#define JSON_HEDLEY_C_DECL
2025#if defined(JSON_HEDLEY_STATIC_ASSERT)
2026#undef JSON_HEDLEY_STATIC_ASSERT
2029 !defined(__cplusplus
) && (
2030 (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L
)) ||
2034 defined(_Static_assert)
2036# define JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message)
2038 (defined(__cplusplus
) && (__cplusplus
>= 201103L
)) ||
2041# define JSON_HEDLEY_STATIC_ASSERT(expr, message) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(static_assert(expr, message))
2043# define JSON_HEDLEY_STATIC_ASSERT(expr, message)
2046#if defined(JSON_HEDLEY_NULL)
2047#undef JSON_HEDLEY_NULL
2049#if defined(__cplusplus
)
2050#if __cplusplus
>= 201103L
2051#define JSON_HEDLEY_NULL JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(nullptr)
2053#define JSON_HEDLEY_NULL NULL
2055#define JSON_HEDLEY_NULL JSON_HEDLEY_STATIC_CAST(void*, 0
)
2058#define JSON_HEDLEY_NULL NULL
2060#define JSON_HEDLEY_NULL ((void*) 0
)
2063#if defined(JSON_HEDLEY_MESSAGE)
2064#undef JSON_HEDLEY_MESSAGE
2067# define JSON_HEDLEY_MESSAGE(msg)
2068 JSON_HEDLEY_DIAGNOSTIC_PUSH
2069 JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS
2071 JSON_HEDLEY_DIAGNOSTIC_POP
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))
2083# define JSON_HEDLEY_MESSAGE(msg)
2086#if defined(JSON_HEDLEY_WARNING)
2087#undef JSON_HEDLEY_WARNING
2090# define JSON_HEDLEY_WARNING(msg)
2091 JSON_HEDLEY_DIAGNOSTIC_PUSH
2092 JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS
2094 JSON_HEDLEY_DIAGNOSTIC_POP
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)
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))
2105# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_MESSAGE(msg)
2108#if defined(JSON_HEDLEY_REQUIRE)
2109#undef JSON_HEDLEY_REQUIRE
2111#if defined(JSON_HEDLEY_REQUIRE_MSG)
2112#undef JSON_HEDLEY_REQUIRE_MSG
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
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")))
2131# define JSON_HEDLEY_REQUIRE(expr)
2132# define JSON_HEDLEY_REQUIRE_MSG(expr,msg)
2135#if defined(JSON_HEDLEY_FLAGS)
2136#undef JSON_HEDLEY_FLAGS
2139#define JSON_HEDLEY_FLAGS __attribute__((__flag_enum__))
2141#define JSON_HEDLEY_FLAGS
2144#if defined(JSON_HEDLEY_FLAGS_CAST)
2145#undef JSON_HEDLEY_FLAGS_CAST
2148# define JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({
2149 JSON_HEDLEY_DIAGNOSTIC_PUSH
2150 _Pragma("warning(disable:188)")
2152 JSON_HEDLEY_DIAGNOSTIC_POP
2155# define JSON_HEDLEY_FLAGS_CAST(T, expr) JSON_HEDLEY_STATIC_CAST(T, expr)
2158#if defined(JSON_HEDLEY_EMPTY_BASES)
2159#undef JSON_HEDLEY_EMPTY_BASES
2164#define JSON_HEDLEY_EMPTY_BASES __declspec(empty_bases)
2166#define JSON_HEDLEY_EMPTY_BASES
2171#if defined(JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK)
2172#undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK
2174#if defined(__clang__
)
2175#define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0
)
2177#define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
2180#if defined(JSON_HEDLEY_CLANG_HAS_ATTRIBUTE)
2181#undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE
2183#define JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_ATTRIBUTE(attribute)
2185#if defined(JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE)
2186#undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE
2188#define JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute)
2190#if defined(JSON_HEDLEY_CLANG_HAS_BUILTIN)
2191#undef JSON_HEDLEY_CLANG_HAS_BUILTIN
2193#define JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) JSON_HEDLEY_HAS_BUILTIN(builtin)
2195#if defined(JSON_HEDLEY_CLANG_HAS_FEATURE)
2196#undef JSON_HEDLEY_CLANG_HAS_FEATURE
2198#define JSON_HEDLEY_CLANG_HAS_FEATURE(feature) JSON_HEDLEY_HAS_FEATURE(feature)
2200#if defined(JSON_HEDLEY_CLANG_HAS_EXTENSION)
2201#undef JSON_HEDLEY_CLANG_HAS_EXTENSION
2203#define JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) JSON_HEDLEY_HAS_EXTENSION(extension)
2205#if defined(JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE)
2206#undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE
2208#define JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute)
2210#if defined(JSON_HEDLEY_CLANG_HAS_WARNING)
2211#undef JSON_HEDLEY_CLANG_HAS_WARNING
2213#define JSON_HEDLEY_CLANG_HAS_WARNING(warning) JSON_HEDLEY_HAS_WARNING(warning)
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"
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"
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
)
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
2248#define JSON_HAS_CPP_11
2252#if defined(__clang__
)
2253#pragma clang diagnostic push
2254#pragma clang diagnostic ignored "-Wdocumentation"
2255#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
2259#if (defined(__cpp_exceptions
) || defined(__EXCEPTIONS) || defined(_CPPUNWIND
)) && !defined(JSON_NOEXCEPTION)
2260#define JSON_THROW(exception) throw exception
2262#define JSON_CATCH(exception) catch(exception)
2263#define JSON_INTERNAL_CATCH(exception) catch(exception)
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)
2273#if defined(JSON_THROW_USER)
2275#define JSON_THROW JSON_THROW_USER
2277#if defined(JSON_TRY_USER)
2279#define JSON_TRY JSON_TRY_USER
2281#if defined(JSON_CATCH_USER)
2283#define JSON_CATCH JSON_CATCH_USER
2284#undef JSON_INTERNAL_CATCH
2285#define JSON_INTERNAL_CATCH JSON_CATCH_USER
2287#if defined(JSON_INTERNAL_CATCH_USER)
2288#undef JSON_INTERNAL_CATCH
2289#define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER
2293#if !defined(JSON_ASSERT)
2295#define JSON_ASSERT(x) assert
(x)
2299#if defined(JSON_TESTS_PRIVATE)
2300#define JSON_PRIVATE_UNLESS_TESTED public
2302#define JSON_PRIVATE_UNLESS_TESTED private
2306
2307
2308
2309
2310#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...)
2311 template<typename BasicJsonType>
2312 inline void to_json(BasicJsonType& j, const ENUM_TYPE& e)
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
2319 return ej_pair.first == e;
2321 j = ((it != std::end(m)) ? it : std::begin(m))->second;
2323 template<typename BasicJsonType>
2324 inline void from_json(const BasicJsonType& j, ENUM_TYPE& e)
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
2331 return ej_pair.second == j;
2333 e = ((it != std::end(m)) ? it : std::begin(m))->first;
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,
2348#define NLOHMANN_BASIC_JSON_TPL
2349 basic_json<ObjectType, ArrayType, StringType, BooleanType,
2350 NumberIntegerType, NumberUnsignedType, NumberFloatType,
2351 AllocatorType, JSONSerializer, BinaryType>
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
2421 NLOHMANN_JSON_PASTE1)(__VA_ARGS__))
2422#define NLOHMANN_JSON_PASTE2(func, v1) func(v1)
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)
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);
2490
2491
2492
2493
2494#define NLOHMANN_DEFINE_TYPE_INTRUSIVE(Type, ...)
2499
2500
2501
2502
2503#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Type, ...)
2507#ifndef JSON_USE_IMPLICIT_CONVERSIONS
2508#define JSON_USE_IMPLICIT_CONVERSIONS 1
2512#define JSON_EXPLICIT
2514#define JSON_EXPLICIT explicit
2517#ifndef JSON_DIAGNOSTICS
2518#define JSON_DIAGNOSTICS 0
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540 inline void replace_substring(
std::string& s,
const std::string& f,
2541 const std::string& t)
2544 for (
auto pos = s.find(f);
2545 pos != std::string::npos;
2546 s.replace(pos, f.size(), t),
2547 pos = s.find(f, pos + t.size()))
2553
2554
2555
2556
2557
2558
2561 replace_substring(s,
"~",
"~0");
2562 replace_substring(s,
"/",
"~1");
2567
2568
2569
2570
2571
2572
2573 static void unescape(
std::string& s)
2575 replace_substring(s,
"~1",
"/");
2576 replace_substring(s,
"~0",
"~");
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2654 const char*
what()
const noexcept override
2666 static std::string name(
const std::string& ename,
int id_)
2668 return "[json.exception." + ename +
"." +
std::to_string(id_) +
"] ";
2671 template<
typename BasicJsonType>
2672 static std::string diagnostics(
const BasicJsonType& leaf_element)
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2789
2790
2791
2792
2793
2794
2795
2796
2797 template<
typename BasicJsonType>
2805 template<
typename BasicJsonType>
2806 static parse_error create(
int id_,
std::size_t byte_,
const std::string& what_arg,
const BasicJsonType& context)
2815
2816
2817
2818
2819
2820
2821
2822
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2876 template<
typename BasicJsonType>
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2931 template<
typename BasicJsonType>
2932 static type_error create(
int id_,
const std::string& what_arg,
const BasicJsonType& context)
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2979 template<
typename BasicJsonType>
2980 static out_of_range create(
int id_,
const std::string& what_arg,
const BasicJsonType& context)
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3018 template<
typename BasicJsonType>
3019 static other_error create(
int id_,
const std::string& what_arg,
const BasicJsonType& context)
3038#include <type_traits>
3049 template<
typename T>
3050 using uncvref_t =
typename std::remove_cv<
typename std::remove_reference<T>::type>::type;
3052#ifdef JSON_HAS_CPP_14
3055 using std::enable_if_t;
3056 using std::index_sequence;
3057 using std::make_index_sequence;
3058 using std::index_sequence_for;
3063 template<
bool B,
typename T =
void>
3090 template <
typename T,
T...
Ints>
3096 return sizeof...(
Ints);
3136 template <
typename T>
3151 template <
typename T,
T N>
3167 template <
typename...
Ts>
3179 template<
typename T>
3185 template<
typename T>
3207#include <type_traits>
3227 template<
typename ...Ts>
using void_t =
typename make_void<Ts...>::type;
3238 template<
typename It,
typename =
void>
3241 template<
typename It>
3256 template<
typename T,
typename =
void>
3261 template<
typename T>
3267 template<
typename T>
3286#include <type_traits>
3306 template<
class Default,
3308 template<
class...>
class Op,
3312 using value_t =
std::false_type;
3313 using type = Default;
3316 template<
class Default,
template<
class...>
class Op,
class...
Args>
3323 template<
template<
class...>
class Op,
class...
Args>
3326 template<
template<
class...>
class Op,
class... Args>
3329 template<
template<
class...>
class Op,
class...
Args>
3332 template<
class Default,
template<
class...>
class Op,
class...
Args>
3335 template<
class Default,
template<
class...>
class Op,
class...
Args>
3338 template<
class Expected,
template<
class...>
class Op,
class...
Args>
3341 template<
class To,
template<
class...>
class Op,
class...
Args>
3348#ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_
3349#define INCLUDE_NLOHMANN_JSON_FWD_HPP_
3358
3359
3360
3361
3365
3366
3367
3368
3369
3370
3371 template<
typename T =
void,
typename SFINAE =
void>
3372 struct adl_serializer;
3374 template<
template<
typename U,
typename V,
typename... Args>
class ObjectType =
3376 template<
typename U,
typename... Args>
class ArrayType =
std::
vector,
3377 class StringType =
std::
string,
class BooleanType =
bool,
3380 class NumberFloatType =
double,
3381 template<
typename U>
class AllocatorType =
std::
allocator,
3382 template<
typename T,
typename SFINAE =
void>
class JSONSerializer =
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398 template<
typename BasicJsonType>
3402
3403
3404
3405
3406
3407
3408
3411 template<
class Key,
class T,
class IgnoredLess,
class Allocator>
3415
3416
3417
3418
3419
3420
3431
3432
3433
3434
3435
3436
3437
3468 template<
typename T>
3475 template<
typename T>
3476 using mapped_type_t =
typename T::mapped_type;
3478 template<
typename T>
3479 using key_type_t =
typename T::key_type;
3481 template<
typename T>
3482 using value_type_t =
typename T::value_type;
3484 template<
typename T>
3485 using difference_type_t =
typename T::difference_type;
3487 template<
typename T>
3488 using pointer_t =
typename T::pointer;
3490 template<
typename T>
3491 using reference_t =
typename T::reference;
3493 template<
typename T>
3494 using iterator_category_t =
typename T::iterator_category;
3496 template<
typename T>
3497 using iterator_t =
typename T::iterator;
3499 template<
typename T,
typename... Args>
3500 using to_json_function =
decltype(T::to_json(
std::declval<Args>()...));
3502 template<
typename T,
typename... Args>
3503 using from_json_function =
decltype(T::from_json(
std::declval<Args>()...));
3505 template<
typename T,
typename U>
3506 using get_template_function =
decltype(
std::declval<T>().
template get<U>());
3509 template<
typename BasicJsonType,
typename T,
typename =
void>
3516 template <
typename BasicJsonType,
typename T>
3534 template<
typename BasicJsonType,
typename T,
typename =
void>
3549 template<
typename BasicJsonType,
typename T,
typename =
void>
3570 template<
class B1,
class... Bn>
3572 :
std::conditional<
bool(B1::value),
conjunction<Bn...>, B1>::type {};
3580 template <
typename T>
3583 template <
typename T1,
typename T2>
3587 template <
typename T1,
typename T2>
3591 template <
typename... Ts>
3595 template <
typename... Ts>
3600 template <
typename T,
typename... Args>
3603 template <
typename T1,
typename T2>
3606 template <
typename T1,
typename T2>
3609 template <
typename... Ts>
3612 template <
typename... Ts>
3616 template<
typename T,
typename =
void>
3619 template<
typename T>
3638 template<
typename T,
typename =
void>
3641 template<
typename T>
3644 template<
typename BasicJsonType,
typename CompatibleObjectType,
3664 template<
typename BasicJsonType,
typename CompatibleObjectType>
3668 template<
typename BasicJsonType,
typename ConstructibleObjectType,
3696 template<
typename BasicJsonType,
typename ConstructibleObjectType>
3701 template<
typename BasicJsonType,
typename CompatibleStringType,
3715 template<
typename BasicJsonType,
typename ConstructibleStringType>
3719 template<
typename BasicJsonType,
typename ConstructibleStringType,
3734 template<
typename BasicJsonType,
typename ConstructibleStringType>
3738 template<
typename BasicJsonType,
typename CompatibleArrayType,
typename =
void>
3757 template<
typename BasicJsonType,
typename CompatibleArrayType>
3761 template<
typename BasicJsonType,
typename ConstructibleArrayType,
typename =
void>
3800 template<
typename BasicJsonType,
typename ConstructibleArrayType>
3804 template<
typename RealIntegerType,
typename CompatibleNumberIntegerType,
3826 template<
typename RealIntegerType,
typename CompatibleNumberIntegerType>
3831 template<
typename BasicJsonType,
typename CompatibleType,
typename =
void>
3843 template<
typename BasicJsonType,
typename CompatibleType>
3847 template<
typename T1,
typename T2>
3850 template<
typename T1,
typename... Args>
3855 template <
typename T>
3865 template <
typename C>
static one
test(
decltype(&C::capacity));
3868 enum {
value =
sizeof(test<T>(
nullptr)) ==
sizeof(
char) };
3872 template <
typename T,
typename U, enable_if_t < !std::is_same<T, U>::value,
int > = 0 >
3873 T conditional_static_cast(U value)
3875 return static_cast<
T>(
value);
3878 template<
typename T,
typename U, enable_if_t<std::is_same<T, U>::value,
int> = 0>
3879 T conditional_static_cast(U value)
3894 template<
typename BasicJsonType>
3905 template <
typename BasicJsonType,
typename ArithmeticType,
3906 enable_if_t < std::is_arithmetic<ArithmeticType>::value &&
3907 !std::is_same<ArithmeticType,
typename BasicJsonType::boolean_t>::value,
3909 void get_arithmetic_value(
const BasicJsonType& j, ArithmeticType& val)
3941 template<
typename BasicJsonType>
3942 void from_json(
const BasicJsonType& j,
typename BasicJsonType::boolean_t& b)
3951 template<
typename BasicJsonType>
3952 void from_json(
const BasicJsonType& j,
typename BasicJsonType::string_t& s)
3962 typename BasicJsonType,
typename ConstructibleStringType,
3964 is_constructible_string_type<BasicJsonType, ConstructibleStringType>::value &&
3965 !std::is_same<
typename BasicJsonType::string_t,
3966 ConstructibleStringType>::value,
3968 void from_json(
const BasicJsonType& j, ConstructibleStringType& s)
3978 template<
typename BasicJsonType>
3979 void from_json(
const BasicJsonType& j,
typename BasicJsonType::number_float_t& val)
3984 template<
typename BasicJsonType>
3985 void from_json(
const BasicJsonType& j,
typename BasicJsonType::number_unsigned_t& val)
3990 template<
typename BasicJsonType>
3991 void from_json(
const BasicJsonType& j,
typename BasicJsonType::number_integer_t& val)
3996 template<
typename BasicJsonType,
typename EnumType,
3997 enable_if_t<std::is_enum<EnumType>::value,
int> = 0>
3998 void from_json(
const BasicJsonType& j, EnumType& e)
4006 template<
typename BasicJsonType,
typename T,
typename Allocator,
4007 enable_if_t<is_getable<BasicJsonType, T>::value,
int> = 0>
4008 void from_json(
const BasicJsonType& j,
std::forward_list<T, Allocator>& l)
4018 return i.
template get<
T>();
4023 template<
typename BasicJsonType,
typename T,
4024 enable_if_t<is_getable<BasicJsonType, T>::value,
int> = 0>
4025 void from_json(
const BasicJsonType& j,
std::valarray<T>& l)
4039 template<
typename BasicJsonType,
typename T,
std::size_t N>
4040 auto from_json(
const BasicJsonType& j, T(&arr)[N])
4041 ->
decltype(j.
template get<T>(),
void())
4049 template<
typename BasicJsonType>
4050 void from_json_array_impl(
const BasicJsonType& j,
typename BasicJsonType::array_t& arr,
priority_tag<3> )
4055 template<
typename BasicJsonType,
typename T,
std::size_t N>
4056 auto from_json_array_impl(
const BasicJsonType& j,
std::array<T, N>& arr,
4058 ->
decltype(j.
template get<T>(),
void())
4066 template<
typename BasicJsonType,
typename ConstructibleArrayType,
4068 std::is_assignable<ConstructibleArrayType&, ConstructibleArrayType>::value,
4070 auto from_json_array_impl(
const BasicJsonType& j, ConstructibleArrayType& arr,
priority_tag<1> )
4072 arr.reserve(
std::declval<
typename ConstructibleArrayType::size_type>()),
4073 j.
template get<
typename ConstructibleArrayType::value_type>(),
4090 template<
typename BasicJsonType,
typename ConstructibleArrayType,
4092 std::is_assignable<ConstructibleArrayType&, ConstructibleArrayType>::value,
4094 void from_json_array_impl(
const BasicJsonType& j, ConstructibleArrayType& arr,
4111 template <
typename BasicJsonType,
typename ConstructibleArrayType,
4113 is_constructible_array_type<BasicJsonType, ConstructibleArrayType>::value &&
4114 !is_constructible_object_type<BasicJsonType, ConstructibleArrayType>::value &&
4115 !is_constructible_string_type<BasicJsonType, ConstructibleArrayType>::value &&
4116 !std::is_same<ConstructibleArrayType,
typename BasicJsonType::binary_t>::value &&
4117 !is_basic_json<ConstructibleArrayType>::value,
4132 template <
typename BasicJsonType,
typename T,
std::size_t... Idx >
4133 std::array<T,
sizeof...(Idx)> from_json_inplace_array_impl(BasicJsonType&& j,
4134 identity_tag<
std::array<T,
sizeof...(Idx)>> , index_sequence<Idx...> )
4139 template <
typename BasicJsonType,
typename T,
std::size_t N >
4151 template<
typename BasicJsonType>
4152 void from_json(
const BasicJsonType& j,
typename BasicJsonType::binary_t& bin)
4162 template<
typename BasicJsonType,
typename ConstructibleObjectType,
4163 enable_if_t<is_constructible_object_type<BasicJsonType, ConstructibleObjectType>::value,
int> = 0>
4164 void from_json(
const BasicJsonType& j, ConstructibleObjectType& obj)
4188 template <
typename BasicJsonType,
typename ArithmeticType,
4190 std::is_arithmetic<ArithmeticType>::value &&
4191 !std::is_same<ArithmeticType,
typename BasicJsonType::number_unsigned_t>::value &&
4192 !std::is_same<ArithmeticType,
typename BasicJsonType::number_integer_t>::value &&
4193 !std::is_same<ArithmeticType,
typename BasicJsonType::number_float_t>::value &&
4194 !std::is_same<ArithmeticType,
typename BasicJsonType::boolean_t>::value,
4196 void from_json(
const BasicJsonType& j, ArithmeticType& val)
4232 template<
typename BasicJsonType,
typename... Args,
std::size_t... Idx>
4233 std::tuple<Args...> from_json_tuple_impl_base(BasicJsonType&& j, index_sequence<Idx...> )
4238 template <
typename BasicJsonType,
class A1,
class A2 >
4245 template<
typename BasicJsonType,
typename A1,
typename A2>
4251 template<
typename BasicJsonType,
typename... Args>
4257 template<
typename BasicJsonType,
typename... Args>
4263 template<
typename BasicJsonType,
typename TupleRelated>
4275 template <
typename BasicJsonType,
typename Key,
typename Value,
typename Compare,
typename Allocator,
4276 typename = enable_if_t < !std::is_constructible <
4277 typename BasicJsonType::string_t, Key >::value >>
4278 void from_json(
const BasicJsonType& j,
std::map<Key, Value, Compare, Allocator>& m)
4285 for (
const auto&
p :
j)
4295 template <
typename BasicJsonType,
typename Key,
typename Value,
typename Hash,
typename KeyEqual,
typename Allocator,
4296 typename = enable_if_t < !std::is_constructible <
4297 typename BasicJsonType::string_t, Key >::value >>
4298 void from_json(
const BasicJsonType& j,
std::unordered_map<Key, Value, Hash, KeyEqual, Allocator>& m)
4305 for (
const auto&
p :
j)
4317 template<
typename BasicJsonType,
typename T>
4318 auto operator()(
const BasicJsonType& j, T&& val)
const
4319 noexcept(
noexcept(from_json(j, std::forward<T>(val))))
4320 ->
decltype(from_json(j,
std::forward<T>(val)))
4322 return from_json(j, std::forward<T>(val));
4343#include <type_traits>
4366 template<
typename string_type>
4376 using difference_type =
std::ptrdiff_t;
4378 using pointer = value_type*;
4379 using reference = value_type&;
4380 using iterator_category =
std::input_iterator_tag;
4381 using string_type =
typename std::remove_cv<
typename std::remove_reference<
decltype(
std::declval<IteratorType>().key()) >::type >::type;
4428 const string_type&
key()
const
4497 template<
std::size_t N,
typename IteratorType, enable_if_t<N == 0,
int> = 0>
4505 template<
std::size_t N,
typename IteratorType, enable_if_t<N == 1,
int> = 0>
4519#if defined(__clang__
)
4521#pragma clang diagnostic push
4522#pragma clang diagnostic ignored "-Wmismatched-tags"
4524 template<
typename IteratorType>
4526 :
public std::integral_constant<std::size_t, 2> {};
4528 template<
std::size_t N,
typename IteratorType>
4532 using type =
decltype(
4533 get<N>(
std::declval <
4536#if defined(__clang__
)
4537#pragma clang diagnostic pop
4557
4558
4559
4560
4561
4568 template<
typename BasicJsonType>
4569 static void construct(BasicJsonType& j,
typename BasicJsonType::boolean_t b)
noexcept
4581 template<
typename BasicJsonType>
4582 static void construct(BasicJsonType& j,
const typename BasicJsonType::string_t& s)
4590 template<
typename BasicJsonType>
4591 static void construct(BasicJsonType& j,
typename BasicJsonType::string_t&& s)
4599 template <
typename BasicJsonType,
typename CompatibleStringType,
4600 enable_if_t < !std::is_same<CompatibleStringType,
typename BasicJsonType::string_t>::value,
4602 static void construct(BasicJsonType& j,
const CompatibleStringType& str)
4614 template<
typename BasicJsonType>
4615 static void construct(BasicJsonType& j,
const typename BasicJsonType::binary_t& b)
4623 template<
typename BasicJsonType>
4624 static void construct(BasicJsonType& j,
typename BasicJsonType::binary_t&& b)
4636 template<
typename BasicJsonType>
4637 static void construct(BasicJsonType& j,
typename BasicJsonType::number_float_t val)
noexcept
4649 template<
typename BasicJsonType>
4650 static void construct(BasicJsonType& j,
typename BasicJsonType::number_unsigned_t val)
noexcept
4662 template<
typename BasicJsonType>
4663 static void construct(BasicJsonType& j,
typename BasicJsonType::number_integer_t val)
noexcept
4675 template<
typename BasicJsonType>
4676 static void construct(BasicJsonType& j,
const typename BasicJsonType::array_t& arr)
4685 template<
typename BasicJsonType>
4686 static void construct(BasicJsonType& j,
typename BasicJsonType::array_t&& arr)
4695 template <
typename BasicJsonType,
typename CompatibleArrayType,
4696 enable_if_t < !std::is_same<CompatibleArrayType,
typename BasicJsonType::array_t>::value,
4698 static void construct(BasicJsonType& j,
const CompatibleArrayType& arr)
4710 template<
typename BasicJsonType>
4711 static void construct(BasicJsonType& j,
const std::vector<
bool>& arr)
4717 for (
const bool x :
arr)
4725 template<
typename BasicJsonType,
typename T,
4726 enable_if_t<std::is_convertible<T, BasicJsonType>::value,
int> = 0>
4727 static void construct(BasicJsonType& j,
const std::valarray<T>& arr)
4745 template<
typename BasicJsonType>
4746 static void construct(BasicJsonType& j,
const typename BasicJsonType::object_t& obj)
4755 template<
typename BasicJsonType>
4756 static void construct(BasicJsonType& j,
typename BasicJsonType::object_t&& obj)
4765 template <
typename BasicJsonType,
typename CompatibleObjectType,
4766 enable_if_t < !std::is_same<CompatibleObjectType,
typename BasicJsonType::object_t>::value,
int > = 0 >
4767 static void construct(BasicJsonType& j,
const CompatibleObjectType& obj)
4784 template<
typename BasicJsonType,
typename T,
4785 enable_if_t<std::is_same<T,
typename BasicJsonType::boolean_t>::value,
int> = 0>
4786 void to_json(BasicJsonType& j, T b)
noexcept
4791 template<
typename BasicJsonType,
typename CompatibleString,
4792 enable_if_t<std::is_constructible<
typename BasicJsonType::string_t, CompatibleString>::value,
int> = 0>
4793 void to_json(BasicJsonType& j,
const CompatibleString& s)
4798 template<
typename BasicJsonType>
4799 void to_json(BasicJsonType& j,
typename BasicJsonType::string_t&& s)
4804 template<
typename BasicJsonType,
typename FloatType,
4805 enable_if_t<std::is_floating_point<FloatType>::value,
int> = 0>
4806 void to_json(BasicJsonType& j, FloatType val)
noexcept
4811 template<
typename BasicJsonType,
typename CompatibleNumberUnsignedType,
4812 enable_if_t<is_compatible_integer_type<
typename BasicJsonType::number_unsigned_t, CompatibleNumberUnsignedType>::value,
int> = 0>
4813 void to_json(BasicJsonType& j, CompatibleNumberUnsignedType val)
noexcept
4818 template<
typename BasicJsonType,
typename CompatibleNumberIntegerType,
4819 enable_if_t<is_compatible_integer_type<
typename BasicJsonType::number_integer_t, CompatibleNumberIntegerType>::value,
int> = 0>
4820 void to_json(BasicJsonType& j, CompatibleNumberIntegerType val)
noexcept
4825 template<
typename BasicJsonType,
typename EnumType,
4826 enable_if_t<std::is_enum<EnumType>::value,
int> = 0>
4827 void to_json(BasicJsonType& j, EnumType e)
noexcept
4833 template<
typename BasicJsonType>
4834 void to_json(BasicJsonType& j,
const std::vector<
bool>& e)
4839 template <
typename BasicJsonType,
typename CompatibleArrayType,
4840 enable_if_t < is_compatible_array_type<BasicJsonType,
4841 CompatibleArrayType>::value &&
4842 !is_compatible_object_type<BasicJsonType, CompatibleArrayType>::value &&
4843 !is_compatible_string_type<BasicJsonType, CompatibleArrayType>::value &&
4844 !std::is_same<
typename BasicJsonType::binary_t, CompatibleArrayType>::value &&
4845 !is_basic_json<CompatibleArrayType>::value,
4847 void to_json(BasicJsonType& j,
const CompatibleArrayType& arr)
4852 template<
typename BasicJsonType>
4853 void to_json(BasicJsonType& j,
const typename BasicJsonType::binary_t& bin)
4858 template<
typename BasicJsonType,
typename T,
4859 enable_if_t<std::is_convertible<T, BasicJsonType>::value,
int> = 0>
4860 void to_json(BasicJsonType& j,
const std::valarray<T>& arr)
4865 template<
typename BasicJsonType>
4866 void to_json(BasicJsonType& j,
typename BasicJsonType::array_t&& arr)
4871 template <
typename BasicJsonType,
typename CompatibleObjectType,
4872 enable_if_t < is_compatible_object_type<BasicJsonType, CompatibleObjectType>::value && !is_basic_json<CompatibleObjectType>::value,
int > = 0 >
4873 void to_json(BasicJsonType& j,
const CompatibleObjectType& obj)
4878 template<
typename BasicJsonType>
4879 void to_json(BasicJsonType& j,
typename BasicJsonType::object_t&& obj)
4885 typename BasicJsonType,
typename T,
std::size_t N,
4886 enable_if_t < !std::is_constructible<
typename BasicJsonType::string_t,
4887 const T(&)[N]>::value,
4889 void to_json(BasicJsonType& j,
const T(&arr)[N])
4894 template <
typename BasicJsonType,
typename T1,
typename T2, enable_if_t < std::is_constructible<BasicJsonType, T1>::value&& std::is_constructible<BasicJsonType, T2>::value,
int > = 0 >
4895 void to_json(BasicJsonType& j,
const std::pair<T1, T2>& p)
4901 template<
typename BasicJsonType,
typename T,
4902 enable_if_t<std::is_same<T, iteration_proxy_value<
typename BasicJsonType::iterator>>::value,
int> = 0>
4903 void to_json(BasicJsonType& j,
const T& b)
4908 template<
typename BasicJsonType,
typename Tuple,
std::size_t... Idx>
4909 void to_json_tuple_impl(BasicJsonType& j,
const Tuple& t, index_sequence<Idx...> )
4914 template<
typename BasicJsonType,
typename T, enable_if_t<is_constructible_tuple<BasicJsonType, T>::value,
int > = 0>
4915 void to_json(BasicJsonType& j,
const T& t)
4922 template<
typename BasicJsonType,
typename T>
4923 auto operator()(BasicJsonType& j, T&& val)
const noexcept(
noexcept(to_json(j, std::forward<T>(val))))
4924 ->
decltype(to_json(j,
std::forward<T>(val)),
void())
4926 return to_json(j, std::forward<T>(val));
4948 template<
typename ValueType,
typename>
4949 struct adl_serializer
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962 template<
typename BasicJsonType,
typename TargetType = ValueType>
4963 static auto from_json(BasicJsonType&& j, TargetType& val)
noexcept(
4964 noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), val)))
4965 ->
decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), val),
void())
4967 ::nlohmann::from_json(std::forward<BasicJsonType>(j), val);
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982 template<
typename BasicJsonType,
typename TargetType = ValueType>
4984 noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {})))
4985 ->
decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {}))
4987 return ::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {});
4991
4992
4993
4994
4995
4996
4997
4998
4999 template<
typename BasicJsonType,
typename TargetType = ValueType>
5000 static auto to_json(BasicJsonType& j, TargetType&& val)
noexcept(
5001 noexcept(::nlohmann::to_json(j, std::forward<TargetType>(val))))
5002 ->
decltype(::nlohmann::to_json(j, std::forward<TargetType>(val)),
void())
5004 ::nlohmann::to_json(j, std::forward<TargetType>(val));
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032 template<
typename BinaryType>
5037 using container_type = BinaryType;
5039 using subtype_type =
std::uint64_t;
5073 return !(
rhs == *
this);
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5191#include <functional>
5206 seed ^= h + 0x9e3779b9 + (seed << 6U) + (seed >> 2U);
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221 template<
typename BasicJsonType>
5268 const auto h =
std::
hash<
bool>{}(
j.
template get<
bool>());
5340#include <type_traits>
5366
5367
5368
5372 using char_type =
char;
5386 std::char_traits<
char>::int_type get_character()
noexcept
5388 return std::fgetc(m_file);
5398
5399
5400
5401
5402
5403
5404
5405
5409 using char_type =
char;
5417 is->clear(is->rdstate() & std::ios::eofbit);
5421 explicit input_stream_adapter(
std::istream& i)
5422 : is(&i), sb(i.rdbuf())
5431 : is(rhs.is),
sb(rhs
.sb)
5440 std::char_traits<
char>::int_type get_character()
5442 auto res = sb->sbumpc();
5446 is->clear(is->rdstate() | std::ios::eofbit);
5460 template<
typename IteratorType>
5464 using char_type =
typename std::iterator_traits<IteratorType>::value_type;
5470 typename std::char_traits<char_type>::int_type get_character()
5483 IteratorType current;
5486 template<
typename BaseInputAdapter, size_t T>
5496 template<
typename BaseInputAdapter, size_t T>
5499 template<
typename BaseInputAdapter>
5503 static void fill_buffer(BaseInputAdapter& input,
5504 std::array<
std::char_traits<
char>::int_type, 4>& utf8_bytes,
5505 size_t& utf8_bytes_index,
5506 size_t& utf8_bytes_filled)
5526 else if (
wc <= 0x7FF)
5532 else if (
wc <= 0xFFFF)
5539 else if (
wc <= 0x10FFFF)
5557 template<
typename BaseInputAdapter>
5561 static void fill_buffer(BaseInputAdapter& input,
5562 std::array<
std::char_traits<
char>::int_type, 4>& utf8_bytes,
5563 size_t& utf8_bytes_index,
5564 size_t& utf8_bytes_filled)
5584 else if (
wc <= 0x7FF)
5590 else if (0xD800 >
wc ||
wc >= 0xE000)
5602 const auto charcode = 0x10000u + (((
static_cast<
unsigned int>(
wc) & 0x3FFu) << 10u) | (
wc2 & 0x3FFu));
5620 template<
typename BaseInputAdapter,
typename WideCharType>
5624 using char_type =
char;
5629 typename std::char_traits<
char>::int_type get_character()
noexcept
5647 BaseInputAdapter base_adapter;
5656 std::array<
std::char_traits<
char>::int_type, 4> utf8_bytes = { {0, 0, 0, 0} };
5665 template<
typename IteratorType,
typename Enable =
void>
5668 using iterator_type = IteratorType;
5669 using char_type =
typename std::iterator_traits<iterator_type>::value_type;
5672 static adapter_type
create(IteratorType first, IteratorType last)
5678 template<
typename T>
5681 using value_type =
typename std::iterator_traits<T>::value_type;
5684 value =
sizeof(value_type) > 1
5703 template<
typename IteratorType>
5704 typename iterator_input_adapter_factory<IteratorType>::adapter_type input_adapter(IteratorType first, IteratorType last)
5720 template<
typename ContainerType,
typename Enable =
void>
5737 template<
typename ContainerType>
5738 typename container_input_adapter_factory_impl::container_input_adapter_factory<ContainerType>::adapter_type input_adapter(
const ContainerType& container)
5764 template <
typename CharT,
5765 typename std::enable_if <
5766 std::is_pointer<CharT>::value &&
5767 !
std::is_array<CharT>::value&&
5768 std::is_integral<
typename std::remove_pointer<CharT>::type>::value &&
5769 sizeof(
typename std::remove_pointer<CharT>::type) == 1,
5771 contiguous_bytes_input_adapter input_adapter(CharT b)
5774 const auto*
ptr =
reinterpret_cast<
const char*>(
b);
5778 template<
typename T,
std::size_t N>
5779 auto input_adapter(T(&array)[N]) ->
decltype(input_adapter(array, array + N))
5787 class span_input_adapter
5790 template <
typename CharT,
5791 typename std::enable_if <
5792 std::is_pointer<CharT>::value&&
5793 std::is_integral<
typename std::remove_pointer<CharT>::type>::value &&
5794 sizeof(
typename std::remove_pointer<CharT>::type) == 1,
5796 span_input_adapter(CharT b,
std::size_t l)
5797 : ia(
reinterpret_cast<
const char*>(b),
reinterpret_cast<
const char*>(b) + l) {}
5799 template<
class IteratorType,
5800 typename std::enable_if<
5801 std::is_same<
typename iterator_traits<IteratorType>::iterator_category, std::random_access_iterator_tag>::value,
5803 span_input_adapter(IteratorType first, IteratorType last)
5804 : ia(input_adapter(first, last)) {}
5806 contiguous_bytes_input_adapter&& get()
5808 return std::move(ia);
5812 contiguous_bytes_input_adapter ia;
5834
5835
5836
5837
5838
5839
5840
5841 template<
typename BasicJsonType>
5844 using number_integer_t =
typename BasicJsonType::number_integer_t;
5845 using number_unsigned_t =
typename BasicJsonType::number_unsigned_t;
5846 using number_float_t =
typename BasicJsonType::number_float_t;
5847 using string_t =
typename BasicJsonType::string_t;
5848 using binary_t =
typename BasicJsonType::binary_t;
5851
5852
5853
5857
5858
5859
5860
5864
5865
5866
5867
5871
5872
5873
5874
5878
5879
5880
5881
5882
5886
5887
5888
5889
5890
5894
5895
5896
5897
5898
5902
5903
5904
5905
5906
5910
5911
5912
5913
5914
5915 virtual bool key(string_t& val) = 0;
5918
5919
5920
5924
5925
5926
5927
5928
5932
5933
5934
5938
5939
5940
5941
5942
5943
5944 virtual bool parse_error(
std::size_t position,
5945 const std::string& last_token,
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972 template<
typename BasicJsonType>
5976 using number_integer_t =
typename BasicJsonType::number_integer_t;
5977 using number_unsigned_t =
typename BasicJsonType::number_unsigned_t;
5978 using number_float_t =
typename BasicJsonType::number_float_t;
5979 using string_t =
typename BasicJsonType::string_t;
5980 using binary_t =
typename BasicJsonType::binary_t;
5983
5984
5985
5986
6085 template<
class Exception>
6086 bool parse_error(
std::size_t ,
const std::string& ,
6087 const Exception& ex)
6090 static_cast<
void>(
ex);
6105
6106
6107
6108
6109
6110 template<
typename Value>
6146 template<
typename BasicJsonType>
6150 using number_integer_t =
typename BasicJsonType::number_integer_t;
6151 using number_unsigned_t =
typename BasicJsonType::number_unsigned_t;
6152 using number_float_t =
typename BasicJsonType::number_float_t;
6153 using string_t =
typename BasicJsonType::string_t;
6154 using binary_t =
typename BasicJsonType::binary_t;
6155 using parser_callback_t =
typename BasicJsonType::parser_callback_t;
6156 using parse_event_t =
typename BasicJsonType::parse_event_t;
6159 const parser_callback_t cb,
6160 const bool allow_exceptions_ =
true)
6335 template<
class Exception>
6336 bool parse_error(
std::size_t ,
const std::string& ,
6337 const Exception& ex)
6340 static_cast<
void>(
ex);
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369 template<
typename Value>
6370 std::pair<
bool, BasicJsonType*> handle_value(Value&& v,
const bool skip_callback =
false)
6378 return {
false,
nullptr };
6390 return {
false,
nullptr };
6396 return {
true, &
root };
6403 return {
false,
nullptr };
6425 return {
false,
nullptr };
6450 BasicJsonType
discarded = BasicJsonType::value_t::discarded;
6453 template<
typename BasicJsonType>
6457 using number_integer_t =
typename BasicJsonType::number_integer_t;
6458 using number_unsigned_t =
typename BasicJsonType::number_unsigned_t;
6459 using number_float_t =
typename BasicJsonType::number_float_t;
6460 using string_t =
typename BasicJsonType::string_t;
6461 using binary_t =
typename BasicJsonType::binary_t;
6540#include <initializer_list>
6560 template<
typename BasicJsonType>
6594 return "<uninitialized>";
6596 return "true literal";
6598 return "false literal";
6600 return "null literal";
6602 return "string literal";
6606 return "number literal";
6620 return "<parse error>";
6622 return "end of input";
6624 return "'[', '{', or a literal";
6627 return "unknown token";
6633
6634
6635
6636
6637 template<
typename BasicJsonType,
typename InputAdapterType>
6640 using number_integer_t =
typename BasicJsonType::number_integer_t;
6641 using number_unsigned_t =
typename BasicJsonType::number_unsigned_t;
6642 using number_float_t =
typename BasicJsonType::number_float_t;
6643 using string_t =
typename BasicJsonType::string_t;
6644 using char_type =
typename InputAdapterType::char_type;
6645 using char_int_type =
typename std::char_traits<char_type>::int_type;
6648 using token_type =
typename lexer_base<BasicJsonType>::token_type;
6650 explicit lexer(InputAdapterType&& adapter,
bool ignore_comments_ =
false)
noexcept
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6702 const auto factors = { 12u, 8u, 4u, 0u };
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744 bool next_byte_in_range(
std::initializer_list<char_int_type> ranges)
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6853 error_message =
"invalid string: '\\u' must be followed by 4 hex digits";
6867 error_message =
"invalid string: '\\u' must be followed by 4 hex digits";
6877 (
static_cast<
unsigned int>(
codepoint1) << 10u)
6887 error_message =
"invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF";
6893 error_message =
"invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF";
6901 error_message =
"invalid string: surrogate U+DC00..U+DFFF must follow U+D800..U+DBFF";
6942 error_message =
"invalid string: forbidden character after backslash";
6952 error_message =
"invalid string: control character U+0000 (NUL) must be escaped to \\u0000";
6958 error_message =
"invalid string: control character U+0001 (SOH) must be escaped to \\u0001";
6964 error_message =
"invalid string: control character U+0002 (STX) must be escaped to \\u0002";
6970 error_message =
"invalid string: control character U+0003 (ETX) must be escaped to \\u0003";
6976 error_message =
"invalid string: control character U+0004 (EOT) must be escaped to \\u0004";
6982 error_message =
"invalid string: control character U+0005 (ENQ) must be escaped to \\u0005";
6988 error_message =
"invalid string: control character U+0006 (ACK) must be escaped to \\u0006";
6994 error_message =
"invalid string: control character U+0007 (BEL) must be escaped to \\u0007";
7000 error_message =
"invalid string: control character U+0008 (BS) must be escaped to \\u0008 or \\b";
7006 error_message =
"invalid string: control character U+0009 (HT) must be escaped to \\u0009 or \\t";
7012 error_message =
"invalid string: control character U+000A (LF) must be escaped to \\u000A or \\n";
7018 error_message =
"invalid string: control character U+000B (VT) must be escaped to \\u000B";
7024 error_message =
"invalid string: control character U+000C (FF) must be escaped to \\u000C or \\f";
7030 error_message =
"invalid string: control character U+000D (CR) must be escaped to \\u000D or \\r";
7036 error_message =
"invalid string: control character U+000E (SO) must be escaped to \\u000E";
7042 error_message =
"invalid string: control character U+000F (SI) must be escaped to \\u000F";
7048 error_message =
"invalid string: control character U+0010 (DLE) must be escaped to \\u0010";
7054 error_message =
"invalid string: control character U+0011 (DC1) must be escaped to \\u0011";
7060 error_message =
"invalid string: control character U+0012 (DC2) must be escaped to \\u0012";
7066 error_message =
"invalid string: control character U+0013 (DC3) must be escaped to \\u0013";
7072 error_message =
"invalid string: control character U+0014 (DC4) must be escaped to \\u0014";
7078 error_message =
"invalid string: control character U+0015 (NAK) must be escaped to \\u0015";
7084 error_message =
"invalid string: control character U+0016 (SYN) must be escaped to \\u0016";
7090 error_message =
"invalid string: control character U+0017 (ETB) must be escaped to \\u0017";
7096 error_message =
"invalid string: control character U+0018 (CAN) must be escaped to \\u0018";
7102 error_message =
"invalid string: control character U+0019 (EM) must be escaped to \\u0019";
7108 error_message =
"invalid string: control character U+001A (SUB) must be escaped to \\u001A";
7114 error_message =
"invalid string: control character U+001B (ESC) must be escaped to \\u001B";
7120 error_message =
"invalid string: control character U+001C (FS) must be escaped to \\u001C";
7126 error_message =
"invalid string: control character U+001D (GS) must be escaped to \\u001D";
7132 error_message =
"invalid string: control character U+001E (RS) must be escaped to \\u001E";
7138 error_message =
"invalid string: control character U+001F (US) must be escaped to \\u001F";
7368
7369
7370
7432 error_message =
"invalid comment; expecting '/' or '*' after '/'";
7439 static void strtof(
float& f,
const char* str,
char** endptr)
noexcept
7445 static void strtof(
double& f,
const char* str,
char** endptr)
noexcept
7451 static void strtof(
long double& f,
const char* str,
char** endptr)
noexcept
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7715 "invalid number; expected '+', '-', or digit after exponent";
7741 error_message =
"invalid number; expected digit after exponent sign";
7822
7823
7824
7825
7828 token_type return_type)
7855
7856
7857
7858
7859
7860
7861
7862
7863
7894
7895
7896
7897
7898
7899
7900
7928 void add(char_int_type c)
7981 if (
static_cast<
unsigned char>(
c) <=
'\x1F')
8010
8011
8012
8018 return get() == 0xBB &&
get() == 0xBF;
8040 error_message =
"invalid BOM; must be 0xEF 0xBB 0xBF if given";
8177 template<
typename T>
8178 using null_function_t =
decltype(
std::declval<T&>().null());
8180 template<
typename T>
8184 template<
typename T,
typename Integer>
8185 using number_integer_function_t =
8186 decltype(
std::declval<T&>().number_integer(
std::declval<Integer>()));
8188 template<
typename T,
typename Unsigned>
8189 using number_unsigned_function_t =
8190 decltype(
std::declval<T&>().number_unsigned(
std::declval<Unsigned>()));
8192 template<
typename T,
typename Float,
typename String>
8193 using number_float_function_t =
decltype(
std::declval<T&>().number_float(
8194 std::declval<Float>(),
std::declval<
const String&>()));
8196 template<
typename T,
typename String>
8197 using string_function_t =
8198 decltype(
std::declval<T&>().string(
std::declval<String&>()));
8200 template<
typename T,
typename Binary>
8201 using binary_function_t =
8202 decltype(
std::declval<T&>().binary(
std::declval<Binary&>()));
8204 template<
typename T>
8208 template<
typename T,
typename String>
8209 using key_function_t =
8210 decltype(
std::declval<T&>().key(
std::declval<String&>()));
8212 template<
typename T>
8213 using end_object_function_t =
decltype(
std::declval<T&>().end_object());
8215 template<
typename T>
8219 template<
typename T>
8220 using end_array_function_t =
decltype(
std::declval<T&>().end_array());
8227 template<
typename SAX,
typename BasicJsonType>
8232 "BasicJsonType must be of type basic_json<...>");
8234 using number_integer_t =
typename BasicJsonType::number_integer_t;
8235 using number_unsigned_t =
typename BasicJsonType::number_unsigned_t;
8236 using number_float_t =
typename BasicJsonType::number_float_t;
8237 using string_t =
typename BasicJsonType::string_t;
8238 using binary_t =
typename BasicJsonType::binary_t;
8239 using exception_t =
typename BasicJsonType::exception;
8258 template<
typename SAX,
typename BasicJsonType>
8263 "BasicJsonType must be of type basic_json<...>");
8265 using number_integer_t =
typename BasicJsonType::number_integer_t;
8266 using number_unsigned_t =
typename BasicJsonType::number_unsigned_t;
8267 using number_float_t =
typename BasicJsonType::number_float_t;
8268 using string_t =
typename BasicJsonType::string_t;
8269 using binary_t =
typename BasicJsonType::binary_t;
8270 using exception_t =
typename BasicJsonType::exception;
8274 "Missing/invalid function: bool null()");
8276 "Missing/invalid function: bool boolean(bool)");
8278 "Missing/invalid function: bool boolean(bool)");
8282 "Missing/invalid function: bool number_integer(number_integer_t)");
8286 "Missing/invalid function: bool number_unsigned(number_unsigned_t)");
8289 "Missing/invalid function: bool number_float(number_float_t, const string_t&)");
8292 "Missing/invalid function: bool string(string_t&)");
8295 "Missing/invalid function: bool binary(binary_t&)");
8297 "Missing/invalid function: bool start_object(std::size_t)");
8299 "Missing/invalid function: bool key(string_t&)");
8301 "Missing/invalid function: bool end_object()");
8303 "Missing/invalid function: bool start_array(std::size_t)");
8305 "Missing/invalid function: bool end_array()");
8308 "Missing/invalid function: bool parse_error(std::size_t, const "
8309 "std::string&, const exception&)");
8333
8334
8335
8336
8337
8338
8341 return *
reinterpret_cast<
char*>(&num) == 1;
8350
8351
8352 template<
typename BasicJsonType,
typename InputAdapterType,
typename SAX =
json_sax_dom_parser<BasicJsonType>>
8355 using number_integer_t =
typename BasicJsonType::number_integer_t;
8356 using number_unsigned_t =
typename BasicJsonType::number_unsigned_t;
8357 using number_float_t =
typename BasicJsonType::number_float_t;
8358 using string_t =
typename BasicJsonType::string_t;
8359 using binary_t =
typename BasicJsonType::binary_t;
8360 using json_sax_t = SAX;
8361 using char_type =
typename InputAdapterType::char_type;
8362 using char_int_type =
typename std::char_traits<char_type>::int_type;
8366
8367
8368
8369
8383
8384
8385
8386
8387
8388
8389
8393 const bool strict =
true,
8450
8451
8452
8472
8473
8474
8475
8476
8477
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507 template<
typename NumberType>
8520
8521
8522
8523
8524
8525
8526
8527
8528 template<
typename NumberType>
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555 bool parse_bson_element_internal(
const char_int_type element_type,
8556 const std::size_t element_type_parse_position)
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8668
8669
8670
8694
8695
8696
8697
8698
8699
8700
9134 const auto half =
static_cast<
unsigned int>((
byte1 << 8u) +
byte2);
9137 const int exp = (
half >> 10u) & 0x1Fu;
9138 const unsigned int mant =
half & 0x3FFu;
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9253 while (
get() != 0xFF)
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9352 while (
get() != 0xFF)
9373
9374
9375
9376
9377
9398 while (
get() != 0xFF)
9411
9412
9413
9414
9415
9446 while (
get() != 0xFF)
9470
9471
9843
9844
9845
9846
9847
9848
9849
9850
9851
9925
9926
9927
9928
9929
9930
9931
9932
9933
10042
10043
10044
10064
10065
10066
10098
10099
10100
10101
10102
10103
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10169 return sax->
parse_error(
chars_read,
last_token,
parse_error::
create(113,
chars_read,
exception_message(
input_format_t::
ubjson,
"expected length type specification (U, i, I, l, L); last byte: 0x" +
last_token,
"string"),
BasicJsonType()));
10174
10175
10176
10239 return sax->
parse_error(
chars_read,
last_token,
parse_error::
create(113,
chars_read,
exception_message(
input_format_t::
ubjson,
"expected length type specification (U, i, I, l, L) after '#'; last byte: 0x" +
last_token,
"size"),
BasicJsonType()));
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254 bool get_ubjson_size_type(
std::pair<
std::size_t, char_int_type>& result)
10292
10293
10294
10295 bool get_ubjson_value(
const char_int_type prefix)
10394
10395
10456
10457
10601
10602
10603
10604
10605
10606
10607
10608
10616
10617
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641 template<
typename NumberType,
bool InputIsLittleEndian =
false>
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684 template<
typename NumberType>
10686 const NumberType len,
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717 template<
typename NumberType>
10719 const NumberType len,
10737
10738
10739
10740
10753
10754
10763
10764
10765
10766
10767
10769 const std::string& detail,
10770 const std::string& context)
const
10828#include <functional>
10872 template<
typename BasicJsonType>
10873 using parser_callback_t =
10877
10878
10879
10880
10881 template<
typename BasicJsonType,
typename InputAdapterType>
10884 using number_integer_t =
typename BasicJsonType::number_integer_t;
10885 using number_unsigned_t =
typename BasicJsonType::number_unsigned_t;
10886 using number_float_t =
typename BasicJsonType::number_float_t;
10887 using string_t =
typename BasicJsonType::string_t;
10888 using lexer_t =
lexer<BasicJsonType, InputAdapterType>;
10889 using token_type =
typename lexer_t::token_type;
10893 explicit parser(InputAdapterType&& adapter,
10894 const parser_callback_t<BasicJsonType> cb =
nullptr,
10895 const bool allow_exceptions_ =
true,
10896 const bool skip_comments =
false)
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915 void parse(
const bool strict, BasicJsonType& result)
10970
10971
10972
10973
10974
10981 template<
typename SAX>
11000 template<
typename SAX>
11288 std::string exception_message(
const token_type expected,
const std::string& context)
11348
11349
11350
11351
11352
11353
11354
11355
11359 using difference_type =
std::ptrdiff_t;
11365 difference_type m_it = (
std::numeric_limits<
std::ptrdiff_t>::min)();
11399 return lhs.m_it == rhs.m_it;
11404 return lhs.m_it < rhs.m_it;
11409 auto result = *
this;
11416 return lhs.m_it - rhs.m_it;
11427 auto result = *
this;
11440 auto result = *
this;
11466
11467
11468
11469
11470
11487#include <type_traits>
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528 template<
typename BasicJsonType>
11532 using other_iter_impl =
iter_impl<
typename std::conditional<
std::is_const<BasicJsonType>::value,
typename std::remove_const<BasicJsonType>::type,
const BasicJsonType>::type>;
11534 friend other_iter_impl;
11535 friend BasicJsonType;
11539 using object_t =
typename BasicJsonType::object_t;
11540 using array_t =
typename BasicJsonType::array_t;
11542 static_assert(
is_basic_json<
typename std::remove_const<BasicJsonType>::type>::value,
11543 "iter_impl only accepts (const) basic_json");
11552 using iterator_category =
std::bidirectional_iterator_tag;
11555 using value_type =
typename BasicJsonType::value_type;
11557 using difference_type =
typename BasicJsonType::difference_type;
11559 using pointer =
typename std::conditional<
std::is_const<BasicJsonType>::value,
11560 typename BasicJsonType::const_pointer,
11561 typename BasicJsonType::pointer>::type;
11564 typename std::conditional<
std::is_const<BasicJsonType>::value,
11565 typename BasicJsonType::const_reference,
11566 typename BasicJsonType::reference>::type;
11574
11575
11576
11577
11578
11614
11615
11616
11617
11618
11619
11620
11623
11624
11625
11626
11627
11628
11634
11635
11636
11637
11638
11641 if (&
other !=
this)
11650
11651
11652
11653
11654 iter_impl(
const iter_impl<
typename std::remove_const<BasicJsonType>::type>& other)
noexcept
11659
11660
11661
11662
11663
11673
11674
11675
11676 void set_begin()
noexcept
11717
11718
11719
11756
11757
11758
11800
11801
11802
11842
11843
11844
11853
11854
11855
11893
11894
11895
11904
11905
11906
11944
11945
11946
11980
11981
11982
11990
11991
11992
12025
12026
12027
12034
12035
12036
12043
12044
12045
12052
12053
12054
12089
12090
12091
12098
12099
12100
12109
12110
12111
12120
12121
12122
12131
12132
12133
12160
12161
12162
12198
12199
12200
12214
12215
12216
12224 pointer m_object =
nullptr;
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266 template<
typename Base>
12270 using difference_type =
std::ptrdiff_t;
12272 using base_iterator =
std::reverse_iterator<Base>;
12274 using reference =
typename Base::reference;
12277 explicit json_reverse_iterator(
const typename base_iterator::iterator_type& it)
noexcept
12338 auto key()
const ->
decltype(
std::declval<Base>().key())
12340 auto it = --
this->
base();
12347 auto it = --
this->
base();
12359#include <algorithm>
12378 template<
typename BasicJsonType>
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407 explicit json_pointer(
const std::string& s =
"")
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653 void push_back(
const std::string& token)
12659 void push_back(
std::string&& token)
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678 bool empty()
const noexcept
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694 static typename BasicJsonType::size_type array_index(
const std::string& s)
12711 unsigned long long res = 0;
12752
12753
12754
12755
12756
12757
12758
12759 BasicJsonType& get_and_create(BasicJsonType& j)
const
12799
12800
12801
12802
12803
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838 BasicJsonType& get_unchecked(BasicJsonType* ptr)
const
12848 [](
const unsigned char x)
12900
12901
12902
12903
12904
12905 BasicJsonType& get_checked(BasicJsonType* ptr)
const
12925 ") is out of range", *
ptr));
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962 const BasicJsonType& get_unchecked(
const BasicJsonType* ptr)
const
13005
13006
13007
13008
13009
13010 const BasicJsonType& get_checked(
const BasicJsonType* ptr)
const
13030 ") is out of range", *
ptr));
13055
13056
13057
13058 bool contains(
const BasicJsonType* ptr)
const
13138
13139
13140
13141
13142
13143
13144
13145
13146 static std::vector<std::string> split(
const std::string& reference_string)
13208
13209
13210
13211
13212
13213
13214 static void flatten(
const std::string& reference_string,
13215 const BasicJsonType& value,
13216 BasicJsonType& result)
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284 static BasicJsonType
13285 unflatten(
const BasicJsonType& value)
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13347 std::vector<std::string> reference_tokens;
13354#include <initializer_list>
13364 template<
typename BasicJsonType>
13368 using value_type = BasicJsonType;
13384 enable_if_t<std::is_constructible<value_type, Args...>::value,
int> = 0 >
13385 json_ref(Args && ... args)
13433#include <algorithm>
13449#include <algorithm>
13483 template<
typename CharType>
13487 template<
typename CharType>
13491 explicit output_vector_adapter(std::vector<CharType>& vec)
noexcept
13512 template<
typename CharType>
13596
13597
13598 template<
typename BasicJsonType,
typename CharType>
13601 using string_t =
typename BasicJsonType::string_t;
13602 using binary_t =
typename BasicJsonType::binary_t;
13603 using number_float_t =
typename BasicJsonType::number_float_t;
13607
13608
13609
13610
13617
13618
13619
13647
13648
13971
13972
14293
14294
14295
14296
14297
14299 const bool use_type,
const bool add_prefix =
true)
14503
14504
14505
14512 static_cast<
void>(
j);
14519
14520
14522 const std::uint8_t element_type)
14531
14532
14541
14542
14544 const double value)
14551
14552
14559
14560
14562 const string_t& value)
14573
14574
14581
14582
14591
14592
14594 const std::int64_t value)
14609
14610
14613 return (value <=
static_cast<
std::uint64_t>((
std::numeric_limits<
std::int32_t>::max)()))
14614 ?
sizeof(
std::int32_t)
14615 :
sizeof(
std::int64_t);
14619
14620
14622 const BasicJsonType& j)
14641
14642
14644 const typename BasicJsonType::object_t& value)
14651
14652
14666
14667
14674
14675
14677 const typename BasicJsonType::array_t& value)
14693
14694
14696 const binary_t& value)
14707
14708
14709
14711 const BasicJsonType& j)
14753
14754
14755
14756
14757
14759 const BasicJsonType& j)
14800
14801
14802
14803
14804
14817
14818
14819
14838 return to_char_type(0xFA);
14843 return to_char_type(0xFB);
14852 return to_char_type(0xCA);
14857 return to_char_type(0xCB);
14865 template<
typename NumberType,
typename std::enable_if<
14866 std::is_floating_point<NumberType>::value,
int>::type = 0>
14867 void write_number_with_ubjson_prefix(
const NumberType n,
14868 const bool add_prefix)
14878 template<
typename NumberType,
typename std::enable_if<
14879 std::is_unsigned<NumberType>::value,
int>::type = 0>
14880 void write_number_with_ubjson_prefix(
const NumberType n,
14881 const bool add_prefix)
14940 template <
typename NumberType,
typename std::enable_if <
14941 std::is_signed<NumberType>::value &&
14942 !
std::is_floating_point<NumberType>::value,
int >::type = 0 >
14943 void write_number_with_ubjson_prefix(
const NumberType n,
14944 const bool add_prefix)
15005
15006
15007 CharType ubjson_prefix(
const BasicJsonType& j)
const noexcept
15088 static constexpr CharType get_ubjson_float_prefix(
float )
15093 static constexpr CharType get_ubjson_float_prefix(
double )
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113 template<
typename NumberType,
bool OutputIsLittleEndian =
false>
15114 void write_number(
const NumberType n)
15133#pragma GCC diagnostic push
15134#pragma GCC diagnostic ignored "-Wfloat-equal"
15138 static_cast<
double>(
static_cast<
float>(
n)) ==
static_cast<
double>(
n))
15153#pragma GCC diagnostic pop
15162 template <
typename C = CharType,
15163 enable_if_t < std::is_signed<C>::value&& std::is_signed<
char>::value >* =
nullptr >
15164 static constexpr CharType to_char_type(
std::uint8_t x)
noexcept
15166 return *
reinterpret_cast<
char*>(&x);
15169 template <
typename C = CharType,
15170 enable_if_t < std::is_signed<C>::value&& std::is_unsigned<
char>::value >* =
nullptr >
15171 static CharType to_char_type(
std::uint8_t x)
noexcept
15173 static_assert(
sizeof(
std::
uint8_t) ==
sizeof(
CharType),
"size of CharType must be equal to std::uint8_t");
15180 template<
typename C = CharType,
15181 enable_if_t<std::is_unsigned<C>::value>* =
nullptr>
15182 static constexpr CharType to_char_type(
std::uint8_t x)
noexcept
15187 template <
typename InputCharType,
typename C = CharType,
15189 std::is_signed<C>::value&&
15190 std::is_signed<
char>::value&&
15191 std::is_same<
char,
typename std::remove_cv<InputCharType>::type>::value
15193 static constexpr CharType to_char_type(InputCharType x)
noexcept
15213#include <algorithm>
15222#include <type_traits>
15233#include <type_traits>
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15265 template<
typename Target,
typename Source>
15268 static_assert(
sizeof(
Target) ==
sizeof(
Source),
"size mismatch");
15285
15286
15287
15297
15298
15299
15302 static_assert(
kPrecision == 64,
"internal error");
15327 const std::uint64_t u_lo = x
.f & 0xFFFFFFFFu;
15328 const std::uint64_t u_hi = x
.f >> 32u;
15329 const std::uint64_t v_lo = y
.f & 0xFFFFFFFFu;
15330 const std::uint64_t v_hi = y
.f >> 32u;
15332 const std::uint64_t p0 = u_lo * v_lo;
15333 const std::uint64_t p1 = u_lo * v_hi;
15334 const std::uint64_t p2 = u_hi * v_lo;
15335 const std::uint64_t p3 = u_hi * v_hi;
15337 const std::uint64_t p0_hi = p0 >> 32u;
15338 const std::uint64_t p1_lo = p1 & 0xFFFFFFFFu;
15339 const std::uint64_t p1_hi = p1 >> 32u;
15340 const std::uint64_t p2_lo = p2 & 0xFFFFFFFFu;
15341 const std::uint64_t p2_hi = p2 >> 32u;
15343 std::uint64_t Q = p0_hi + p1_lo + p2_lo;
15354 Q +=
std::uint64_t{ 1 } << (64u - 32u - 1u);
15356 const std::uint64_t h = p3 + p2_hi + p1_hi + (Q >> 32u);
15358 return { h
, x
.e + y
.e + 64
};
15362
15363
15364
15369 while ((x
.f >> 63u) == 0)
15379
15380
15381
15384 const int delta = x
.e - target_exponent;
15389 return { x
.f << delta
, target_exponent
};
15401
15402
15403
15404
15405
15406 template<
typename FloatType>
15420 "internal error: dtoa_short requires an IEEE-754 floating-point implementation");
15540
15541
15542
15543
15544
15545
15598 constexpr int kCachedPowersMinDecExp = -300;
15599 constexpr int kCachedPowersDecStep = 8;
15604 { 0xAB70FE17C79AC6CA, -1060, -300 },
15605 { 0xFF77B1FCBEBCDC4F, -1034, -292 },
15606 { 0xBE5691EF416BD60C, -1007, -284 },
15607 { 0x8DD01FAD907FFC3C, -980, -276 },
15608 { 0xD3515C2831559A83, -954, -268 },
15609 { 0x9D71AC8FADA6C9B5, -927, -260 },
15610 { 0xEA9C227723EE8BCB, -901, -252 },
15611 { 0xAECC49914078536D, -874, -244 },
15612 { 0x823C12795DB6CE57, -847, -236 },
15613 { 0xC21094364DFB5637, -821, -228 },
15614 { 0x9096EA6F3848984F, -794, -220 },
15615 { 0xD77485CB25823AC7, -768, -212 },
15616 { 0xA086CFCD97BF97F4, -741, -204 },
15617 { 0xEF340A98172AACE5, -715, -196 },
15618 { 0xB23867FB2A35B28E, -688, -188 },
15619 { 0x84C8D4DFD2C63F3B, -661, -180 },
15620 { 0xC5DD44271AD3CDBA, -635, -172 },
15621 { 0x936B9FCEBB25C996, -608, -164 },
15622 { 0xDBAC6C247D62A584, -582, -156 },
15623 { 0xA3AB66580D5FDAF6, -555, -148 },
15624 { 0xF3E2F893DEC3F126, -529, -140 },
15625 { 0xB5B5ADA8AAFF80B8, -502, -132 },
15626 { 0x87625F056C7C4A8B, -475, -124 },
15627 { 0xC9BCFF6034C13053, -449, -116 },
15628 { 0x964E858C91BA2655, -422, -108 },
15629 { 0xDFF9772470297EBD, -396, -100 },
15630 { 0xA6DFBD9FB8E5B88F, -369, -92 },
15631 { 0xF8A95FCF88747D94, -343, -84 },
15632 { 0xB94470938FA89BCF, -316, -76 },
15633 { 0x8A08F0F8BF0F156B, -289, -68 },
15634 { 0xCDB02555653131B6, -263, -60 },
15635 { 0x993FE2C6D07B7FAC, -236, -52 },
15636 { 0xE45C10C42A2B3B06, -210, -44 },
15637 { 0xAA242499697392D3, -183, -36 },
15638 { 0xFD87B5F28300CA0E, -157, -28 },
15639 { 0xBCE5086492111AEB, -130, -20 },
15640 { 0x8CBCCC096F5088CC, -103, -12 },
15641 { 0xD1B71758E219652C, -77, -4 },
15642 { 0x9C40000000000000, -50, 4 },
15643 { 0xE8D4A51000000000, -24, 12 },
15644 { 0xAD78EBC5AC620000, 3, 20 },
15645 { 0x813F3978F8940984, 30, 28 },
15646 { 0xC097CE7BC90715B3, 56, 36 },
15647 { 0x8F7E32CE7BEA5C70, 83, 44 },
15648 { 0xD5D238A4ABE98068, 109, 52 },
15649 { 0x9F4F2726179A2245, 136, 60 },
15650 { 0xED63A231D4C4FB27, 162, 68 },
15651 { 0xB0DE65388CC8ADA8, 189, 76 },
15652 { 0x83C7088E1AAB65DB, 216, 84 },
15653 { 0xC45D1DF942711D9A, 242, 92 },
15654 { 0x924D692CA61BE758, 269, 100 },
15655 { 0xDA01EE641A708DEA, 295, 108 },
15656 { 0xA26DA3999AEF774A, 322, 116 },
15657 { 0xF209787BB47D6B85, 348, 124 },
15658 { 0xB454E4A179DD1877, 375, 132 },
15659 { 0x865B86925B9BC5C2, 402, 140 },
15660 { 0xC83553C5C8965D3D, 428, 148 },
15661 { 0x952AB45CFA97A0B3, 455, 156 },
15662 { 0xDE469FBD99A05FE3, 481, 164 },
15663 { 0xA59BC234DB398C25, 508, 172 },
15664 { 0xF6C69A72A3989F5C, 534, 180 },
15665 { 0xB7DCBF5354E9BECE, 561, 188 },
15666 { 0x88FCF317F22241E2, 588, 196 },
15667 { 0xCC20CE9BD35C78A5, 614, 204 },
15668 { 0x98165AF37B2153DF, 641, 212 },
15669 { 0xE2A0B5DC971F303A, 667, 220 },
15670 { 0xA8D9D1535CE3B396, 694, 228 },
15671 { 0xFB9B7CD9A4A7443C, 720, 236 },
15672 { 0xBB764C4CA7A44410, 747, 244 },
15673 { 0x8BAB8EEFB6409C1A, 774, 252 },
15674 { 0xD01FEF10A657842C, 800, 260 },
15675 { 0x9B10A4E5E9913129, 827, 268 },
15676 { 0xE7109BFBA19C0C9D, 853, 276 },
15677 { 0xAC2820D9623BF429, 880, 284 },
15678 { 0x80444B5E7AA7CF85, 907, 292 },
15679 { 0xBF21E44003ACDD2D, 933, 300 },
15680 { 0x8E679C2F5E44FF8F, 960, 308 },
15681 { 0xD433179D9C8CB841, 986, 316 },
15682 { 0x9E19DB92B4E31BA9, 1013, 324 },
15692 const int f =
kAlpha - e - 1;
15693 const int k = (f * 78913) / (1 << 18) +
static_cast<
int>(f > 0);
15695 const int index = (-kCachedPowersMinDecExp + k + (kCachedPowersDecStep - 1)) / kCachedPowersDecStep;
15697 JSON_ASSERT(
static_cast<std::size_t>(index) < kCachedPowers.size());
15699 const cached_power cached = kCachedPowers[
static_cast<std::size_t>(index)];
15707
15708
15709
15713 if (n >= 1000000000)
15715 pow10 = 1000000000;
15719 if (n >= 100000000)
15765 std::uint64_t rest,
std::uint64_t ten_k)
15792 && delta - rest >= ten_k
15793 && (rest + ten_k < dist || dist - rest > rest + ten_k - dist))
15802
15803
15804
15808 static_assert(
kAlpha >= -60,
"internal error");
15809 static_assert(
kGamma <= -32,
"internal error");
15838 auto p1 =
static_cast<
std::uint32_t>(M_plus
.f >> -one
.e);
15839 std::uint64_t p2 = M_plus
.f & (one
.f - 1);
15847 std::uint32_t pow10{};
15875 const std::uint32_t d = p1 / pow10;
15876 const std::uint32_t r = p1 % pow10;
15882 buffer[length++] =
static_cast<
char>(
'0' + d);
15901 const std::uint64_t rest = (
std::uint64_t{ p1 } << -one
.e) + p2;
15906 decimal_exponent += n;
15917 const std::uint64_t ten_n =
std::uint64_t{ pow10 } << -one
.e;
15981 const std::uint64_t d = p2 >> -one
.e;
15982 const std::uint64_t r = p2 & (one
.f - 1);
15989 buffer[length++] =
static_cast<
char>(
'0' + d);
16014 decimal_exponent -= m;
16022 const std::uint64_t ten_m = one
.f;
16041
16042
16043
16044
16046 inline void grisu2(
char* buf,
int& len,
int& decimal_exponent,
16094 decimal_exponent = -cached
.k;
16100
16101
16102
16103
16104 template<
typename FloatType>
16106 void grisu2(
char* buf,
int& len,
int& decimal_exponent, FloatType value)
16109 "internal error: not enough precision");
16140
16141
16142
16143
16161 auto k =
static_cast<
std::uint32_t>(e);
16167 *buf++ =
static_cast<
char>(
'0' + k);
16171 *buf++ =
static_cast<
char>(
'0' + k / 10);
16173 *buf++ =
static_cast<
char>(
'0' + k);
16177 *buf++ =
static_cast<
char>(
'0' + k / 100);
16179 *buf++ =
static_cast<
char>(
'0' + k / 10);
16181 *buf++ =
static_cast<
char>(
'0' + k);
16188
16189
16190
16191
16192
16193
16194
16195
16199 int min_exp,
int max_exp)
16205 const int n = len + decimal_exponent;
16211 if (k <= n && n <= max_exp)
16216 std::memset(buf + k,
'0',
static_cast<size_t>(n) -
static_cast<size_t>(k));
16220 return buf + (
static_cast<size_t>(n) + 2);
16223 if (0 < n && n <= max_exp)
16230 std::memmove(buf + (
static_cast<size_t>(n) + 1), buf + n,
static_cast<size_t>(k) -
static_cast<size_t>(n));
16232 return buf + (
static_cast<size_t>(k) + 1U);
16235 if (min_exp < n && n <= 0)
16240 std::memmove(buf + (2 +
static_cast<size_t>(-n)), buf,
static_cast<size_t>(k));
16243 std::memset(buf + 2,
'0',
static_cast<size_t>(-n));
16244 return buf + (2U +
static_cast<size_t>(-n) +
static_cast<size_t>(k));
16259 std::memmove(buf + 2, buf + 1,
static_cast<size_t>(k) - 1);
16261 buf += 1 +
static_cast<size_t>(k);
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280 template<
typename FloatType>
16283 char*
to_chars(
char* first,
const char* last, FloatType value)
16285 static_cast<
void>(
last);
16296#pragma GCC diagnostic push
16297#pragma GCC diagnostic ignored "-Wfloat-equal"
16308#pragma GCC diagnostic pop
16367 template<
typename BasicJsonType>
16370 using string_t =
typename BasicJsonType::string_t;
16371 using number_float_t =
typename BasicJsonType::number_float_t;
16372 using number_integer_t =
typename BasicJsonType::number_integer_t;
16373 using number_unsigned_t =
typename BasicJsonType::number_unsigned_t;
16374 using binary_char_t =
typename BasicJsonType::binary_t::value_type;
16380
16381
16382
16383
16384 serializer(output_adapter_t<
char> s,
const char ichar,
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16425 const bool pretty_print,
16426 const bool ensure_ascii,
16427 const unsigned int indent_step,
16428 const unsigned int current_indent = 0)
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16962
16963
16964
16965
16966
16967
16968
16969 inline unsigned int count_digits(number_unsigned_t x)
noexcept
16996
16997
16998
16999
17000
17001
17002
17003
17004 template <
typename NumberType, detail::enable_if_t <
17005 std::is_integral<NumberType>::value ||
17006 std::is_same<NumberType, number_unsigned_t>::value ||
17007 std::is_same<NumberType, number_integer_t>::value ||
17008 std::is_same<NumberType, binary_char_t>::value,
17010 void dump_integer(NumberType x)
17015 {{
'0',
'0'}}, {{
'0',
'1'}}, {{
'0',
'2'}}, {{
'0',
'3'}}, {{
'0',
'4'}}, {{
'0',
'5'}}, {{
'0',
'6'}}, {{
'0',
'7'}}, {{
'0',
'8'}}, {{
'0',
'9'}},
17016 {{
'1',
'0'}}, {{
'1',
'1'}}, {{
'1',
'2'}}, {{
'1',
'3'}}, {{
'1',
'4'}}, {{
'1',
'5'}}, {{
'1',
'6'}}, {{
'1',
'7'}}, {{
'1',
'8'}}, {{
'1',
'9'}},
17017 {{
'2',
'0'}}, {{
'2',
'1'}}, {{
'2',
'2'}}, {{
'2',
'3'}}, {{
'2',
'4'}}, {{
'2',
'5'}}, {{
'2',
'6'}}, {{
'2',
'7'}}, {{
'2',
'8'}}, {{
'2',
'9'}},
17018 {{
'3',
'0'}}, {{
'3',
'1'}}, {{
'3',
'2'}}, {{
'3',
'3'}}, {{
'3',
'4'}}, {{
'3',
'5'}}, {{
'3',
'6'}}, {{
'3',
'7'}}, {{
'3',
'8'}}, {{
'3',
'9'}},
17019 {{
'4',
'0'}}, {{
'4',
'1'}}, {{
'4',
'2'}}, {{
'4',
'3'}}, {{
'4',
'4'}}, {{
'4',
'5'}}, {{
'4',
'6'}}, {{
'4',
'7'}}, {{
'4',
'8'}}, {{
'4',
'9'}},
17020 {{
'5',
'0'}}, {{
'5',
'1'}}, {{
'5',
'2'}}, {{
'5',
'3'}}, {{
'5',
'4'}}, {{
'5',
'5'}}, {{
'5',
'6'}}, {{
'5',
'7'}}, {{
'5',
'8'}}, {{
'5',
'9'}},
17021 {{
'6',
'0'}}, {{
'6',
'1'}}, {{
'6',
'2'}}, {{
'6',
'3'}}, {{
'6',
'4'}}, {{
'6',
'5'}}, {{
'6',
'6'}}, {{
'6',
'7'}}, {{
'6',
'8'}}, {{
'6',
'9'}},
17022 {{
'7',
'0'}}, {{
'7',
'1'}}, {{
'7',
'2'}}, {{
'7',
'3'}}, {{
'7',
'4'}}, {{
'7',
'5'}}, {{
'7',
'6'}}, {{
'7',
'7'}}, {{
'7',
'8'}}, {{
'7',
'9'}},
17023 {{
'8',
'0'}}, {{
'8',
'1'}}, {{
'8',
'2'}}, {{
'8',
'3'}}, {{
'8',
'4'}}, {{
'8',
'5'}}, {{
'8',
'6'}}, {{
'8',
'7'}}, {{
'8',
'8'}}, {{
'8',
'9'}},
17024 {{
'9',
'0'}}, {{
'9',
'1'}}, {{
'9',
'2'}}, {{
'9',
'3'}}, {{
'9',
'4'}}, {{
'9',
'5'}}, {{
'9',
'6'}}, {{
'9',
'7'}}, {{
'9',
'8'}}, {{
'9',
'9'}},
17089
17090
17091
17092
17093
17094
17095
17096 void dump_float(number_float_t x)
17117 void dump_float(number_float_t x,
std::true_type )
17125 void dump_float(number_float_t x,
std::false_type )
17166 return c ==
'.' ||
c ==
'e';
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196 static std::uint8_t decode(
std::uint8_t& state,
std::uint32_t& codep,
const std::uint8_t byte)
noexcept
17201 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17202 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17203 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17204 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17205 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
17206 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
17207 8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
17208 0xA, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x4, 0x3, 0x3,
17209 0xB, 0x6, 0x6, 0x6, 0x5, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8,
17210 0x0, 0x1, 0x2, 0x3, 0x5, 0x8, 0x7, 0x1, 0x1, 0x1, 0x4, 0x6, 0x1, 0x1, 0x1, 0x1,
17211 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1,
17212 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
17213 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1,
17214 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
17232
17233
17234
17235
17236 number_unsigned_t remove_sign(number_unsigned_t x)
17243
17244
17245
17246
17247
17248
17249
17250
17251 inline number_unsigned_t remove_sign(number_integer_t x)
noexcept
17259 output_adapter_t<
char> o =
nullptr;
17292#include <functional>
17293#include <initializer_list>
17296#include <stdexcept>
17297#include <type_traits>
17309 template <
class Key,
class T,
class IgnoredLess =
std::less<Key>,
17310 class Allocator =
std::allocator<
std::pair<
const Key, T>>>
17311 struct ordered_map :
std::vector<
std::pair<
const Key, T>, Allocator>
17313 using key_type = Key;
17314 using mapped_type = T;
17315 using Container =
std::vector<
std::pair<
const Key, T>, Allocator>;
17316 using typename Container::iterator;
17317 using typename Container::const_iterator;
17318 using typename Container::size_type;
17319 using typename Container::value_type;
17323 ordered_map(
const Allocator& alloc = Allocator()) : Container{ alloc } {}
17324 template <
class It>
17325 ordered_map(It first, It last,
const Allocator& alloc = Allocator())
17326 : Container{ first, last, alloc } {}
17327 ordered_map(
std::initializer_list<T> init,
const Allocator& alloc = Allocator())
17328 : Container{ init, alloc } {}
17330 std::pair<iterator,
bool> emplace(
const key_type& key, T&& t)
17332 for (
auto it =
this->begin(); it !=
this->end(); ++it)
17334 if (it->first == key)
17336 return { it,
false };
17339 Container::emplace_back(key, t);
17340 return { --
this->end(),
true };
17343 T& operator[](
const Key& key)
17345 return emplace(key, T{}).first->second;
17348 const T& operator[](
const Key& key)
const
17353 T& at(
const Key& key)
17355 for (
auto it =
this->begin(); it !=
this->end(); ++it)
17357 if (it->first == key)
17363 JSON_THROW(std::out_of_range(
"key not found"));
17366 const T& at(
const Key& key)
const
17368 for (
auto it =
this->begin(); it !=
this->end(); ++it)
17370 if (it->first == key)
17376 JSON_THROW(std::out_of_range(
"key not found"));
17379 size_type erase(
const Key& key)
17381 for (
auto it =
this->begin(); it !=
this->end(); ++it)
17383 if (it->first == key)
17386 for (
auto next = it; ++next !=
this->end(); ++it)
17389 new (&*it) value_type{ std::move(*next) };
17391 Container::pop_back();
17398 iterator erase(iterator pos)
17403 for (
auto next = it; ++next !=
this->end(); ++it)
17406 new (&*it) value_type{ std::move(*next) };
17408 Container::pop_back();
17412 size_type count(
const Key& key)
const
17414 for (
auto it =
this->begin(); it !=
this->end(); ++it)
17416 if (it->first == key)
17424 iterator find(
const Key& key)
17426 for (
auto it =
this->begin(); it !=
this->end(); ++it)
17428 if (it->first == key)
17433 return Container::end();
17436 const_iterator find(
const Key& key)
const
17438 for (
auto it =
this->begin(); it !=
this->end(); ++it)
17440 if (it->first == key)
17445 return Container::end();
17448 std::pair<iterator,
bool> insert(value_type&& value)
17450 return emplace(value.first, std::move(value.second));
17453 std::pair<iterator,
bool> insert(
const value_type& value)
17455 for (
auto it =
this->begin(); it !=
this->end(); ++it)
17457 if (it->first == value.first)
17459 return { it,
false };
17462 Container::push_back(value);
17463 return { --
this->end(),
true };
17466 template<
typename InputIt>
17467 using require_input_iter =
typename std::enable_if<std::is_convertible<
typename std::iterator_traits<InputIt>::iterator_category,
17468 std::input_iterator_tag>::value>::type;
17470 template<
typename InputIt,
typename = require_input_iter<InputIt>>
17471 void insert(InputIt first, InputIt last)
17473 for (
auto it = first; it != last; ++it)
17483#if defined(JSON_HAS_CPP_17)
17484#include <string_view>
17488
17489
17490
17491
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17586 template<
typename BasicJsonType,
typename InputType>
17589 template<
typename BasicJsonType>
17591 template<
typename BasicJsonType,
typename CharType>
17593 template<
typename BasicJsonType,
typename InputType,
typename SAX>
17595 template<
typename BasicJsonType>
17597 template<
typename BasicJsonType>
17608 template<
typename InputAdapterType>
17610 InputAdapterType adapter,
17611 detail::parser_callback_t<basic_json>cb =
nullptr,
17612 const bool allow_exceptions =
true,
17613 const bool ignore_comments =
false
17622 template<
typename BasicJsonType>
17624 template<
typename BasicJsonType>
17626 template<
typename Iterator>
17644 template<
typename T,
typename SFINAE>
17645 using json_serializer = JSONSerializer<T, SFINAE>;
17694 using reference = value_type&;
17696 using const_reference =
const value_type&;
17699 using difference_type =
std::ptrdiff_t;
17707 using pointer =
typename std::allocator_traits<allocator_type>::pointer;
17709 using const_pointer =
typename std::allocator_traits<allocator_type>::const_pointer;
17724
17725
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17762 result[
"copyright"] =
"(C) 2013-2021 Niels Lohmann";
17763 result[
"name"] =
"JSON for Modern C++";
17764 result[
"url"] =
"https://github.com/nlohmann/json";
17765 result[
"version"][
"string"] =
17774 result[
"platform"] =
"win32";
17775#elif defined __linux__
17776 result[
"platform"] =
"linux";
17777#elif defined __APPLE__
17778 result[
"platform"] =
"apple";
17779#elif defined __unix__
17780 result[
"platform"] =
"unix";
17782 result[
"platform"] =
"unknown";
17785#if defined(__ICC) || defined(__INTEL_COMPILER)
17787#elif defined(__clang__
)
17788 result[
"compiler"] = { {
"family",
"clang"}, {
"version", __clang_version__} };
17789#elif defined(__GNUC__) || defined(__GNUG__)
17791#elif defined(__HP_cc) || defined(__HP_aCC)
17792 result[
"compiler"] =
"hp"
17793#elif defined(__IBMCPP__)
17795#elif defined(_MSC_VER)
17796 result[
"compiler"] = { {
"family",
"msvc"}, {
"version",
_MSC_VER} };
17797#elif defined(__PGI)
17798 result[
"compiler"] = { {
"family",
"pgcpp"}, {
"version",
__PGI} };
17799#elif defined(__SUNPRO_CC)
17802 result[
"compiler"] = { {
"family",
"unknown"}, {
"version",
"unknown"} };
17808 result[
"compiler"][
"c++"] =
"unknown";
17823#if defined(JSON_HAS_CPP_14
)
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017 using string_t = StringType;
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043 using boolean_t = BooleanType;
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115 using number_integer_t = NumberIntegerType;
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186 using number_unsigned_t = NumberUnsignedType;
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254 using number_float_t = NumberFloatType;
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18331 template<
typename T,
typename... Args>
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18412 case value_t::object:
18414 object = create<object_t>();
18418 case value_t::array:
18420 array = create<array_t>();
18424 case value_t::string:
18426 string = create<string_t>(
"");
18430 case value_t::binary:
18432 binary = create<binary_t>();
18436 case value_t::boolean:
18438 boolean = boolean_t(
false);
18442 case value_t::number_integer:
18444 number_integer = number_integer_t(0);
18448 case value_t::number_unsigned:
18450 number_unsigned = number_unsigned_t(0);
18454 case value_t::number_float:
18456 number_float = number_float_t(0.0);
18460 case value_t::null:
18466 case value_t::discarded:
18472 JSON_THROW(other_error::create(500,
"961c151d2e87f2686a955a9be24d316f1362bf21 3.10.2", basic_json()));
18482 string = create<string_t>(value);
18488 string = create<string_t>(std::move(value));
18494 object = create<object_t>(value);
18500 object = create<object_t>(std::move(value));
18506 array = create<array_t>(value);
18512 array = create<array_t>(std::move(value));
18518 binary = create<binary_t>(value);
18524 binary = create<binary_t>(std::move(value));
18530 binary = create<binary_t>(value);
18536 binary = create<binary_t>(std::move(value));
18541 if (t == value_t::array || t == value_t::object)
18544 std::vector<basic_json> stack;
18547 if (t == value_t::array)
18549 stack.reserve(array->size());
18550 std::move(array->begin(), array->end(), std::back_inserter(stack));
18554 stack.reserve(object->size());
18555 for (
auto&& it : *object)
18557 stack.push_back(std::move(it.second));
18561 while (!stack.empty())
18564 basic_json current_item(std::move(stack.back()));
18569 if (current_item.is_array())
18571 std::move(current_item.m_value.array->begin(), current_item.m_value.array->end(), std::back_inserter(stack));
18573 current_item.m_value.array->clear();
18575 else if (current_item.is_object())
18577 for (
auto&& it : *current_item.m_value.object)
18579 stack.push_back(std::move(it.second));
18582 current_item.m_value.object->clear();
18592 case value_t::object:
18594 AllocatorType<object_t> alloc;
18595 std::allocator_traits<
decltype(alloc)>::destroy(alloc, object);
18596 std::allocator_traits<
decltype(alloc)>::deallocate(alloc, object, 1);
18600 case value_t::array:
18602 AllocatorType<array_t> alloc;
18603 std::allocator_traits<
decltype(alloc)>::destroy(alloc, array);
18604 std::allocator_traits<
decltype(alloc)>::deallocate(alloc, array, 1);
18608 case value_t::string:
18610 AllocatorType<string_t> alloc;
18611 std::allocator_traits<
decltype(alloc)>::destroy(alloc, string);
18612 std::allocator_traits<
decltype(alloc)>::deallocate(alloc, string, 1);
18616 case value_t::binary:
18618 AllocatorType<binary_t> alloc;
18619 std::allocator_traits<
decltype(alloc)>::destroy(alloc, binary);
18620 std::allocator_traits<
decltype(alloc)>::deallocate(alloc, binary, 1);
18624 case value_t::null:
18625 case value_t::boolean:
18626 case value_t::number_integer:
18627 case value_t::number_unsigned:
18628 case value_t::number_float:
18629 case value_t::discarded:
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18715 iterator set_parents(iterator it,
typename iterator::difference_type count)
18723 static_cast<
void>(
count);
18745#ifdef JSON_HEDLEY_MSVC_VERSION
18746#pragma warning(push )
18747#pragma warning(disable : 4127
)
18754#ifdef JSON_HEDLEY_MSVC_VERSION
18755#pragma warning( pop )
18760 static_cast<
void>(
j);
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970 template <
typename CompatibleType,
18972 detail::enable_if_t <
18973 !detail::is_basic_json<U>::value&& detail::is_compatible_type<basic_json_t, U>::value,
int > = 0 >
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009 template <
typename BasicJsonType,
19010 detail::enable_if_t <
19011 detail::is_basic_json<BasicJsonType>::value && !std::is_same<basic_json, BasicJsonType>::value,
int > = 0 >
19012 basic_json(
const BasicJsonType& val)
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136 basic_json(initializer_list_t init,
19137 bool type_deduction =
true,
19138 value_t manual_type = value_t
::array)
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19217 static basic_json binary(
const typename binary_t::container_type& init)
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19254 static basic_json binary(
const typename binary_t::container_type& init,
typename binary_t::subtype_type subtype)
19274 static basic_json binary(
typename binary_t::container_type&& init,
typename binary_t::subtype_type subtype)
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454 template <
class InputIT,
typename std::enable_if <
19455 std::is_same<InputIT,
typename basic_json_t::iterator>::value ||
19456 std::is_same<InputIT,
typename basic_json_t::const_iterator>::value,
int >::type = 0 >
19457 basic_json(InputIT first, InputIT last)
19564 template<
typename JsonRef,
19565 detail::enable_if_t<detail::conjunction<detail::is_json_ref<JsonRef>,
19566 std::is_same<
typename JsonRef::value_type, basic_json>>::value,
int> = 0 >
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
19681
19682
19683
19684
19685
19702
19703
19704
19705
19706
19707
19708
19709
19710
19711
19712
19713
19714
19715
19716
19717
19718
19719
19720
19721
19722
19723
19725 std::is_nothrow_move_constructible<value_t>::value&&
19726 std::is_nothrow_move_assignable<value_t>::value&&
19727 std::is_nothrow_move_constructible<json_value>::value&&
19728 std::is_nothrow_move_assignable<json_value>::value
19744
19745
19746
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758 ~basic_json()
noexcept
19776
19777
19778
19779
19780
19781
19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
19806
19807
19808
19809
19810
19811
19812
19813
19814
19815
19816
19817
19818
19819
19820
19821
19822 string_t dump(
const int indent = -1,
19823 const char indent_char =
' ',
19824 const bool ensure_ascii =
false,
19825 const error_handler_t error_handler = error_handler_t
::strict)
const
19843
19844
19845
19846
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
19869
19870
19871
19872
19873
19874
19875 constexpr value_t type()
const noexcept
19881
19882
19883
19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
19901
19902
19903
19904
19905
19906 constexpr bool is_primitive()
const noexcept
19908 return is_null() || is_string() || is_boolean() || is_number() || is_binary();
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
19922
19923
19924
19925
19926
19927
19928
19929
19930
19931
19932
19933 constexpr bool is_structured()
const noexcept
19935 return is_array() || is_object();
19939
19940
19941
19942
19943
19944
19945
19946
19947
19948
19949
19950
19951
19952
19953
19954
19955 constexpr bool is_null()
const noexcept
19957 return m_type == value_t
::null;
19961
19962
19963
19964
19965
19966
19967
19968
19969
19970
19971
19972
19973
19974
19975
19976
19977 constexpr bool is_boolean()
const noexcept
19983
19984
19985
19986
19987
19988
19989
19990
19991
19992
19993
19994
19995
19996
19997
19998
19999
20000
20001
20002
20003
20004
20005
20006
20007 constexpr bool is_number()
const noexcept
20009 return is_number_integer() || is_number_float();
20013
20014
20015
20016
20017
20018
20019
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
20035
20036 constexpr bool is_number_integer()
const noexcept
20042
20043
20044
20045
20046
20047
20048
20049
20050
20051
20052
20053
20054
20055
20056
20057
20058
20059
20060
20061
20062
20063
20064 constexpr bool is_number_unsigned()
const noexcept
20070
20071
20072
20073
20074
20075
20076
20077
20078
20079
20080
20081
20082
20083
20084
20085
20086
20087
20088
20089
20090
20091
20092 constexpr bool is_number_float()
const noexcept
20098
20099
20100
20101
20102
20103
20104
20105
20106
20107
20108
20109
20110
20111
20112
20113
20114 constexpr bool is_object()
const noexcept
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
20133
20134
20135
20136 constexpr bool is_array()
const noexcept
20138 return m_type == value_t
::array;
20142
20143
20144
20145
20146
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158 constexpr bool is_string()
const noexcept
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180 constexpr bool is_binary()
const noexcept
20186
20187
20188
20189
20190
20191
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201
20202
20203
20204
20205
20206
20207 constexpr bool is_discarded()
const noexcept
20213
20214
20215
20216
20217
20218
20219
20220
20221
20222
20223
20224
20225
20226
20227
20228
20229
20230
20231
20232
20233 constexpr operator value_t()
const noexcept
20246 boolean_t get_impl(boolean_t* )
const
20257 object_t* get_impl_ptr(object_t* )
noexcept
20263 constexpr const object_t* get_impl_ptr(
const object_t* )
const noexcept
20265 return is_object() ?
m_value.object :
nullptr;
20269 array_t* get_impl_ptr(array_t* )
noexcept
20275 constexpr const array_t* get_impl_ptr(
const array_t* )
const noexcept
20277 return is_array() ?
m_value.array :
nullptr;
20281 string_t* get_impl_ptr(string_t* )
noexcept
20287 constexpr const string_t* get_impl_ptr(
const string_t* )
const noexcept
20289 return is_string() ?
m_value.string :
nullptr;
20293 boolean_t* get_impl_ptr(boolean_t* )
noexcept
20299 constexpr const boolean_t* get_impl_ptr(
const boolean_t* )
const noexcept
20301 return is_boolean() ? &
m_value.boolean :
nullptr;
20305 number_integer_t* get_impl_ptr(number_integer_t* )
noexcept
20311 constexpr const number_integer_t* get_impl_ptr(
const number_integer_t* )
const noexcept
20313 return is_number_integer() ? &
m_value.number_integer :
nullptr;
20317 number_unsigned_t* get_impl_ptr(number_unsigned_t* )
noexcept
20323 constexpr const number_unsigned_t* get_impl_ptr(
const number_unsigned_t* )
const noexcept
20325 return is_number_unsigned() ? &
m_value.number_unsigned :
nullptr;
20329 number_float_t* get_impl_ptr(number_float_t* )
noexcept
20335 constexpr const number_float_t* get_impl_ptr(
const number_float_t* )
const noexcept
20337 return is_number_float() ? &
m_value.number_float :
nullptr;
20341 binary_t* get_impl_ptr(binary_t* )
noexcept
20347 constexpr const binary_t* get_impl_ptr(
const binary_t* )
const noexcept
20349 return is_binary() ?
m_value.binary :
nullptr;
20353
20354
20355
20356
20357
20358
20359
20360
20361
20362
20363 template<
typename ReferenceType,
typename ThisType>
20364 static ReferenceType get_ref_impl(ThisType& obj)