Loading...
Searching...
No Matches
Go to the documentation of this file.
14#include <daw/daw_consteval.h>
15#include <daw/daw_cpp_feature_check.h>
16#include <daw/daw_is_detected.h>
17#include <daw/stdinc/enable_if.h>
21#if defined( DAW_HAS_GCC ) and not defined( DAW_JSON_FLATTEN )
22#if not defined( DAW_NO_FLATTEN )
29#if defined( DAW_USE_EXCEPTIONS )
30#if defined( DAW_JSON_DONT_USE_EXCEPTIONS )
31#error Conflicting defines DAW_USE_EXCEPTIONS and DAW_JSON_DONT_USE_EXCEPTIONS
33#if defined( DAW_DONT_USE_EXCEPTIONS )
34#error Conflicting defines DAW_USE_EXCEPTIONS and DAW_DONT_USE_EXCEPTIONS
37#if not defined( DAW_JSON_DONT_USE_EXCEPTIONS )
38#define DAW_JSON_DONT_USE_EXCEPTIONS
40#if not defined( DAW_DONT_USE_EXCEPTIONS )
41#define DAW_JSON_DONT_USE_EXCEPTIONS
51#if not defined( DAW_NO_CONSTEXPR_SCOPE_GUARD ) and \
52 not defined( DAW_JSON_ENABLE_FULL_RVO )
53#define DAW_NO_CONSTEXPR_SCOPE_GUARD
64#if defined( DAW_HAS_GCC_LIKE )
65#define DAW_CAN_CONSTANT_EVAL( ... ) \
66 ( __builtin_constant_p( __VA_ARGS__ ) == 1 )
68#define DAW_CAN_CONSTANT_EVAL( ... ) true
75#if not defined( DAW_USE_CPP17_ABI )
76#if defined( __cpp_nontype_template_parameter_class )
77#if not defined( DAW_JSON_CNTTP_JSON_NAME )
78#define DAW_JSON_CNTTP_JSON_NAME
81#if defined( __cpp_nontype_template_args )
82#if __cpp_nontype_template_args >= 201911L
83#if not defined( DAW_JSON_CNTTP_JSON_NAME )
84#define DAW_JSON_CNTTP_JSON_NAME
88#if DAW_HAS_CLANG_VER_GTE( 12, 0 ) and DAW_CPP_VERSION >= 202002L
91#if not defined( DAW_JSON_CNTTP_JSON_NAME )
92#define DAW_JSON_CNTTP_JSON_NAME
97#if defined( __cpp_constexpr_dynamic_alloc )
98#define CPP20CONSTEXPR constexpr
101#define CPP20CONSTEXPR
105#if defined( DAW_HAS_MSVC )
106#define DAW_JSON_MAKE_LOC_INFO_CONSTEVAL constexpr
108#define DAW_JSON_MAKE_LOC_INFO_CONSTEVAL DAW_CONSTEVAL
113#if not defined( DAW_JSON_NO_SSE42 )
114#if defined( __SSE4_2__ ) or defined( __AVX__ ) or defined( __AVX2__ )
115#if not defined( DAW_ALLOW_SSE42 )
116#define DAW_ALLOW_SSE42 1
123#if not defined( DAW_JSON_USE_STRTOD ) and not defined( __cpp_lib_to_chars )
124#define DAW_JSON_USE_STRTOD
131#if defined( DAW_HAS_MSVC )
132#if not defined( DAW_JSON_DISABLE_RANDOM )
133#define DAW_JSON_DISABLE_RANDOM
139#if DAW_HAS_GCC_VER_GTE( 8, 0 ) or defined( DAW_HAS_CLANG ) or \
140 ( DAW_HAS_BUILTIN( __builtin_uadd_overflow ) and \
141 DAW_HAS_BUILTIN( __builtin_uaddl_overflow ) and \
142 DAW_HAS_BUILTIN( __builtin_uaddll_overflow ) )
143#define DAW_JSON_HAS_BUILTIN_UADD
148#if defined( DAW_HAS_MSVC )
149#define DAW_JSON_BUGFIX_FROM_JSON_001
157#if defined( DAW_HAS_MSVC )
158#define DAW_JSON_BUGFIX_MSVC_EVAL_ORDER_002
163#if defined( DAW_HAS_MSVC ) and __cpp_constexpr > 201700L
164#define DAW_JSON_BUGFIX_MSVC_KNOWN_LOC_ICE_003
170#if not defined( NDEBUG ) or defined( DEBUG ) or \
171 defined( DAW_JSON_PARSER_DIAGNOSTICS ) or defined( DAW_HAS_MSVC )
172#if not defined( DAW_JSON_ALWAYS_FULL_NAME_MATCH )
173#define DAW_JSON_ALWAYS_FULL_NAME_MATCH
179#if defined( __cpp_generic_lambdas )
180#if __cpp_generic_lambdas >= 201707L
181#define DAW_JSON_USE_GENERIC_LAMBDAS
186#if defined( __cpp_static_call_operator )
187#if __cpp_static_call_operator >= 202207L
188#define DAW_JSON_HAS_STATIC_CALL_OP
191#if defined( DAW_JSON_HAS_STATIC_CALL_OP )
192#define DAW_JSON_CPP23_STATIC_CALL_OP static
193#define DAW_JSON_CPP23_STATIC_CALL_OP_CONST
195#if DAW_HAS_CLANG_VER_GTE( 17, 0 )
196#define DAW_JSON_CPP23_STATIC_CALL_OP_DISABLE_WARNING \
197 _Pragma( "clang diagnostic push" ) \
198 _Pragma( "clang diagnostic ignored \"-Wc++23-extensions\"" )
200#define DAW_JSON_CPP23_STATIC_CALL_OP_ENABLE_WARNING \
201 _Pragma( "clang diagnostic pop" )
203#define DAW_JSON_CPP23_STATIC_CALL_OP_DISABLE_WARNING
204#define DAW_JSON_CPP23_STATIC_CALL_OP_ENABLE_WARNING
207#define DAW_JSON_CPP23_STATIC_CALL_OP
208#define DAW_JSON_CPP23_STATIC_CALL_OP_CONST const
209#define DAW_JSON_CPP23_STATIC_CALL_OP_DISABLE_WARNING
210#define DAW_JSON_CPP23_STATIC_CALL_OP_ENABLE_WARNING
213#if defined( __cpp_constexpr_dynamic_alloc )
214#if __cpp_constexpr_dynamic_alloc >= 201907L
215#define DAW_JSON_HAS_CPP20_CX_ALLOC
219#if defined( DAW_JSON_HAS_CPP20_CX_ALLOC )
220#define DAW_JSON_HAS_CPP20_CX_DTOR
221#define DAW_JSON_CPP20_CX_DTOR constexpr
223#define DAW_JSON_CPP20_CX_DTOR
226#if defined( DAW_JSON_HAS_CPP20_CX_ALLOC ) and \
227 defined( __cpp_lib_constexpr_vector )
228#if __cpp_lib_constexpr_vector >= 201907L
229#define DAW_JSON_HAS_CPP20_CX_VECTOR
233#if defined( DAW_JSON_HAS_CPP20_CX_VECTOR )
234#define DAW_JSON_CX_VECTOR constexpr
236#define DAW_JSON_CX_VECTOR
239#if defined( DAW_JSON_HAS_CPP20_CX_ALLOC ) and \
240 defined( __cpp_lib_constexpr_string )
241#if __cpp_lib_constexpr_string >= 201907L
242#define DAW_JSON_HAS_CPP20_CX_STRING
246#if defined( DAW_JSON_HAS_CPP20_CX_STRING )
247#define DAW_JSON_CX_STRING constexpr
249#define DAW_JSON_CX_STRING inline
252#if defined( DAW_JSON_HAS_CPP20_CX_STRING ) and \
253 defined( DAW_JSON_HAS_CPP20_CX_VECTOR )
254#define DAW_JSON_HAS_CPP20_CX_STRVEC
255#define DAW_JSON_CX_STRVEC constexpr
257#define DAW_JSON_CX_STRVEC
265#if defined( DAW_JSON_HAS_CPP20_CX_DTOR )
266#if not defined( NDEBUG ) and not defined( DAW_JSON_USE_FULL_DEBUG_ITERATORS )
267#define DAW_JSON_USE_FULL_DEBUG_ITERATORS
271#if defined( __cpp_lib_containers_ranges )
272#if __cpp_lib_containers_ranges > 202202L
273#define DAW_JSON_HAS_CPP23_RANGE_CTOR
277#if defined( __cpp_lib_constexpr_exceptions )
278#if __cpp_lib_constexpr_exceptions >= 202411L
279#define DAW_JSON_HAS_CONSTEXPR_EXCEPTIONS
283#if defined( DAW_JSON_HAS_CONSTEXPR_EXCEPTIONS )
284#define DAW_JSON_CPP26_CX_EXCEPT constexpr
286#define DAW_JSON_CPP26_CX_EXCEPT inline
289#if defined( __cpp_lib_reflection )
290#if __cpp_lib_reflection >= 202506L
291#define DAW_JSON_HAS_REFLECTION 1
295#if defined( __cpp_generic_lambdas )
296#if __cpp_generic_lambdas >= 201707L
297#define DAW_JSON_CPP20_TEMPLATE_LAMBDAS