[Ktechlab-devel] oops. =(
P Zoltan
zoltan.padrah at gmail.com
Fri Oct 23 22:56:04 UTC 2009
On Mon, 19 Oct 2009 03:47:47 +0200, Alan Grimes <agrimes at speakeasy.net>
wrote:
> I might have been a bit overzealous with converting things to STL
> container classes.
>
> On the upside, it's a wonderful way to manage memory for things. On the
> down side, the container classes love to re-organize their internal data
> stores at will. If we simply do something with a pointer to one of those
> elements, we'll be okay. However, if we try to store one of those
> pointers in another structure, we could be in for a whole pile of Hurt.
> =(
>
> There are some techniques that can help discourage certain STL classes
> from re-organizing themselves too much. It would be good to have some
> Real Experts(tm) chime in on how best to abuse C++ to solve the problems
> the code tries to solve.
>
> I ph34r I've introduced a whole pile of bugs of this kind over the last
> week. I just spent the whole day, successfully, debugging the
> matrixDisplay bug I mentioned earlier.
>
What about using pointer-based containers... and use pointers and
QGuardedPointers? In java style: we have the heap, allocate each object
there, and move around with the pointers. The hard part is to clean up
those pointers -- this needs planning. (I'm not an expert)
More information about the Ktechlab-devel
mailing list