[Development] Making QScopedPointer scoped (again)

Knoll Lars Lars.Knoll at digia.com
Wed Sep 4 22:09:38 CEST 2013


On 9/4/13 11:20 PM, "Janusz Lewandowski" <lew21 at enves.pl> wrote:

>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.

typedef's are usually not such a good idea, as forward declarations won't
work the way people expect them to.

Cheers,
Lars




More information about the Development mailing list