← Back to team overview

yade-dev team mailing list archive

Re: [Branch ~yade-dev/yade/trunk] Rev 2962: - make body iterators jump empty slots, as suggested and discussed here: http://www.mail-archive....

 

I deactivated smart_iterators Anton, but I can't reproduce #891540 at
the moment. With ordinary iterators it crashes, with smart iterators it
is ok. Let me know what you did.

>> Anton, do you agree that we cannot fix a bug in hundred places in the
>> code, everywhere the container is used?
> It is already fixed in almost all places.
Yes, but it is nonsense and for this reason future code will in most
cases not include such test. Then we will drag the same segfault bugs
after deleting bodies forever.
>> A more complicated approach is to make special handling in container
>> when a body is deleted. After all a C++ ISO container has method
>> erase() in it's specification. So It would be a matter of
>> implementing it correctly. As Bruno pointed that will need some more
>> thinking, to handle redirections.
> If it is not implemented, there are, probably, some serious reasons for that.
> It needs to be investigated before any changes.
>
> Yade code is pretty stable for last 1 year.
> We should be careful not to break the code.
It's not implemented because it's been removed ;)
http://yade.berlios.de/doxygen/html/dc/d96/classBodyRedirectionVectorIterator.html

I agree to be careful but there is no reason for excessive conservatism
since every change can be reverted quite easily.

Bruno


Follow ups

References