🐛 std::variant should be properly gated...

This commit is contained in:
ThePhD 2021-03-14 19:51:29 -04:00
parent f54138305d
commit f56b3c698c
No known key found for this signature in database
GPG Key ID: 1509DB1C0F702BFA

View File

@ -479,21 +479,39 @@ namespace sol { namespace meta {
template <typename T, typename U>
class supports_op_less_test<T, U, void_t<decltype(std::declval<T&>() < std::declval<U&>())>>
: public std::integral_constant<bool,
!is_specialization_of_v<unqualified_t<T>, std::variant> && !is_specialization_of_v<unqualified_t<U>, std::variant>> { };
#if SOL_IS_ON(SOL_STD_VARIANT_I_)
!is_specialization_of_v<unqualified_t<T>, std::variant> && !is_specialization_of_v<unqualified_t<U>, std::variant>
#else
true
#endif
> {
};
template <typename T, typename U, typename = void>
class supports_op_equal_test : public std::false_type { };
template <typename T, typename U>
class supports_op_equal_test<T, U, void_t<decltype(std::declval<T&>() == std::declval<U&>())>>
: public std::integral_constant<bool,
!is_specialization_of_v<unqualified_t<T>, std::variant> && !is_specialization_of_v<unqualified_t<U>, std::variant>> { };
#if SOL_IS_ON(SOL_STD_VARIANT_I_)
!is_specialization_of_v<unqualified_t<T>, std::variant> && !is_specialization_of_v<unqualified_t<U>, std::variant>
#else
true
#endif
> {
};
template <typename T, typename U, typename = void>
class supports_op_less_equal_test : public std::false_type { };
template <typename T, typename U>
class supports_op_less_equal_test<T, U, void_t<decltype(std::declval<T&>() <= std::declval<U&>())>>
: public std::integral_constant<bool,
!is_specialization_of_v<unqualified_t<T>, std::variant> && !is_specialization_of_v<unqualified_t<U>, std::variant>> { };
#if SOL_IS_ON(SOL_STD_VARIANT_I_)
!is_specialization_of_v<unqualified_t<T>, std::variant> && !is_specialization_of_v<unqualified_t<U>, std::variant>
#else
true
#endif
> {
};
template <typename T, typename U, typename = void>
class supports_op_left_shift_test : public std::false_type { };