```d struct List(T) { auto addUp() If (isInteger!T) { (Add numbers) } } } ```
I’ve got a struct that has a method that adds numbers together. I
want to do something like this, static if (isInteger!T) … but it
isn’t working. static if (is(T==int)) works for one integer type.
- Type constraint Joel via Digitalmars-d-learn
- Re: Type constraint ryuukk_ via Digitalmars-d-learn
- Re: Type constraint Joel via Digitalmars-d-learn
- Re: Type constraint Jonathan M Davis via Digitalmars-d-learn
- Re: Type constraint Joel via Digitalmars-d-learn
- Re: Type constra... Jonathan M Davis via Digitalmars-d-learn
- Re: Type constra... IchorDev via Digitalmars-d-learn
- Re: Type co... Salih Dincer via Digitalmars-d-learn
- Re: Type constraint Salih Dincer via Digitalmars-d-learn