[Development] Can we use std::unique_ptr in Qt base/modules sources since Qt5.7 ?

Thiago Macieira thiago.macieira at intel.com
Wed Jun 15 17:01:47 CEST 2016

On quarta-feira, 15 de junho de 2016 15:44:09 PDT Giuseppe D'Angelo wrote:
> Il 14/06/2016 19:01, Sune Vuorela ha scritto:
> > You can pass your own classes as handlers, provided that they have a
> > public static function void cleanup(T *pointer).
> > 
> >   - from the documentation.
> However, you can't pass a per-QScopedPointer unique deleter object,
> which also makes this part of the API sub-par compared with the Standard...

Or, if you look at the same problem from a different angle, since 
QScopedPointer has the same size as a regular pointer, allowing you to replace 
a regular pointer in a class with it, without causing a binary compatibility 
break, its API is better than the Standard.

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

More information about the Development mailing list