mirror of
https://github.com/nlohmann/json
synced 2024-11-26 05:40:07 +00:00
make has_mapped_type struct friendly
This commit is contained in:
parent
a0ef5a194c
commit
e9fde3e116
@ -112,10 +112,13 @@ template<typename T>
|
||||
struct has_mapped_type
|
||||
{
|
||||
private:
|
||||
template<typename C> static char test(typename C::mapped_type*);
|
||||
template<typename C> static char (&test(...))[2];
|
||||
template <typename U, typename = typename U::mapped_type>
|
||||
static int detect(U&&);
|
||||
|
||||
static void detect(...);
|
||||
public:
|
||||
static constexpr bool value = sizeof(test<T>(0)) == 1;
|
||||
static constexpr bool value =
|
||||
std::is_integral<decltype(detect(std::declval<T>()))>::value;
|
||||
};
|
||||
|
||||
/*!
|
||||
|
@ -112,10 +112,13 @@ template<typename T>
|
||||
struct has_mapped_type
|
||||
{
|
||||
private:
|
||||
template<typename C> static char test(typename C::mapped_type*);
|
||||
template<typename C> static char (&test(...))[2];
|
||||
template <typename U, typename = typename U::mapped_type>
|
||||
static int detect(U&&);
|
||||
|
||||
static void detect(...);
|
||||
public:
|
||||
static constexpr bool value = sizeof(test<T>(0)) == 1;
|
||||
static constexpr bool value =
|
||||
std::is_integral<decltype(detect(std::declval<T>()))>::value;
|
||||
};
|
||||
|
||||
/*!
|
||||
|
Loading…
Reference in New Issue
Block a user