yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #08065
Re: [Branch ~yade-dev/yade/trunk] Rev 2961: Add check on body existance in GlobalStiffnessTimeStepper. Fixes LP:891540
>
> In fact iterator should not only jump null bodies, but also remove
> them from container.
>
> By doing that, it would break the rule b=bodies[b.id], then it would need
a redirection that is painful to maintain.
> It is the correct way, because even by C++ ISO specification an
> iterator must never be empty. This is obviously our definition of
> "empty": a deleted body.
>
Again, our iterators are never empty since they always contain a pointer.
The pointer can be null, I don't think it breaks c++ iso, but it is not
convenient.
Bruno
Follow ups
References