Own type for null?

kenji hara k.hara.pg at gmail.com
Thu Oct 27 05:12:17 PDT 2011


https://github.com/D-Programming-Language/dmd/pull/476
The pull request implementing that enhancement.

Kenji Hara

2011/10/27 kenji hara <k.hara.pg at gmail.com>:
> +1
> I think 5899 is related issue.
>
> Kenji Hara
>
> 2011/10/26 Gor Gyolchanyan <gor.f.gyolchanyan at gmail.com>:
>> I agree. Null is a very common special-case value and overloading may
>> be necessary based on that special-case value. Currently doing so
>> means accepting any kind of typeless pointer (which is certainly not
>> desirable).
>>
>> On Wed, Oct 26, 2011 at 9:49 AM, Benjamin Thaut <code at benjamin-thaut.de> wrote:
>>> I recently tried to replace the deprecated overloading of new and delete and
>>> came across a serious issue. You can not use std.conv.emplace with null. If
>>> you pass null to it, null loses it's implicit casting cabablities and just
>>> becomes a void*.
>>> This issue pretty much exists with every template. As soon as you pass null
>>> to a template (compile time) information gets lost.
>>>
>>> Besides fixing std.conv.emplace it could be really handy to be able to check
>>> for a null-type at compile time for example with non-nullable types.
>>>
>>> There is already a enhancement reqeust in bugzilla since January but it
>>> didn't get much attention yet:
>>> http://d.puremagic.com/issues/show_bug.cgi?id=5416
>>>
>>> Would this be a worthwile improvement for the langauge?
>>> --
>>> Kind Regards
>>> Benjamin Thaut
>>>
>>
>


More information about the Digitalmars-d mailing list