T opImplCast(T)() so we can add @disable to it?

Sjoerd Nijboer sjoerdnijboer at gmail.com
Thu May 24 07:37:40 UTC 2018


On Thursday, 24 May 2018 at 07:06:03 UTC, Bastiaan Veelo wrote:
> On Thursday, 24 May 2018 at 06:42:51 UTC, Sjoerd Nijboer wrote:
>> On Thursday, 24 May 2018 at 01:39:56 UTC, Jonathan M Davis 
>> wrote:
>>> If you don't want an implict cast, then why did you declare 
>>> an alias this?
>>
>> Because I wanted an inconvertible type which was exactly like 
>> the int in the example but didn't want the implicit cast.
>
> Doesn’t std.typecons.Typedef do that?
> https://dlang.org/phobos/std_typecons.html#Typedef

I didn't know this existed. Cool!


More information about the Digitalmars-d mailing list