An idiom for disabling implicit conversions

Uranuz via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 26 11:29:48 PDT 2014


On Tuesday, 26 August 2014 at 16:48:08 UTC, Timon Gehr wrote:
> On 08/26/2014 05:46 PM, Uranuz wrote:
>> In the pre-last paragraph please read text^
>> Also notice that C is language with weak type system but D is
>> declared to have type system.
>>
>> as:
>> Also notice that C is language with weak type system but D is
>> declared to have *strong* type system.
>
> It's not _that_ strong. Also, this is a library problem.
>
> I'd suggest you file a bug report/enhancement request against 
> Phobos, if it is not already there.
> https://issues.dlang.org/
>
> It seems that adding some constructor(s)/opAssign(s) to 
> Nullable will solve this problem.
>
> ( BTW: You are more likely to get a quick response if your post 
> looks a little bit more digestible, like:
>
> On 08/26/2014 05:38 PM, Uranuz could have written:
>> // ---
>> import std.typecons;
>> void main(){
>>    Nullable!ubyte x;
>>    Nullable!int y=x; // AssertError: Called 'get' on null 
>> Nullable!ubyte
>> }
>> // ---
>> import std.typecons;
>> void main(){
>>    Nullable!ubyte x;
>>    Nullable!int y;
>>    y=x; // AssertError: Called 'get' on null Nullable!ubyte
>> }
>> // ---
>>
>> Is this a bug?
>
> Or you could have gone straight to https://issues.dlang.org/. 
> :) )

The last example is even more obvious but didn't come to my mind. 
Maybe I'l think of better implementation myself and push 
something to standard library.

The best way to make something working is to do it myself 
[jokingly]


More information about the Digitalmars-d mailing list