mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-28 15:53:00 +00:00
Fixes related to r312: gcc refuses to erase a const_iterator
This commit is contained in:
@@ -1193,7 +1193,7 @@ void IfcFile::removeEntity(IfcUtil::IfcBaseClass* entity) {
|
|||||||
IfcEntityListList::ptr new_list(new IfcEntityListList);
|
IfcEntityListList::ptr new_list(new IfcEntityListList);
|
||||||
for (IfcEntityListList::outer_it it = instance_list_list->begin(); it != instance_list_list->end(); ++it) {
|
for (IfcEntityListList::outer_it it = instance_list_list->begin(); it != instance_list_list->end(); ++it) {
|
||||||
std::vector<IfcUtil::IfcBaseClass*> instances = *it;
|
std::vector<IfcUtil::IfcBaseClass*> instances = *it;
|
||||||
std::vector<IfcUtil::IfcBaseClass*>::const_iterator jt;
|
std::vector<IfcUtil::IfcBaseClass*>::iterator jt;
|
||||||
while ((jt = std::find(instances.begin(), instances.end(), entity)) != instances.end()) {
|
while ((jt = std::find(instances.begin(), instances.end(), entity)) != instances.end()) {
|
||||||
instances.erase(jt);
|
instances.erase(jt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ bool IfcEntityList::contains(IfcUtil::IfcBaseClass* instance) const {
|
|||||||
return std::find(ls.begin(), ls.end(), instance) != ls.end();
|
return std::find(ls.begin(), ls.end(), instance) != ls.end();
|
||||||
}
|
}
|
||||||
void IfcEntityList::remove(IfcUtil::IfcBaseClass* instance) {
|
void IfcEntityList::remove(IfcUtil::IfcBaseClass* instance) {
|
||||||
std::vector<IfcUtil::IfcBaseClass*>::const_iterator it;
|
std::vector<IfcUtil::IfcBaseClass*>::iterator it;
|
||||||
while ((it = std::find(ls.begin(), ls.end(), instance)) != ls.end()) {
|
while ((it = std::find(ls.begin(), ls.end(), instance)) != ls.end()) {
|
||||||
ls.erase(it);
|
ls.erase(it);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ public:
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
void remove(T* t) {
|
void remove(T* t) {
|
||||||
typename std::vector<T*>::const_iterator it;
|
typename std::vector<T*>::iterator it;
|
||||||
while ((it = std::find(ls.begin(), ls.end(), t)) != ls.end()) {
|
while ((it = std::find(ls.begin(), ls.end(), t)) != ls.end()) {
|
||||||
ls.erase(it);
|
ls.erase(it);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user