On 2019-08-08 12:33, Philippe wrote:
No. When you call detach(), you're in a mutating function of the
object
and you can assume that you're the only thread executing on a member
function of that thread, because if that's not the case, you're in UB
land. Only const methods are allowed to execute concurrently on the
same
object. Mutators must get exclusive access.
Absolutly right, but a method "isDetached()" which is const
has no usefulness on its own, independently from a detach() procedure.
This is the purpose of my orginal remark.
Which isDetached() are you talking about?
Don't mix the Intrusive Protocol with QISP members. The IP is a
C++0X-pre-C++11 concept_map for use by QISP. It's not for being called
by users.
If there _was_ a QIntrusiveSharedPointer::isDetached(), _then_ it would
have the same problem as shared_ptr::unique() in that the result becomes
meaningless upon return to the caller. Such a method might still useful,
but it's not currently proposed; qIntrusiveDetached() is _not_ that
function.
HTH,
Marc
_______________________________________________
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development