mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
taxonony::cast throws exceptions now on invalid casts
This commit is contained in:
@@ -1239,7 +1239,11 @@ typedef item const* ptr;
|
|||||||
if (pwupg) {
|
if (pwupg) {
|
||||||
return pwupg;
|
return pwupg;
|
||||||
}
|
}
|
||||||
return std::static_pointer_cast<T>(u);
|
if (auto r = std::dynamic_pointer_cast<T>(u)) {
|
||||||
|
return r;
|
||||||
|
} else {
|
||||||
|
throw std::runtime_error("Unexpected topology");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
template <typename T, typename U>
|
template <typename T, typename U>
|
||||||
std::shared_ptr<T> dcast(const std::shared_ptr<U>& u) {
|
std::shared_ptr<T> dcast(const std::shared_ptr<U>& u) {
|
||||||
|
|||||||
Reference in New Issue
Block a user