Opt-in non-null class references?

aliak something at something.com
Sun Mar 4 12:11:31 UTC 2018


On Saturday, 3 March 2018 at 19:20:26 UTC, arturg wrote:
> On Saturday, 3 March 2018 at 18:28:42 UTC, aliak wrote:
>> On Friday, 2 March 2018 at 19:47:23 UTC, SimonN wrote:
>>
>> If you know of other ways though I'm all ears :)
>>
>> Cheers
>
> maybe not exactly what you want, but here are some templates i 
> wrote a while ago which basically are a more flexible form of 
> the ?. operator.
>
> https://run.dlang.io/gist/598c59506699a0f81c3abbbaf7d5feee?compiler=dmd

Aye, nice, I might steal that when stuff :D I also want to 
implement something like 
https://dlang.org/library/std/variant/visit.html

so Optional!T a;
a.visit!(
   (T value) => value here,
   () => no value here
);




More information about the Digitalmars-d mailing list