Skip to content

Instantly share code, notes, and snippets.

@AlphaModder
Last active August 29, 2015 14:15
Show Gist options
  • Save AlphaModder/a3daf1df7c96ff642f98 to your computer and use it in GitHub Desktop.
Save AlphaModder/a3daf1df7c96ff642f98 to your computer and use it in GitHub Desktop.
public class SomethingGeneric<T> : SomethingNonGeneric
{
public void DoSomething(T parameter);
}
public interface SomethingNonGeneric { }
public class SomethingStorage
{
private List<SomethingNonGeneric> somethings = new List<SomethingNonGeneric>();
public void AddSomething(SomethingNonGeneric something)
{
somethings.Add(something);
}
public Something<T> GetSomething<T>(int index)
{
return (Something<T>)somethings[index];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment