Marc Mutz wrote:

> On Wednesday 20 January 2016 22:50:43 Kevin Kofler wrote:
>> All these are horrible and error-prone hacks that have obvious lifetime
>> issues. You are complaining about Qt containers because the detaching can
>> invalidate iterators. Well, the lifetime issues you introduce with the
>> above proposed solutions are much worse! And a caching mutable member
>> also destroys thread-safety (in addition to the obvious lifetime issue
>> that the next call surprisingly invalidates your existing reference).
> 
> One word: QModelIndex.

And that class is the source of innumerable bugs. The fact that one Qt class 
has such broken semantics is no excuse for putting them everywhere.

        Kevin Kofler

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to