On segunda-feira, 25 de junho de 2012 15.39.07, Nils Jeisecke wrote:
> Hi,
>
> I assume that classes using a QSharedDataPointer are movable, correct?

Yes, but we have to mark them each as such.

qshareddata.h has:
template<typename T> Q_DECLARE_TYPEINFO_BODY(QSharedDataPointer<T>,
Q_MOVABLE_TYPE);
template<typename T> Q_DECLARE_TYPEINFO_BODY(QExplicitlySharedDataPointer<T>,
Q_MOVABLE_TYPE);

But that only marks the actual Pointer class as movable. The class using it
needs to declare itself movable too.

> As the container implementation cannot detect this automatically maybe
> the QSharedDataPointer documentation should suggest to use
> Q_DECLARE_TYPEINFO(ClassName, Q_MOVABLE_TYPE) for such classes.

Yes, but I'm afraid of that recommendation in our docs. It may be read and
used by people who don't know exactly what movable is and their types aren't
movable.

--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden

Attachment: signature.asc
Description: This is a digitally signed message part.

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

Reply via email to