[Development] Notes from the Containers session from QtCS

Thiago Macieira thiago.macieira at intel.com
Mon Jun 25 15:48:54 CEST 2012


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120625/3a829e33/attachment.sig>


More information about the Development mailing list