D
Dan Holmes
I have a class that i need a constraint of int, string, float or bool. I
have tried the following but can't make VS accept it. I read the docs
and they showed that any value type can be used unless it is nullable.
Why doesn't this work?
public class Metadata<T>
where T: System.int
line from the docs
where T: struct
The type argument must be a value type. Any value type except Nullable
can be specified. See Using Nullable Types (C# Programming Guide) for
more information.
dan
have tried the following but can't make VS accept it. I read the docs
and they showed that any value type can be used unless it is nullable.
Why doesn't this work?
public class Metadata<T>
where T: System.int
line from the docs
where T: struct
The type argument must be a value type. Any value type except Nullable
can be specified. See Using Nullable Types (C# Programming Guide) for
more information.
dan