Why? In case of QMap, we have no need to use operator= to change the map.
We simply detach and insert new data in it.
Of course, in case of multiple changes, the map can reach some "invalid
state" before changes are finished (i.e. in case we need transacted
changes, we have to use mutex anyway). But it is not neccessary in some
cases.

2016-01-22 12:48 GMT+03:00 Marc Mutz <marc.m...@kdab.com>:

> On Friday 22 January 2016 01:31:20 Kevin Kofler wrote:
> > Marc Mutz wrote:
> > > Ivan was talking about thread-safe classes. You need to lock a mutex to
> > > take the copy.
> >
> > Returning a QMap instead of a std::shared_ptr<std::map> would be
> perfectly
> > thread-safe there.
>
> Wrong.
>
> --
> Marc Mutz <marc.m...@kdab.com> | Senior Software Engineer
> KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
> Tel: +49-30-521325470
> KDAB - The Qt Experts
> _______________________________________________
> Development mailing list
> Development@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to