References in D

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Sep 17 10:07:16 PDT 2012


On 9/17/12 12:41 PM, deadalnix wrote:
> Le 17/09/2012 15:12, Andrei Alexandrescu a écrit :
>> On 9/17/12 6:52 AM, deadalnix wrote:
>>>> Regardless, the solution at this point is going to be to add
>>>> std.typecons.NonNullable. It would be in there already, but the pull
>>>> request
>>>> with it needed more work, and it hasn't been resubmitted yet.
>>>>
>>>
>>> I don't think this is implementable as a lib in a satisfying way.
>>
>> It is, but it needs just a bit of language support in constructors.
>> Walter never got around to it.
>>
>> Andrei
>
> So it isn't. That was my point. You need the compiler to help you on
> that one.

I don't think that was your point. My understanding is that your point 
was that (a) with or without @disable, one cannot implement NonNull 
pointers in the library, and (b) there is need for _specific_ support 
for NonNull in the language. Our position is that NonNull is only one of 
several instances of a much more general pattern, which can be addressed 
with @disable once it is properly tracked inside constructors.


Andrei


More information about the Digitalmars-d mailing list