mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 23:36:20 +00:00
msvc17 workaround
This commit is contained in:
@@ -29,10 +29,18 @@ namespace {
|
|||||||
template<typename Variant, typename T>
|
template<typename Variant, typename T>
|
||||||
struct is_type_in_variant;
|
struct is_type_in_variant;
|
||||||
|
|
||||||
template<typename T, typename... Types>
|
// Specialization when there are multiple types in the variant
|
||||||
struct is_type_in_variant<boost::variant<Types...>, T>
|
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>
|
template<typename Variant, typename T>
|
||||||
|
|||||||
Reference in New Issue
Block a user