msvc17 workaround

This commit is contained in:
Thomas Krijnen
2024-08-24 13:24:23 +02:00
parent cd411e1f14
commit daa6b31c5d
+11 -3
View File
@@ -29,10 +29,18 @@ namespace {
template<typename Variant, typename T>
struct is_type_in_variant;
template<typename T, typename... Types>
struct is_type_in_variant<boost::variant<Types...>, T>
// Specialization when there are multiple types in the variant
template<typename T, typename First, typename... Rest>
struct is_type_in_variant<boost::variant<First, Rest...>, T>
{
static constexpr bool value = (std::is_same<T, Types>::value || ...);
static constexpr bool value = std::is_same<T, First>::value || is_type_in_variant<boost::variant<Rest...>, T>::value;
};
// Specialization when there is only one type left in the variant
template<typename T, typename Last>
struct is_type_in_variant<boost::variant<Last>, T>
{
static constexpr bool value = std::is_same<T, Last>::value;
};
template<typename Variant, typename T>