[Development] Making QScopedPointer scoped (again)

Stephen Kelly stephen.kelly at kdab.com
Tue Sep 3 11:47:33 CEST 2013


On Tuesday, September 03, 2013 11:31:28 Oswald Buddenhagen wrote:
> On Tue, Sep 03, 2013 at 10:02:52AM +0200, Stephen Kelly wrote:
> > Again, this is what std::unique_ptr is for. We should not try to turn
> > QScopedPointer into an attempt at a NIH std::unique_ptr. Where people have
> > a need for a std::unique_ptr, they should use it. We should not adapt
> > QScopedPointer to fit the need instead.
> 
> why exactly would such a dual-use scoped pointer be a problem? anything
> else than dogmatism?

What is "dual-use" about having a 'scoped' pointer which is not scoped? It 
makes as much sense as creating a 'shared' pointer which is not shared.

To turn the question around on people who don't see the need to revert the 
original patch:

 Why not use std::unique_ptr instead in the cases where the patch has an 
effect?

Thanks,

-- 
Join us in October at Qt Developer Days 2013 - https://devdays.kdab.com

Stephen Kelly <stephen.kelly at kdab.com> | Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-Independent Software Solutions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130903/9ea97a54/attachment.sig>


More information about the Development mailing list