Go to the documentation of this file.
11 #include <daw/daw_cpp_feature_check.h>
15 #if DAW_HAS_GCC_VER_LT( 13, 3 )
16 #define DAW_JSON_DONT_USE_CONCEPTS
19 #if not defined( DAW_JSON_DONT_USE_CONCEPTS ) and defined( __cpp_lib_concepts )
20 #if __cpp_lib_concepts >= 202002L
21 #define DAW_JSON_USE_CONCEPTS
25 #if defined( DAW_JSON_USE_CONCEPTS )
26 #define DAW_JSON_MAKE_REQ_TRAIT( Name, ... ) \
27 template<typename T> \
28 inline constexpr bool Name = requires { \
32 #define DAW_JSON_MAKE_REQ_TRAIT( Name, ... ) \
33 template<typename, typename = void> \
34 inline constexpr bool Name = false; \
36 template<typename T> \
37 inline constexpr bool Name<T, std::void_t<decltype( __VA_ARGS__ )>> = true
40 #if defined( DAW_JSON_USE_CONCEPTS )
41 #define DAW_JSON_MAKE_REQ_TRAIT2( Name, ... ) \
42 template<typename T, typename U> \
43 inline constexpr bool Name = requires { \
47 #define DAW_JSON_MAKE_REQ_TRAIT2( Name, ... ) \
48 template<typename, typename, typename = void> \
49 inline constexpr bool Name = false; \
51 template<typename T, typename U> \
52 inline constexpr bool Name<T, U, std::void_t<decltype( __VA_ARGS__ )>> = \
56 #if defined( DAW_JSON_USE_CONCEPTS )
57 #define DAW_JSON_MAKE_REQ_TRAIT2( Name, ... ) \
58 template<typename T, typename U> \
59 inline constexpr bool Name = requires { \
63 #define DAW_JSON_MAKE_REQ_TRAIT2( Name, ... ) \
64 template<typename, typename, typename = void> \
65 inline constexpr bool Name = false; \
67 template<typename T, typename U> \
68 inline constexpr bool Name<T, U, std::void_t<decltype( __VA_ARGS__ )>> = \
72 #if defined( DAW_JSON_USE_CONCEPTS )
73 #define DAW_JSON_MAKE_REQ_TRAIT3( Name, ... ) \
74 template<typename T, typename U, typename V> \
75 inline constexpr bool Name = requires { \
79 #define DAW_JSON_MAKE_REQ_TRAIT3( Name, ... ) \
80 template<typename, typename, typename, typename = void> \
81 inline constexpr bool Name = false; \
83 template<typename T, typename U, typename V> \
84 inline constexpr bool Name<T, U, V, std::void_t<decltype( __VA_ARGS__ )>> = \
88 #if defined( DAW_JSON_USE_CONCEPTS )
89 #define DAW_JSON_MAKE_REQ_TYPE_ALIAS_TRAIT_NT( Name, ... ) \
90 template<typename T, typename = void> \
91 inline constexpr bool Name = requires { \
92 typename __VA_ARGS__; \
95 #define DAW_JSON_MAKE_REQ_TYPE_ALIAS_TRAIT_NT( Name, ... ) \
96 template<typename, typename = void> \
97 inline constexpr bool Name = false; \
99 template<typename T> \
100 inline constexpr bool Name<T, std::void_t<__VA_ARGS__>> = true
103 #if defined( DAW_JSON_USE_CONCEPTS )
104 #define DAW_JSON_MAKE_REQ_TYPE_ALIAS_TRAIT( Name, ... ) \
105 template<typename T, typename = void> \
106 inline constexpr bool Name = requires { \
107 typename __VA_ARGS__; \
110 #define DAW_JSON_MAKE_REQ_TYPE_ALIAS_TRAIT( Name, ... ) \
111 template<typename, typename = void> \
112 inline constexpr bool Name = false; \
114 template<typename T> \
115 inline constexpr bool Name<T, std::void_t<typename __VA_ARGS__>> = true
118 #if defined( DAW_JSON_USE_CONCEPTS )
119 #define DAW_JSON_MAKE_REQ_TYPE_ALIAS_TRAIT2( Name, ... ) \
120 template<typename T, typename U> \
121 inline constexpr bool Name = requires { \
125 #define DAW_JSON_MAKE_REQ_TYPE_ALIAS_TRAIT2( Name, ... ) \
126 template<typename, typename, typename = void> \
127 inline constexpr bool Name = false; \
129 template<typename T, typename U> \
130 inline constexpr bool Name<T, U, std::void_t<__VA_ARGS__>> = true