I'm basically wanting to do this:
class UILockable<T> : T
where T : UIWidget
{
}
However, this doesn't work. I've seen people recommend that you do this:
class UILockable<T>
where T : UIWidget
{
private T _base;
}
This would require me to override each function UILockable would need and forward it to T. This is impossible since T may derive from UIWidget and have unique abstract/virtual methods of its own.
Is there no way to simply inherit from T?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…