[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: about kde4's smart pointer
From:       André_Wöbbeking <Woebbeking () onlinehome ! de>
Date:       2006-10-03 15:59:11
Message-ID: 200610031759.11520.Woebbeking () onlinehome ! de
[Download RAW message or body]

On Tuesday 03 October 2006 15:58, Cyrille Berger wrote:
> Hello
>
> Can we have the kde3 behaviour back for smart pointer ? The new one
> is really painfull. We use them a lot in krita, and what we want is
> them to be use transparently as if they were "normal" pointers.
>
> I mean for instance:
>
> typedef KSharedPtr<KisPaintDevice> KisPaintDeviceSP;
> typedef KSharedPtr<KisDevice> KisDeviceSP;
> KisPaintDeviceSP pd = KisPaintDeviceSP(new KisPaintDevice());

KisPaintDeviceSP pd(new KisPaintDevice());

> KisDeviceSP d = KisDeviceSP( pd.data()); // Assuming that
> KisPaintDevice inherits from KisDevice

Yeah, a converting "copy ctor" is missing.

BTW, KisDeviceSP( pd.data()) is asking for trouble (double deletion).

> instead of
> KisPaintDeviceSP pd = new KisPaintDevice();
> KisDeviceSP d = pd;
>
> And there is also pd.isNull instead of pd == 0.

!pd

> And I forget other difference of behaviour between our smartpointers
> and the "normal" pointers.

???
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic