Templates considered impressive

Salih Dincer salihdb at hotmail.com
Tue Oct 1 16:30:27 UTC 2024


On Tuesday, 1 October 2024 at 16:18:17 UTC, Salih Dincer wrote:
> ```d
> // ...
>     struct MyCon
>     {
>         string input;
>         T value;
>
>         this(string data)
>         {
> // ...
>         }
>
> // ...
>     }
> }
>
> ```
Please add this to your MyCon structure:
```d
alias value this;
// assert(num1 == 3.14);
```
And test it like this too, I think it's awesome!

SDB at 79




More information about the Digitalmars-d-learn mailing list