- for (auto const& elem : *(current->getChildren())) {
- filter_netzones_by_type_recursive(elem, whereto);
- if (elem == dynamic_cast<T*>(elem))
- whereto->push_back(dynamic_cast<T*>(elem));
+ static_assert(std::is_base_of<kernel::routing::NetZoneImpl, T>::value,
+ "Filtering netzones is only possible for subclasses of kernel::routing::NetZoneImpl");
+ for (auto const& elem : current->get_children()) {
+ get_filtered_netzones_recursive(elem, whereto);
+ if (elem->get_impl() == dynamic_cast<T*>(elem->get_impl()))
+ whereto->push_back(dynamic_cast<T*>(elem->get_impl()));