On 11/9/06, Georg Baum <[EMAIL PROTECTED]> wrote:
Ozgur Ugras BARAN wrote:

> This patch solves the crash while calling Qt4-TOC dialog in Linux /gcc-4.1

Are you sure?

I have tested here and it works now..

The old code is perfectly valid for a std::map: if the element does not
exist it is created. I don't understand at all how using insert() instead
of operator[] could solve a crash.

What I understand is map::operator[] returns mapped_type&,  (for this
case a const_iterator&). When you use operator = you try to
copy-construct with another const_iterator. This is erroneous, since
you cannot dereference the first.

Pair, however, packs two items first.

I guess this make sense, or just test it and see the result. )

Anyway, I am not that sure. This may be a gcc bug also.


Georg


Reply via email to