From 727ea553151b112938ff711fc88d512abe80d6ba Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Thu, 14 Sep 2023 09:27:08 +0200 Subject: [PATCH] Apply ifcparse/ part of '65cb47e2d892d84c0d3d8e89ba157360c6902c7f' --- src/ifcparse/aggregate_of_instance.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ifcparse/aggregate_of_instance.h b/src/ifcparse/aggregate_of_instance.h index 59f335f79d..c6bf8f5921 100644 --- a/src/ifcparse/aggregate_of_instance.h +++ b/src/ifcparse/aggregate_of_instance.h @@ -45,8 +45,11 @@ public: template typename U::list::ptr as() { typename U::list::ptr r(new typename U::list); - const bool all = !U::Class().as_entity(); - for (it i = begin(); i != end(); ++i) if (all || (*i)->declaration().is(U::Class())) r->push((U*)*i); + for (it i = begin(); i != end(); ++i) { + if ((*i)->as()) { + r->push((*i)->as()); + } + } return r; } void remove(IfcUtil::IfcBaseClass*);