diff --git a/src/ifcparse/IfcFile.cpp b/src/ifcparse/IfcFile.cpp index 1cf65b33a3..830754444f 100644 --- a/src/ifcparse/IfcFile.cpp +++ b/src/ifcparse/IfcFile.cpp @@ -29,10 +29,18 @@ namespace { template struct is_type_in_variant; - template - struct is_type_in_variant, T> + // Specialization when there are multiple types in the variant + template + struct is_type_in_variant, T> { - static constexpr bool value = (std::is_same::value || ...); + static constexpr bool value = std::is_same::value || is_type_in_variant, T>::value; + }; + + // Specialization when there is only one type left in the variant + template + struct is_type_in_variant, T> + { + static constexpr bool value = std::is_same::value; }; template