Fixes for gcc

This commit is contained in:
Thomas Krijnen
2026-01-06 13:23:48 +01:00
parent ccd91c0ff0
commit 572a5655cf
12 changed files with 86 additions and 104 deletions
+3 -3
View File
@@ -113,7 +113,7 @@ class IFC_PARSE_API Base {
return T{};
}
} else if constexpr (std::is_same_v<Select, T>) {
static_assert(false, "Select is abstract");
static_assert(std::is_same_v<Select, T>, "Select is abstract");
} else {
if (declaration().is(T::Class())) {
return T(data_weak());
@@ -189,14 +189,14 @@ template <typename T, typename U>
std::vector<T> cast_vector(const std::vector<U>& vs) {
std::vector<T> result;
for (const auto& v : vs) {
if constexpr (std::is_base_of_v<T, U> || std::is_same_v<T, U>) {
if constexpr (std::is_base_of_v<T, U>) {
// For a base or identity transform we can just rely on static cast
result.push_back(v);
} else if constexpr (std::is_base_of_v<express::Select, U> && std::is_same_v<T, express::Base>) {
// From a select to concrete we simply call the appropriate method
result.push_back(v.concrete());
} else {
if (auto u = v.as<T>()) {
if (auto u = v.template as<T>()) {
result.push_back(u);
}
}