M
Michal Januszczyk
Hello.
Sometimes I encounter the following problem:
foreach( element of some collection)
{
delete this element;
}
of course, the runtime would not allow to modify
the collection whilst executing loop through
its elements.
I often happen to write solutoin to this problem
by myself, but i am curious if there is some
design pattern how to handle such a situation
(the need to delete element of collection being ierated
through)
Thaks for answer
Michal Januszczyk
Sometimes I encounter the following problem:
foreach( element of some collection)
{
delete this element;
}
of course, the runtime would not allow to modify
the collection whilst executing loop through
its elements.
I often happen to write solutoin to this problem
by myself, but i am curious if there is some
design pattern how to handle such a situation
(the need to delete element of collection being ierated
through)
Thaks for answer
Michal Januszczyk