🎨 replace alternative operators (and, not, or)
This commit is contained in:
parent
4f04ea1bef
commit
0498202a03
22 changed files with 1300 additions and 1300 deletions
|
|
@ -19,39 +19,39 @@ struct nonesuch
|
|||
void operator=(nonesuch&&) = delete;
|
||||
};
|
||||
|
||||
template <class Default,
|
||||
class AlwaysVoid,
|
||||
template <class...> class Op,
|
||||
class... Args>
|
||||
template<class Default,
|
||||
class AlwaysVoid,
|
||||
template<class...> class Op,
|
||||
class... Args>
|
||||
struct detector
|
||||
{
|
||||
using value_t = std::false_type;
|
||||
using type = Default;
|
||||
};
|
||||
|
||||
template <class Default, template <class...> class Op, class... Args>
|
||||
template<class Default, template<class...> class Op, class... Args>
|
||||
struct detector<Default, void_t<Op<Args...>>, Op, Args...>
|
||||
{
|
||||
using value_t = std::true_type;
|
||||
using type = Op<Args...>;
|
||||
};
|
||||
|
||||
template <template <class...> class Op, class... Args>
|
||||
template<template<class...> class Op, class... Args>
|
||||
using is_detected = typename detector<nonesuch, void, Op, Args...>::value_t;
|
||||
|
||||
template <template <class...> class Op, class... Args>
|
||||
template<template<class...> class Op, class... Args>
|
||||
using detected_t = typename detector<nonesuch, void, Op, Args...>::type;
|
||||
|
||||
template <class Default, template <class...> class Op, class... Args>
|
||||
template<class Default, template<class...> class Op, class... Args>
|
||||
using detected_or = detector<Default, void, Op, Args...>;
|
||||
|
||||
template <class Default, template <class...> class Op, class... Args>
|
||||
template<class Default, template<class...> class Op, class... Args>
|
||||
using detected_or_t = typename detected_or<Default, Op, Args...>::type;
|
||||
|
||||
template <class Expected, template <class...> class Op, class... Args>
|
||||
template<class Expected, template<class...> class Op, class... Args>
|
||||
using is_detected_exact = std::is_same<Expected, detected_t<Op, Args...>>;
|
||||
|
||||
template <class To, template <class...> class Op, class... Args>
|
||||
template<class To, template<class...> class Op, class... Args>
|
||||
using is_detected_convertible =
|
||||
std::is_convertible<detected_t<Op, Args...>, To>;
|
||||
} // namespace detail
|
||||
|
|
|
|||
|
|
@ -11,53 +11,53 @@ namespace nlohmann
|
|||
{
|
||||
namespace detail
|
||||
{
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
using null_function_t = decltype(std::declval<T&>().null());
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
using boolean_function_t =
|
||||
decltype(std::declval<T&>().boolean(std::declval<bool>()));
|
||||
|
||||
template <typename T, typename Integer>
|
||||
template<typename T, typename Integer>
|
||||
using number_integer_function_t =
|
||||
decltype(std::declval<T&>().number_integer(std::declval<Integer>()));
|
||||
|
||||
template <typename T, typename Unsigned>
|
||||
template<typename T, typename Unsigned>
|
||||
using number_unsigned_function_t =
|
||||
decltype(std::declval<T&>().number_unsigned(std::declval<Unsigned>()));
|
||||
|
||||
template <typename T, typename Float, typename String>
|
||||
template<typename T, typename Float, typename String>
|
||||
using number_float_function_t = decltype(std::declval<T&>().number_float(
|
||||
std::declval<Float>(), std::declval<const String&>()));
|
||||
|
||||
template <typename T, typename String>
|
||||
template<typename T, typename String>
|
||||
using string_function_t =
|
||||
decltype(std::declval<T&>().string(std::declval<String&>()));
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
using start_object_function_t =
|
||||
decltype(std::declval<T&>().start_object(std::declval<std::size_t>()));
|
||||
|
||||
template <typename T, typename String>
|
||||
template<typename T, typename String>
|
||||
using key_function_t =
|
||||
decltype(std::declval<T&>().key(std::declval<String&>()));
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
using end_object_function_t = decltype(std::declval<T&>().end_object());
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
using start_array_function_t =
|
||||
decltype(std::declval<T&>().start_array(std::declval<std::size_t>()));
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
using end_array_function_t = decltype(std::declval<T&>().end_array());
|
||||
|
||||
template <typename T, typename Exception>
|
||||
template<typename T, typename Exception>
|
||||
using parse_error_function_t = decltype(std::declval<T&>().parse_error(
|
||||
std::declval<std::size_t>(), std::declval<const std::string&>(),
|
||||
std::declval<const Exception&>()));
|
||||
|
||||
template <typename SAX, typename BasicJsonType>
|
||||
template<typename SAX, typename BasicJsonType>
|
||||
struct is_sax
|
||||
{
|
||||
private:
|
||||
|
|
@ -89,7 +89,7 @@ struct is_sax
|
|||
is_detected_exact<bool, parse_error_function_t, SAX, exception_t>::value;
|
||||
};
|
||||
|
||||
template <typename SAX, typename BasicJsonType>
|
||||
template<typename SAX, typename BasicJsonType>
|
||||
struct is_sax_static_asserts
|
||||
{
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -45,59 +45,59 @@ struct is_basic_json<NLOHMANN_BASIC_JSON_TPL> : std::true_type {};
|
|||
// json_ref helpers //
|
||||
//////////////////////
|
||||
|
||||
template <typename>
|
||||
template<typename>
|
||||
class json_ref;
|
||||
|
||||
template<typename>
|
||||
struct is_json_ref : std::false_type {};
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
struct is_json_ref<json_ref<T>> : std::true_type {};
|
||||
|
||||
//////////////////////////
|
||||
// aliases for detected //
|
||||
//////////////////////////
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
using mapped_type_t = typename T::mapped_type;
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
using key_type_t = typename T::key_type;
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
using value_type_t = typename T::value_type;
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
using difference_type_t = typename T::difference_type;
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
using pointer_t = typename T::pointer;
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
using reference_t = typename T::reference;
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
using iterator_category_t = typename T::iterator_category;
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
using iterator_t = typename T::iterator;
|
||||
|
||||
template <typename T, typename... Args>
|
||||
template<typename T, typename... Args>
|
||||
using to_json_function = decltype(T::to_json(std::declval<Args>()...));
|
||||
|
||||
template <typename T, typename... Args>
|
||||
template<typename T, typename... Args>
|
||||
using from_json_function = decltype(T::from_json(std::declval<Args>()...));
|
||||
|
||||
template <typename T, typename U>
|
||||
template<typename T, typename U>
|
||||
using get_template_function = decltype(std::declval<T>().template get<U>());
|
||||
|
||||
// trait checking if JSONSerializer<T>::from_json(json const&, udt&) exists
|
||||
template <typename BasicJsonType, typename T, typename = void>
|
||||
template<typename BasicJsonType, typename T, typename = void>
|
||||
struct has_from_json : std::false_type {};
|
||||
|
||||
template <typename BasicJsonType, typename T>
|
||||
struct has_from_json<BasicJsonType, T,
|
||||
enable_if_t<not is_basic_json<T>::value>>
|
||||
template<typename BasicJsonType, typename T>
|
||||
struct has_from_json < BasicJsonType, T,
|
||||
enable_if_t < !is_basic_json<T>::value >>
|
||||
{
|
||||
using serializer = typename BasicJsonType::template json_serializer<T, void>;
|
||||
|
||||
|
|
@ -108,11 +108,11 @@ struct has_from_json<BasicJsonType, T,
|
|||
|
||||
// This trait checks if JSONSerializer<T>::from_json(json const&) exists
|
||||
// this overload is used for non-default-constructible user-defined-types
|
||||
template <typename BasicJsonType, typename T, typename = void>
|
||||
template<typename BasicJsonType, typename T, typename = void>
|
||||
struct has_non_default_from_json : std::false_type {};
|
||||
|
||||
template<typename BasicJsonType, typename T>
|
||||
struct has_non_default_from_json<BasicJsonType, T, enable_if_t<not is_basic_json<T>::value>>
|
||||
struct has_non_default_from_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >>
|
||||
{
|
||||
using serializer = typename BasicJsonType::template json_serializer<T, void>;
|
||||
|
||||
|
|
@ -123,11 +123,11 @@ struct has_non_default_from_json<BasicJsonType, T, enable_if_t<not is_basic_json
|
|||
|
||||
// This trait checks if BasicJsonType::json_serializer<T>::to_json exists
|
||||
// Do not evaluate the trait when T is a basic_json type, to avoid template instantiation infinite recursion.
|
||||
template <typename BasicJsonType, typename T, typename = void>
|
||||
template<typename BasicJsonType, typename T, typename = void>
|
||||
struct has_to_json : std::false_type {};
|
||||
|
||||
template <typename BasicJsonType, typename T>
|
||||
struct has_to_json<BasicJsonType, T, enable_if_t<not is_basic_json<T>::value>>
|
||||
template<typename BasicJsonType, typename T>
|
||||
struct has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >>
|
||||
{
|
||||
using serializer = typename BasicJsonType::template json_serializer<T, void>;
|
||||
|
||||
|
|
@ -141,10 +141,10 @@ struct has_to_json<BasicJsonType, T, enable_if_t<not is_basic_json<T>::value>>
|
|||
// is_ functions //
|
||||
///////////////////
|
||||
|
||||
template <typename T, typename = void>
|
||||
template<typename T, typename = void>
|
||||
struct is_iterator_traits : std::false_type {};
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
struct is_iterator_traits<iterator_traits<T>>
|
||||
{
|
||||
private:
|
||||
|
|
@ -161,20 +161,20 @@ struct is_iterator_traits<iterator_traits<T>>
|
|||
|
||||
// source: https://stackoverflow.com/a/37193089/4116453
|
||||
|
||||
template <typename T, typename = void>
|
||||
template<typename T, typename = void>
|
||||
struct is_complete_type : std::false_type {};
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
struct is_complete_type<T, decltype(void(sizeof(T)))> : std::true_type {};
|
||||
|
||||
template <typename BasicJsonType, typename CompatibleObjectType,
|
||||
typename = void>
|
||||
template<typename BasicJsonType, typename CompatibleObjectType,
|
||||
typename = void>
|
||||
struct is_compatible_object_type_impl : std::false_type {};
|
||||
|
||||
template <typename BasicJsonType, typename CompatibleObjectType>
|
||||
template<typename BasicJsonType, typename CompatibleObjectType>
|
||||
struct is_compatible_object_type_impl <
|
||||
BasicJsonType, CompatibleObjectType,
|
||||
enable_if_t<is_detected<mapped_type_t, CompatibleObjectType>::value and
|
||||
enable_if_t < is_detected<mapped_type_t, CompatibleObjectType>::value&&
|
||||
is_detected<key_type_t, CompatibleObjectType>::value >>
|
||||
{
|
||||
|
||||
|
|
@ -183,53 +183,53 @@ struct is_compatible_object_type_impl <
|
|||
// macOS's is_constructible does not play well with nonesuch...
|
||||
static constexpr bool value =
|
||||
std::is_constructible<typename object_t::key_type,
|
||||
typename CompatibleObjectType::key_type>::value and
|
||||
typename CompatibleObjectType::key_type>::value &&
|
||||
std::is_constructible<typename object_t::mapped_type,
|
||||
typename CompatibleObjectType::mapped_type>::value;
|
||||
};
|
||||
|
||||
template <typename BasicJsonType, typename CompatibleObjectType>
|
||||
template<typename BasicJsonType, typename CompatibleObjectType>
|
||||
struct is_compatible_object_type
|
||||
: is_compatible_object_type_impl<BasicJsonType, CompatibleObjectType> {};
|
||||
|
||||
template <typename BasicJsonType, typename ConstructibleObjectType,
|
||||
typename = void>
|
||||
template<typename BasicJsonType, typename ConstructibleObjectType,
|
||||
typename = void>
|
||||
struct is_constructible_object_type_impl : std::false_type {};
|
||||
|
||||
template <typename BasicJsonType, typename ConstructibleObjectType>
|
||||
template<typename BasicJsonType, typename ConstructibleObjectType>
|
||||
struct is_constructible_object_type_impl <
|
||||
BasicJsonType, ConstructibleObjectType,
|
||||
enable_if_t<is_detected<mapped_type_t, ConstructibleObjectType>::value and
|
||||
enable_if_t < is_detected<mapped_type_t, ConstructibleObjectType>::value&&
|
||||
is_detected<key_type_t, ConstructibleObjectType>::value >>
|
||||
{
|
||||
using object_t = typename BasicJsonType::object_t;
|
||||
|
||||
static constexpr bool value =
|
||||
(std::is_default_constructible<ConstructibleObjectType>::value and
|
||||
(std::is_move_assignable<ConstructibleObjectType>::value or
|
||||
std::is_copy_assignable<ConstructibleObjectType>::value) and
|
||||
(std::is_default_constructible<ConstructibleObjectType>::value &&
|
||||
(std::is_move_assignable<ConstructibleObjectType>::value ||
|
||||
std::is_copy_assignable<ConstructibleObjectType>::value) &&
|
||||
(std::is_constructible<typename ConstructibleObjectType::key_type,
|
||||
typename object_t::key_type>::value and
|
||||
typename object_t::key_type>::value &&
|
||||
std::is_same <
|
||||
typename object_t::mapped_type,
|
||||
typename ConstructibleObjectType::mapped_type >::value)) or
|
||||
typename ConstructibleObjectType::mapped_type >::value)) ||
|
||||
(has_from_json<BasicJsonType,
|
||||
typename ConstructibleObjectType::mapped_type>::value or
|
||||
typename ConstructibleObjectType::mapped_type>::value ||
|
||||
has_non_default_from_json <
|
||||
BasicJsonType,
|
||||
typename ConstructibleObjectType::mapped_type >::value);
|
||||
};
|
||||
|
||||
template <typename BasicJsonType, typename ConstructibleObjectType>
|
||||
template<typename BasicJsonType, typename ConstructibleObjectType>
|
||||
struct is_constructible_object_type
|
||||
: is_constructible_object_type_impl<BasicJsonType,
|
||||
ConstructibleObjectType> {};
|
||||
|
||||
template <typename BasicJsonType, typename CompatibleStringType,
|
||||
typename = void>
|
||||
template<typename BasicJsonType, typename CompatibleStringType,
|
||||
typename = void>
|
||||
struct is_compatible_string_type_impl : std::false_type {};
|
||||
|
||||
template <typename BasicJsonType, typename CompatibleStringType>
|
||||
template<typename BasicJsonType, typename CompatibleStringType>
|
||||
struct is_compatible_string_type_impl <
|
||||
BasicJsonType, CompatibleStringType,
|
||||
enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type,
|
||||
|
|
@ -239,15 +239,15 @@ struct is_compatible_string_type_impl <
|
|||
std::is_constructible<typename BasicJsonType::string_t, CompatibleStringType>::value;
|
||||
};
|
||||
|
||||
template <typename BasicJsonType, typename ConstructibleStringType>
|
||||
template<typename BasicJsonType, typename ConstructibleStringType>
|
||||
struct is_compatible_string_type
|
||||
: is_compatible_string_type_impl<BasicJsonType, ConstructibleStringType> {};
|
||||
|
||||
template <typename BasicJsonType, typename ConstructibleStringType,
|
||||
typename = void>
|
||||
template<typename BasicJsonType, typename ConstructibleStringType,
|
||||
typename = void>
|
||||
struct is_constructible_string_type_impl : std::false_type {};
|
||||
|
||||
template <typename BasicJsonType, typename ConstructibleStringType>
|
||||
template<typename BasicJsonType, typename ConstructibleStringType>
|
||||
struct is_constructible_string_type_impl <
|
||||
BasicJsonType, ConstructibleStringType,
|
||||
enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type,
|
||||
|
|
@ -258,55 +258,55 @@ struct is_constructible_string_type_impl <
|
|||
typename BasicJsonType::string_t>::value;
|
||||
};
|
||||
|
||||
template <typename BasicJsonType, typename ConstructibleStringType>
|
||||
template<typename BasicJsonType, typename ConstructibleStringType>
|
||||
struct is_constructible_string_type
|
||||
: is_constructible_string_type_impl<BasicJsonType, ConstructibleStringType> {};
|
||||
|
||||
template <typename BasicJsonType, typename CompatibleArrayType, typename = void>
|
||||
template<typename BasicJsonType, typename CompatibleArrayType, typename = void>
|
||||
struct is_compatible_array_type_impl : std::false_type {};
|
||||
|
||||
template <typename BasicJsonType, typename CompatibleArrayType>
|
||||
template<typename BasicJsonType, typename CompatibleArrayType>
|
||||
struct is_compatible_array_type_impl <
|
||||
BasicJsonType, CompatibleArrayType,
|
||||
enable_if_t<is_detected<value_type_t, CompatibleArrayType>::value and
|
||||
is_detected<iterator_t, CompatibleArrayType>::value and
|
||||
enable_if_t < is_detected<value_type_t, CompatibleArrayType>::value&&
|
||||
is_detected<iterator_t, CompatibleArrayType>::value&&
|
||||
// This is needed because json_reverse_iterator has a ::iterator type...
|
||||
// Therefore it is detected as a CompatibleArrayType.
|
||||
// The real fix would be to have an Iterable concept.
|
||||
not is_iterator_traits<
|
||||
iterator_traits<CompatibleArrayType>>::value >>
|
||||
!is_iterator_traits <
|
||||
iterator_traits<CompatibleArrayType >>::value >>
|
||||
{
|
||||
static constexpr bool value =
|
||||
std::is_constructible<BasicJsonType,
|
||||
typename CompatibleArrayType::value_type>::value;
|
||||
};
|
||||
|
||||
template <typename BasicJsonType, typename CompatibleArrayType>
|
||||
template<typename BasicJsonType, typename CompatibleArrayType>
|
||||
struct is_compatible_array_type
|
||||
: is_compatible_array_type_impl<BasicJsonType, CompatibleArrayType> {};
|
||||
|
||||
template <typename BasicJsonType, typename ConstructibleArrayType, typename = void>
|
||||
template<typename BasicJsonType, typename ConstructibleArrayType, typename = void>
|
||||
struct is_constructible_array_type_impl : std::false_type {};
|
||||
|
||||
template <typename BasicJsonType, typename ConstructibleArrayType>
|
||||
template<typename BasicJsonType, typename ConstructibleArrayType>
|
||||
struct is_constructible_array_type_impl <
|
||||
BasicJsonType, ConstructibleArrayType,
|
||||
enable_if_t<std::is_same<ConstructibleArrayType,
|
||||
typename BasicJsonType::value_type>::value >>
|
||||
: std::true_type {};
|
||||
|
||||
template <typename BasicJsonType, typename ConstructibleArrayType>
|
||||
template<typename BasicJsonType, typename ConstructibleArrayType>
|
||||
struct is_constructible_array_type_impl <
|
||||
BasicJsonType, ConstructibleArrayType,
|
||||
enable_if_t<not std::is_same<ConstructibleArrayType,
|
||||
typename BasicJsonType::value_type>::value and
|
||||
std::is_default_constructible<ConstructibleArrayType>::value and
|
||||
(std::is_move_assignable<ConstructibleArrayType>::value or
|
||||
std::is_copy_assignable<ConstructibleArrayType>::value) and
|
||||
is_detected<value_type_t, ConstructibleArrayType>::value and
|
||||
is_detected<iterator_t, ConstructibleArrayType>::value and
|
||||
is_complete_type<
|
||||
detected_t<value_type_t, ConstructibleArrayType>>::value >>
|
||||
enable_if_t < !std::is_same<ConstructibleArrayType,
|
||||
typename BasicJsonType::value_type>::value&&
|
||||
std::is_default_constructible<ConstructibleArrayType>::value&&
|
||||
(std::is_move_assignable<ConstructibleArrayType>::value ||
|
||||
std::is_copy_assignable<ConstructibleArrayType>::value)&&
|
||||
is_detected<value_type_t, ConstructibleArrayType>::value&&
|
||||
is_detected<iterator_t, ConstructibleArrayType>::value&&
|
||||
is_complete_type <
|
||||
detected_t<value_type_t, ConstructibleArrayType >>::value >>
|
||||
{
|
||||
static constexpr bool value =
|
||||
// This is needed because json_reverse_iterator has a ::iterator type,
|
||||
|
|
@ -314,30 +314,30 @@ detected_t<value_type_t, ConstructibleArrayType>>::value >>
|
|||
// base class `iterator`... Therefore it is detected as a
|
||||
// ConstructibleArrayType. The real fix would be to have an Iterable
|
||||
// concept.
|
||||
not is_iterator_traits<iterator_traits<ConstructibleArrayType>>::value and
|
||||
!is_iterator_traits<iterator_traits<ConstructibleArrayType>>::value &&
|
||||
|
||||
(std::is_same<typename ConstructibleArrayType::value_type,
|
||||
typename BasicJsonType::array_t::value_type>::value or
|
||||
typename BasicJsonType::array_t::value_type>::value ||
|
||||
has_from_json<BasicJsonType,
|
||||
typename ConstructibleArrayType::value_type>::value or
|
||||
typename ConstructibleArrayType::value_type>::value ||
|
||||
has_non_default_from_json <
|
||||
BasicJsonType, typename ConstructibleArrayType::value_type >::value);
|
||||
};
|
||||
|
||||
template <typename BasicJsonType, typename ConstructibleArrayType>
|
||||
template<typename BasicJsonType, typename ConstructibleArrayType>
|
||||
struct is_constructible_array_type
|
||||
: is_constructible_array_type_impl<BasicJsonType, ConstructibleArrayType> {};
|
||||
|
||||
template <typename RealIntegerType, typename CompatibleNumberIntegerType,
|
||||
typename = void>
|
||||
template<typename RealIntegerType, typename CompatibleNumberIntegerType,
|
||||
typename = void>
|
||||
struct is_compatible_integer_type_impl : std::false_type {};
|
||||
|
||||
template <typename RealIntegerType, typename CompatibleNumberIntegerType>
|
||||
template<typename RealIntegerType, typename CompatibleNumberIntegerType>
|
||||
struct is_compatible_integer_type_impl <
|
||||
RealIntegerType, CompatibleNumberIntegerType,
|
||||
enable_if_t<std::is_integral<RealIntegerType>::value and
|
||||
std::is_integral<CompatibleNumberIntegerType>::value and
|
||||
not std::is_same<bool, CompatibleNumberIntegerType>::value >>
|
||||
enable_if_t < std::is_integral<RealIntegerType>::value&&
|
||||
std::is_integral<CompatibleNumberIntegerType>::value&&
|
||||
!std::is_same<bool, CompatibleNumberIntegerType>::value >>
|
||||
{
|
||||
// is there an assert somewhere on overflows?
|
||||
using RealLimits = std::numeric_limits<RealIntegerType>;
|
||||
|
|
@ -345,20 +345,20 @@ struct is_compatible_integer_type_impl <
|
|||
|
||||
static constexpr auto value =
|
||||
std::is_constructible<RealIntegerType,
|
||||
CompatibleNumberIntegerType>::value and
|
||||
CompatibleLimits::is_integer and
|
||||
CompatibleNumberIntegerType>::value &&
|
||||
CompatibleLimits::is_integer &&
|
||||
RealLimits::is_signed == CompatibleLimits::is_signed;
|
||||
};
|
||||
|
||||
template <typename RealIntegerType, typename CompatibleNumberIntegerType>
|
||||
template<typename RealIntegerType, typename CompatibleNumberIntegerType>
|
||||
struct is_compatible_integer_type
|
||||
: is_compatible_integer_type_impl<RealIntegerType,
|
||||
CompatibleNumberIntegerType> {};
|
||||
|
||||
template <typename BasicJsonType, typename CompatibleType, typename = void>
|
||||
template<typename BasicJsonType, typename CompatibleType, typename = void>
|
||||
struct is_compatible_type_impl: std::false_type {};
|
||||
|
||||
template <typename BasicJsonType, typename CompatibleType>
|
||||
template<typename BasicJsonType, typename CompatibleType>
|
||||
struct is_compatible_type_impl <
|
||||
BasicJsonType, CompatibleType,
|
||||
enable_if_t<is_complete_type<CompatibleType>::value >>
|
||||
|
|
@ -367,7 +367,7 @@ struct is_compatible_type_impl <
|
|||
has_to_json<BasicJsonType, CompatibleType>::value;
|
||||
};
|
||||
|
||||
template <typename BasicJsonType, typename CompatibleType>
|
||||
template<typename BasicJsonType, typename CompatibleType>
|
||||
struct is_compatible_type
|
||||
: is_compatible_type_impl<BasicJsonType, CompatibleType> {};
|
||||
|
||||
|
|
@ -378,10 +378,10 @@ template<class B1, class... Bn>
|
|||
struct conjunction<B1, Bn...>
|
||||
: std::conditional<bool(B1::value), conjunction<Bn...>, B1>::type {};
|
||||
|
||||
template <typename T1, typename T2>
|
||||
template<typename T1, typename T2>
|
||||
struct is_constructible_tuple : std::false_type {};
|
||||
|
||||
template <typename T1, typename... Args>
|
||||
template<typename T1, typename... Args>
|
||||
struct is_constructible_tuple<T1, std::tuple<Args...>> : conjunction<std::is_constructible<T1, Args>...> {};
|
||||
} // namespace detail
|
||||
} // namespace nlohmann
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ namespace nlohmann
|
|||
{
|
||||
namespace detail
|
||||
{
|
||||
template <typename ...Ts> struct make_void
|
||||
template<typename ...Ts> struct make_void
|
||||
{
|
||||
using type = void;
|
||||
};
|
||||
template <typename ...Ts> using void_t = typename make_void<Ts...>::type;
|
||||
template<typename ...Ts> using void_t = typename make_void<Ts...>::type;
|
||||
} // namespace detail
|
||||
} // namespace nlohmann
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue