Challenge Tuples

Nick Treleaven nick at geany.org
Sat Apr 27 15:36:40 UTC 2024


On Saturday, 27 April 2024 at 15:32:40 UTC, Nick Treleaven wrote:
> On Saturday, 27 April 2024 at 11:55:58 UTC, Basile B. wrote:
>>         foreach const e in u do
>>             if echo(is, e, T) do
>>                 result += e;

>         static if (is(typeof(e) == int))
>             r += e;

Actually I would write that:
```d
     R r;
     foreach (e; v)
     {
         static if (is(typeof(e) : R))
```


More information about the Digitalmars-d-learn mailing list