newbie question

Sergey kornburn at yandex.ru
Thu Oct 31 09:35:47 UTC 2024


On Thursday, 31 October 2024 at 09:10:32 UTC, f wrote:
> since i am converting from c# to d :
>
> 2. how to make  built in array , std.container.slist, 
> container.HashMap (emsi_containers)  a range
>
> c# code
> void a(IEnumerable\<string> a) {}
>
> dcode
> void a(InputRange!string a) {}
>
> // notworking : i slice it to get Range
> int[] i=[1,3,4];
> a(i[0..2]);

```d
void f (InputRange!int f) {
     writeln(f);
}

auto x = [1,2,3,4,5];
f(inputRangeObject(x[1..3]));
```




More information about the Digitalmars-d-learn mailing list