newbie question

f f at abc.com
Thu Oct 31 09:10:32 UTC 2024


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))
{
}

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

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

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

thanks in advance.


More information about the Digitalmars-d-learn mailing list