[Interest] QScopedPointer and c++11 move semantics

Alexander Dyagilev alervdvcw at gmail.com
Fri Dec 30 20:51:55 CET 2016


Sorry, my bad.

QScopedPointer does not compiles so also...


On 12/30/2016 10:44 PM, Alexander Dyagilev wrote:
> QScopedPointer var(new QObject, &QObject::deleteLater) - compiles fine.
>
> std::unique_ptr var(new QObject, &QObject::deleteLater) - does not 
> compile.
>
> Is there an easy way I miss?
>
>
> On 12/30/2016 10:35 PM, Giuseppe D'Angelo wrote:
>> Il 30/12/2016 20:32, Alexander Dyagilev ha scritto:
>>> This requires me to implement a special deleter function somewhere. I'm
>>> too lazy :)
>>>
>>> QXXXXPointer is a more convenient way.
>> QXXXXPointer would still require you to define your custom deleter (as
>> by default it would delete via operator delete). What would the
>> advantage be?
>>
>> Cheers,
>




More information about the Interest mailing list