How to assign and compare arrays to SumType?

Steven Schveighoffer schveiguy at gmail.com
Tue Jun 11 23:37:41 UTC 2024


On Tuesday, 11 June 2024 at 22:54:50 UTC, Steven Schveighoffer 
wrote:

> Let's see how it works if you want to both check that the value 
> is a `double[]` and that it matches your value:
>
> ```d
> SumType!(double[], int) s = [1.7, 2.7, 3.7, 4.7, 5.7];
> assert(s.data.match!(
> ```

This should be `s.match!(...`, I just was copy-pasting.

-Steve


More information about the Digitalmars-d-learn mailing list