I created a generic class and I want to pass it a enum,
class GObject<SomeType>
{
...
public SomeType q = SomeType.Default;
...
}
enum MyEnum
{
....
Default = x;
}
Then later,
GObject<MyEnumT;
The type passed to GObject should always contain a default value and I need
to have GObject use it to set some initial values of fields. I could, of
course just set everything to 0 but it may turn out that the default value
shouldn't be 0.
Its not a huge issue cause I can just force the default value to be 0 but
this method seems more elegant.
I guess C# isn't going to do this though because SomeType is a generic
object and I'm trying to restrict it to a smaller class?
Thanks,
Jon