mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +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) {
|
||||
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>
|
||||
std::shared_ptr<T> dcast(const std::shared_ptr<U>& u) {
|
||||
|
||||
Reference in New Issue
Block a user