std.typecons Typedef initializers?

Mike Parker aldacron at gmail.com
Mon Apr 25 12:53:14 UTC 2022


On Monday, 25 April 2022 at 08:54:52 UTC, Chris Katko wrote:
> ````D
> struct pair
> {
> float x,y;
> }
>
> alias sPair = Typedef!pair; // pair of xy in screen space 
> coordinates
> alias vPair = Typedef!pair; // pair of xy in viewport space 
> coordinates
> //etc
>
>
>
> How do you initialize a typedef'd struct?

``d
vPair v1 = vPair(pair(1f, 2f));
```


More information about the Digitalmars-d-learn mailing list