Op 21/03/2016 om 14:25 schreef Marc Mutz:
On Monday 21 March 2016 13:38:43 Sean Harmer wrote:
On Monday 21 March 2016 12:23:44 Poenitz Andre wrote:
It's to support one-to-many delivery of an event-like object to backends
potentially running on multiple threads concurrently. The type is not a
QObject so can't be managed by the QObject parent-child relationship. Using
a naked pointer
But QSharedPointer *is* a naked pointer. That is, if you're referring to Sean
Parent's definition in his goal of "No raw pointers".

goes against modern C++ recommendations and would mean
having to put in place code to delete the objects after all consumers are
done with it.
If you follow Sean Parent, then you should hide the naked shared pointer in an
object with value semantics. In Qt we'd say a CoW type, but the type may not
need to allow writing.
Are we following Sean Parent though? Because if we are, we better start thinking about also replacing our QObject parent/child stuff with some external forest data structure in the future...

André

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

Reply via email to