[Development] Making QScopedPointer scoped (again)

Nicolás Alvarez nicolas.alvarez at gmail.com
Fri Sep 6 04:29:02 CEST 2013


2013/9/4 Janusz Lewandowski <lew21 at enves.pl>:
> On Wed, 4 Sep 2013 19:48:53 +0000 Knoll Lars <Lars.Knoll at digia.com> wrote
>
>> So then there are basically two options:
>>
>> 1. We extend QScopedPointer and live with the fact that the name is not
>> perfect, as scoping can be broken explicitly.
>> 2. We add a QUniquePointer that has pretty much the functionality that we
>> now have in QScopedPointer, and we revert the change that added moving to
>> QScopedPointer
>> 3. We revert the patch, and hope that C++11 spreads fast enough so that
>> people will start using unique_ptr instead. Then we deprecate
>> QScopedPointer.
>
> You also can typedef QScopedPointer QUniquePointer; and deprecate the former
> name.

No, you can't do that typedef since it's a template. You need template
aliases, which are new in C++11.

-- 
Nicolás



More information about the Development mailing list