Actually, no it's not because this will compile ok with a struct constraint, but will throw a compile error with a IConvertible constraint.where T : struct is good constraint for this case
So an IConvertible constraint is better.Code:struct MyStruct { int a; double b; } MyStruct min = new MyStruct(); MyStruct max = new MyStruct(); RangedRandom<MyStruct> rr = new RangedRandom<MyStruct>(min, max);
Darwen.




Reply With Quote