mirror of
https://github.com/nlohmann/json.git
synced 2025-08-09 05:22:48 +03:00
use detected instead of has_* traits
This commit is contained in:
@@ -102,22 +102,3 @@
|
||||
basic_json<ObjectType, ArrayType, StringType, BooleanType, \
|
||||
NumberIntegerType, NumberUnsignedType, NumberFloatType, \
|
||||
AllocatorType, JSONSerializer>
|
||||
|
||||
/*!
|
||||
@brief Helper to determine whether there's a key_type for T.
|
||||
|
||||
This helper is used to tell associative containers apart from other containers
|
||||
such as sequence containers. For instance, `std::map` passes the test as it
|
||||
contains a `mapped_type`, whereas `std::vector` fails the test.
|
||||
|
||||
@sa http://stackoverflow.com/a/7728728/266378
|
||||
@since version 1.0.0, overworked in version 2.0.6
|
||||
*/
|
||||
#define NLOHMANN_JSON_HAS_HELPER(type) \
|
||||
template<typename T> struct has_##type { \
|
||||
template<typename U, typename = typename U::type> \
|
||||
static int detect(U &&); \
|
||||
static void detect(...); \
|
||||
static constexpr bool value = \
|
||||
std::is_integral<decltype(detect(std::declval<T>()))>::value; \
|
||||
}
|
||||
|
Reference in New Issue
Block a user