Time to kill T() as (sometimes) working T.init alias ?

Jonathan M Davis jmdavisProg at gmx.com
Fri Nov 30 23:33:05 PST 2012


On Saturday, December 01, 2012 08:26:54 deadalnix wrote:
> On Saturday, 1 December 2012 at 04:51:44 UTC, Jonathan M Davis
> 
> wrote:
> > On Saturday, December 01, 2012 05:42:23 deadalnix wrote:
> >> On Saturday, 1 December 2012 at 04:32:44 UTC, Walter Bright
> >> 
> >> wrote:
> >> > On 11/30/2012 3:31 PM, Mehrdad wrote:
> >> >> If that's the case, then we need to get rid of postblits
> >> >> entirely.
> >> > 
> >> > The only justification I've ever been able to come up with
> >> > for
> >> > postblits is implementing a reference counting type.
> >> 
> >> Which have to check for null all over the place because it can
> >> be
> >> uninitialized.
> > 
> > That's only an issue with a ref-counting type which is
> > attempting to be non-
> > nullable. Most shared pointers are nullable, making such checks
> > be required
> > regardless. In most cases, I would consider this to be a
> > complete non-issue.
> > 
> > - Jonathan M Davis
> 
> The reference to the counter can be null too, not only the
> payload.

Not a big deal, because you just have it so it would only be null if the 
payload is null, so you wouldn't need to check it much, if ever. At most, 
you'd have to check it when setting the payload to something other than null, 
and if the counter is set to null if the payload is set to null, then you 
don't even need to do that.

- Jonathan M Davis


More information about the Digitalmars-d mailing list