Thread overview
newbie question
Oct 31
f
Oct 31
Sergey
Oct 31
Sergey
October 31

since i am converting from c# to d :

  1. how to check template inheritance
    c# code
    interface I
    class A : I { void run(){}}
    class B : A {}

void D<T> (T t) : where T:B, new T()
{
t.run();
}
d code
//there should be has several check such as hasBase, hasImplements on std.traits
void D(T) (int a) if (isBase(T,B))
{
}

  1. 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]);

  1. known OAuth / OIDC Api Sdk in D.
    there is only Jwt stuff when search code.dlang.org.

  2. how to make proxy in D that can intercept call. java has one (or two perhaps)

thanks in advance.

October 31

On Thursday, 31 October 2024 at 09:10:32 UTC, f wrote:

>
  1. known OAuth / OIDC Api Sdk in D.
    there is only Jwt stuff when search code.dlang.org.

https://code.dlang.org/packages/oauth
https://code.dlang.org/packages/vibe-auth

October 31

On Thursday, 31 October 2024 at 09:10:32 UTC, f wrote:

>

since i am converting from c# to d :

  1. 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]);

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

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