If I write a generic class like class MyGeneric<T>
is it possible to write an implicit cast to type T, so I can do stuff like:
public class MyGeneric<T>
{
...
}
public class GenericProperties
{
public MyGeneric<string> MyGenericString {get;set;}
public void UseMyGeneric()
{
string sTest = MyGenericString;
MyGenericString = "this is a test";
}
}
Is it possible to do that by overloading operators? I know it could be done if my class wasn't a generic...